diff options
author | Joe Perches <joe@perches.com> | 2023-01-25 00:16:55 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-03 07:50:07 +0100 |
commit | 362173572a4018e9c8e39c616823189c41d39d41 (patch) | |
tree | a86ec850e0f9b1b2760226e5605dcdc7da44e2c7 /scripts/checkpatch.pl | |
parent | fs/ext4: use try_cmpxchg in ext4_update_bh_state (diff) | |
download | linux-362173572a4018e9c8e39c616823189c41d39d41.tar.xz linux-362173572a4018e9c8e39c616823189c41d39d41.zip |
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>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a2fc7d556126..bd44d12965c9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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); } |