Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7997843ybi; Thu, 6 Jun 2019 05:09:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGyKIEwgxPl/rzYHAqqsqL0GefQbAAXznKuY3sQejbJzHBDLlOPBsMHPq7F2Rny8p6ZY39 X-Received: by 2002:a17:90a:a00b:: with SMTP id q11mr51005129pjp.108.1559822951506; Thu, 06 Jun 2019 05:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559822951; cv=none; d=google.com; s=arc-20160816; b=jfsr0gK2Uuh9ElrDzQqoEBwhpICWi3mi1PtTRoa5cyMdSUGPAS6MI0+8cZmvyu7ekm sHt+p//AvhgwtsyBcY0k0zfRczSqCNS99yPAT06STC2Mvd96ovMNxSrrXU2Rlo8BMJdI Dwhhm32paggBQtRscwuzWGhtehQCQB5gwydsTDt56zC4VqV3AvBQUou19523B7TsKe95 WitEQjZ7InKbfoqRTpD5GriqJfp7hmYLLeLP4k+N692DcZtxr3AJYATb4gboSEnwcw16 Li/AvEuOHRtmuB6+oDbMmvTQu0eOjhx2sGRFuRYq5M3fZGAjXlGp41YII/omU4JhTpDM AgJA== 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=CYdJIrBU83khStvSGVg8ySuKn6WPb/kbQ9bMGPSCHnc=; b=lhShg1D0Ld+aDI9Rmwasqpc2dbDPAj7UxvcOhdqQW0e1PmebiQm3ijTtwTcbYmjmIh CF/4XEHU+Ox+MEw5iwuZfCMykzLAMSch8E4FLwJd+Fh6rFTrX5M5jiBJidbxghs3JqDm Q3WykBz3AbRIhUuoILMP/9Vz0v2BEDhYNIUOLK5co9RDj23qfJnNdWcbH/Qyl8kL2Tid jBSIthQmq8ZE02L60i5bMX0E26vzuydYTdJW6Q+rM+eS0kug3EruZbD0ze322qx82CyY Xe0NZ2SnFJ3IUfjo+TXOvBVHiinnSLoQrAntouZh5ORdBcil1fkR2MZWkHW6VEy4Nk28 BkaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=GSZG8tnY; 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 s5si1600020plr.129.2019.06.06.05.08.54; Thu, 06 Jun 2019 05:09:11 -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-2018-07-02 header.b=GSZG8tnY; 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 S1727236AbfFFKvf (ORCPT + 99 others); Thu, 6 Jun 2019 06:51:35 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:40754 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbfFFKvf (ORCPT ); Thu, 6 Jun 2019 06:51:35 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x56An497115142; Thu, 6 Jun 2019 10:51:18 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-2018-07-02; bh=CYdJIrBU83khStvSGVg8ySuKn6WPb/kbQ9bMGPSCHnc=; b=GSZG8tnYFAcH0V8tG4YkdSsjjld/zZCLtpm1Ujt/QdqJ9BBwlR9lR8poTAQgxfG9BCAW SHtrAZFWpYRTkml/xdOmDCl5NAz6QcKXf39DHB+vN8RcdyBvYHBSf+IobnHdO9E+Bj4B pYICfwUIKzxhiqKwc8GV1FFy3fMUrcIxotPoMPdmqFcmOKAR0L00Uj1LVbL0c9xOWVyl Vd7WpTu8EZPIG+I6x4uEEw++49QhBNcWOASuvuHYBmkWM1HzcsqA+XwwhxQ6llaDocFh T1EwzxQgsiin1KV+FSxLgbCJ9gfuiK8aK6jAipVAyTvSXgAkbL2yWEJoROeqswH6zjsT Xg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2suj0qqjvd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2019 10:51:18 +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 x56AofFx017801; Thu, 6 Jun 2019 10:51:18 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2swnhcmfv8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2019 10:51:17 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x56ApGXE022658; Thu, 6 Jun 2019 10:51:16 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 06 Jun 2019 03:51:15 -0700 Date: Thu, 6 Jun 2019 13:51:08 +0300 From: Dan Carpenter To: Hariprasad Kelam Cc: Greg Kroah-Hartman , Carmeli Tamir , Nishad Kamdar , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging: emxx_udc: fix warning "sum of probable bitmasks, consider |" Message-ID: <20190606105108.GL31203@kadam> References: <20190603185412.GA11183@hari-Inspiron-1545> <20190603190457.GA6487@kroah.com> <20190605063443.GA5248@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190605063443.GA5248@hari-Inspiron-1545> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9279 signatures=668687 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-1810050000 definitions=main-1906060079 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9279 signatures=668687 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-1810050000 definitions=main-1906060079 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 05, 2019 at 12:04:43PM +0530, Hariprasad Kelam wrote: > On Mon, Jun 03, 2019 at 09:04:57PM +0200, Greg Kroah-Hartman wrote: > > On Tue, Jun 04, 2019 at 12:24:12AM +0530, Hariprasad Kelam wrote: > > > Knowing the fact that operator '|' is faster than '+'. > > > Its better we replace + with | in this case. > > > > > > Issue reported by coccicheck > > > drivers/staging/emxx_udc/emxx_udc.h:94:34-35: WARNING: sum of probable > > > bitmasks, consider | > > > > > > Signed-off-by: Hariprasad Kelam > > > --- > > > drivers/staging/emxx_udc/emxx_udc.h | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h > > > index b8c3dee..88d6bda 100644 > > > --- a/drivers/staging/emxx_udc/emxx_udc.h > > > +++ b/drivers/staging/emxx_udc/emxx_udc.h > > > @@ -91,7 +91,7 @@ int vbus_irq; > > > #define BIT30 0x40000000 > > > #define BIT31 0x80000000 > > > > All of those BITXX defines should be removed and the "real" BIT(X) macro > > used instead. > Yes will send separate patch to address this. > > > > > -#define TEST_FORCE_ENABLE (BIT18 + BIT16) > > > +#define TEST_FORCE_ENABLE (BIT18 | BIT16) > > > > It really doesn't matter, a good compiler will have already turned this > > into a constant value so you really do not know if this is less/faster > > code or not, right? > > > > Did you look at the output to verify this actually changed anything? > > > > thanks, > > > > greg k-h > > Ok . Treating this as false postive from coccicheck. I liked the patch. | is way more normal and readable than +. It's just the commit message was bogus. I would be very surprised if this coccicheck found anything that wasn't a compile time constant like this. regards, dan carpenter