linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ata: pata_artop: remove redundant initialization of pio
@ 2017-09-14 18:54 Colin King
  2017-09-19  3:24 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-09-14 18:54 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Tejun Heo, linux-ide
  Cc: kernel-janitors, linux-kernel

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ata: pata_artop: remove redundant initialization of pio
  2017-09-14 18:54 [PATCH] ata: pata_artop: remove redundant initialization of pio Colin King
@ 2017-09-19  3:24 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2017-09-19  3:24 UTC (permalink / raw)
  To: Colin King
  Cc: Bartlomiej Zolnierkiewicz, linux-ide, kernel-janitors,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-19  3:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-14 18:54 [PATCH] ata: pata_artop: remove redundant initialization of pio Colin King
2017-09-19  3:24 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).