Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1732517 > unrolled thread

[PATCH] ata: pata_artop: remove redundant initialization of pio

Started byColin King <colin.king@canonical.com>
First post2017-09-14 21:00 +0200
Last post2017-09-19 05:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ata: pata_artop: remove redundant initialization of pio Colin King <colin.king@canonical.com> - 2017-09-14 21:00 +0200
    Re: [PATCH] ata: pata_artop: remove redundant initialization of pio Tejun Heo <tj@kernel.org> - 2017-09-19 05:30 +0200

#1732517 — [PATCH] ata: pata_artop: remove redundant initialization of pio

FromColin King <colin.king@canonical.com>
Date2017-09-14 21:00 +0200
Subject[PATCH] ata: pata_artop: remove redundant initialization of pio
Message-ID<upHwK-hq-13@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

pio is initialized and the data is never read, instead it is almost
immediately being updated to a new value. Fix this by removing the
initialization.

Detected by scan-build:
"warning: Value stored to 'pio' during its initialization is never read"

Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/ata/pata_artop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 96c05c9494fa..6b3355343542 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -242,7 +242,7 @@ static void artop6210_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 
 static void artop6260_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 {
-	unsigned int pio	= adev->pio_mode - XFER_PIO_0;
+	unsigned int pio;
 	struct pci_dev *pdev	= to_pci_dev(ap->host->dev);
 	u8 ultra;
 
-- 
2.14.1

[toc] | [next] | [standalone]


#1734632

FromTejun Heo <tj@kernel.org>
Date2017-09-19 05:30 +0200
Message-ID<urhou-7ap-3@gated-at.bofh.it>
In reply to#1732517
On Thu, Sep 14, 2017 at 07:54:18PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> pio is initialized and the data is never read, instead it is almost
> immediately being updated to a new value. Fix this by removing the
> initialization.
> 
> Detected by scan-build:
> "warning: Value stored to 'pio' during its initialization is never read"
> 
> Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied to libata/for-4.15.

Thanks.

-- 
tejun

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web