From: Joe Perches <joe@perches.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: liguang <lig.fnst@cn.fujitsu.com>,
mingo@redhat.com, peterz@infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH]cputime: make bool type for steal ticks
Date: Fri, 25 Jan 2013 17:24:04 -0800 [thread overview]
Message-ID: <1359163444.2079.12.camel@joe-AO722> (raw)
In-Reply-To: <CAFTL4hzLu5RN-PSuP6NRwx2sMKXh5OZ7gNqLnUQQvKTK4n9i1Q@mail.gmail.com>
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."
next prev parent reply other threads:[~2013-01-26 1:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-16 9:24 liguang
2013-01-26 0:45 ` Frederic Weisbecker
2013-01-26 1:24 ` Joe Perches [this message]
2013-01-26 14:38 ` Frederic Weisbecker
-- strict thread matches above, loose matches on Subject: below --
2012-11-06 7:12 liguang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359163444.2079.12.camel@joe-AO722 \
--to=joe@perches.com \
--cc=fweisbec@gmail.com \
--cc=lig.fnst@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®