[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <a1ac975aaabc9f71397b75254f833920428411e0.1618588673.git.christophe.jaillet@wanadoo.fr>
Date: Fri, 16 Apr 2021 17:58:57 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: apw@...onical.com, joe@...ches.com, dwaipayanray1@...il.com,
lukas.bulwahn@...il.com
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] checkpatch: Improve ALLOC_ARRAY_ARGS test
The devm_ variant of 'kcalloc()' and 'kmalloc_array()' are not tested
Add the corresponding check.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
scripts/checkpatch.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 44b9dc330ac6..c778edfdbad7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -7006,9 +7006,9 @@ sub process {
}
# check for alloc argument mismatch
- if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) {
+ if ($line =~ /\b(devm_|)(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) {
WARN("ALLOC_ARRAY_ARGS",
- "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
+ "$1$2 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
}
# check for multiple semicolons
--
2.27.0
Powered by blists - more mailing lists