Code like:
        if (a < sizeof(<type>) &&
and
        { .len = sizeof(<type>) },

incorrectly emits that warning, so add more exceptions to avoid
the warning.

Signed-off-by: Joe Perches <j...@perches.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7f1804e..a9baaab 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2541,7 +2541,7 @@ sub process {
                        }
                }
 
-               if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ 
\t]+(?!$Assignment|$Arithmetic|[,;\({\[\<\>])/ &&
+               if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ 
\t]+(?!$Assignment|$Arithmetic|[,;:\?\(\{\}\[\<\>]|&&|\|\||\\$)/ &&
                    (!defined($1) || $1 !~ /sizeof\s*/)) {
                        if (CHK("SPACING",
                                "No space is necessary after a cast\n" . 
$herecurr) &&
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to