From 625fd1a9913d7b68ccd9652e3b2e5b829305a37a Mon Sep 17 00:00:00 2001 From: Himangi Saraogi Date: Mon, 17 Mar 2014 14:53:10 +0530 Subject: [PATCH] staging:vt6655: Fix sparse warnings of using plain integer as NULL pointer This patch fixes the following sparse warnings: drivers/staging/vt6655/wmgr.c:970:42: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:971:41: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:972:38: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:973:43: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:4110:37: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:4111:41: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:4112:34: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:4113:30: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:4114:35: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:4123:32: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:1815:41: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:1816:34: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:1817:30: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:1818:35: warning: Using plain integer as NULL pointer drivers/staging/vt6655/wmgr.c:2075:63: warning: Using plain integer as NULL pointer The following coccinelle script was used to achieve this: @rule1@ expression *x; @@ ( - x = 0; + x = NULL; | - (x == 0) + (x == NULL) | - (x != 0) + (x != NULL) ) Signed-off-by: Himangi Saraogi Acked-by: Paul E. McKenney Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vt6655/wmgr.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c index 5200a2a..b673bc9 100644 --- a/drivers/staging/vt6655/wmgr.c +++ b/drivers/staging/vt6655/wmgr.c @@ -967,10 +967,10 @@ s_vMgrRxAssocResponse( sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; // decode the frame vMgrDecodeAssocResponse(&sFrame); - if ((sFrame.pwCapInfo == 0) || - (sFrame.pwStatus == 0) || - (sFrame.pwAid == 0) || - (sFrame.pSuppRates == 0)) { + if ((sFrame.pwCapInfo == NULL) || + (sFrame.pwStatus == NULL) || + (sFrame.pwAid == NULL) || + (sFrame.pSuppRates == NULL)) { DBG_PORT80(0xCC); return; } @@ -1812,10 +1812,10 @@ s_vMgrRxBeacon( // decode the beacon frame vMgrDecodeBeacon(&sFrame); - if ((sFrame.pwBeaconInterval == 0) || - (sFrame.pwCapInfo == 0) || - (sFrame.pSSID == 0) || - (sFrame.pSuppRates == 0)) { + if ((sFrame.pwBeaconInterval == NULL) || + (sFrame.pwCapInfo == NULL) || + (sFrame.pSSID == NULL) || + (sFrame.pSuppRates == NULL)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Rx beacon frame error\n"); return; } @@ -2072,7 +2072,7 @@ s_vMgrRxBeacon( if (bTSFLargeDiff) bUpdateTSF = true; - if (pDevice->bEnablePSMode && (sFrame.pTIM != 0)) { + if (pDevice->bEnablePSMode && (sFrame.pTIM != NULL)) { // deal with DTIM, analysis TIM pMgmt->bMulticastTIM = WLAN_MGMT_IS_MULTICAST_TIM(sFrame.pTIM->byBitMapCtl) ? true : false; pMgmt->byDTIMCount = sFrame.pTIM->byDTIMCount; @@ -4107,11 +4107,11 @@ s_vMgrRxProbeResponse( sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; vMgrDecodeProbeResponse(&sFrame); - if ((sFrame.pqwTimestamp == 0) || - (sFrame.pwBeaconInterval == 0) || - (sFrame.pwCapInfo == 0) || - (sFrame.pSSID == 0) || - (sFrame.pSuppRates == 0)) { + if ((sFrame.pqwTimestamp == NULL) || + (sFrame.pwBeaconInterval == NULL) || + (sFrame.pwCapInfo == NULL) || + (sFrame.pSSID == NULL) || + (sFrame.pSuppRates == NULL)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe resp:Fail addr:[%p] \n", pRxPacket->p80211Header); DBG_PORT80(0xCC); return; @@ -4120,7 +4120,7 @@ s_vMgrRxProbeResponse( if (sFrame.pSSID->len == 0) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Rx Probe resp: SSID len = 0 \n"); - if (sFrame.pDSParms != 0) { + if (sFrame.pDSParms != NULL) { if (byCurrChannel > CB_MAX_CHANNEL_24G) { // channel remapping to byIEChannel = get_channel_mapping(pMgmt->pAdapter, sFrame.pDSParms->byCurrChannel, PHY_TYPE_11A); -- 2.7.4