From: Dan Carpenter <dan.carpenter@oracle.com>
To: Luca Abeni <luca.abeni@santannapisa.it>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] sched/deadline: Don't use dubious signed bitfields
Date: Fri, 13 Oct 2017 13:36:51 +0300 [thread overview]
Message-ID: <20171013103651.whci6ns6dxnyddnw@mwanda> (raw)
In-Reply-To: <20171013093606.5539975f@luca>
On Fri, Oct 13, 2017 at 09:36:06AM +0200, Luca Abeni wrote:
> Hi,
>
> On Fri, 13 Oct 2017 10:01:22 +0300
> Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> > It doesn't cause a run-time bug, but these bitfields should be unsigned.
> > When it's signed ->dl_throttled is set to either 0 or -1, instead of
> > 0 and 1 as expected. The sched.h file is included into tons of places
> > so Sparse generates a flood of warnings like this:
> >
> > ./include/linux/sched.h:477:54: error: dubious one-bit signed bitfield
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> I did not notice any issue when testing
Correct. It would only cause a bug if we had a condition like:
if (foo->dl_throttled == 1) {
That would be impossible because ->dl_throttled == -1, but since the
conditions are all in the form:
if (foo->dl_throttled) {
Then that works for both 1 and -1.
regards,
dan carpenter
next prev parent reply other threads:[~2017-10-13 10:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 7:01 Dan Carpenter
2017-10-13 7:36 ` Luca Abeni
2017-10-13 10:36 ` Dan Carpenter [this message]
2017-11-21 8:30 ` [tip:sched/urgent] " tip-bot for Dan Carpenter
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=20171013103651.whci6ns6dxnyddnw@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.abeni@santannapisa.it \
--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®