From: Larry Finger <Larry.Finger@lwfinger.net>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: Possible false positive from checkpatch.pl
Date: Mon, 12 Jul 2010 14:37:39 -0500 [thread overview]
Message-ID: <4C3B6F03.8060708@lwfinger.net> (raw)
In-Reply-To: <1278961381.1501.284.camel@Joe-Laptop.home>
On 07/12/2010 02:03 PM, Joe Perches wrote:
> On Mon, 2010-07-12 at 13:35 -0500, Larry Finger wrote:
>> These are ugly macros that will be eliminated, but for the moment they are in
>> the code. As I stated in my original email, removing the comma from the
>> definition and adding it to the code does fix the checkpatch error, but it
>> should not be necessary.
>
> Hi Larry.
>
> Using checkpatch is not necessary.
>
> If you want generally conforming kernel style,
> the macro should not end in a trailing comma.
>
> Feel free to ignore the checkpatch message,
>
> I think the warning is reasonable, though it
> could be made more specific.
>
> cheers, Joe
>
> Maybe something like:
> ---
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index bd88f11..7e8a3f4 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2394,8 +2394,10 @@ sub process {
> }x;
> #print "REST<$rest> dstat<$dstat>\n";
> if ($rest ne '') {
> - if ($rest !~ /while\s*\(/&&
> - $dstat !~ /$exceptions/)
> + if ($rest eq ",") {
> + ERROR("Macros should not end with a trailing comma\n" . "$here\n$ctx\n");
> + } elsif ($rest !~ /while\s*\(/&&
> + $dstat !~ /$exceptions/)
> {
> ERROR("Macros with multiple statements should be enclosed in a do - while loop\n" . "$here\n$ctx\n");
> }
That looks good. At least it makes clear what is wrong.
Should it be an error, or just a warning?
Larry
next prev parent reply other threads:[~2010-07-12 19:37 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 [this message]
2010-07-12 19:49 ` Joe Perches
2010-07-14 13:14 ` Andy Whitcroft
2010-07-14 16:16 ` Joe Perches
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=4C3B6F03.8060708@lwfinger.net \
--to=larry.finger@lwfinger.net \
--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 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®