Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1543984ybj; Fri, 20 Sep 2019 12:12:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTzvJQyrmesnavTa0lagI8PMwFQJgZOl/f8AU2Z+s0dyH+TQLjvEqk4hzXyNmiF63i+llI X-Received: by 2002:a50:f045:: with SMTP id u5mr23723570edl.297.1569006723277; Fri, 20 Sep 2019 12:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569006723; cv=none; d=google.com; s=arc-20160816; b=A/DmVrzwwl/oUqnmeQeZ0OSi3jb2nNosu2N4N41VMT9t4NxhREJ3AqIZF/82xtw3yR 4tEUx+4bAlVWFk6+kaMi1VZuzHFZrrgsGi0GDdOxjDJ5aqfhGeJ3bTKnQjTEtdcO3/xc 7sbYBFWLlSGlamWhUOjw59uJS8Eem6dv7EgmRMrgrAuwR/K4PDezLdrMtu/p7ULDI2DZ 6RceXbvW6y9bbwPwk3wqK/a3/rs/3RlEeot9tZCwuKr9yqOQVzto4xEPZpLbl/41sHFR FJdT1pJYsxITh51cqMOYmQe27FevKuWKS+Oog9nu4O//bq+PWgH6DWX9qVTiqu/3mttB WV7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=o/+8VWjq66u4kHcS5rClvAfiki4/PccampY7VYyU+Kk=; b=WByL3WZ7S+bh0P+8Mtw+MBnlFk8Ff9mMRf0eYRJcaR74gKs1UNRWDzJerEH/qZZ0Qo 8TNr33rQEFycjZmPN1fI+bKtmE4aoCq4NRfkymZolkm20+HyMAiFyPAYSmtmpRLxB6XY 23gAXrkRncZZ/OVedwfCEsQLixQ55/+t5LViMmy+iW+DUR+NJiukqR6betDDQ5M4ZeJi OohYXn0RLS8V52lSN0/gyREACLVlZvGinOnRSkmKMPr2IHgkTDLn9jSBHSuXc635hzn+ 6/RfPuZ4rkbdhRCi/pXJ2OfdAA2kl8uB77dfzSJD+0Zl6fCpmmEn1Zf7KMKVAIbY8Ov3 sv1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=B92q+1tu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si2125846edf.102.2019.09.20.12.11.39; Fri, 20 Sep 2019 12:12:03 -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; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=B92q+1tu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438104AbfITK2Q (ORCPT + 99 others); Fri, 20 Sep 2019 06:28:16 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:33650 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393456AbfITK2P (ORCPT ); Fri, 20 Sep 2019 06:28:15 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8KAONSk009268; Fri, 20 Sep 2019 10:28:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=o/+8VWjq66u4kHcS5rClvAfiki4/PccampY7VYyU+Kk=; b=B92q+1tuKam1I3qE2aYQemBNVvDpF6IWI8kLeAFDrrKJHJmj4vZxlWjDbcCBZytg3B9o PxvcEyccrLWGAs49aXR1doUSc3WHe32KQCQXJ3GwjfrJwenf6et1W9LEyCnLwiIwKHLa gmyvG6SbAsyMxKQCNddVuMEmMz43PX4gjP6wUZxs/QVISVPbl/DSBwa7LRK3n4KiEnEW B++4ER4KoZlhsFZGP/BpCoPMeahqqmSIGmMTWSLYLVZ1sdVYP8u1oO8C+Oz8+dw49VFj y8dbbP34RHrcdoeeC02sW05xbG0eEdXX/zzyPeO2CGdx9bteTDTxIxfTmDz/N2DH8u2i aA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2v3vb4sk28-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Sep 2019 10:28:12 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8KANZ3k086815; Fri, 20 Sep 2019 10:26:12 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2v4g2v8nun-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Sep 2019 10:26:11 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x8KAQA4C011944; Fri, 20 Sep 2019 10:26:10 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 20 Sep 2019 03:26:09 -0700 Date: Fri, 20 Sep 2019 13:25:35 +0300 From: Dan Carpenter To: Steve French , Nicolai Stange , Luc Van Oostenryck , Chris Li Cc: LKML , linux-sparse@vger.kernel.org Subject: Re: checkpatch warnings in sched.h Message-ID: <20190920102535.GA25547@kadam> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9385 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909200098 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9385 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909200098 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 20, 2019 at 02:34:46AM -0500, Steve French wrote: > Any hints to get rid of the noisy warnings in sched.h that make it > hard to spot real warnings: > > /include/linux/sched.h:609:43: error: bad integer constant expression > /include/linux/sched.h:609:73: error: invalid named zero-width bitfield `value' > This is a bug in Sparse and it's way worse than you think. It actually disables the real Sparse warnings because now Sparse thinks it has encountered a parse error. I think we should just ifdef out that Sparse code. The problem is that if you have code like: 1 ? 1 :__bits_per() GCC treats that as a compile constant but Sparse says that it's not because all three elements of the conditional statement have to be constant. See the code in evaluate_conditional_expression(). The complication is that Sparse sets the constant flags before calls expand_expression() to see what the condition part of the statement is so the code needs to shuffled around to set the constant bits to match GCC. I'm going to #ifdef this out for Smatch later today but someone needs to do the same thing in Sparse because right now no one can check for endian bugs until this gets fixed. It's been broken for a month so we'll probably get a flood of patches marking functions as static once we patch this and people start seeing that warning again. regards, dan carpenter