lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1359163444.2079.12.camel@joe-AO722>
Date:	Fri, 25 Jan 2013 17:24:04 -0800
From:	Joe Perches <joe@...ches.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	liguang <lig.fnst@...fujitsu.com>, mingo@...hat.com,
	peterz@...radead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH]cputime: make bool type for steal ticks

On Sat, 2013-01-26 at 01:45 +0100, Frederic Weisbecker wrote:
> > diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
[]
> > @@ -282,7 +282,7 @@ static __always_inline bool steal_account_process_tick(void)
[]
> > -               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.

It's unnecessary.

6.3.1.2p1:

"When any scalar value is converted to _Bool, the result is 0
if the value compares equal to 0; otherwise, the result is 1."


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ