From: Omar Sandoval <osandov@osandov.com>
To: Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
linux-btrfs@vger.kernel.org,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/2] Return a value from printk_ratelimited
Date: Fri, 19 Sep 2014 02:01:29 -0700 [thread overview]
Message-ID: <3629aa32fd3e434e41e5e5f4a97ab50adb8edcdc.1411116672.git.osandov@osandov.com> (raw)
In-Reply-To: <cover.1411116672.git.osandov@osandov.com>
In-Reply-To: <cover.1411116672.git.osandov@osandov.com>
printk returns an integer; there's no reason for printk_ratelimited to swallow
it.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
---
include/linux/printk.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/printk.h b/include/linux/printk.h
index d78125f..67534bc 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -343,12 +343,14 @@ extern asmlinkage void dump_stack(void) __cold;
#ifdef CONFIG_PRINTK
#define printk_ratelimited(fmt, ...) \
({ \
+ int __ret = 0; \
static DEFINE_RATELIMIT_STATE(_rs, \
DEFAULT_RATELIMIT_INTERVAL, \
DEFAULT_RATELIMIT_BURST); \
\
if (__ratelimit(&_rs)) \
- printk(fmt, ##__VA_ARGS__); \
+ __ret = printk(fmt, ##__VA_ARGS__); \
+ __ret; \
})
#else
#define printk_ratelimited(fmt, ...) \
--
2.1.0
next prev parent reply other threads:[~2014-09-19 9:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-19 9:01 [PATCH v2 0/2] Move BTRFS RCU string to common library Omar Sandoval
2014-09-19 9:01 ` Omar Sandoval [this message]
2014-09-19 17:21 ` [PATCH v2 1/2] Return a value from printk_ratelimited Steven Rostedt
2014-09-19 18:15 ` Joe Perches
2014-09-21 13:25 ` Paul E. McKenney
2014-09-21 15:53 ` Joe Perches
2014-09-19 9:01 ` [PATCH v2 2/2] Move BTRFS RCU string to common library Omar Sandoval
2014-09-26 23:25 ` josh
2014-09-19 15:45 ` [PATCH v2 0/2] " Paul E. McKenney
2014-09-19 15:47 ` Chris Mason
2014-09-19 16:05 ` Paul E. McKenney
2014-09-19 16:22 ` Chris Mason
2014-09-21 13:25 ` Paul E. McKenney
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=3629aa32fd3e434e41e5e5f4a97ab50adb8edcdc.1411116672.git.osandov@osandov.com \
--to=osandov@osandov.com \
--cc=clm@fb.com \
--cc=jbacik@fb.com \
--cc=josh@joshtriplett.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rostedt@goodmis.org \
/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;
as well as URLs for NNTP newsgroup(s).