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: <d8c512e3-09c2-4a29-b678-56d81c942b77@amd.com>
Date: Thu, 11 Dec 2025 17:13:37 +0530
From: Shyam Sundar S K <Shyam-sundar.S-k@....com>
To: Johan Hovold <johan@...nel.org>, Elie Morisse <syniurge@...il.com>,
 Andi Shyti <andi.shyti@...nel.org>
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] i2c: amd-mp2: clean up amd_mp2_find_device()



On 12/10/2025 09:32, Johan Hovold wrote:
> Rename the driver data pointer for consistency with the rest of the
> driver and drop a redundant cast.
> 
> Signed-off-by: Johan Hovold <johan@...nel.org>

Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@....com>

Thanks,
Shyam

> ---
> 
> Changes in v2
>  - rebase [1] on current mainline where the reference leak has already
>    been fixed and update the commit message to reflect that this is now
>    only a cleanup
> 
> [1] https://lore.kernel.org/lkml/20251121113714.4080-1-johan@kernel.org/
> 
> 
>  drivers/i2c/busses/i2c-amd-mp2-pci.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-amd-mp2-pci.c b/drivers/i2c/busses/i2c-amd-mp2-pci.c
> index 60edbabc2986..5b41d18b62d3 100644
> --- a/drivers/i2c/busses/i2c-amd-mp2-pci.c
> +++ b/drivers/i2c/busses/i2c-amd-mp2-pci.c
> @@ -456,18 +456,20 @@ module_pci_driver(amd_mp2_pci_driver);
>  
>  struct amd_mp2_dev *amd_mp2_find_device(void)
>  {
> +	struct amd_mp2_dev *privdata;
>  	struct device *dev;
>  	struct pci_dev *pci_dev;
> -	struct amd_mp2_dev *mp2_dev;
>  
>  	dev = driver_find_next_device(&amd_mp2_pci_driver.driver, NULL);
>  	if (!dev)
>  		return NULL;
>  
>  	pci_dev = to_pci_dev(dev);
> -	mp2_dev = (struct amd_mp2_dev *)pci_get_drvdata(pci_dev);
> +	privdata = pci_get_drvdata(pci_dev);
> +
>  	put_device(dev);
> -	return mp2_dev;
> +
> +	return privdata;
>  }
>  EXPORT_SYMBOL_GPL(amd_mp2_find_device);
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ