Skip to content
Snippets Groups Projects
Commit f3ba5523 authored by Stephen Warren's avatar Stephen Warren Committed by Joe Hershberger
Browse files

net: rtl8169: Build warning fixes for 64-bit


Casting from dev->priv to pci_dev_t changes the value's size on a 64-bit
system. This causes the compiler to complain about casting a pointer to an
integer of a different (smaller) size. To avoid this, cast to an integer
of matching size first, then perform an int->int cast to perform the size
change. This signals explicitly that we do want to change the size, and
avoids the compiler warning. This is legitimate since we know the pointer
actually stores a small integer, not a pointer value.

Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
Acked-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent 11a69ff8
No related branches found
No related tags found
No related merge requests found
...@@ -581,7 +581,8 @@ int rtl8169_eth_recv(struct udevice *dev, int flags, uchar **packetp) ...@@ -581,7 +581,8 @@ int rtl8169_eth_recv(struct udevice *dev, int flags, uchar **packetp)
#else #else
static int rtl_recv(struct eth_device *dev) static int rtl_recv(struct eth_device *dev)
{ {
return rtl_recv_common((pci_dev_t)dev->priv, dev->iobase, NULL); return rtl_recv_common((pci_dev_t)(unsigned long)dev->priv,
dev->iobase, NULL);
} }
#endif /* nCONFIG_DM_ETH */ #endif /* nCONFIG_DM_ETH */
...@@ -666,8 +667,8 @@ int rtl8169_eth_send(struct udevice *dev, void *packet, int length) ...@@ -666,8 +667,8 @@ int rtl8169_eth_send(struct udevice *dev, void *packet, int length)
#else #else
static int rtl_send(struct eth_device *dev, void *packet, int length) static int rtl_send(struct eth_device *dev, void *packet, int length)
{ {
return rtl_send_common((pci_dev_t)dev->priv, dev->iobase, packet, return rtl_send_common((pci_dev_t)(unsigned long)dev->priv,
length); dev->iobase, packet, length);
} }
#endif #endif
...@@ -846,7 +847,8 @@ RESET - Finish setting up the ethernet interface ...@@ -846,7 +847,8 @@ RESET - Finish setting up the ethernet interface
***************************************************************************/ ***************************************************************************/
static int rtl_reset(struct eth_device *dev, bd_t *bis) static int rtl_reset(struct eth_device *dev, bd_t *bis)
{ {
rtl8169_common_start((pci_dev_t)dev->priv, dev->enetaddr); rtl8169_common_start((pci_dev_t)(unsigned long)dev->priv,
dev->enetaddr);
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment