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>
This commit is contained in:
Arnd Bergmann 2010-09-30 10:24:11 +02:00 committed by Greg Kroah-Hartman
parent 2a953cfd42
commit 9f1c75ac2d
9 changed files with 32 additions and 31 deletions

View File

@ -100,7 +100,7 @@ static int bcm_char_release(struct inode *inode, struct file *filp)
return 0; return 0;
} }
static int bcm_char_read(struct file *filp, PCHAR buf, size_t size, loff_t *f_pos) static ssize_t bcm_char_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos)
{ {
PPER_TARANG_DATA pTarang = (PPER_TARANG_DATA)filp->private_data; PPER_TARANG_DATA pTarang = (PPER_TARANG_DATA)filp->private_data;
PMINI_ADAPTER Adapter = pTarang->Adapter; PMINI_ADAPTER Adapter = pTarang->Adapter;
@ -153,8 +153,7 @@ static int bcm_char_read(struct file *filp, PCHAR buf, size_t size, loff_t *f_po
return PktLen; return PktLen;
} }
static INT bcm_char_ioctl(struct inode *inode, struct file *filp, static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
UINT cmd, ULONG arg)
{ {
PPER_TARANG_DATA pTarang = (PPER_TARANG_DATA)filp->private_data; PPER_TARANG_DATA pTarang = (PPER_TARANG_DATA)filp->private_data;
PMINI_ADAPTER Adapter = pTarang->Adapter; PMINI_ADAPTER Adapter = pTarang->Adapter;
@ -2359,11 +2358,11 @@ static INT bcm_char_ioctl(struct inode *inode, struct file *filp,
static struct file_operations bcm_fops = { static struct file_operations bcm_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = bcm_char_open, .open = bcm_char_open,
.release = bcm_char_release, .release = bcm_char_release,
.read = bcm_char_read, .read = bcm_char_read,
.unlocked_ioctl = bcm_char_ioctl, .unlocked_ioctl = bcm_char_ioctl,
.llseek = no_llseek, .llseek = no_llseek,
}; };

View File

@ -126,7 +126,7 @@ int register_networkdev(PMINI_ADAPTER Adapter)
{ {
int result=0; int result=0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
int *temp = NULL ; void **temp = NULL; /* actually we're *allocating* the device in alloc_etherdev */
#endif #endif
Adapter->dev = alloc_etherdev(sizeof(PMINI_ADAPTER)); Adapter->dev = alloc_etherdev(sizeof(PMINI_ADAPTER));
if(!Adapter->dev) if(!Adapter->dev)
@ -139,7 +139,7 @@ int register_networkdev(PMINI_ADAPTER Adapter)
Adapter->dev->priv = Adapter; Adapter->dev->priv = Adapter;
#else #else
temp = netdev_priv(Adapter->dev); temp = netdev_priv(Adapter->dev);
*temp = (UINT)Adapter; *temp = (void *)Adapter;
#endif #endif
//BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "init adapterptr: %x %x\n", (UINT)Adapter, temp); //BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "init adapterptr: %x %x\n", (UINT)Adapter, temp);

View File

@ -1792,8 +1792,8 @@ ULONG StoreCmControlResponseMessage(PMINI_ADAPTER Adapter,PVOID pvBuffer,UINT *p
(ULONG)pstAddIndication->psfAuthorizedSet)!= 1) (ULONG)pstAddIndication->psfAuthorizedSet)!= 1)
return 0; return 0;
pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *) /* this can't possibly be right */
ntohl((ULONG)pstAddIndication->psfAuthorizedSet); pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
if(pstAddIndicationAlt->u8Type == DSA_REQ) if(pstAddIndicationAlt->u8Type == DSA_REQ)
{ {
@ -1886,9 +1886,9 @@ static inline stLocalSFAddIndicationAlt
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8TID : 0x%X",ntohs(pstAddIndication->u16TID)); BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8TID : 0x%X",ntohs(pstAddIndication->u16TID));
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8CID : 0x%X",ntohs(pstAddIndication->u16CID)); BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8CID : 0x%X",ntohs(pstAddIndication->u16CID));
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID)); BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID));
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-autorized set loc : 0x%x",ntohl(pstAddIndication->psfAuthorizedSet)); BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-autorized set loc : %p",pstAddIndication->psfAuthorizedSet);
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-admitted set loc : 0x%x",ntohl(pstAddIndication->psfAdmittedSet)); BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-admitted set loc : %p",pstAddIndication->psfAdmittedSet);
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-Active set loc : 0x%x",ntohl(pstAddIndication->psfActiveSet)); BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-Active set loc : %p",pstAddIndication->psfActiveSet);
pstAddIndicationDest->u8Type = pstAddIndication->u8Type; pstAddIndicationDest->u8Type = pstAddIndication->u8Type;
pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir; pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir;

View File

@ -241,7 +241,7 @@ usbbcm_device_probe(struct usb_interface *intf, const struct usb_device_id *id)
psIntfAdapter->interface = intf; psIntfAdapter->interface = intf;
usb_set_intfdata(intf, psIntfAdapter); usb_set_intfdata(intf, psIntfAdapter);
BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%x",(unsigned int)psIntfAdapter); BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%p",psIntfAdapter);
retval = InterfaceAdapterInit(psIntfAdapter); retval = InterfaceAdapterInit(psIntfAdapter);
if(retval) if(retval)
{ {
@ -323,7 +323,7 @@ static void usbbcm_disconnect (struct usb_interface *intf)
return; return;
} }
psIntfAdapter = usb_get_intfdata(intf); psIntfAdapter = usb_get_intfdata(intf);
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%x",(unsigned int)psIntfAdapter); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%p",psIntfAdapter);
if(psIntfAdapter == NULL) if(psIntfAdapter == NULL)
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "InterfaceAdapter pointer is NULL"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "InterfaceAdapter pointer is NULL");

View File

@ -80,9 +80,9 @@ static __inline ULONG GetSFTokenCount(PMINI_ADAPTER Adapter, PacketInfo *psSF)
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow ===>"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow ===>");
/* Validate the parameters */ /* Validate the parameters */
if(NULL == Adapter || (psSF < Adapter->PackInfo && if(NULL == Adapter || (psSF < Adapter->PackInfo &&
(UINT)psSF > (UINT) &Adapter->PackInfo[HiPriority])) (uintptr_t)psSF > (uintptr_t) &Adapter->PackInfo[HiPriority]))
{ {
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)); 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));
return 0; return 0;
} }
@ -94,14 +94,14 @@ static __inline ULONG GetSFTokenCount(PMINI_ADAPTER Adapter, PacketInfo *psSF)
} }
else else
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "Not enough tokens in queue %d Available %u\n", BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "Not enough tokens in queue %ld Available %u\n",
psSF-Adapter->PackInfo, psSF->uiCurrentTokenCount); psSF-Adapter->PackInfo, psSF->uiCurrentTokenCount);
psSF->uiPendedLast = 1; psSF->uiPendedLast = 1;
} }
} }
else else
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Queue %d not valid\n", psSF-Adapter->PackInfo); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Queue %ld not valid\n", psSF-Adapter->PackInfo);
} }
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow <==="); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow <===");
return 0; return 0;
@ -113,12 +113,12 @@ static __inline void RemovePacketFromQueue(PacketInfo *pPackInfo , struct sk_buf
psQueueCurrent = pPackInfo->FirstTxQueue; psQueueCurrent = pPackInfo->FirstTxQueue;
while(psQueueCurrent) while(psQueueCurrent)
{ {
if((UINT)Packet == (UINT)psQueueCurrent) if(Packet == psQueueCurrent)
{ {
if((UINT)psQueueCurrent == (UINT)pPackInfo->FirstTxQueue) if(psQueueCurrent == pPackInfo->FirstTxQueue)
{ {
pPackInfo->FirstTxQueue=psQueueCurrent->next; pPackInfo->FirstTxQueue=psQueueCurrent->next;
if((UINT)psQueueCurrent==(UINT)pPackInfo->LastTxQueue) if(psQueueCurrent==pPackInfo->LastTxQueue)
pPackInfo->LastTxQueue=NULL; pPackInfo->LastTxQueue=NULL;
} }
else else
@ -189,8 +189,8 @@ static __inline VOID CheckAndSendPacketFromIndex
int iPacketLen=0; int iPacketLen=0;
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "%d ====>", (psSF-Adapter->PackInfo)); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "%ld ====>", (psSF-Adapter->PackInfo));
if(((UINT)psSF != (UINT)&Adapter->PackInfo[HiPriority]) && Adapter->LinkUpStatus && atomic_read(&psSF->uiPerSFTxResourceCount))//Get data packet if((psSF != &Adapter->PackInfo[HiPriority]) && Adapter->LinkUpStatus && atomic_read(&psSF->uiPerSFTxResourceCount))//Get data packet
{ {
if(!psSF->ucDirection ) if(!psSF->ucDirection )
return; return;
@ -240,7 +240,7 @@ static __inline VOID CheckAndSendPacketFromIndex
} }
else else
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "For Queue: %d\n", psSF-Adapter->PackInfo); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "For Queue: %ld\n", psSF-Adapter->PackInfo);
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "\nAvailable Tokens = %d required = %d\n", BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "\nAvailable Tokens = %d required = %d\n",
psSF->uiCurrentTokenCount, iPacketLen); psSF->uiCurrentTokenCount, iPacketLen);
//this part indicates that becuase of non-availability of the tokens //this part indicates that becuase of non-availability of the tokens

View File

@ -382,7 +382,7 @@ enum eAbortPattern {
#define GET_BCM_ADAPTER(net_dev) ({\ #define GET_BCM_ADAPTER(net_dev) ({\
PMINI_ADAPTER __Adapter = NULL; \ PMINI_ADAPTER __Adapter = NULL; \
if (net_dev) { \ if (net_dev) { \
__Adapter = (PMINI_ADAPTER)(*((UINT *)netdev_priv(net_dev))); \ __Adapter = (PMINI_ADAPTER)(*((unsigned long *)netdev_priv(net_dev))); \
} \ } \
else { \ else { \
__Adapter = NULL; \ __Adapter = NULL; \

View File

@ -26,7 +26,7 @@ InitAdapter(PMINI_ADAPTER psAdapter)
{ {
int i = 0; int i = 0;
INT Status = STATUS_SUCCESS ; INT Status = STATUS_SUCCESS ;
BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Initialising Adapter = 0x%x",(unsigned int) psAdapter); BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Initialising Adapter = %p", psAdapter);
if(psAdapter == NULL) if(psAdapter == NULL)
{ {

View File

@ -4,7 +4,7 @@
#define PHS_INVALID_TABLE_INDEX 0xffffffff #define PHS_INVALID_TABLE_INDEX 0xffffffff
/************************* MACROS **********************************************/ /************************* MACROS **********************************************/
#define PHS_MEM_TAG '_SHP' #define PHS_MEM_TAG "_SHP"

View File

@ -282,7 +282,9 @@ INT SetupNextSend(PMINI_ADAPTER Adapter, /**<Logical Adapter*/
USHORT Vcid) /**<VCID for this packet*/ USHORT Vcid) /**<VCID for this packet*/
{ {
int status=0; int status=0;
#ifdef GDMA_INTERFACE
int dontfree = 0; int dontfree = 0;
#endif
BOOLEAN bHeaderSupressionEnabled = FALSE; BOOLEAN bHeaderSupressionEnabled = FALSE;
B_UINT16 uiClassifierRuleID; B_UINT16 uiClassifierRuleID;
int QueueIndex = NO_OF_QUEUES + 1; int QueueIndex = NO_OF_QUEUES + 1;
@ -423,7 +425,7 @@ int tx_pkt_handler(PMINI_ADAPTER Adapter /**< pointer to adapter object*/
#endif #endif
UINT calltransmit = 1; UINT calltransmit = 1;
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); 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);
while(1) while(1)