lkml.org 
[lkml]   [2022]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regulator: tps65219: fix Wextra warning
On Thu, Dec 15, 2022, at 17:48, Mark Brown wrote:
> On Thu, Dec 15, 2022 at 05:41:28PM +0100, Arnd Bergmann wrote:
>
>> - tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev);
>> - if (rdev < 0) {
>> + error = tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev);
>> + if (error) {
>> dev_err(tps->dev, "Failed to get rdev for %s\n",
>> irq_type->regulator_name);
>> - return -EINVAL;
>> + return error;
>
> This will shut up the warning but is leaving the use of the
> uninitialised rdev (which I'm kind of disappointed the static checkers
> didn't pick up on). rdev needs to be passed by reference into the
> function, or set from the return value.

Right, I didn't look far enough to see what the function is
actually trying to do here, and that it completely fails to
do that.

I see that the bug was introduced between the first [1] and
second []2] version of the driver, but don't see why. I'll
leave it up to Jerome to address the problem, he's still
in the middle of posting the rest of the series that has
not yet been merged, so it makes sense for him to test it
all together.

Arnd

[1] https://lore.kernel.org/lkml/20220719091742.3221-9-jneanne@baylibre.com/
[2] https://lore.kernel.org/lkml/20220726103355.17684-10-jneanne@baylibre.com/

\
 
 \ /
  Last update: 2022-12-16 11:43    [W:0.077 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site