Subject: Re: [PATCH] [RFC] i2c: imx: make use of format specifier %dE

From: Wolfram Sang <[email-masked]>
Date: Thu, 29 Aug 2019 22:39:12 +0200

On Thu, Aug 29, 2019 at 06:29:05AM +0200, Uwe Kleine-König wrote:
> I created a patch that teaches printk et al to emit a symbolic error
> name for an error valued integer[1]. With that applied
> 
> 	dev_err(&pdev->dev, "can't enable I2C clock, ret=%dE\n", ret);
> 
> emits
> 
> 	... can't enable I2C clock, ret=EIO
> 
> if ret is -EIO. Petr Mladek (i.e. one of the printk maintainers) had
> concerns if this would be well received and worth the effort. He asked
> to present it to a few subsystems. So for now, this patch converting the
> i2c-imx driver shouldn't be applied yet but it would be great to get
> some feedback about if you think that being able to easily printk (for
> example) "EIO" instead of "-5" is a good idea. Would it help you? Do you
> think it helps your users?

Yes, it would help me. And users, too, I am quite sure. For me, if I mix
up two numbers while debugging, I am hunting ghosts for a while until I
realize my mistake. So:

Acked-by: Wolfram Sang <[email-masked]>

I think the main drawback is that ERRORCODES in vsprintf.c now need
maintenance, but I think it is worth the effort. I'd be interested in
the overhead in size this causes, but I also think it is worth the
effort. (It could even be compiled out if we have some generic Kconfig
symbol for smaller kernels).

Thanks,

   Wolfram

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel