lkml.org 
[lkml]   [2010]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Possible false positive from checkpatch.pl
From
Date
On Mon, 2010-07-12 at 14:37 -0500, Larry Finger wrote:
> On 07/12/2010 02:03 PM, Joe Perches wrote:
> > 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?

I don't much care.

If Andy wants to do anything, let him decide.

Perhaps the new test should be
if ($rest =~ /\s*,\s*$/)

cheers, Joe



\
 
 \ /
  Last update: 2010-07-12 21:51    [W:0.057 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site