From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965310AbdKQIUa (ORCPT ); Fri, 17 Nov 2017 03:20:30 -0500 Received: from mail.sssup.it ([193.205.80.98]:30643 "EHLO mail.santannapisa.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751322AbdKQIUX (ORCPT ); Fri, 17 Nov 2017 03:20:23 -0500 Date: Fri, 17 Nov 2017 09:20:16 +0100 From: Luca Abeni To: Xin Long Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH] sched: use unsigned int for one-bit bitfield in sched_dl_entity Message-ID: <20171117092016.382a7270@luca> In-Reply-To: <9ca35406601257b736823d9a2109888c86f2c0e3.1510901411.git.lucien.xin@gmail.com> References: <9ca35406601257b736823d9a2109888c86f2c0e3.1510901411.git.lucien.xin@gmail.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, 17 Nov 2017 14:50:11 +0800 Xin Long 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 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