lkml.org 
[lkml]   [2020]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] checkpatch: check for missing \n at the end of logging message
From
Date
On Fri, 2020-04-10 at 19:35 +0200, Christophe JAILLET wrote:
> Le 08/04/2020 à 04:14, Joe Perches a écrit :
> > This works rather better:
> > Perhaps you could test?
[]
> I'm looking at some modification done in the last month that could have
> been spotted by the above script.
>
> ./scripts/checkpatch.pl -f drivers/usb/phy/phy-jz4770.c
>
> correctly spots the 3 first cases, but the 3 last (line 202, 210 and
> 217) are missed.
> I don't understand why.

It has to do with checkpatch's single statement parsing.

This case:

if (foo)
dev_warn(...);

is parsed as a single statement but

if (foo) {
dev_warn(...);
};

is parsed as multiple statements so for the
second case

dev_warn(...);

is analyzed as a separate statement.

The regex match for this missing newline test expects
that each printk is a separate statement so the first
case doesn't match.

Clearly the regex can be improved here.

cheers, Joe

\
 
 \ /
  Last update: 2020-04-10 21:49    [W:0.125 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site