2011-06-16 12:14:33

by Manuel Zerpies

[permalink] [raw]
Subject: [PATCH 09/11] xen/xenbus: use printk_ratelimited() instead of printk_ratelimit()

Since printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited()

Signed-off-by: Manuel Zerpies <[email protected]>
---
drivers/xen/xenbus/xenbus_xs.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index 5534690..4055858 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -44,6 +44,7 @@
#include <linux/rwsem.h>
#include <linux/module.h>
#include <linux/mutex.h>
+#include <linux/ratelimit.h>
#include <xen/xenbus.h>
#include "xenbus_comms.h"

@@ -270,8 +271,7 @@ static void *xs_talkv(struct xenbus_transaction t,
}

if (msg.type != type) {
- if (printk_ratelimit())
- printk(KERN_WARNING
+ `printk_ratelimited(KERN_WARNING
"XENBUS unexpected type [%d], expected [%d]\n",
msg.type, type);
kfree(ret);
--
1.7.4.1


2011-06-16 21:00:44

by Jeremy Fitzhardinge

[permalink] [raw]
Subject: Re: [PATCH 09/11] xen/xenbus: use printk_ratelimited() instead of printk_ratelimit()

On 06/16/2011 05:14 AM, Manuel Zerpies wrote:
> Since printk_ratelimit() shouldn't be used anymore (see comment in
> include/linux/printk.h), replace it with printk_ratelimited()
>
Looks OK to me, but please fix the indentation of the rest of the
statement to match.

Thanks,
J

> Signed-off-by: Manuel Zerpies <[email protected]>
> ---
> drivers/xen/xenbus/xenbus_xs.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
> index 5534690..4055858 100644
> --- a/drivers/xen/xenbus/xenbus_xs.c
> +++ b/drivers/xen/xenbus/xenbus_xs.c
> @@ -44,6 +44,7 @@
> #include <linux/rwsem.h>
> #include <linux/module.h>
> #include <linux/mutex.h>
> +#include <linux/ratelimit.h>
> #include <xen/xenbus.h>
> #include "xenbus_comms.h"
>
> @@ -270,8 +271,7 @@ static void *xs_talkv(struct xenbus_transaction t,
> }
>
> if (msg.type != type) {
> - if (printk_ratelimit())
> - printk(KERN_WARNING
> + `printk_ratelimited(KERN_WARNING
> "XENBUS unexpected type [%d], expected [%d]\n",
> msg.type, type);
> kfree(ret);

2011-06-16 23:44:09

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 09/11] xen/xenbus: use printk_ratelimited() instead of printk_ratelimit()

On Thu, 2011-06-16 at 14:00 -0700, Jeremy Fitzhardinge wrote:
> On 06/16/2011 05:14 AM, Manuel Zerpies wrote:
> > Since printk_ratelimit() shouldn't be used anymore (see comment in
> > include/linux/printk.h), replace it with printk_ratelimited()
> Looks OK to me, but please fix the indentation of the rest of the
> statement to match.
[]
> > diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
[]
> > @@ -270,8 +271,7 @@ static void *xs_talkv(struct xenbus_transaction t,
> > }
> >
> > if (msg.type != type) {
> > - if (printk_ratelimit())
> > - printk(KERN_WARNING
> > + `printk_ratelimited(KERN_WARNING

Appears that it's not compile tested?
A stray "`" got put before printk_ratelimited()