0x%<foo> should be used to emit hexadecimal values.
Uses of 0x%[udi] emit decimal values but these should
probably instead use 0x%x variants.
Warn on these uses.
Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
Noticed-by: Hans Wennborg <hans@xxxxxxxxxx>
---
scripts/checkpatch.pl | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index da74e65..0178fe0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4985,6 +4985,10 @@ sub process {
while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) {
$string = substr($rawline, $-[1], $+[1] - $-[1]);
$string =~ s/%%/__/g;
+ if ($string =~ /(0x(?<!%)%[0-9.\*]*[Ll]*[udi])(?![xX])/) {