Messages in this thread Patch in this message | | | Date | Tue, 7 Aug 2007 22:43:21 -0400 | From | Dave Jones <> | 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@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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |