From: Joe Perches Date: Wed, 27 Feb 2013 00:33:11 +0000 (-0800) Subject: staging: slicoss: Remove dma_addr_t cast compilation warnings X-Git-Tag: upstream/snapshot3+hdmi~5290^2~770 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01d0a9b474661831cd1ee5d88d5ee3fb80b55a7a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git staging: slicoss: Remove dma_addr_t cast compilation warnings Eliminate some warnings by casting to unsigned long before casting a dma_addr_t value to a pointer. btw: Does slicoss always work on x86-32? Is a pshmem guaranteed to be accessible by a 32 bit address? Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c index 58a00c2..c8375a2 100644 --- a/drivers/staging/slicoss/slicoss.c +++ b/drivers/staging/slicoss/slicoss.c @@ -999,7 +999,8 @@ static void slic_link_upr_complete(struct adapter *adapter, u32 isr) if ((isr & ISR_UPCERR) || (isr & ISR_UPCBSY)) { struct slic_shmem *pshmem; - pshmem = (struct slic_shmem *)adapter->phys_shmem; + pshmem = (struct slic_shmem *)(unsigned long) + adapter->phys_shmem; #if BITS_PER_LONG == 64 slic_upr_queue_request(adapter, SLIC_UPR_RLSR, @@ -1631,10 +1632,11 @@ retry_rcvqfill: #endif skb = alloc_skb(SLIC_RCVQ_RCVBUFSIZE, GFP_ATOMIC); if (skb) { - paddr = (void *)pci_map_single(adapter->pcidev, - skb->data, - SLIC_RCVQ_RCVBUFSIZE, - PCI_DMA_FROMDEVICE); + paddr = (void *)(unsigned long) + pci_map_single(adapter->pcidev, + skb->data, + SLIC_RCVQ_RCVBUFSIZE, + PCI_DMA_FROMDEVICE); paddrl = SLIC_GET_ADDR_LOW(paddr); paddrh = SLIC_GET_ADDR_HIGH(paddr); @@ -1781,8 +1783,9 @@ static u32 slic_rcvqueue_reinsert(struct adapter *adapter, struct sk_buff *skb) struct slic_rcvbuf *rcvbuf = (struct slic_rcvbuf *)skb->head; struct device *dev; - paddr = (void *)pci_map_single(adapter->pcidev, skb->head, - SLIC_RCVQ_RCVBUFSIZE, PCI_DMA_FROMDEVICE); + paddr = (void *)(unsigned long) + pci_map_single(adapter->pcidev, skb->head, + SLIC_RCVQ_RCVBUFSIZE, PCI_DMA_FROMDEVICE); rcvbuf->status = 0; skb->next = NULL; @@ -2279,7 +2282,7 @@ static void slic_link_event_handler(struct adapter *adapter) return; } - pshmem = (struct slic_shmem *)adapter->phys_shmem; + pshmem = (struct slic_shmem *)(unsigned long)adapter->phys_shmem; #if BITS_PER_LONG == 64 status = slic_upr_request(adapter, @@ -2306,7 +2309,7 @@ static void slic_init_cleanup(struct adapter *adapter) sizeof(struct slic_shmem), adapter->pshmem, adapter->phys_shmem); adapter->pshmem = NULL; - adapter->phys_shmem = (dma_addr_t) NULL; + adapter->phys_shmem = (dma_addr_t)(unsigned long)NULL; } if (adapter->pingtimerset) { @@ -2880,7 +2883,8 @@ static int slic_if_init(struct adapter *adapter) mdelay(1); if (!adapter->isp_initialized) { - pshmem = (struct slic_shmem *)adapter->phys_shmem; + pshmem = (struct slic_shmem *)(unsigned long) + adapter->phys_shmem; spin_lock_irqsave(&adapter->bit64reglock.lock, adapter->bit64reglock.flags); @@ -3282,7 +3286,8 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter) } slic_reg32_write(&slic_regs->slic_icr, ICR_INT_OFF, FLUSH); mdelay(1); - pshmem = (struct slic_shmem *)adapter->phys_shmem; + pshmem = (struct slic_shmem *)(unsigned long) + adapter->phys_shmem; spin_lock_irqsave(&adapter->bit64reglock.lock, adapter->bit64reglock.flags);