From: Joe Perches Date: Tue, 26 Jul 2011 00:13:22 +0000 (-0700) Subject: checkpatch: suggest using min_t or max_t X-Git-Tag: v3.1-rc1~241^2~19 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d2367af0b09f8028dc5c1b1919bb82d141c2afb;p=pandora-kernel.git checkpatch: suggest using min_t or max_t A common issue with min() or max() is using a cast on one or both of the arguments when using min_t/max_t could be better. Add cast detection to uses of min/max and suggest an appropriate use of min_t or max_t instead. Caveat: This only works for min() or max() on a single line. It does not find min() or max() split across multiple lines. This does find: min((u32)foo, bar); But it does not find: max((unsigned long)foo, bar); Suggested-by: Andrew Morton Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed