[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1378336086.1787.48.camel@joe-AO722>
Date: Wed, 04 Sep 2013 16:08:06 -0700
From: Joe Perches <joe@...ches.com>
To: Sarah Sharp <sarah.a.sharp@...ux.intel.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Wang Shilong <wangshilong1991@...il.com>,
kumargauravgupta3@...il.com, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: Extend CamelCase types and ignore existing
CamelCase uses in a patch
(sending for 3rd time, odd dns problems today, apologies for dupes)
On Wed, 2013-09-04 at 08:58 -0700, Sarah Sharp wrote:
> On Tue, Sep 03, 2013 at 10:25:21AM -0700, Joe Perches wrote:
> > Extend the CamelCase words found to include structure members.
> >
> > In https://lkml.org/lkml/2013/9/3/318 Sarah Sharp (mostly) wrote:
> >
> > "In general, if checkpatch.pl complains about a variable a patch
> > introduces that's CamelCase, you should pay attention to it.
> > Otherwise, [] ignore it."
> >
> > So, if checking a patch, scan the original patched file if it's
> > available and add any preexisting CamelCase types so reuses do
> > not generate CamelCase messages.
[]
> Thanks! Will this mean checkpatch.pl still complains on CamelCase names
> if it's run against a file? I think that's still valuable.
Yes.
First, checkpatch looks for all existing CamelCase #defines,
typedefs, function names and struct/union members in the
include path. (it uses regexes so it's actually not at all
close to even good at finding those).
It stores all those CamelCase uses in a hash.
If checkpatch is scanning a patch, it'll now read the file
being patched for existing uses of CamelCase #defines, etc,
and checkpatch adds those uses to the hash.
If checkpatch is scanning a file, it doesn't doesn't
prescan the file.
Then, when checkpatch scans the patch or file and finds a
CamelCase use, it looks for that use in the hash and is
silent if it's there, noisy otherwise.
This can still report CamelCase uses in a patch if say a
CamelCase type is defined in a .h file in the same directory
or some other include path and that word is not already used
by the file.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists