From dcdfbe1c067dea4493f8ee07deb45388afcfa95a Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 10 Jan 2012 15:09:52 -0800 Subject: [PATCH] --- yaml --- r: 283068 b: refs/heads/master c: 5f14d3bd87ef5f979ea64c1f0862534d71786db7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6cec196e2b45..e377864aeeac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 270c49a088ae58d4b817861bb04bfec63b0966db +refs/heads/master: 5f14d3bd87ef5f979ea64c1f0862534d71786db7 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 885e3b43d64a..e94626ca77cf 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -3114,6 +3114,12 @@ sub process { "__aligned(size) is preferred over __attribute__((aligned(size)))\n" . $herecurr); } +# Check for __attribute__ format(printf, prefer __printf + if ($line =~ /\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf/) { + WARN("PREFER_PRINTF", + "__printf(string-index, first-to-check) is preferred over __attribute__((format(printf, string-index, first-to-check)))\n" . $herecurr); + } + # check for sizeof(&) if ($line =~ /\bsizeof\s*\(\s*\&/) { WARN("SIZEOF_ADDRESS",