Patchwork via-velocity warnings on sparc64

login
register
mail settings
Submitter fran├žois romieu
Date Sept. 25, 2008, 9:37 p.m.
Message ID <20080925213714.GA13178@electric-eye.fr.zoreil.com>
Download mbox | patch
Permalink /patch/1581/
State Accepted
Delegated to: Jeff Garzik
Headers show

Comments

fran├žois romieu - Sept. 25, 2008, 9:37 p.m.
Meelis Roos <mroos@linux.ee> :
> Noticed this while compiling 2.6.27-rc7+git on sparc64 - maybe it is of 
> interest.
> 
>   CC [M]  drivers/net/via-velocity.o
> drivers/net/via-velocity.c: In function 'velocity_free_rd_ring':
> drivers/net/via-velocity.c:1275: warning: cast from pointer to integer of different size
> drivers/net/via-velocity.c: In function 'velocity_free_td_ring_entry':
> drivers/net/via-velocity.c:1336: warning: cast from pointer to integer of different size

Something like the patch below maybe ?


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Meelis Roos - Sept. 26, 2008, 6:22 a.m.
> Something like the patch below maybe ?

Yes, it cures the warnings.

Patch

diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 007c129..ad20f96 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -1272,7 +1272,7 @@  static void velocity_free_rd_ring(struct velocity_info *vptr)
 			continue;
 		pci_unmap_single(vptr->pdev, rd_info->skb_dma, vptr->rx.buf_sz,
 				 PCI_DMA_FROMDEVICE);
-		rd_info->skb_dma = (dma_addr_t) NULL;
+		rd_info->skb_dma = 0;
 
 		dev_kfree_skb(rd_info->skb);
 		rd_info->skb = NULL;
@@ -1333,7 +1333,7 @@  static void velocity_free_td_ring_entry(struct velocity_info *vptr,
 			if (td_info->skb_dma[i]) {
 				pci_unmap_single(vptr->pdev, td_info->skb_dma[i],
 					td_info->skb->len, PCI_DMA_TODEVICE);
-				td_info->skb_dma[i] = (dma_addr_t) NULL;
+				td_info->skb_dma[i] = 0;
 			}
 		}
 		dev_kfree_skb(td_info->skb);