From 63c9d4101c1f96a212fbec588bb511a40687e56f Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 30 Jul 2012 14:41:22 -0700 Subject: [PATCH] --- yaml --- r: 319939 b: refs/heads/master c: 66c80b6077256898df948ac6acf547b47ddb1fcf h: refs/heads/master i: 319937: dafd35e77914b83fcc6fcf05ae4494b16670764d 319935: 1cee54b27caaea2c19edf7a27c8b3997cbb573c6 v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 79643d56e4d1..10d995f5733a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4a273195a551a27a9a3ebed072c8df16c853da7f +refs/heads/master: 66c80b6077256898df948ac6acf547b47ddb1fcf diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 4bad5700670a..40b0627aeb5e 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -3265,6 +3265,12 @@ sub process { "sizeof(& should be avoided\n" . $herecurr); } +# check for sizeof without parenthesis + if ($line =~ /\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/) { + WARN("SIZEOF_PARENTHESIS", + "sizeof $1 should be sizeof($1)\n" . $herecurr); + } + # check for line continuations in quoted strings with odd counts of " if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) { WARN("LINE_CONTINUATIONS",