summaryrefslogtreecommitdiff
path: root/drivers/net/rtl8169.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2015-10-02 17:44:34 -0600
committerJoe Hershberger <joe.hershberger@ni.com>2015-10-29 14:05:47 -0500
commitf3ba55235dddb11bbb615669b43688f4c1b73f69 (patch)
tree77cba5077fb8a424f8d38faeb7b2e60263742be5 /drivers/net/rtl8169.c
parent11a69ff85b0a459f4ac096ae054d0b527d44b095 (diff)
downloadu-boot-f3ba55235dddb11bbb615669b43688f4c1b73f69.tar.gz
u-boot-f3ba55235dddb11bbb615669b43688f4c1b73f69.tar.bz2
u-boot-f3ba55235dddb11bbb615669b43688f4c1b73f69.zip
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: Stephen Warren <swarren@nvidia.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net/rtl8169.c')
-rw-r--r--drivers/net/rtl8169.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index ebd46b27e5..19422c4a2a 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -581,7 +581,8 @@ int rtl8169_eth_recv(struct udevice *dev, int flags, uchar **packetp)
#else
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 */
@@ -666,8 +667,8 @@ int rtl8169_eth_send(struct udevice *dev, void *packet, int length)
#else
static int rtl_send(struct eth_device *dev, void *packet, int length)
{
- return rtl_send_common((pci_dev_t)dev->priv, dev->iobase, packet,
- length);
+ return rtl_send_common((pci_dev_t)(unsigned long)dev->priv,
+ dev->iobase, packet, length);
}
#endif
@@ -846,7 +847,8 @@ RESET - Finish setting up the ethernet interface
***************************************************************************/
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;
}