Re: [PATCH] regulator: tps65219: fix Wextra warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux