From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938001AbdAJQuK (ORCPT ); Tue, 10 Jan 2017 11:50:10 -0500 Received: from smtprelay0177.hostedemail.com ([216.40.44.177]:59102 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934032AbdAJQuI (ORCPT ); Tue, 10 Jan 2017 11:50:08 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:69:355:379:541:599: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:2559:2562:2693:2828:2902:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6119:7264:7903:10004:10400:10450:10455:10848:11232:11658:11914:12043:12683:12740:12760:12895:13069:13095:13161:13163:13229:13311:13357:13439:14659:14721:19904:19999:21080:21433:30012:30054:30070:30079:30083: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:1,LUA_SUMMARY:none X-HE-Tag: arch95_f5b2dae4713 X-Filterd-Recvd-Size: 2838 Message-ID: <1484067005.12006.5.camel@perches.com> Subject: Re: [PATCH] checkpatch: don't warn on every struct without const_structs file From: Joe Perches To: Johannes Berg , Andrew Morton Cc: linux-kernel@vger.kernel.org Date: Tue, 10 Jan 2017 08:50:05 -0800 In-Reply-To: <1484065886.1014.3.camel@sipsolutions.net> References: <20170110140318.737-1-johannes@sipsolutions.net> <1484060517.2106.38.camel@perches.com> <1484060672.1014.1.camel@sipsolutions.net> <1484065662.12006.2.camel@perches.com> <1484065886.1014.3.camel@sipsolutions.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.1 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 On Tue, 2017-01-10 at 17:31 +0100, Johannes Berg wrote: > > > I copied checkpatch elsewhere and ran it. > > > > Why do you want to copy checkpatch "someplace else"? > > Instead of copy, I think you should soft link it. > > Well, no, I have to distribute it with that. > > > > Regardless, the current code is utterly stupid - it prints a > > > warning that it won't flag any structs, and then proceeds to flag > > > all structs. > > > > > > If you must, send a patch to abort() [whatever the perl equivalent > > > is] when the file can't be found, but as it is, the code is just > > > idiotic. > > > > Maybe so. > > > > As is, your patch description is incomplete because > > it doesn't mention your use case. > > I don't think that's relevant. I do. checkpatch is a script written for linux patches. You are making use of the script outside of the linux tree. You could just as well keep a local copy of this patch instead. Your patch allows you to avoid this and the patch description is relevant to why this is useful. So your patch description is simply incorrect/incomplete: --------------------------------------------------------------- The script says that it won't warn: "No structs that should be const will be found [...]" but then that doesn't work and it warns on every single struct instead, since the regular expression ends up empty. Fix that by checking that it's not empty first. --------------------------------------------------------------- When used for linux, checkpatch works just fine and your patch description describes a condition that doesn't happen. > The script is internally inconsistent, > as I do mention in the commit log, which is worth fixing. Yeah, I think it's useful to fix. Just make the commit message describe why the patch is appropriate for non-linux uses.