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] [day] [month] [year] [list]
Message-ID: <20220308171858.GA2582095@roeck-us.net>
Date:   Tue, 8 Mar 2022 09:18:58 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     cgel.zte@...il.com
Cc:     jdelvare@...e.com, liviu.dudau@....com, sudeep.holla@....com,
        lorenzo.pieralisi@....com, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] drivers/hwmon: Use of_device_get_match_data()

Hi,

On Mon, Mar 07, 2022 at 03:36:31AM +0000, cgel.zte@...il.com wrote:
> From: Minghao Chi (CGEL ZTE) <chi.minghao@....com.cn>
> 
> Use of_device_get_match_data() to simplify the code.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@....com.cn>

This is not the first patch from issues reported by Zeal Robot
with an inappropriate subject. "drivers/hwmon:" doesn't say anything.
The subject should either be "<subsystem>: <driver>: <description>" or,
as commonly used in hwmon, "hwmon: (driver) <description". I fixed
the subject and applied the patch, but don't expect me to do this
again in the future.

Guenter

> ---
>  drivers/hwmon/vexpress-hwmon.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/vexpress-hwmon.c b/drivers/hwmon/vexpress-hwmon.c
> index 44d798be3d59..2ac5fb96bba4 100644
> --- a/drivers/hwmon/vexpress-hwmon.c
> +++ b/drivers/hwmon/vexpress-hwmon.c
> @@ -207,7 +207,6 @@ MODULE_DEVICE_TABLE(of, vexpress_hwmon_of_match);
>  
>  static int vexpress_hwmon_probe(struct platform_device *pdev)
>  {
> -	const struct of_device_id *match;
>  	struct vexpress_hwmon_data *data;
>  	const struct vexpress_hwmon_type *type;
>  
> @@ -216,10 +215,9 @@ static int vexpress_hwmon_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	platform_set_drvdata(pdev, data);
>  
> -	match = of_match_device(vexpress_hwmon_of_match, &pdev->dev);
> -	if (!match)
> +	type = of_device_get_match_data(&pdev->dev);
> +	if (!type)
>  		return -ENODEV;
> -	type = match->data;
>  
>  	data->reg = devm_regmap_init_vexpress_config(&pdev->dev);
>  	if (IS_ERR(data->reg))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ