All of lore.kernel.org
 help / color / mirror / Atom feed
* Make checkpatch warn about pointless casting of kalloc returns.
@ 2007-08-08  2:43 Dave Jones
  2007-08-08 17:05 ` jschopp
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Jones @ 2007-08-08  2:43 UTC (permalink / raw)
  To: apw; +Cc: rdunlap, jschopp, Linux Kernel

Make checkpatch warn about pointless casting of kalloc returns.

Signed-off-by: Dave Jones <davej@redhat.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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-13 13:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-08  2:43 Make checkpatch warn about pointless casting of kalloc returns Dave Jones
2007-08-08 17:05 ` jschopp
2007-08-08 18:00   ` Dave Jones
2007-08-08 18:10     ` Cal Peake
2007-08-08 18:27     ` jschopp
2007-08-08 18:40       ` Nish Aravamudan
2007-08-13 10:24   ` Andy Whitcroft

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.