Skip to content

Commit db8334f

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 > torvalds#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/[email protected] Signed-off-by: Joe Perches <[email protected]> Reported-by: Heinz Mauelshagen <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent d760dc5 commit db8334f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)