From: Joe Perches Date: Wed, 15 Jun 2011 22:08:17 +0000 (-0700) Subject: checkpatch: add warning for uses of printk_ratelimit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=17441227f6258fc379c6ebfe21c3eec43b6f0de3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git checkpatch: add warning for uses of printk_ratelimit Warn about uses of printk_ratelimit() because it uses a global state and can hide subsequent useful messages. Signed-off-by: Joe Perches Cc: Andy Whitcroft Cc: Richard Weinberger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8657f99bfb2b..b0aa2c680593 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1943,6 +1943,11 @@ sub process { WARN("LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr); } +# check for uses of printk_ratelimit + if ($line =~ /\bprintk_ratelimit\s*\(/) { + WARN("Prefer printk_ratelimited or pr__ratelimited to printk_ratelimit\n" . $herecurr); + } + # printk should use KERN_* levels. Note that follow on printk's on the # same line do not need a level, so we use the current block context # to try and find and validate the current printk. In summary the current