Skip to contentSkip to conversation

scripts/checkpatch.pl: fix k[mz]alloc with multiplies check

PATCH In review Fabian Frederick 2 participants 2 messages Oct 13, 2014 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/checkpatch.pl: fix k[mz]alloc with multiplies check

checkpatch doesn't seem to detect any case since

Commit e367455a9f25
("checkpatch: emit fewer kmalloc_array/kcalloc conversion warnings")

Cc Joe Perches <[email protected]>
Cc Andrew Morton <[email protected]>
---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +2 -2
index 374abf4..e18afcd 100755
@@ -4875,8 +4875,8 @@ sub process {
 				$r1 = $a2;
 				$r2 = $a1;
 			}
-			if ($r1 !~ /^sizeof\b/ && $r2 =~ /^sizeof\s*\S/ &&
-			    !($r1 =~ /^$Constant$/ || $r1 =~ /^[A-Z_][A-Z0-9_]*$/)) {
+			if ($r1 !~ /^sizeof\b/ && !($r2 =~ /^sizeof\s*\S/ &&
+			    ($r1 =~ /^$Constant$/ || $r1 =~ /^[A-Z_][A-Z0-9_]*$/))) {
 				if (WARN("ALLOC_WITH_MULTIPLY",
 					 "Prefer $newfunc over $oldfunc with multiply\n" . $herecurr) &&
 				    $fix) {
Signature · 1 line
1.9.3
maintainer
#1 lore raw
Quoted 3 lines · Fabian Frederick

checkpatch doesn't seem to detect any case since
Commit e367455a9f25
("checkpatch: emit fewer kmalloc_array/kcalloc conversion warnings")

It seems that worked too well.

Thanks, I'll look at it.