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]
Date:   Mon, 28 Nov 2022 10:03:21 +0100
From:   Ahmad Fatoum <a.fatoum@...gutronix.de>
To:     ye.xingchen@....com.cn, p.zabel@...gutronix.de
Cc:     daniel@...ll.ch, festevam@...il.com, s.hauer@...gutronix.de,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linux-imx@....com, kernel@...gutronix.de, airlied@...il.com,
        shawnguo@...nel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH linux-next] drm/imx: Use device_match_of_node()

Hello,

On 17.11.22 08:11, ye.xingchen@....com.cn wrote:
> From: ye xingchen <ye.xingchen@....com.cn>
> 
> Replace the open-code with device_match_of_node().

device_match_of_node() exists so a pointer to the function can be passed
to class/driver_find_device. I see no reason to call it directly.

I don't think you should pursue any patches, where you do this
transformation even if they pass a compile test unlike the patch here.

Thanks,
Ahmad

> 
> Signed-off-by: ye xingchen <ye.xingchen@....com.cn>
> ---
>  drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
> index e060fa6cbcb9..2e4f5af894b0 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -182,7 +182,7 @@ static int compare_of(struct device *dev, void *data)
>  	if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) {
>  		struct ipu_client_platformdata *pdata = dev->platform_data;
> 
> -		return pdata->of_node == np;
> +		return device_match_of_node(pdata, np);
>  	}
> 
>  	/* Special case for LDB, one device for two channels */
> @@ -191,7 +191,7 @@ static int compare_of(struct device *dev, void *data)
>  		of_node_put(np);
>  	}
> 
> -	return dev->of_node == np;
> +	return device_match_of_node(dev, np);
>  }
> 
>  static int imx_drm_bind(struct device *dev)

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ