[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221007095236.37113034@xps-13>
Date: Fri, 7 Oct 2022 09:52:36 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Joe Perches <joe@...ches.com>
Cc: Ray Zhang <sgzhang@...gle.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] mtd: mtdoops: change printk() to counterpart pr_
functions
Hi Joe, Ray,
joe@...ches.com wrote on Fri, 07 Oct 2022 00:09:26 -0700:
> On Fri, 2022-10-07 at 06:50 +0000, Ray Zhang wrote:
> > To comply with latest kernel code requirement, change printk() to
> > counterpart pr_ functions in mtdoops driver:
> > - change printk(INFO) to pr_info()
> > - change printk(DEBUG) to pr_debug()
>
> There is a different behavior with printk(KERN_DEBUG to pr_debug(
> as pr_debug is a no-op unless dynamic debugging is enabled or
> DEBUG is defined.
I didn't know about this difference. I was expecting printk(KERN_DEBUG)
to behave the same as pr_debug/dev_dbg.
> And even with dynamic_debug, the output is default disabled unless
> DEBUG is defined.
>
> As is, printk(KERN_DEBUG is emitted unless the console level is low.
>
> > diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
> []
> > @@ -120,8 +120,8 @@ static void mtdoops_inc_counter(struct mtdoops_context *cxt)
> > return;
> > }
> >
> > - printk(KERN_DEBUG "mtdoops: ready %d, %d (no erase)\n",
> > - cxt->nextpage, cxt->nextcount);
> > + pr_debug("mtdoops: ready %d, %d (no erase)\n",
> > + cxt->nextpage, cxt->nextcount);
But honestly in this driver I feel fine changing the printk(KERN_DEBUG)
into pr_debug().
Ray, maybe you can adapt your commit log to mention the difference?
Thanks,
Miquèl
Powered by blists - more mailing lists