From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757281AbcH2MbG (ORCPT ); Mon, 29 Aug 2016 08:31:06 -0400 Received: from smtprelay0138.hostedemail.com ([216.40.44.138]:48653 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756457AbcH2MbE (ORCPT ); Mon, 29 Aug 2016 08:31:04 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:334:355:368:369:379:541:599:960:967:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2560:2563:2682:2685:2693:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:6119:7903:7904:9025:10004:10400:10848:11026:11232:11473:11658:11783:11914:12043:12438:12679:12740:13069:13311:13357:13439:13618:13894:13972:14180:14181:14659:14721:21080:21434:21451:30012:30029:30054:30064:30070:30089:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: glass35_7cb4db935e52a X-Filterd-Recvd-Size: 3011 Message-ID: <1472473855.3425.18.camel@perches.com> Subject: Re: checkkpatch (in)sanity ? From: Joe Perches To: Kalle Valo Cc: "Levin, Alexander" , Sasha Levin , Greg KH , LKML , "ksummit-discuss@lists.linuxfoundation.org" Date: Mon, 29 Aug 2016 05:30:55 -0700 In-Reply-To: <874m634yip.fsf@purkki.adurom.net> References: <1472330452.26978.23.camel@perches.com> <20160828005636.GB19088@sasha-lappy> <1472348579.26978.47.camel@perches.com> <874m634yip.fsf@purkki.adurom.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2016-08-29 at 14:15 +0300, Kalle Valo wrote: > I wish that checkpatch would have a way to enable/disable warnings per > directory (or file). For example, there would be > drivers/net/wireless/ath/ath10k/.checkpatch which would disable the > warnings are not suitable for ath10k for one reason or another: > > 'MSLEEP', > 'USLEEP_RANGE', > 'PRINTK_WITHOUT_KERN_LEVEL', > 'NETWORKING_BLOCK_COMMENT_STYLE', > 'BLOCK_COMMENT_STYLE', > 'LINUX_VERSION_CODE', > 'COMPLEX_MACRO', > 'PREFER_DEV_LEVEL', > 'PREFER_PR_LEVEL', > 'COMPARISON_TO_NULL', > 'BIT_MACRO', > 'CONSTANT_COMPARISON', > 'MACRO_WITH_FLOW_CONTROL' > > Currently my workaround is to have a custom ath10k-check script[1] which > runs checkpatch with those checks disabled. Oh, and it also filters out > some of the warnings based on the symbol it is located in. > > https://github.com/qca/qca-swiss-army-knife/blob/master/tools/scripts/ath10k/ath10k-check Hey Kalle: I looked at your script (which also does compilation and sparse checking) I don't see how a .checkpatch_conf hierarchy helps you much there as you've added all those long symbol name long line avoidance bits. Also, there'd be a lot of rework to the globals in checkpatch for per-directory specific overrides if someone fed it files in multiple directories like checkpatch.pl A couple btw's: Why avoid the printk, sleep or macro tests? And this for ath10k_core_register_work:     ('ath10k_core_register_work', 'RETURN_VOID'), and the code associated to it: err: /* TODO: It's probably a good idea to release device from the driver * but calling device_release_driver() here will cause a deadlock. */ return; } ia avoided a few times in the kernel by using a bare ";" instead of "return;" before the function closing brace. It's maybe unfortunate that gcc / c spec doesn't allow jumping to a label just before the function close brace.