Patchwork omap: dmtimer: convert printk to pr_*

login
register
mail settings
Submitter Víctor Manuel Jáquez Leal
Date Oct. 6, 2011, 10:48 a.m.
Message ID <1317898106-1891-1-git-send-email-vjaquez@igalia.com>
Download mbox | patch
Permalink /patch/118039/
State New
Headers show

Comments

Víctor Manuel Jáquez Leal - Oct. 6, 2011, 10:48 a.m.
Convert all the printk(<level>) messages in the driver to pr_<level>().

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
---
 arch/arm/plat-omap/dmtimer.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
Joe Perches - Oct. 6, 2011, 3:19 p.m.
On Thu, 2011-10-06 at 12:48 +0200, Víctor Manuel Jáquez Leal wrote:
> Convert all the printk(<level>) messages in the driver to pr_<level>().
[]
> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
[]
> @@ -397,8 +397,7 @@ struct omap_dm_timer *omap_dm_timer_request_specific(int id)
>  	spin_lock_irqsave(&dm_timer_lock, flags);
>  	if (id <= 0 || id > dm_timer_count || dm_timers[id-1].reserved) {
>  		spin_unlock_irqrestore(&dm_timer_lock, flags);
> -		printk("BUG: warning at %s:%d/%s(): unable to get timer %d\n",
> -		       __FILE__, __LINE__, __func__, id);
> +		pr_warning("unable to get timer %d\n", id);

For new conversions, please use pr_warn not pr_warning.
It's shorter and similar to other dev_warn/netdev_warn
uses.

>  		dump_stack();

To emit a message then dump stack, please use
	WARN(1, fmt, ...)
Víctor Manuel Jáquez Leal - Oct. 6, 2011, 4:26 p.m.
On Thu, Oct 06, 2011 at 08:19:39AM -0700, Joe Perches wrote:
> On Thu, 2011-10-06 at 12:48 +0200, Víctor Manuel Jáquez Leal wrote:
> > Convert all the printk(<level>) messages in the driver to pr_<level>().
> []
> > diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
> []
> > @@ -397,8 +397,7 @@ struct omap_dm_timer *omap_dm_timer_request_specific(int id)
> >  	spin_lock_irqsave(&dm_timer_lock, flags);
> >  	if (id <= 0 || id > dm_timer_count || dm_timers[id-1].reserved) {
> >  		spin_unlock_irqrestore(&dm_timer_lock, flags);
> > -		printk("BUG: warning at %s:%d/%s(): unable to get timer %d\n",
> > -		       __FILE__, __LINE__, __func__, id);
> > +		pr_warning("unable to get timer %d\n", id);
> 
> For new conversions, please use pr_warn not pr_warning.
> It's shorter and similar to other dev_warn/netdev_warn
> uses.
> 
> >  		dump_stack();
> 
> To emit a message then dump stack, please use
> 	WARN(1, fmt, ...)
> 

Thanks a lot!

I'll do that and then resend.

vmjl

Patch

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index ee9f6eb..34384b0 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -322,7 +322,7 @@  static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer)
 	while (!(omap_dm_timer_read_reg(timer, OMAP_TIMER_SYS_STAT_REG) & 1)) {
 		c++;
 		if (c > 100000) {
-			printk(KERN_ERR "Timer failed to reset\n");
+			pr_err("Timer failed to reset\n");
 			return;
 		}
 	}
@@ -397,8 +397,7 @@  struct omap_dm_timer *omap_dm_timer_request_specific(int id)
 	spin_lock_irqsave(&dm_timer_lock, flags);
 	if (id <= 0 || id > dm_timer_count || dm_timers[id-1].reserved) {
 		spin_unlock_irqrestore(&dm_timer_lock, flags);
-		printk("BUG: warning at %s:%d/%s(): unable to get timer %d\n",
-		       __FILE__, __LINE__, __func__, id);
+		pr_warning("unable to get timer %d\n", id);
 		dump_stack();
 		return NULL;
 	}