Skip to contentSkip to conversation

checkpatch-add-check-for-array-allocator-family-argument-order.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Dec 1, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: checkpatch: add check for array allocator family argument order
has been removed from the -mm tree. Its filename was
checkpatch-add-check-for-array-allocator-family-argument-order.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Liao Chang <[email protected]>
Subject: checkpatch: add check for array allocator family argument order
Date: Fri, 4 Nov 2022 15:05:23 +0800

These array allocator family are sometimes misused with the first and second arguments switched.

Same issue with calloc, kvcalloc, kvmalloc_array etc.

Bleat if sizeof is the first argument.

---

 scripts/checkpatch.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-add-check-for-array-allocator-family-argument-order +1 -1
@@ -7146,7 +7146,7 @@ sub process {
 		}
 
 # check for alloc argument mismatch
-		if ($line =~ /\b((?:devm_)?(?:kcalloc|kmalloc_array))\s*\(\s*sizeof\b/) {
+		if ($line =~ /\b((?:devm_)?((?:k|kv)?(calloc|malloc_array)(?:_node)?))\s*\(\s*sizeof\b/) {
 			WARN("ALLOC_ARRAY_ARGS",
 			     "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
 		}

_

Patches currently in -mm which might be from [email protected] are