mirror of
https://github.com/torvalds/linux
synced 2024-09-06 18:01:05 +00:00
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>
This commit is contained in:
parent
3ee2a3e7c1
commit
362173572a
|
@ -3751,7 +3751,7 @@ sub process {
|
|||
}
|
||||
|
||||
# check for embedded filenames
|
||||
if ($rawline =~ /^\+.*\Q$realfile\E/) {
|
||||
if ($rawline =~ /^\+.*\b\Q$realfile\E\b/) {
|
||||
WARN("EMBEDDED_FILENAME",
|
||||
"It's generally not useful to have the filename in the file\n" . $herecurr);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue