lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXv+5F8HZOawAKoDvVCx7+mGmEPsELzp-r-6c5tw64c87Aa_A@mail.gmail.com>
Date:   Mon, 14 Aug 2023 13:20:13 +0800
From:   Chen-Yu Tsai <wenst@...omium.org>
To:     Alexandru Ardelean <alex@...uggie.ro>
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, rafael@...nel.org,
        daniel.lezcano@...aro.org, amitk@...nel.org, rui.zhang@...el.com,
        matthias.bgg@...il.com, angelogioacchino.delregno@...labora.com,
        aouledameur@...libre.com, daniel@...rotopia.org,
        void0red@...t.edu.cn, aboutphysycs@...il.com
Subject: Re: [PATCH] thermal/drivers/mediatek: remove redundant dev_warn in probe

On Mon, Aug 14, 2023 at 3:09 AM Alexandru Ardelean <alex@...uggie.ro> wrote:
>
> There's no need to print any extra messages in the driver if
> devm_thermal_add_hwmon_sysfs() fails.
> If this function has any failures, they will already be printed.
>
> While looking inside 'drivers/thermal/mediatek/auxadc_thermal.c', the
> failure will be either be one of:
>   'Failed to allocate device resource data'
> or
>   'Failed to add hwmon sysfs attributes'
>
> Also, the failure will be reported on the 'dev' object passed to
> 'devm_thermal_add_hwmon_sysfs()', so it should be clear which device this
> error belongs to.
>
> Signed-off-by: Alexandru Ardelean <alex@...uggie.ro>
> ---
>  drivers/thermal/mediatek/auxadc_thermal.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
> index f59d36de20a0..55f7fde470e5 100644
> --- a/drivers/thermal/mediatek/auxadc_thermal.c
> +++ b/drivers/thermal/mediatek/auxadc_thermal.c
> @@ -1290,11 +1290,7 @@ static int mtk_thermal_probe(struct platform_device *pdev)
>         if (IS_ERR(tzdev))
>                 return PTR_ERR(tzdev);
>
> -       ret = devm_thermal_add_hwmon_sysfs(&pdev->dev, tzdev);
> -       if (ret)
> -               dev_warn(&pdev->dev, "error in thermal_add_hwmon_sysfs");
> -
> -       return 0;
> +       return devm_thermal_add_hwmon_sysfs(&pdev->dev, tzdev);

You changed the logic here. The original logic is to print a warning
if the hwmon sysfs stuff failed, but continue to probe the driver. In
other words, hwmon sysfs failing is a non-fatal error.

Your changes make it fatal.

ChenYu

>  }
>
>  static struct platform_driver mtk_thermal_driver = {
> --
> 2.41.0
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ