[PATCH 05/19] ata: ide-sff: fix warnings when compiling as 64-bit
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Jun 12 06:02:26 PDT 2023
Driver is applicable to both IDEs with I/O port and MMIO control. This
is differentiated by ide->io.mmio. Compiler can't follow that and
criticizes casting pointers to 32-bit integers on 64-bit architectures.
Adjust the casts to silence this false positive.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
drivers/ata/ide-sff.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/ide-sff.c b/drivers/ata/ide-sff.c
index 69055e058503..f25dfeae4328 100644
--- a/drivers/ata/ide-sff.c
+++ b/drivers/ata/ide-sff.c
@@ -26,7 +26,7 @@ static inline uint8_t ata_rd_byte(struct ide_port *ide, void __iomem *addr)
if (ide->io.mmio)
return readb(addr);
else
- return (uint8_t) inb((int) addr);
+ return (uint8_t) inb((ulong)addr);
}
/**
@@ -42,7 +42,7 @@ static inline void ata_wr_byte(struct ide_port *ide, uint8_t value,
if (ide->io.mmio)
writeb(value, addr);
else
- outb(value, (int) addr);
+ outb(value, (ulong)addr);
}
/**
@@ -57,7 +57,7 @@ static inline uint16_t ata_rd_word(struct ide_port *ide,
if (ide->io.mmio)
return readw(addr);
else
- return (uint16_t) inw((int) addr);
+ return (uint16_t) inw((ulong)addr);
}
/**
@@ -73,7 +73,7 @@ static inline void ata_wr_word(struct ide_port *ide, uint16_t value,
if (ide->io.mmio)
writew(value, addr);
else
- outw(value, (int) addr);
+ outw(value, (ulong)addr);
}
/**
--
2.39.2
More information about the barebox
mailing list