diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-10-13 03:01:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-11-21 03:25:01 -0500 |
commit | aa5222e92f8000ed3c1c38dddf11c83222aadfb3 (patch) | |
tree | b775012d49350fb135d22369216c95e8aa023831 | |
parent | 5c0342ca7ef17220d8dd2da68d0d349c26ab19df (diff) |
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 <willy@infradead.org>
Reported-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Luca Abeni <luca.abeni@santannapisa.it>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-janitors@vger.kernel.org
Cc: luca abeni <luca.abeni@santannapisa.it>
Link: http://lkml.kernel.org/r/20171013070121.dzcncojuj2f4utij@mwanda
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | include/linux/sched.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index a5dc7c98b0a2..21991d668d35 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -473,10 +473,10 @@ struct sched_dl_entity { | |||
473 | * conditions between the inactive timer handler and the wakeup | 473 | * conditions between the inactive timer handler and the wakeup |
474 | * code. | 474 | * code. |
475 | */ | 475 | */ |
476 | int dl_throttled : 1; | 476 | unsigned int dl_throttled : 1; |
477 | int dl_boosted : 1; | 477 | unsigned int dl_boosted : 1; |
478 | int dl_yielded : 1; | 478 | unsigned int dl_yielded : 1; |
479 | int dl_non_contending : 1; | 479 | unsigned int dl_non_contending : 1; |
480 | 480 | ||
481 | /* | 481 | /* |
482 | * Bandwidth enforcement timer. Each -deadline task has its | 482 | * Bandwidth enforcement timer. Each -deadline task has its |