From 6e30075742316a1d72b7e8f794f6e0bd44d774e2 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 9 Sep 2015 15:37:47 -0700 Subject: [PATCH] checkpatch: emit an error on formats with 0x% Using 0x%d is wrong. Emit a message when it happens. Miscellanea: Improve the %Lu warning to match formats like %16Lu. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 41ecae81de99..d98ffdd2180f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4816,16 +4816,20 @@ sub process { "Consecutive strings are generally better as a single string\n" . $herecurr); } -# check for %L{u,d,i} in strings +# check for %L{u,d,i} and 0x%[udi] in strings my $string; while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) { $string = substr($rawline, $-[1], $+[1] - $-[1]); $string =~ s/%%/__/g; - if ($string =~ /(?