lkml.org 
[lkml]   [2011]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-next: manual merge of the tip tree with the cputime tree
On Wed, 7 Dec 2011 09:35:09 -0200
Glauber Costa <glommer@parallels.com> wrote:

> On 12/07/2011 02:09 AM, Stephen Rothwell wrote:
> > + index = (TASK_NICE(p)> 0) ? CPUTIME_NICE : CPUTIME_USER;
> > +
> > /* Add user time to cpustat. */
> > - if (TASK_NICE(p)> 0)
> > - cpustat->nice += (__force cputime64_t) cputime;
> > - else
> > - cpustat->user += (__force cputime64_t) cputime;
> > - task_group_account_field(p, index, cputime);
> > ++ task_group_account_field(p, index, (__force cputime64_t) cputime);
>
>
> I doubt __force cputime64_t is necessary. After these patches, those
> fields are all u64.

You need the __force keyword whenever a conversion between a cputime[64]_t
and a plain scalar type is done. The cputime[64]_t types are defined with
__nocast so that sparse can find bugs in the usage of cputime.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.



\
 
 \ /
  Last update: 2011-12-07 13:01    [W:0.027 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site