All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Marion & Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-kernel@vger.kernel.org,
	Chunyan Zhang <zhang.lyra@gmail.com>
Subject: Re: [PATCH 4/9] nvmem: sprd: Fix an error message
Date: Fri, 11 Jun 2021 12:17:31 +0200	[thread overview]
Message-ID: <YMM4O2HEN9D8mJv9@kroah.com> (raw)
In-Reply-To: <7bd13064-8a50-2723-4ebe-d4ff7563c199@wanadoo.fr>

On Fri, Jun 11, 2021 at 12:10:58PM +0200, Marion & Christophe JAILLET wrote:
> 
> Le 11/06/2021 à 11:45, Greg KH a écrit :
> > On Fri, Jun 11, 2021 at 11:17:50AM +0200, Greg KH wrote:
> > > On Fri, Jun 11, 2021 at 10:05:40AM +0100, Srinivas Kandagatla wrote:
> > > > 
> > > > On 11/06/2021 09:56, Greg KH wrote:
> > > > > On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
> > > > > > From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > > > > 
> > > > > > 'ret' is known to be 0 here.
> > > > > > The expected error status is stored in 'status', so use it instead.
> > > > > > 
> > > > > > Also change %d in %u, because status is an u32, not a int.
> > > > > > 
> > > > > > Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
> > > > > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > > > > Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
> > > > > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > > > > > ---
> > > > > >    drivers/nvmem/sprd-efuse.c | 2 +-
> > > > > >    1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > 
> > > > > > diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
> > > > > > index 5d394559edf2..e3e721d4c205 100644
> > > > > > --- a/drivers/nvmem/sprd-efuse.c
> > > > > > +++ b/drivers/nvmem/sprd-efuse.c
> > > > > > @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
> > > > > >    	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
> > > > > >    	if (status) {
> > > > > >    		dev_err(efuse->dev,
> > > > > > -			"write error status %d of block %d\n", ret, blk);
> > > > > > +			"write error status %u of block %d\n", status, blk);
> > > > > Shouldn't this be %pe and not %u?
> > > > This is not error pointer its status value read back from a register.
> > > > 
> > > > I think %u should be good here.
> > > Argh, you are right, my fault.  For some reason I thought this worked
> > > for integers as well.  Don't we have such a printk modifier somewhere to
> > > turn error values into strings?  Let me dig...
> > Ah, errname() will do it.
> > 
> > Looks like no one uses it, so nevermind, sorry for the noise.  I'll go
> > apply this one now.
> > 
> > thanks,
> > 
> > greg k-h
> 
> Hi,
> 
> errname() depends on CONFIG_SYMBOLIC_ERRNAME.
> Is this widely used?

It is set by default if you enable CONFIG_PRINTK

> If not, using errname() directly would loose the error code.
> (note that %pe already deals with it)
> 
> Dan Capenter already spoke about a potential %e extension, but I don't think
> anyone did anything yet.

That would be a fun and simple beginner task for someone to do.  Maybe
I'll mention it to this new round of interns that have just started...

thanks,

greg k-h

  reply	other threads:[~2021-06-11 10:17 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 1/9] nvmem: sprd: Add missing MODULE_DEVICE_TABLE Srinivas Kandagatla
2021-06-11  8:55   ` Greg KH
2021-06-11  9:09     ` Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 2/9] nvmem: qcom-spmi-sdam: add " Srinivas Kandagatla
2021-06-11  8:55   ` Greg KH
2021-06-11  8:33 ` [PATCH 3/9] nvmem: sc27xx: Add " Srinivas Kandagatla
2021-06-11  8:55   ` Greg KH
2021-06-11  8:33 ` [PATCH 4/9] nvmem: sprd: Fix an error message Srinivas Kandagatla
2021-06-11  8:56   ` Greg KH
2021-06-11  9:05     ` Srinivas Kandagatla
2021-06-11  9:17       ` Greg KH
2021-06-11  9:45         ` Greg KH
2021-06-11  9:48           ` Greg KH
2021-06-11 10:17             ` Srinivas Kandagatla
2021-06-11 10:09           ` Srinivas Kandagatla
2021-06-11 10:10           ` Marion & Christophe JAILLET
2021-06-11 10:17             ` Greg KH [this message]
2021-06-11 10:20               ` Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 5/9] nvmem: core: add a missing of_node_put Srinivas Kandagatla
2021-06-11  8:57   ` Greg KH
2021-06-11  9:10     ` Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 6/9] nvmem: sunxi_sid: Set type to OTP Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 7/9] nvmem: qfprom: minor nit fixes Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 8/9] nvmem: core: constify nvmem_cell_read_variable_common() return value Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 9/9] nvmem: qfprom: Improve the comment about regulator setting Srinivas Kandagatla
2021-06-11  8:58 ` [PATCH 0/9] nvmem: patches (set 1) for 5.14 Greg KH

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=YMM4O2HEN9D8mJv9@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=zhang.lyra@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.