From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751624AbdKUIfd (ORCPT ); Tue, 21 Nov 2017 03:35:33 -0500 Received: from terminus.zytor.com ([65.50.211.136]:54359 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751438AbdKUIfc (ORCPT ); Tue, 21 Nov 2017 03:35:32 -0500 Date: Tue, 21 Nov 2017 00:30:48 -0800 From: tip-bot for Dan Carpenter Message-ID: Cc: tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, lucien.xin@gmail.com, luca.abeni@santannapisa.it, dan.carpenter@oracle.com, willy@infradead.org, hpa@zytor.com, torvalds@linux-foundation.org Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, willy@infradead.org, dan.carpenter@oracle.com, luca.abeni@santannapisa.it, lucien.xin@gmail.com In-Reply-To: <20171013070121.dzcncojuj2f4utij@mwanda> References: <20171013070121.dzcncojuj2f4utij@mwanda> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/urgent] sched/deadline: Don't use dubious signed bitfields Git-Commit-ID: aa5222e92f8000ed3c1c38dddf11c83222aadfb3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: aa5222e92f8000ed3c1c38dddf11c83222aadfb3 Gitweb: https://git.kernel.org/tip/aa5222e92f8000ed3c1c38dddf11c83222aadfb3 Author: Dan Carpenter AuthorDate: Fri, 13 Oct 2017 10:01:22 +0300 Committer: Ingo Molnar CommitDate: Tue, 21 Nov 2017 09:25:01 +0100 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 Reported-by: Xin Long Signed-off-by: Dan Carpenter Reviewed-by: Luca Abeni Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: kernel-janitors@vger.kernel.org Cc: luca abeni Link: http://lkml.kernel.org/r/20171013070121.dzcncojuj2f4utij@mwanda Signed-off-by: Ingo Molnar --- 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..21991d6 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; + unsigned int dl_boosted : 1; + unsigned int dl_yielded : 1; + unsigned int dl_non_contending : 1; /* * Bandwidth enforcement timer. Each -deadline task has its