From: Joe Perches <joe@perches.com>
To: Andy Whitcroft <apw@canonical.com>, "Tobin C. Harding" <me@tobin.cc>
Cc: linux-kernel@vger.kernel.org
Subject: Re: checkpatch potential false positive
Date: Mon, 06 Nov 2017 07:29:18 -0800 [thread overview]
Message-ID: <1509982158.2431.42.camel@perches.com> (raw)
In-Reply-To: <20171106083336.ccz5ht77iegqrd6d@brain>
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.
next prev parent reply other threads:[~2017-11-06 15:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-06 4:19 checkpatch potential false positive Tobin C. Harding
2017-11-06 8:33 ` Andy Whitcroft
2017-11-06 15:29 ` Joe Perches [this message]
2017-11-06 20:54 ` Tobin C. Harding
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1509982158.2431.42.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=me@tobin.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox