Skip to contentSkip to conversation

libata-sff: use ATAPI_{COD|IO}

PATCH Superseded Sergei Shtylyov 1 participant 2 messages Dec 1, 2011 – Dec 2, 2011 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata-sff: use ATAPI_{COD|IO}

atapi_pio_bytes() uses bare numbers for the ATAPI interrupt reason bits despite these are #define'd in <linux/aha.h>.

---
This patch is against the recent Linus' tree.

 drivers/ata/libata-sff.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/libata-sff.c +2 -2
Index: linux-2.6/drivers/ata/libata-sff.c
===================================================================
@@ -929,11 +929,11 @@ static void atapi_pio_bytes(struct ata_q
 	bytes = (bc_hi << 8) | bc_lo;
 
 	/* shall be cleared to zero, indicating xfer of data */
-	if (unlikely(ireason & (1 << 0)))
+	if (unlikely(ireason & ATAPI_COD))
 		goto atapi_check;
 
 	/* make sure transfer direction matches expected */
-	i_write = ((ireason & (1 << 1)) == 0) ? 1 : 0;
+	i_write = ((ireason & ATAPI_IO) == 0) ? 1 : 0;
 	if (unlikely(do_write != i_write))
 		goto atapi_check;
 
#1 lore raw

PATCH v2 1/1 libata-sff: use ATAPI_{COD|IO}

atapi_pio_bytes() uses bare numbers for the ATAPI interrupt reason bits despite these are #define'd in <linux/ata.h>.

---
This patch is against the recent Linus' tree.

Changes in v2: corrected typo in the patch description.

 drivers/ata/libata-sff.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/libata-sff.c +2 -2
Index: linux-2.6/drivers/ata/libata-sff.c
===================================================================
@@ -929,11 +929,11 @@ static void atapi_pio_bytes(struct ata_q
 	bytes = (bc_hi << 8) | bc_lo;
 
 	/* shall be cleared to zero, indicating xfer of data */
-	if (unlikely(ireason & (1 << 0)))
+	if (unlikely(ireason & ATAPI_COD))
 		goto atapi_check;
 
 	/* make sure transfer direction matches expected */
-	i_write = ((ireason & (1 << 1)) == 0) ? 1 : 0;
+	i_write = ((ireason & ATAPI_IO) == 0) ? 1 : 0;
 	if (unlikely(do_write != i_write))
 		goto atapi_check;