[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z69s0vu_T_77q9X8@smile.fi.intel.com>
Date: Fri, 14 Feb 2025 18:18:26 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Mathieu Dubois-Briand <mathieu.dubois-briand@...tlin.com>
Cc: Lee Jones <lee@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Kamel Bouhara <kamel.bouhara@...tlin.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Uwe Kleine-König <ukleinek@...nel.org>,
Michael Walle <mwalle@...nel.org>, Mark Brown <broonie@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-input@...r.kernel.org, linux-pwm@...r.kernel.org,
Grégory Clement <gregory.clement@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v4 07/10] gpio: max7360: Add MAX7360 gpio support
On Fri, Feb 14, 2025 at 05:59:40PM +0200, Andy Shevchenko wrote:
> On Fri, Feb 14, 2025 at 12:49:57PM +0100, Mathieu Dubois-Briand wrote:
...
> > + ret = device_property_read_u32(dev, "maxim,constant-current-disable", &outconf);
> > + if (ret && (ret != -EINVAL))
> > + return dev_err_probe(dev, -ENODEV,
>
> Why shadowing the real error code?
>
> > + "Failed to read maxim,constant-current-disable OF property\n");
>
> It may be not only OF :-)
Btw, can you compare this approach and the below in terms of bloat-o-meter
against the object file size?
// can be done without this as well, just the same string as a parameter
const char *propname;
propname = "maxim,constant-current-disable";
ret = device_property_read_u32(dev, propname, &outconf);
if (ret && (ret != -EINVAL))
return dev_err_probe(dev, ret, "Failed to read %s device property\n", propname);
While the above is strong hint to the compiler, the below should give similar
result but by the duplicates elimination:
ret = device_property_read_u32(dev, "maxim,constant-current-disable", &outconf);
if (ret && (ret != -EINVAL))
return dev_err_probe(dev, ret, "Failed to read %s device property\n",
"maxim,constant-current-disable");
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists