[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200108075247.y5ex44flp6lvqeoc@pengutronix.de>
Date: Wed, 8 Jan 2020 08:52:47 +0100
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: Fabio Estevam <festevam@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, Peng Fan <peng.fan@....com>,
"jason@...edaemon.net" <jason@...edaemon.net>,
"linus.walleij@...aro.org" <linus.walleij@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mripard@...nel.org" <mripard@...nel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"wens@...e.org" <wens@...e.org>,
"gregory.clement@...tlin.com" <gregory.clement@...tlin.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"sebastian.hesselbarth@...il.com" <sebastian.hesselbarth@...il.com>
Subject: Re: [PATCH 1/2] pinctrl: mvebu: armada-37xx: use use platform api
Hello Fabio,
On Wed, Dec 18, 2019 at 12:09:42PM -0300, Fabio Estevam wrote:
> On Wed, Dec 18, 2019 at 12:00 PM Andrew Lunn <andrew@...n.ch> wrote:
>
> > Hi Fabio
> >
> > Look closer. This is not about returning an error, it is about
> > printing an error.
> >
> > I think the API could better. A %ie formatter would make a lot of
> > sense, so avoiding the ERR_PTR().
>
> Yes, I think that returning the error like:
>
> dev_err(dev, "Couldn't determine irq count: %d\n", nr_irq_parent);
>
> would make the code cleaner.
Are you aware of the semantic difference between
dev_err(..., "Couldn't determine irq count: %d\n", nr_irq_parent);
and
dev_err(..., "Couldn't determine irq count: %pe\n", ERR_PTR(nr_irq_parent));
? The first yields:
Couldn't determine irq count: -5
while the latter yields
Couldn't determine irq count: -EIO
which is more expressive.
I agree that having a format for printing an integer error code would be
useful. I have this on my todo-list but having some %pe with ERR_PTR
conversion would help me arguing my case.
So I would like the patch to go in with ERR_PTR even though v2 was sent
using %d today.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Powered by blists - more mailing lists