Re: [PATCH] sched/deadline: Don't use dubious signed bitfields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> 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@xxxxxxxxxx>
> 
> 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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux