summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/checkpatch.pl8
1 files 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 {
4816 "Consecutive strings are generally better as a single string\n" . $herecurr); 4816 "Consecutive strings are generally better as a single string\n" . $herecurr);
4817 } 4817 }
4818 4818
4819# check for %L{u,d,i} in strings 4819# check for %L{u,d,i} and 0x%[udi] in strings
4820 my $string; 4820 my $string;
4821 while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) { 4821 while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) {
4822 $string = substr($rawline, $-[1], $+[1] - $-[1]); 4822 $string = substr($rawline, $-[1], $+[1] - $-[1]);
4823 $string =~ s/%%/__/g; 4823 $string =~ s/%%/__/g;
4824 if ($string =~ /(?<!%)%L[udi]/) { 4824 if ($string =~ /(?<!%)%[\*\d\.\$]*L[udi]/) {
4825 WARN("PRINTF_L", 4825 WARN("PRINTF_L",
4826 "\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr); 4826 "\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
4827 last; 4827 last;
4828 } 4828 }
4829 if ($string =~ /0x%[\*\d\.\$\Llzth]*[udi]/) {
4830 ERROR("PRINTF_0xDECIMAL",
4831 "Prefixing 0x with decimal output is defective\n" . $herecurr);
4832 }
4829 } 4833 }
4830 4834
4831# check for line continuations in quoted strings with odd counts of " 4835# check for line continuations in quoted strings with odd counts of "