Messages in this thread Patch in this message | | | Date | Wed, 3 Jun 2020 16:19:01 -0700 | From | Kees Cook <> | Subject | [PATCH] checkpatch: Avoid missing typo suggestions |
| |
My codespell dictionary has a lot of capitalized words. For example:
MSDOS->MS-DOS
Since checkpatch uses case-insensitive matching, I get an undefined variable warning and then empty suggestions for things like this:
Use of uninitialized value $typo_fix in concatenation (.) or string at ./scripts/checkpatch.pl line 2958.
WARNING: 'msdos' may be misspelled - perhaps ''? + struct msdos_dir_entry *de;
This fixes the matcher to avoid the warning, but it's still a rather silly suggestion:
WARNING: 'msdos' may be misspelled - perhaps 'MS-DOS'? + struct msdos_dir_entry *de;
So I'm not really sure what to do with this ... filter out bad suggestions instead?
Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Kees Cook <keescook@chromium.org> --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e9f8146600d0..1aaf3317b6ad 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -727,7 +727,7 @@ if ($codespell) { my ($suspect, $fix) = split(/->/, $line); - $spelling_fix{$suspect} = $fix; + $spelling_fix{lc($suspect)} = $fix; } close($spelling); } else { -- 2.25.1
-- Kees Cook
| |