[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 7 Aug 2007 22:43:21 -0400
From: Dave Jones <davej@...hat.com>
To: apw@...dowen.org
Cc: rdunlap@...otime.net, jschopp@...tin.ibm.com,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Make checkpatch warn about pointless casting of kalloc returns.
Make checkpatch warn about pointless casting of kalloc returns.
Signed-off-by: Dave Jones <davej@...hat.com>
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 73751ab..c6cae6a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1051,6 +1051,11 @@ sub process {
CHK("__setup appears un-documented -- check Documentation/kernel-parameters.txt\n" . $herecurr);
}
}
+
+# check for pointless casting of kmalloc return
+ if ($rawline =~ /\*\)[ ]k[czm]alloc/) {
+ WARN("No need to cast return value.\n");
+ }
}
if ($chk_patch && !$is_patch) {
--
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists