checkpatch: %Lx tests should hand %% as a literal

Ensure that we handle literal %'s correctly when adjacent to a %Lx.

	%Lx	bad
	%%Lx	good
	%%%Lx	bad

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Andy Whitcroft 2008-10-15 22:02:23 -07:00 committed by Linus Torvalds
parent 9bd49efe4e
commit 2a1bc5d5c5

View file

@ -2392,6 +2392,7 @@ sub process {
my $string; my $string;
while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) { while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) {
$string = substr($rawline, $-[1], $+[1] - $-[1]); $string = substr($rawline, $-[1], $+[1] - $-[1]);
$string =~ s/%%/__/g;
if ($string =~ /(?<!%)%L[udi]/) { if ($string =~ /(?<!%)%L[udi]/) {
WARN("\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr); WARN("\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
last; last;