Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751965AbdF3DMf (ORCPT ); Thu, 29 Jun 2017 23:12:35 -0400 Received: from smtprelay0124.hostedemail.com ([216.40.44.124]:50484 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751005AbdF3DMe (ORCPT ); Thu, 29 Jun 2017 23:12:34 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3873:3874:4250:4321:4605:5007:7903:10004:10400:10848:11026:11232:11473:11658:11914:12043:12438:12555:12679:12740:12760:12895:13069:13161:13229:13311:13357:13439:14659:21080:21451:21627:30012:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:15,LUA_SUMMARY:none X-HE-Tag: bird75_335332430932b X-Filterd-Recvd-Size: 1842 Message-ID: <1498792351.2739.8.camel@perches.com> Subject: Re: Inconsistency in scripts/checkpatch.pl From: Joe Perches To: Larry Finger , Andy Whitcroft Cc: LKML Date: Thu, 29 Jun 2017 20:12:31 -0700 In-Reply-To: <70ae7b56-7fcd-9677-4768-e8a7343c5d75@lwfinger.net> References: <70ae7b56-7fcd-9677-4768-e8a7343c5d75@lwfinger.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1050 Lines: 32 On Thu, 2017-06-29 at 20:26 -0500, Larry Finger wrote: > Andy and Joe, > > In some new rtlwifi code, I get the following for one of the new macros: > > CHECK: Macro argument '__h2c' may be better as '(__h2c)' to avoid precedence issues > #45005: FILE: > drivers/net/wireless/realtek/rtlwifi/halmac/halmac_original_h2c_nic.h:1163: > +#define AOAC_RSVD_PAGE3_GET_LOC_AOAC_REPORT(__h2c) \ > + LE_BITS_TO_4BYTE(__h2c + 0X00, 16, 8) > > When I make that change, I get > > CHECK: No space is necessary after a cast > #45004: FILE: > drivers/net/wireless/realtek/rtlwifi/halmac/halmac_original_h2c_nic.h:1162: > + LE_BITS_TO_4BYTE((__h2c) + 0X00, 16, 8) > > Which CHECK should I fix? The first. Only if you want to. > To my eye, the second form is the false positive. I agree. Ignore the 2nd warning for awhile. . A few trivial notes: o 0X00 is kinda ugly to me. 0x00 is nicer. o I presume that 0x00 could be a #define somewhere o AOAC_RSVD_PAGE3_GET_LOC_AOAC_REPORT is a rather long identifier at 35 chars.