Skip to contentSkip to conversation

net: eepro100: Fix build warnings

PATCH In review Bin Meng 3 participants 3 messages Jan 25, 2016 Network drivers

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 net: eepro100: Fix build warnings

When building katmai, it reports quite a lot

warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Fix this by casting the dev->iobase with u_long.

---

 drivers/net/eepro100.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/eepro100.c +4 -4
index f2cd32c..d4a6386 100644
@@ -240,23 +240,23 @@ static void eepro100_halt (struct eth_device *dev);
 
 static inline int INW (struct eth_device *dev, u_long addr)
 {
-	return le16_to_cpu (*(volatile u16 *) (addr + dev->iobase));
+	return le16_to_cpu(*(volatile u16 *)(addr + (u_long)dev->iobase));
 }
 
 static inline void OUTW (struct eth_device *dev, int command, u_long addr)
 {
-	*(volatile u16 *) ((addr + dev->iobase)) = cpu_to_le16 (command);
+	*(volatile u16 *)((addr + (u_long)dev->iobase)) = cpu_to_le16(command);
 }
 
 static inline void OUTL (struct eth_device *dev, int command, u_long addr)
 {
-	*(volatile u32 *) ((addr + dev->iobase)) = cpu_to_le32 (command);
+	*(volatile u32 *)((addr + (u_long)dev->iobase)) = cpu_to_le32(command);
 }
 
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 static inline int INL (struct eth_device *dev, u_long addr)
 {
-	return le32_to_cpu (*(volatile u32 *) (addr + dev->iobase));
+	return le32_to_cpu(*(volatile u32 *)(addr + (u_long)dev->iobase));
 }
 
 static int get_phyreg (struct eth_device *dev, unsigned char addr,
Signature · 1 line
1.8.2.1
#2 lore raw
In reply to Bin Meng
Quoted 8 lines · Bin Meng

When building katmai, it reports quite a lot

warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Fix this by casting the dev->iobase with u_long.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160125/a96e2341/attachment.sig>