[PATCH v3] block: mtip32xx: Remove excess code in mtip_pci_probe

Zhang Heng posted 1 patch 1 month, 1 week ago
drivers/block/mtip32xx/mtip32xx.c | 2 --
1 file changed, 2 deletions(-)
[PATCH v3] block: mtip32xx: Remove excess code in mtip_pci_probe
Posted by Zhang Heng 1 month, 1 week ago
In the error exit function of the iomap_err in mtip_pci_probe,
pci_set_drvdata(pdev, NULL) and return can be removed without
affecting the code execution

Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
---
 drivers/block/mtip32xx/mtip32xx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 8fc7761397bd..2c33c1dfc39d 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -3840,8 +3840,6 @@ static int mtip_pci_probe(struct pci_dev *pdev,
 
 iomap_err:
 	kfree(dd);
-	pci_set_drvdata(pdev, NULL);
-	return rv;
 done:
 	return rv;
 }
-- 
2.47.1
Re: [PATCH v3] block: mtip32xx: Remove excess code in mtip_pci_probe
Posted by Andy Shevchenko 1 month ago
On Wed, Aug 27, 2025 at 09:12:27PM +0800, Zhang Heng wrote:
> In the error exit function of the iomap_err in mtip_pci_probe,
> pci_set_drvdata(pdev, NULL) and return can be removed without
> affecting the code execution

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v3] block: mtip32xx: Remove excess code in mtip_pci_probe
Posted by Philipp Stanner 1 month, 1 week ago
On Wed, 2025-08-27 at 21:12 +0800, Zhang Heng wrote:
> In the error exit function of the iomap_err in mtip_pci_probe,
> pci_set_drvdata(pdev, NULL) and return can be removed without
> affecting the code execution
> 
> Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>

Reviewed-by: Philipp Stanner <phasta@kernel.org>

> ---
>  drivers/block/mtip32xx/mtip32xx.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
> index 8fc7761397bd..2c33c1dfc39d 100644
> --- a/drivers/block/mtip32xx/mtip32xx.c
> +++ b/drivers/block/mtip32xx/mtip32xx.c
> @@ -3840,8 +3840,6 @@ static int mtip_pci_probe(struct pci_dev *pdev,
>  
>  iomap_err:
>  	kfree(dd);
> -	pci_set_drvdata(pdev, NULL);
> -	return rv;
>  done:
>  	return rv;
>  }