From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753709AbdKFP3X (ORCPT ); Mon, 6 Nov 2017 10:29:23 -0500 Received: from smtprelay0179.hostedemail.com ([216.40.44.179]:44082 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752019AbdKFP3W (ORCPT ); Mon, 6 Nov 2017 10:29:22 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:69: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:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3868:3870:3871:3872:3874:4184:4250:4321:5007:6691:7903:10004:10400:10848:11232:11658:11914:12043:12740:12760:12895:13069:13071:13311:13357:13439:14180:14659:14721:21060:21080:21451:21627:30012:30041: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:1,LUA_SUMMARY:none X-HE-Tag: work56_174b5e9749f52 X-Filterd-Recvd-Size: 1981 Message-ID: <1509982158.2431.42.camel@perches.com> Subject: Re: checkpatch potential false positive From: Joe Perches To: Andy Whitcroft , "Tobin C. Harding" Cc: linux-kernel@vger.kernel.org Date: Mon, 06 Nov 2017 07:29:18 -0800 In-Reply-To: <20171106083336.ccz5ht77iegqrd6d@brain> References: <20171106041914.GB18478@eros> <20171106083336.ccz5ht77iegqrd6d@brain> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-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 Mon, 2017-11-06 at 08:33 +0000, Andy Whitcroft wrote: > On Mon, Nov 06, 2017 at 03:19:14PM +1100, Tobin C. Harding wrote: > > Hi, Hello. > > When parsing drivers/staging/unisys/visorbus/visorchipset.c in Greg's > > staging tree checkpatch emits > > > > -------------- > > visorchipset.c > > -------------- > > WARNING: char * array declaration might be better as static const > > #1050: FILE: visorchipset.c:1050: > > + char *envp[] = { env_cmd, env_id, env_state, env_bus, env_dev, > > > > WARNING: char * array declaration might be better as static const > > #1140: FILE: visorchipset.c:1140: > > + char *envp[] = { env_selftest, NULL }; > > > > total: 0 errors, 2 warnings, 1694 lines checked > > > > I may be wrong but I think the code in question is clean and > > correct. Since checkpatch is saying this _might_ be better ... perhaps > > checkpatch could emit CHECK instead of WARNING for this? CHECKs aren't enabled by default except for a few directories and this warning is much more commonly correct than incorrect. checkpatch will always have both false positives and false negatives. It's stupid, people generally aren't. Just ignore checkpatch bleats that aren't appropriate.