linux-um archives
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Andy Whitcroft <apw@canonical.com>
Cc: Richard Weinberger <richard@nod.at>,
	linux-kernel@vger.kernel.org,
	user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] [PATCH] checkpatch: Add warning for uses of printk_ratelimit
Date: Tue, 24 May 2011 13:02:26 -0700	[thread overview]
Message-ID: <1306267346.2298.58.camel@Joe-Laptop> (raw)
In-Reply-To: <20110524123433.0b74f33e.akpm@linux-foundation.org>

Warn about uses of printk_ratelimit because it uses a
global state and can hide subsequent useful messages.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d867081..d1a9adc 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_<level>_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



------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


  reply	other threads:[~2011-05-24 20:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 14:48 [PATCH 1/7] um: fix UML_LIB_PATH Richard Weinberger
2011-05-22 14:48 ` [uml-devel] [PATCH 2/7] um: remove SIGHUP handler Richard Weinberger
2011-05-22 14:48 ` [uml-devel] [PATCH 3/7] um: add earlyprintk support Richard Weinberger
2011-05-22 14:48 ` [uml-devel] [PATCH 4/7] um: add ucast ethernet transport Richard Weinberger
2011-05-22 14:48 ` [uml-devel] [PATCH 5/7] um: print info about fatal segfaults Richard Weinberger
2011-05-24 19:34   ` Andrew Morton
2011-05-24 20:02     ` Joe Perches [this message]
2011-05-24 20:14     ` Richard Weinberger
2011-05-22 14:48 ` [uml-devel] [PATCH 6/7] um: include linux/prefetch.h Richard Weinberger
2011-05-22 14:48 ` [uml-devel] [PATCH 7/7] um: fix crash while os_dump_core() Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306267346.2298.58.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox