netfront: 64bit cleanup
PATCH 1/1 netfront: 64bit cleanup
Fixed compiler warnings of "cast to pointer from integer of different size" which were caused by referencing memory addresses as 32bits on a 64bit system.
Signed-off-by Jon Mason <[email protected]>
drivers/xen/netfront/netfront.c renamed from drivers/xen/netfront/netfront.c.orig +5 -5
@@ -624,7 +624,7 @@ static int netif_poll(struct net_deviceif (skb->len <= (dev->mtu +ETH_HLEN )) {if ((skb->tail > skb->end) &&net_ratelimit ())printk (KERN_INFO "Received packet needs %d bytes more " -"headroom.\n" , skb->tail - skb->end); +"headroom.\n" , (int )(skb->tail - skb->end));if ((nskb =alloc_xen_skb (skb->len +2 )) !=NULL ) {skb_reserve (nskb,2 );
@@ -967,9 +967,9 @@ static int create_netdev(int handle, str/* Initialise {tx,rx}_skbs to be a free chain containing every entry. */ for (i =0 ; i <=NETIF_TX_RING_SIZE ; i++) - np->tx_skbs[i] = (void *)(i+1 ); + np->tx_skbs[i] = (void *)((unsigned long ) i+1 );for (i =0 ; i <=NETIF_RX_RING_SIZE ; i++) - np->rx_skbs[i] = (void *)(i+1 ); + np->rx_skbs[i] = (void *)((unsigned long ) i+1 ); dev->open = network_open; dev->hard_start_xmit = network_start_xmit;
@@ -1343,7 +1343,7 @@ static int xennet_proc_read( {struct net_device *dev = (struct net_device *)((unsigned long )data & ~3UL );struct net_private *np =netdev_priv (dev); -int len =0 , which_target = (int )data &3 ; +int len =0 , which_target = (unsigned long ) data &3 ;switch (which_target) {
@@ -1368,7 +1368,7 @@ static int xennet_proc_write( {struct net_device *dev = (struct net_device *)((unsigned long )data & ~3UL );struct net_private *np =netdev_priv (dev); -int which_target = (int )data &3 ; +int which_target = (unsigned long )data &3 ;char string[64 ];long target;
drivers/xen/netfront/netfront.c static int netif_poll(struct net_device · line 627
Quoted 3 lines · Jon Mason
printk(KERN_INFO "Received packet needs %d bytes more "
drivers/xen/netfront/netfront.c renamed from drivers/xen/netfront/netfront.c.orig +1
-1- "headroom.\n", skb->tail - skb->end); + "headroom.\n", (int)(skb->tail - skb->end));
this is not right here. the right fix is to modify %d to be %zd
the rest looks good, applied.
Thanks,
Signature · 1 line
Vincent Hanquez