All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>, linux-kernel@vger.kernel.org
Subject: Re: Checkpatch error on trace events macros
Date: Mon, 29 Jul 2013 14:23:28 -0700	[thread overview]
Message-ID: <20130729212328.GD14883@xanatos> (raw)
In-Reply-To: <1375128164.2075.53.camel@joe-AO722>

On Mon, Jul 29, 2013 at 01:02:44PM -0700, Joe Perches wrote:
> On Mon, 2013-07-29 at 12:52 -0700, Sarah Sharp wrote:
> > Hi Andy and Joe,
> 
> Hi Sarah.
> 
> > Checkpatch is complaining when code adds new trace events macros:
> > 
> > sarah@xanatos:~/git/kernels/xhci$ git am -s ~/Maildir.fetchmail/.to-apply
> > Applying: xhci: add traces for debug messages in xhci_address_device()
> > ERROR: Macros with complex values should be enclosed in parenthesis
> > #86: FILE: drivers/usb/host/xhci-trace.h:15:
> > +#define TRACE_SYSTEM xhci-hcd
> 
> <shrug>
> 
> I think these are suboptimal as the files should use
> underscores rather than dashes.

The norm in the USB subsystem is to use dashes in filenames.  I think
it's suboptimal to have to use the shift key at all when typing
filenames.  We have different preferences here, and different reasons
for those preferences, but there is no "should" here, just opinions.

> checkpatch sees this as a subtraction which really
> should have parentheses.

I see.

> > ERROR: Macros with complex values should be enclosed in parenthesis
> > #115: FILE: drivers/usb/host/xhci-trace.h:44:
> > +#define TRACE_INCLUDE_PATH .
> > 
> > ERROR: Macros with complex values should be enclosed in parenthesis
> > #118: FILE: drivers/usb/host/xhci-trace.h:47:
> > +#define TRACE_INCLUDE_FILE xhci-trace
> 
> Don't expect to checkpatch to be perfect.
> 
> It's not.
> 
> It's a stupid little tool good for some things
> and good for highlighting areas that might need
> another look.
> 
> Use your judgment about everything it spews.

If checkpatch spews warnings and errors,  that makes it basically
useless as a git pre-commit hook.

Sigh, I suppose I'll just add a '|| true' to the end of the line and
deal with it.

Sarah Sharp

  reply	other threads:[~2013-07-29 21:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 19:52 Checkpatch error on trace events macros Sarah Sharp
2013-07-29 20:02 ` Joe Perches
2013-07-29 21:23   ` Sarah Sharp [this message]
2013-07-29 21:48     ` Joe Perches
2013-07-30  1:30 ` Li Zefan
2013-07-30  1:58   ` Joe Perches
2013-07-30  2:06     ` Li Zefan
2013-07-30  2:36       ` Joe Perches
2013-07-30  3:04         ` Li Zefan
2013-07-30  3:10           ` Joe Perches
2013-07-30  3:25             ` Li Zefan
2013-07-30 18:17               ` [PATCH] checkpatch: Ignore #define TRACE_<foo> macros Joe Perches

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=20130729212328.GD14883@xanatos \
    --to=sarah.a.sharp@linux.intel.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.