Skip to content

Commit 3621735

Browse files
JoePerchesakpm00
authored andcommitted
checkpatch: improve EMBEDDED_FILENAME test
Privately, Heinz Mauelshagen showed that the embedded filename test is not specific enough. > WARNING: It's generally not useful to have the filename in the file > #113: FILE: errors.c:113: > + block < registered_errors.blocks + registered_errors.count; Extend the test to use the appropriate word boundary tests. Link: https://lkml.kernel.org/r/36069dac5d07509dab1c7f1238f8cbb08db80ac6.camel@perches.com Signed-off-by: Joe Perches <joe@perches.com> Reported-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 3ee2a3e commit 3621735

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/checkpatch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3751,7 +3751,7 @@ sub process {
37513751
}
37523752

37533753
# check for embedded filenames
3754-
if ($rawline =~ /^\+.*\Q$realfile\E/) {
3754+
if ($rawline =~ /^\+.*\b\Q$realfile\E\b/) {
37553755
WARN("EMBEDDED_FILENAME",
37563756
"It's generally not useful to have the filename in the file\n" . $herecurr);
37573757
}

0 commit comments

Comments
 (0)