From: Andy Whitcroft <apw@shadowen.org>
Date: Thu, 16 Oct 2008 05:02:23 +0000 (-0700)
Subject: checkpatch: %Lx tests should hand %% as a literal
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2a1bc5d5c5096f2dfb6f8b18f39ecb718f101535;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git

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>
---

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