linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Avoid missing typo suggestions
@ 2020-06-03 23:19 Kees Cook
  2020-06-04  0:39 ` Joe Perches
  0 siblings, 1 reply; 8+ messages in thread
From: Kees Cook @ 2020-06-03 23:19 UTC (permalink / raw)
  To: Joe Perches; +Cc: Andy Whitcroft, linux-kernel

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-06-05  3:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 23:19 [PATCH] checkpatch: Avoid missing typo suggestions Kees Cook
2020-06-04  0:39 ` Joe Perches
2020-06-04  6:55   ` Maxim Uvarov
2020-06-04  7:29     ` Joe Perches
2020-06-04 14:45       ` Maxim Uvarov
2020-06-04 22:08   ` Kees Cook
2020-06-05  1:02     ` Joe Perches
2020-06-05  3:05       ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).