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:Ah, errname() will do it.
Argh, you are right, my fault. For some reason I thought this worked
On 11/06/2021 09:56, Greg KH wrote:
On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:This is not error pointer its status value read back from a register.
From: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>Shouldn't this be %pe and not %u?
'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@xxxxxxxxxx>
Acked-by: Chunyan Zhang <zhang.lyra@xxxxxxxxx>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
---
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);
I think %u should be good here.
for integers as well. Don't we have such a printk modifier somewhere to
turn error values into strings? Let me dig...
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