mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Wang Shilong <wangshilong1991@gmail.com>,
	kumargauravgupta3@gmail.com, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: Extend CamelCase types and ignore existing CamelCase uses in a patch
Date: Thu, 5 Sep 2013 10:45:08 -0700	[thread overview]
Message-ID: <20130905174508.GA5978@xanatos> (raw)
In-Reply-To: <1378336086.1787.48.camel@joe-AO722>

On Wed, Sep 04, 2013 at 04:08:06PM -0700, Joe Perches wrote:
> (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.

Great!  Thanks for doing this Joe.

Sarah Sharp

      reply	other threads:[~2013-09-05 17:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5223383f.hCMXrpqEq1AlVw9b%wangshilong1991@gmail.com>
2013-09-03 15:58 ` [v4:No,Change] xHCI:Fixing xhci_readl definition and function call Sarah Sharp
2013-09-03 17:25   ` [PATCH] checkpatch: Extend CamelCase types and ignore existing CamelCase uses in a patch Joe Perches
2013-09-04 15:58     ` Sarah Sharp
2013-09-04 23:08       ` Joe Perches
2013-09-05 17:45         ` Sarah Sharp [this message]

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=20130905174508.GA5978@xanatos \
    --to=sarah.a.sharp@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kumargauravgupta3@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangshilong1991@gmail.com \
    /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

all inboxes | Powered by JetHome®