Commit 6e4a930c authored by Andrew Lunn's avatar Andrew Lunn Committed by Jakub Kicinski

drivers: net: smc911x: Fix cast from pointer to integer of different size

drivers/net/ethernet/smsc/smc911x.c: In function ‘smc911x_hardware_send_pkt’:
drivers/net/ethernet/smsc/smc911x.c:471:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  471 |  cmdA = (((u32)skb->data & 0x3) << 16) |

When built on 64bit targets, the skb->data pointer cannot be cast to a
u32 in a meaningful way. Use uintptr_t instead.
Suggested-by: default avatarNicolas Pitre <nico@fluxnic.net>
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent dd5fdb3f
...@@ -465,9 +465,9 @@ static void smc911x_hardware_send_pkt(struct net_device *dev) ...@@ -465,9 +465,9 @@ static void smc911x_hardware_send_pkt(struct net_device *dev)
TX_CMD_A_INT_FIRST_SEG_ | TX_CMD_A_INT_LAST_SEG_ | TX_CMD_A_INT_FIRST_SEG_ | TX_CMD_A_INT_LAST_SEG_ |
skb->len; skb->len;
#else #else
buf = (char*)((u32)skb->data & ~0x3); buf = (char *)((uintptr_t)skb->data & ~0x3);
len = (skb->len + 3 + ((u32)skb->data & 3)) & ~0x3; len = (skb->len + 3 + ((uintptr_t)skb->data & 3)) & ~0x3;
cmdA = (((u32)skb->data & 0x3) << 16) | cmdA = (((uintptr_t)skb->data & 0x3) << 16) |
TX_CMD_A_INT_FIRST_SEG_ | TX_CMD_A_INT_LAST_SEG_ | TX_CMD_A_INT_FIRST_SEG_ | TX_CMD_A_INT_LAST_SEG_ |
skb->len; skb->len;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment