Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging/bcm: fix most build warnings

This removes all warnings I get on a 64 bit build except
for those that look unfixable, where we convert a pointer
to a 32 bit integer and change its byte order!

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
9f1c75ac 2a953cfd

+32 -31
+7 -8
drivers/staging/bcm/Bcmchar.c
··· 100 100 return 0; 101 101 } 102 102 103 - static int bcm_char_read(struct file *filp, PCHAR buf, size_t size, loff_t *f_pos) 103 + static ssize_t bcm_char_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos) 104 104 { 105 105 PPER_TARANG_DATA pTarang = (PPER_TARANG_DATA)filp->private_data; 106 106 PMINI_ADAPTER Adapter = pTarang->Adapter; ··· 153 153 return PktLen; 154 154 } 155 155 156 - static INT bcm_char_ioctl(struct inode *inode, struct file *filp, 157 - UINT cmd, ULONG arg) 156 + static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) 158 157 { 159 158 PPER_TARANG_DATA pTarang = (PPER_TARANG_DATA)filp->private_data; 160 159 PMINI_ADAPTER Adapter = pTarang->Adapter; ··· 2358 2359 2359 2360 2360 2361 static struct file_operations bcm_fops = { 2361 - .owner = THIS_MODULE, 2362 - .open = bcm_char_open, 2363 - .release = bcm_char_release, 2364 - .read = bcm_char_read, 2365 - .unlocked_ioctl = bcm_char_ioctl, 2362 + .owner = THIS_MODULE, 2363 + .open = bcm_char_open, 2364 + .release = bcm_char_release, 2365 + .read = bcm_char_read, 2366 + .unlocked_ioctl = bcm_char_ioctl, 2366 2367 .llseek = no_llseek, 2367 2368 }; 2368 2369
+2 -2
drivers/staging/bcm/Bcmnet.c
··· 126 126 { 127 127 int result=0; 128 128 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 129 - int *temp = NULL ; 129 + void **temp = NULL; /* actually we're *allocating* the device in alloc_etherdev */ 130 130 #endif 131 131 Adapter->dev = alloc_etherdev(sizeof(PMINI_ADAPTER)); 132 132 if(!Adapter->dev) ··· 139 139 Adapter->dev->priv = Adapter; 140 140 #else 141 141 temp = netdev_priv(Adapter->dev); 142 - *temp = (UINT)Adapter; 142 + *temp = (void *)Adapter; 143 143 #endif 144 144 //BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "init adapterptr: %x %x\n", (UINT)Adapter, temp); 145 145
+5 -5
drivers/staging/bcm/CmHost.c
··· 1792 1792 (ULONG)pstAddIndication->psfAuthorizedSet)!= 1) 1793 1793 return 0; 1794 1794 1795 - pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *) 1796 - ntohl((ULONG)pstAddIndication->psfAuthorizedSet); 1795 + /* this can't possibly be right */ 1796 + pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAuthorizedSet); 1797 1797 1798 1798 if(pstAddIndicationAlt->u8Type == DSA_REQ) 1799 1799 { ··· 1886 1886 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8TID : 0x%X",ntohs(pstAddIndication->u16TID)); 1887 1887 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8CID : 0x%X",ntohs(pstAddIndication->u16CID)); 1888 1888 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID)); 1889 - BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-autorized set loc : 0x%x",ntohl(pstAddIndication->psfAuthorizedSet)); 1890 - BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-admitted set loc : 0x%x",ntohl(pstAddIndication->psfAdmittedSet)); 1891 - BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-Active set loc : 0x%x",ntohl(pstAddIndication->psfActiveSet)); 1889 + BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-autorized set loc : %p",pstAddIndication->psfAuthorizedSet); 1890 + BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-admitted set loc : %p",pstAddIndication->psfAdmittedSet); 1891 + BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-Active set loc : %p",pstAddIndication->psfActiveSet); 1892 1892 1893 1893 pstAddIndicationDest->u8Type = pstAddIndication->u8Type; 1894 1894 pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir;
+2 -2
drivers/staging/bcm/InterfaceInit.c
··· 241 241 psIntfAdapter->interface = intf; 242 242 usb_set_intfdata(intf, psIntfAdapter); 243 243 244 - BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%x",(unsigned int)psIntfAdapter); 244 + BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%p",psIntfAdapter); 245 245 retval = InterfaceAdapterInit(psIntfAdapter); 246 246 if(retval) 247 247 { ··· 323 323 return; 324 324 } 325 325 psIntfAdapter = usb_get_intfdata(intf); 326 - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%x",(unsigned int)psIntfAdapter); 326 + BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%p",psIntfAdapter); 327 327 if(psIntfAdapter == NULL) 328 328 { 329 329 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "InterfaceAdapter pointer is NULL");
+10 -10
drivers/staging/bcm/LeakyBucket.c
··· 80 80 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow ===>"); 81 81 /* Validate the parameters */ 82 82 if(NULL == Adapter || (psSF < Adapter->PackInfo && 83 - (UINT)psSF > (UINT) &Adapter->PackInfo[HiPriority])) 83 + (uintptr_t)psSF > (uintptr_t) &Adapter->PackInfo[HiPriority])) 84 84 { 85 - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Got wrong Parameters:Adapter: %p, QIndex: %d\n", Adapter, (psSF-Adapter->PackInfo)); 85 + BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Got wrong Parameters:Adapter: %p, QIndex: %ld\n", Adapter, (psSF-Adapter->PackInfo)); 86 86 return 0; 87 87 } 88 88 ··· 94 94 } 95 95 else 96 96 { 97 - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "Not enough tokens in queue %d Available %u\n", 97 + BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "Not enough tokens in queue %ld Available %u\n", 98 98 psSF-Adapter->PackInfo, psSF->uiCurrentTokenCount); 99 99 psSF->uiPendedLast = 1; 100 100 } 101 101 } 102 102 else 103 103 { 104 - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Queue %d not valid\n", psSF-Adapter->PackInfo); 104 + BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Queue %ld not valid\n", psSF-Adapter->PackInfo); 105 105 } 106 106 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow <==="); 107 107 return 0; ··· 113 113 psQueueCurrent = pPackInfo->FirstTxQueue; 114 114 while(psQueueCurrent) 115 115 { 116 - if((UINT)Packet == (UINT)psQueueCurrent) 116 + if(Packet == psQueueCurrent) 117 117 { 118 - if((UINT)psQueueCurrent == (UINT)pPackInfo->FirstTxQueue) 118 + if(psQueueCurrent == pPackInfo->FirstTxQueue) 119 119 { 120 120 pPackInfo->FirstTxQueue=psQueueCurrent->next; 121 - if((UINT)psQueueCurrent==(UINT)pPackInfo->LastTxQueue) 121 + if(psQueueCurrent==pPackInfo->LastTxQueue) 122 122 pPackInfo->LastTxQueue=NULL; 123 123 } 124 124 else ··· 189 189 int iPacketLen=0; 190 190 191 191 192 - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "%d ====>", (psSF-Adapter->PackInfo)); 193 - if(((UINT)psSF != (UINT)&Adapter->PackInfo[HiPriority]) && Adapter->LinkUpStatus && atomic_read(&psSF->uiPerSFTxResourceCount))//Get data packet 192 + BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "%ld ====>", (psSF-Adapter->PackInfo)); 193 + if((psSF != &Adapter->PackInfo[HiPriority]) && Adapter->LinkUpStatus && atomic_read(&psSF->uiPerSFTxResourceCount))//Get data packet 194 194 { 195 195 if(!psSF->ucDirection ) 196 196 return; ··· 240 240 } 241 241 else 242 242 { 243 - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "For Queue: %d\n", psSF-Adapter->PackInfo); 243 + BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "For Queue: %ld\n", psSF-Adapter->PackInfo); 244 244 BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "\nAvailable Tokens = %d required = %d\n", 245 245 psSF->uiCurrentTokenCount, iPacketLen); 246 246 //this part indicates that becuase of non-availability of the tokens
+1 -1
drivers/staging/bcm/Macros.h
··· 382 382 #define GET_BCM_ADAPTER(net_dev) ({\ 383 383 PMINI_ADAPTER __Adapter = NULL; \ 384 384 if (net_dev) { \ 385 - __Adapter = (PMINI_ADAPTER)(*((UINT *)netdev_priv(net_dev))); \ 385 + __Adapter = (PMINI_ADAPTER)(*((unsigned long *)netdev_priv(net_dev))); \ 386 386 } \ 387 387 else { \ 388 388 __Adapter = NULL; \
+1 -1
drivers/staging/bcm/Misc.c
··· 26 26 { 27 27 int i = 0; 28 28 INT Status = STATUS_SUCCESS ; 29 - BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Initialising Adapter = 0x%x",(unsigned int) psAdapter); 29 + BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Initialising Adapter = %p", psAdapter); 30 30 31 31 if(psAdapter == NULL) 32 32 {
+1 -1
drivers/staging/bcm/PHSDefines.h
··· 4 4 #define PHS_INVALID_TABLE_INDEX 0xffffffff 5 5 6 6 /************************* MACROS **********************************************/ 7 - #define PHS_MEM_TAG '_SHP' 7 + #define PHS_MEM_TAG "_SHP" 8 8 9 9 10 10
+3 -1
drivers/staging/bcm/Transmit.c
··· 282 282 USHORT Vcid) /**<VCID for this packet*/ 283 283 { 284 284 int status=0; 285 + #ifdef GDMA_INTERFACE 285 286 int dontfree = 0; 287 + #endif 286 288 BOOLEAN bHeaderSupressionEnabled = FALSE; 287 289 B_UINT16 uiClassifierRuleID; 288 290 int QueueIndex = NO_OF_QUEUES + 1; ··· 425 423 #endif 426 424 427 425 UINT calltransmit = 1; 428 - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "Entring to wait for signal from the interrupt service thread!Adapter = 0x%x",(unsigned int) Adapter); 426 + BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "Entring to wait for signal from the interrupt service thread!Adapter = %p",Adapter); 429 427 430 428 431 429 while(1)