All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Mason <jdmason@us.ibm.com>
To: Xen-devel@lists.xensource.com
Subject: [PATCH] netfront: 64bit cleanup
Date: Fri, 17 Jun 2005 17:44:34 -0500	[thread overview]
Message-ID: <20050617224434.GA4491@us.ibm.com> (raw)

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 <jdmason@us.ibm.com>

--- linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c.orig	2005-06-17 16:41:39.873677800 -0500
+++ linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c	2005-06-17 17:16:45.595559416 -0500
@@ -624,7 +624,7 @@ static int netif_poll(struct net_device 
             if (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;

             reply	other threads:[~2005-06-17 22:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-17 22:44 Jon Mason [this message]
2005-06-18 10:24 ` [PATCH] netfront: 64bit cleanup Vincent Hanquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050617224434.GA4491@us.ibm.com \
    --to=jdmason@us.ibm.com \
    --cc=Xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.