Received: by 10.223.164.221 with SMTP id h29csp539437wrb; Fri, 13 Oct 2017 01:36:59 -0700 (PDT) X-Google-Smtp-Source: AOwi7QABct1QPKstIu1L+/kDho2CeO81zO7YdlKQcy1CCLyL66R07wEzTXoBdipnKSWL3UDUWh6E X-Received: by 10.84.248.129 with SMTP id q1mr742244pll.156.1507883819603; Fri, 13 Oct 2017 01:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507883819; cv=none; d=google.com; s=arc-20160816; b=G4Us+vYXediStZlG0k9Qm575R8hf4oB37DvJBQkzraZyvjFHPMu5N3MYb0Yc33mahc Kqkvt4NdVdOj7UwS02UKmAYoCQ+h6tPm7RgLAcRP3K3sYwnCGwT+cxXU6UR4xFnzrf5X iudOU5wTsye8HR47ZHL2Mb4e3Z0l5ZNMsvOKya+2K0IxsDsCQ/p4aSjYc1k1L83O4c7d HK6HrgvM7wWgijQ7QvoY20zfJ8qILQWaiYepJw3+d5UU/LeNphrSCqHYsomrnYU7kyBy 1X0jcVSGKdPcjeu39+AW0DiEQiTFhWsP+QnyTpHEXEeNMGXQk/ATBV71AoEx5rSdw4I5 6a5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=5FokGXeflczI1cPSbTMdq78C93cK7t18oq63dljFUfc=; b=xYEmfiXzVvQtIASOGbsPJNHWZlFKrVAdqprmsqVUA+o8PboqTFCHL+m0OeE7NrRVKH 2JVZ//HicLqKGJhnoIZdA4JdpNiXdSEBY1H9DPJsFn6nP1aO6R/QcaJPyyTb+FfOSeTH Od0RHUHL+qmYKaD2rSmxhChhAu2z/c/6b+koynQuOUD2eKZFh3W1Zdujp0H9Aw8IDWll 4SewRHCIpSURGRxGbispeYXgB0UtE5Ikuz9hH6YaGOei8FY4o+KEm4oODQJkAU7Qs/GL QZi+Dr2SXTmf7FbgE4ud2ldrygP9W6GiVVQJlnFlhAl9uSQvP2RY8fPaYaQLbaNA5pha tWFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si300824pld.655.2017.10.13.01.36.45; Fri, 13 Oct 2017 01:36:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757548AbdJMIgR (ORCPT + 99 others); Fri, 13 Oct 2017 04:36:17 -0400 Received: from mail.sssup.it ([193.205.80.98]:64330 "EHLO mail.santannapisa.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756606AbdJMIgO (ORCPT ); Fri, 13 Oct 2017 04:36:14 -0400 X-Greylist: delayed 3601 seconds by postgrey-1.27 at vger.kernel.org; Fri, 13 Oct 2017 04:36:14 EDT Received: from [10.30.3.176] (account l.abeni@santannapisa.it HELO luca) by santannapisa.it (CommuniGate Pro SMTP 6.1.11) with ESMTPSA id 124632096; Fri, 13 Oct 2017 09:36:10 +0200 Date: Fri, 13 Oct 2017 09:36:06 +0200 From: Luca Abeni To: Dan Carpenter Cc: Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] sched/deadline: Don't use dubious signed bitfields Message-ID: <20171013093606.5539975f@luca> In-Reply-To: <20171013070121.dzcncojuj2f4utij@mwanda> References: <20171013070121.dzcncojuj2f4utij@mwanda> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, 13 Oct 2017 10:01:22 +0300 Dan Carpenter wrote: > 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 > > Signed-off-by: Dan Carpenter I did not notice any issue when testing, but if "unsigned int" is the common practice for bitfields, I agree with the change. Reviewed-by: Luca Abeni Thanks, Luca > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 0f897dfc195e..105eaff8a5e7 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -474,10 +474,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 From 1581124861000027433@xxx Fri Oct 13 07:02:50 +0000 2017 X-GM-THRID: 1581124861000027433 X-Gmail-Labels: Inbox,Category Forums