From patchwork Tue Sep 15 02:53:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Cho X-Patchwork-Id: 7179711 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6189A9F314 for ; Tue, 15 Sep 2015 02:54:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7088C2060C for ; Tue, 15 Sep 2015 02:53:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4920D2060A for ; Tue, 15 Sep 2015 02:53:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbbIOCx4 (ORCPT ); Mon, 14 Sep 2015 22:53:56 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:56633 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752633AbbIOCx4 (ORCPT ); Mon, 14 Sep 2015 22:53:56 -0400 Received: from tony-itx.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Tue, 15 Sep 2015 04:53:52 +0200 From: Tony Cho To: CC: , , , , , , , , , , , Subject: [PATCH 2/7] staging: wilc1000: remove definition WILC_NULLCHECK Date: Tue, 15 Sep 2015 11:53:36 +0900 Message-ID: <1442285621-29457-3-git-send-email-tony.cho@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442285621-29457-1-git-send-email-tony.cho@atmel.com> References: <1442285621-29457-1-git-send-email-tony.cho@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Kim This patch removes the definition WILC_NULLCHECK which is not used anymore. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 8 ++++++-- drivers/staging/wilc1000/wilc_errorsupport.h | 6 ------ drivers/staging/wilc1000/wilc_msgqueue.c | 9 +++++++-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 24 ++++++++++++++--------- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 59a1a9d..29491f6 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1,5 +1,6 @@ #include "host_interface.h" #include "coreconfigurator.h" +#include extern s32 TransportInit(void); extern s32 TransportDeInit(void); @@ -7291,7 +7292,8 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrSta if (pstrAddStationMsg->u8NumRates > 0) { u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL); - WILC_NULLCHECK(s32Error, rates); + if (rates == NULL) + return -ENOMEM; memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates); pstrAddStationMsg->pu8Rates = rates; @@ -7446,7 +7448,9 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrSt if (pstrAddStationMsg->u8NumRates > 0) { u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL); - WILC_NULLCHECK(s32Error, rates); + if (rates == NULL) + return -ENOMEM; + memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates); pstrAddStationMsg->pu8Rates = rates; } diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h b/drivers/staging/wilc1000/wilc_errorsupport.h index 8eb8150..42495d9 100644 --- a/drivers/staging/wilc1000/wilc_errorsupport.h +++ b/drivers/staging/wilc1000/wilc_errorsupport.h @@ -51,12 +51,6 @@ goto ERRORHANDLER; \ } while (0) -#define WILC_NULLCHECK(__status__, __ptr__) do { \ - if (__ptr__ == NULL) { \ - WILC_ERRORREPORT(__status__, WILC_NULL_PTR); \ - } \ -} while (0) - #define WILC_CATCH(__status__) \ ERRORHANDLER: \ if (__status__ < WILC_SUCCESS) \ diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 41244ce..f3d0d34 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -1,6 +1,7 @@ #include "wilc_msgqueue.h" #include +#include /*! * @author syounan @@ -69,11 +70,15 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, /* construct a new message */ pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); - WILC_NULLCHECK(s32RetStatus, pstrMessage); + if (pstrMessage == NULL) + return -ENOMEM; pstrMessage->u32Length = u32SendBufferSize; pstrMessage->pstrNext = NULL; pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC); - WILC_NULLCHECK(s32RetStatus, pstrMessage->pvBuffer); + if (pstrMessage->pvBuffer == NULL) { + s32RetStatus = -ENOMEM; + goto ERRORHANDLER; + } memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize); /* add it to the message queue */ diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 068e648..a182bdb 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -15,7 +15,7 @@ #ifdef WILC_SDIO #include "linux_wlan_sdio.h" /* tony : for set_wiphy_dev() */ #endif - +#include #define IS_MANAGMEMENT 0x100 #define IS_MANAGMEMENT_CALLBACK 0x080 @@ -382,7 +382,10 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo if (priv->bCfgScanning == true) { if (enuScanEvent == SCAN_EVENT_NETWORK_FOUND) { wiphy = priv->dev->ieee80211_ptr->wiphy; - WILC_NULLCHECK(s32Error, wiphy); + + if (wiphy == NULL) + return; + if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC && ((((s32)pstrNetworkInfo->s8rssi) * 100) < 0 @@ -396,7 +399,8 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo s32Freq = ieee80211_channel_to_frequency((s32)pstrNetworkInfo->u8channel, IEEE80211_BAND_2GHZ); channel = ieee80211_get_channel(wiphy, s32Freq); - WILC_NULLCHECK(s32Error, channel); + if (channel == NULL) + return; PRINT_INFO(CFG80211_DBG, "Network Info:: CHANNEL Frequency: %d, RSSI: %d, CapabilityInfo: %d," "BeaconPeriod: %d\n", channel->center_freq, (((s32)pstrNetworkInfo->s8rssi) * 100), @@ -3292,8 +3296,8 @@ static int stop_ap(struct wiphy *wiphy, struct net_device *dev) struct WILC_WFI_priv *priv; u8 NullBssid[ETH_ALEN] = {0}; - - WILC_NULLCHECK(s32Error, wiphy); + if (wiphy == NULL) + return -EFAULT; priv = wiphy_priv(wiphy); @@ -3329,8 +3333,8 @@ static int add_station(struct wiphy *wiphy, struct net_device *dev, tstrWILC_AddStaParam strStaParams = { {0} }; perInterface_wlan_t *nic; - - WILC_NULLCHECK(s32Error, wiphy); + if (wiphy == NULL) + return -EFAULT; priv = wiphy_priv(wiphy); nic = netdev_priv(dev); @@ -3400,7 +3404,8 @@ static int del_station(struct wiphy *wiphy, struct net_device *dev, struct WILC_WFI_priv *priv; perInterface_wlan_t *nic; - WILC_NULLCHECK(s32Error, wiphy); + if (wiphy == NULL) + return -EFAULT; priv = wiphy_priv(wiphy); nic = netdev_priv(dev); @@ -3446,7 +3451,8 @@ static int change_station(struct wiphy *wiphy, struct net_device *dev, PRINT_D(HOSTAPD_DBG, "Change station paramters\n"); - WILC_NULLCHECK(s32Error, wiphy); + if (wiphy == NULL) + return -EFAULT; priv = wiphy_priv(wiphy); nic = netdev_priv(dev);