From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753388AbdKFUyf (ORCPT ); Mon, 6 Nov 2017 15:54:35 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:59069 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751787AbdKFUye (ORCPT ); Mon, 6 Nov 2017 15:54:34 -0500 X-ME-Sender: Date: Tue, 7 Nov 2017 07:54:30 +1100 From: "Tobin C. Harding" To: Joe Perches Cc: Andy Whitcroft , linux-kernel@vger.kernel.org Subject: Re: checkpatch potential false positive Message-ID: <20171106205430.GR18478@eros> References: <20171106041914.GB18478@eros> <20171106083336.ccz5ht77iegqrd6d@brain> <1509982158.2431.42.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1509982158.2431.42.camel@perches.com> X-Mailer: Mutt 1.5.24 (2015-08-30) User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 06, 2017 at 07:29:18AM -0800, Joe Perches wrote: > 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. Ok, thanks. > 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. Got it, cheers Andy.