From 6df667e7d9dbd1bd06bcc43d392e9d2fd2934728 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Fri, 5 Mar 2010 13:43:48 -0800 Subject: [PATCH] --- yaml --- r: 186300 b: refs/heads/master c: 8f53a9b80f011080555c498d2ca2dc6b1a77c42c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 3cc34da31e52..c8fffadb0d33 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 849382948992cc6482c778b1e854c19368b60c05 +refs/heads/master: 8f53a9b80f011080555c498d2ca2dc6b1a77c42c diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 3257d3d96767..309050f30874 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -2572,6 +2572,11 @@ sub process { WARN("plain inline is preferred over $1\n" . $herecurr); } +# check for sizeof(&) + if ($line =~ /\bsizeof\s*\(\s*\&/) { + WARN("sizeof(& should be avoided\n" . $herecurr); + } + # check for new externs in .c files. if ($realfile =~ /\.c$/ && defined $stat && $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)