[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171013103651.whci6ns6dxnyddnw@mwanda>
Date: Fri, 13 Oct 2017 13:36:51 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Luca Abeni <luca.abeni@...tannapisa.it>
Cc: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] sched/deadline: Don't use dubious signed bitfields
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@...cle.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@...cle.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
Powered by blists - more mailing lists