From 695f54f92060210a7aa8332a30616348a0c9cdaa Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 8 Feb 2017 10:44:09 +1100 Subject: checkpatch: warn when formats use %Z and suggest %z vsnprintf extension %Z is non-standard C. Suggest the use of %z instead. Miscellanea: o Correct the misuse of type string PRINTF_0xDECIMAL type strings are supposed to be uppercase only. Fix this and add tr/[a-z]/[A-Z] to the type check in case I forget this again sometime in the future. o Improve the mechanism to find these defects so all 3 current checks are done on the format string Link: http://lkml.kernel.org/r/20170109235955.GA6787@avx2 Signed-off-by: Alexey Dobriyan Cc: Joe Perches Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 12db1483e6c2..289d61303cfc 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5208,6 +5208,12 @@ sub process { "\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr); last; } + # check for %Z + if ($string =~ /(?