Skip to content

Commit aa5222e

Browse files
Dan CarpenterIngo Molnar
authored andcommitted
sched/deadline: Don't use dubious signed bitfields
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 Reported-by: Matthew Wilcox <[email protected]> Reported-by: Xin Long <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Luca Abeni <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: luca abeni <[email protected]> Link: http://lkml.kernel.org/r/20171013070121.dzcncojuj2f4utij@mwanda Signed-off-by: Ingo Molnar <[email protected]>
1 parent 5c0342c commit aa5222e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/linux/sched.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ struct sched_dl_entity {
473473
* conditions between the inactive timer handler and the wakeup
474474
* code.
475475
*/
476-
int dl_throttled : 1;
477-
int dl_boosted : 1;
478-
int dl_yielded : 1;
479-
int dl_non_contending : 1;
476+
unsigned int dl_throttled : 1;
477+
unsigned int dl_boosted : 1;
478+
unsigned int dl_yielded : 1;
479+
unsigned int dl_non_contending : 1;
480480

481481
/*
482482
* Bandwidth enforcement timer. Each -deadline task has its

0 commit comments

Comments
 (0)