diff options
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4bad5700670a..40b0627aeb5e 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -3265,6 +3265,12 @@ sub process { | |||
3265 | "sizeof(& should be avoided\n" . $herecurr); | 3265 | "sizeof(& should be avoided\n" . $herecurr); |
3266 | } | 3266 | } |
3267 | 3267 | ||
3268 | # check for sizeof without parenthesis | ||
3269 | if ($line =~ /\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/) { | ||
3270 | WARN("SIZEOF_PARENTHESIS", | ||
3271 | "sizeof $1 should be sizeof($1)\n" . $herecurr); | ||
3272 | } | ||
3273 | |||
3268 | # check for line continuations in quoted strings with odd counts of " | 3274 | # check for line continuations in quoted strings with odd counts of " |
3269 | if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) { | 3275 | if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) { |
3270 | WARN("LINE_CONTINUATIONS", | 3276 | WARN("LINE_CONTINUATIONS", |