aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-03-23 18:02:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 19:58:36 -0400
commit6061d949dd984c762ee272a88e77699fa675d1c8 (patch)
tree2e19eecd34a716fc5ed9fa3f18a7db0a3edf6f5b /scripts/checkpatch.pl
parent97e834c5040b85e133d8d922111a62b2b853a406 (diff)
include/ and checkpatch: prefer __scanf to __attribute__((format(scanf,...)
It's equivalent to __printf, so prefer __scanf. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a3b9782441f9..89d24b3ea438 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3123,6 +3123,12 @@ sub process {
3123 "__printf(string-index, first-to-check) is preferred over __attribute__((format(printf, string-index, first-to-check)))\n" . $herecurr); 3123 "__printf(string-index, first-to-check) is preferred over __attribute__((format(printf, string-index, first-to-check)))\n" . $herecurr);
3124 } 3124 }
3125 3125
3126# Check for __attribute__ format(scanf, prefer __scanf
3127 if ($line =~ /\b__attribute__\s*\(\s*\(\s*format\s*\(\s*scanf\b/) {
3128 WARN("PREFER_SCANF",
3129 "__scanf(string-index, first-to-check) is preferred over __attribute__((format(scanf, string-index, first-to-check)))\n" . $herecurr);
3130 }
3131
3126# check for sizeof(&) 3132# check for sizeof(&)
3127 if ($line =~ /\bsizeof\s*\(\s*\&/) { 3133 if ($line =~ /\bsizeof\s*\(\s*\&/) {
3128 WARN("SIZEOF_ADDRESS", 3134 WARN("SIZEOF_ADDRESS",