lkml.org 
[lkml]   [2017]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched: use unsigned int for one-bit bitfield in sched_dl_entity
Hi,

On Fri, 17 Nov 2017 14:50:11 +0800
Xin Long <lucien.xin@gmail.com> wrote:

> This patch is to fix the 'dubious one-bit signed bitfield' error reported
> by sparse, when using 'make C=2'.
>
> Fixes: 799ba82de01e ("sched/deadline: Use C bitfields for the state flags")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

I think this is very similar to patches already sent by Dan Carpenter
and Matthew Wilcox. As for the previous patches, I think the change is
ok.



Luca



> ---
> include/linux/sched.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index a5dc7c9..3e35a37 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -473,10 +473,10 @@ struct sched_dl_entity {
> * conditions between the inactive timer handler and the wakeup
> * code.
> */
> - int dl_throttled : 1;
> - int dl_boosted : 1;
> - int dl_yielded : 1;
> - int dl_non_contending : 1;
> + unsigned int dl_throttled : 1,
> + dl_boosted : 1,
> + dl_yielded : 1,
> + dl_non_contending : 1;
>
> /*
> * Bandwidth enforcement timer. Each -deadline task has its

\
 
 \ /
  Last update: 2017-11-17 17:19    [W:0.134 / U:5.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site