2020-04-05 11:53:09

by Colin King

[permalink] [raw]
Subject: [PATCH] ata: ahci-imx: remove redundant assignment to ret

From: Colin Ian King <[email protected]>

The variable ret is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <[email protected]>
---
drivers/ata/ahci_imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index 948d2c6557f3..388baf528fa8 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -782,7 +782,7 @@ static int ahci_imx_softreset(struct ata_link *link, unsigned int *class,
struct ata_host *host = dev_get_drvdata(ap->dev);
struct ahci_host_priv *hpriv = host->private_data;
struct imx_ahci_priv *imxpriv = hpriv->plat_data;
- int ret = -EIO;
+ int ret;

if (imxpriv->type == AHCI_IMX53)
ret = ahci_pmp_retry_srst_ops.softreset(link, class, deadline);
--
2.25.1


2020-04-07 20:51:09

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] ata: ahci-imx: remove redundant assignment to ret

On 4/5/20 4:51 AM, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> The variable ret is being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.

Applied, thanks.

--
Jens Axboe