lkml.org 
[lkml]   [2013]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH]cputime: make bool type for steal ticks
From
2012/11/16 liguang <lig.fnst@cn.fujitsu.com>:
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
> kernel/sched/cputime.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
> index 81b763b..d2c24c1 100644
> --- a/kernel/sched/cputime.c
> +++ b/kernel/sched/cputime.c
> @@ -282,7 +282,7 @@ static __always_inline bool steal_account_process_tick(void)
> this_rq()->prev_steal_time += st * TICK_NSEC;
>
> account_steal_time(st);
> - return st;
> + return !!st;

I would expect gcc to perform the semantic "!!" cast implicitly. I
just did some basic tests locally and it does.
I prefer to be paranoid and not do any assumption though, unless I'm
told gcc always guarantees this correct implicit cast. I'm queuing
this patch and will send it to Ingo.

Thanks!

> }
> #endif
> return false;
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


\
 
 \ /
  Last update: 2013-01-26 02:41    [W:0.044 / U:13.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site