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: <5m4zr6d3geqdyxtr5owlur4ysn6ublauvc5km3boga2vnm2rwj@mflpsf4ql2yj>
Date: Tue, 6 Feb 2024 15:23:09 +0530
From: Jai Luthra <j-luthra@...com>
To: Markus Elfring <Markus.Elfring@....de>
CC: <linux-media@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
        Mauro
 Carvalho Chehab <mchehab@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: ti: Use devm_platform_get_and_ioremap_resource()
 in ti_csi2rx_probe()

Hi Markus,

Thanks for the patch.

On Feb 05, 2024 at 13:20:30 +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Mon, 5 Feb 2024 13:14:00 +0100
> 
> A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6
> ("drivers: provide devm_platform_get_and_ioremap_resource()").
> Thus reuse existing functionality instead of keeping duplicate source code.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>  drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> index 2b078c5d7f5d..6ff066097346 100644
> --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> @@ -1100,9 +1100,7 @@ static int ti_csi2rx_probe(struct platform_device *pdev)
>  	platform_set_drvdata(pdev, csi);
> 
>  	mutex_init(&csi->mutex);
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

As this "res" variable is not used anywhere else, it would be better to 
drop the declaration for it and instead call:

    csi->shim = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);

With that change,

Reviewed-by: Jai Luthra <j-luthra@...com>

> -	csi->shim = devm_ioremap_resource(&pdev->dev, res);
> +	csi->shim = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
>  	if (IS_ERR(csi->shim)) {
>  		ret = PTR_ERR(csi->shim);
>  		goto err_mutex;
> --
> 2.43.0
> 

-- 
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ