Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1224902

[PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero

Path csiph.com!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!bofh.it!news.nic.it!robomod
From Ronit Halder <ronit.crj@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
Date Tue, 15 Sep 2015 11:40:02 +0200
Message-ID <q8USt-QT-7@gated-at.bofh.it> (permalink)
X-Original-To johnny.kim@atmel.com
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=7yTtYkcEry0dQdt49BR2GUXnpKR+xVczGP9atxgOlQM=; b=WTTyUdOGAvcFt9/ZLs8ocwtE0rNHE88VfjNL4N9P7cbBQmssCRB2PYVTz4YvsreAGv hiDA1yuzO/PupSK3Al5W92dpwvGRDwirqmV+6YglYlOjppT05W+NkfrltsFlDFHdyaOx WVrCeGlu/tI5PqXJxppww8HUbCXjCeaKg8zwALMQ/K0ysLhv3ep4BgUXxvaZ4UoPD852 cYj7UGpk8i6FoPZ6t/t5QHQffNpIQ17NWi2cZ0IRGqZy3wgMpVRS6PuKpeata682Mk3Y Bm16MUzRmX8uhFop22CwlpTAlN+1mrjTCaO7t+Z+T5awcMZ3FDoCcmB/c8hFvonrB6Xy VcLQ==
X-Received by 10.68.108.67 with SMTP id hi3mr45092717pbb.36.1442309721445; Tue, 15 Sep 2015 02:35:21 -0700 (PDT)
X-Mailer git-send-email 2.4.0.GIT
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 106
Organization linux.* mail to news gateway
X-Original-Cc rachel.kim@atmel.com, chris.park@atmel.com, tony.cho@atmel.com, glen.lee@atmel.com, leo.kim@atmel.com, gregkh@linuxfoundation.org, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Ronit Halder <ronit.crj@gmail.com>
X-Original-Date Tue, 15 Sep 2015 15:04:58 +0530
X-Original-Message-ID <1442309698-12393-1-git-send-email-ronit.crj@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1224902

Show key headers only | View raw


This patch fixes the warning generated by sparse
"Using plain integer as NULL pointer" by using NULL
instead of zero.

Signed-off-by: Ronit halder <ronit.crj@gmail.com>
---

v2: added a new patch in this patch series to fix the NULL comparison style

 drivers/staging/wilc1000/coreconfigurator.c | 14 +++++++-------
 drivers/staging/wilc1000/linux_wlan.c       |  6 +++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 544c12d..8164a33 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -525,7 +525,7 @@ u8 *get_tim_elm(u8 *pu8msa, u16 u16RxLen, u16 u16TagParamOffset)
 			u16index += (IE_HDR_LEN + pu8msa[u16index + 1]);
 	}
 
-	return 0;
+	return NULL;
 }
 
 /* This function gets the current channel information from
@@ -587,7 +587,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
 
 	u16 u16WidID = (u16)WID_NIL;
 	u16 u16WidLen  = 0;
-	u8  *pu8WidVal = 0;
+	u8  *pu8WidVal = NULL;
 
 	u8MsgType = pu8MsgBuffer[0];
 
@@ -614,10 +614,10 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
 
 	/* parse the WID value of the WID "WID_NEWORK_INFO" */
 	{
-		u8  *pu8msa = 0;
+		u8  *pu8msa = NULL;
 		u16 u16RxLen = 0;
-		u8 *pu8TimElm = 0;
-		u8 *pu8IEs = 0;
+		u8 *pu8TimElm = NULL;
+		u8 *pu8IEs = NULL;
 		u16 u16IEsLen = 0;
 		u8 u8index = 0;
 		u32 u32Tsf_Lo;
@@ -670,7 +670,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
 
 		/* Get DTIM Period */
 		pu8TimElm = get_tim_elm(pu8msa, (u16RxLen + FCS_LEN), u8index);
-		if (pu8TimElm != 0)
+		if (pu8TimElm != NULL)
 			pstrNetworkInfo->u8DtimPeriod = pu8TimElm[3];
 		pu8IEs = &pu8msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN];
 		u16IEsLen = u16RxLen - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN);
@@ -743,7 +743,7 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
 	s32 s32Error = WILC_SUCCESS;
 	tstrConnectRespInfo *pstrConnectRespInfo = NULL;
 	u16 u16AssocRespLen = 0;
-	u8 *pu8IEs = 0;
+	u8 *pu8IEs = NULL;
 	u16 u16IEsLen = 0;
 
 	pstrConnectRespInfo = kmalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL);
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 63f44f8..d8f17c6 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -412,7 +412,7 @@ static int isr_bh_routine(void *vp)
 			break;
 		}
 		PRINT_D(INT_DBG, "Interrupt received BH\n");
-		if (g_linux_wlan->oup.wlan_handle_rx_isr != 0)
+		if (g_linux_wlan->oup.wlan_handle_rx_isr != NULL)
 			g_linux_wlan->oup.wlan_handle_rx_isr();
 		else
 			PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n");
@@ -1284,7 +1284,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
 #elif (RX_BH_TYPE == RX_BH_KTHREAD)
 	PRINT_D(INIT_DBG, "Creating kthread for Rxq BH\n");
 	g_linux_wlan->rx_bh_thread = kthread_run(isr_bh_routine, (void *)g_linux_wlan, "K_RXQ_BH");
-	if (g_linux_wlan->rx_bh_thread == 0) {
+	if (g_linux_wlan->rx_bh_thread == NULL) {
 		PRINT_ER("couldn't create RX BH thread\n");
 		ret = -ENOBUFS;
 		goto _fail_;
@@ -1309,7 +1309,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
 	/* create tx task */
 	PRINT_D(INIT_DBG, "Creating kthread for transmission\n");
 	g_linux_wlan->txq_thread = kthread_run(linux_wlan_txq_task, (void *)g_linux_wlan, "K_TXQ_TASK");
-	if (g_linux_wlan->txq_thread == 0) {
+	if (g_linux_wlan->txq_thread == NULL) {
 		PRINT_ER("couldn't create TXQ thread\n");
 		ret = -ENOBUFS;
 		goto _fail_2;
-- 
2.4.0.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Ronit Halder <ronit.crj@gmail.com> - 2015-09-15 11:40 +0200
  Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Greg KH <gregkh@linuxfoundation.org> - 2015-09-15 16:00 +0200
    Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Ronit Halder <ronit.crj@gmail.com> - 2015-09-17 03:50 +0200
      Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Greg KH <gregkh@linuxfoundation.org> - 2015-09-17 04:30 +0200
        Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero roni <ronit.crj@gmail.com> - 2015-09-17 05:00 +0200
          Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Greg KH <gregkh@linuxfoundation.org> - 2015-09-17 05:20 +0200
            Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Ronit Halder <ronit.crj@gmail.com> - 2015-09-17 05:40 +0200
              Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-17 09:00 +0200

csiph-web