lkml.org 
[lkml]   [2017]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@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

\
 
 \ /
  Last update: 2017-10-13 12:37    [W:0.035 / U:2.672 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site