Re: [PATCH] ACPI / PMIC: Remove unneeded check in tps68470_pmic_opregion_probe()

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

 



On Fri, Jul 5, 2024 at 1:36 PM Aleksandr Mishin <amishin@xxxxxxxxxx> wrote:
>
> In tps68470_pmic_opregion_probe() pointer 'dev' is compared to NULL which
> is useless.
>
> Fix this issue by removing unneeded check.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.

...

> -       if (!dev || !tps68470_regmap) {
> +       if (!tps68470_regmap) {
>                 dev_warn(dev, "dev or regmap is NULL\n");

Now this message is misleading.

>                 return -EINVAL;
>         }

And I dunno why it's a warning and not an error level.

With all above being said, I would recommend to update to

  if (!tps68470_regmap)
    return dev_err_probe(dev, -EINVAL, "regmap is missing\n");

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux