mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andy Whitcroft <apw@canonical.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: Possible false positive from checkpatch.pl
Date: Wed, 14 Jul 2010 09:16:17 -0700	[thread overview]
Message-ID: <1279124177.11873.46.camel@Joe-Laptop.home> (raw)
In-Reply-To: <20100714131447.GC20746@shadowen.org>

On Wed, 2010-07-14 at 14:14 +0100, Andy Whitcroft wrote:
> On Mon, Jul 12, 2010 at 12:49:07PM -0700, Joe Perches wrote:
> > On Mon, 2010-07-12 at 14:37 -0500, Larry Finger wrote:
> > > That looks good. At least it makes clear what is wrong.
> > > Should it be an error, or just a warning?
> > I don't much care.
> > If Andy wants to do anything, let him decide.
> > Perhaps the new test should be
> > 	if ($rest =~ /\s*,\s*$/)
> I am not sure these are even invalid are they?  Macro abuse of this sort
> is always going to throw up exceptions.  Hrmm.

This seems to work better.

---
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bd88f11..548f8d9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2393,6 +2393,9 @@ sub process {
 				^\"|\"$
 			}x;
 			#print "REST<$rest> dstat<$dstat>\n";
+			if ($rest =~ /,\s*$/ || $dstat =~ /,\s*$/) {
+			    ERROR("Macros should not end with a trailing comma\n" . "$here\n$ctx\n");
+			}
 			if ($rest ne '') {
 				if ($rest !~ /while\s*\(/ &&
 				    $dstat !~ /$exceptions/)




  reply	other threads:[~2010-07-14 16:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-12 17:52 Larry Finger
2010-07-12 18:28 ` Joe Perches
2010-07-12 18:35   ` Larry Finger
2010-07-12 19:03     ` Joe Perches
2010-07-12 19:37       ` Larry Finger
2010-07-12 19:49         ` Joe Perches
2010-07-14 13:14           ` Andy Whitcroft
2010-07-14 16:16             ` Joe Perches [this message]
2010-07-14 13:13 ` Andy Whitcroft

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=1279124177.11873.46.camel@Joe-Laptop.home \
    --to=joe@perches.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=apw@canonical.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 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®