From patchwork Mon Oct 12 07:55:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Cho X-Patchwork-Id: 7372751 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 E64959F37F for ; Mon, 12 Oct 2015 07:56:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F373620883 for ; Mon, 12 Oct 2015 07:56:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB970207AA for ; Mon, 12 Oct 2015 07:56:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752070AbbJLH44 (ORCPT ); Mon, 12 Oct 2015 03:56:56 -0400 Received: from eusmtp01.atmel.com ([212.144.249.243]:12011 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751426AbbJLH4z (ORCPT ); Mon, 12 Oct 2015 03:56:55 -0400 Received: from tony-itx.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.3.235.1; Mon, 12 Oct 2015 09:56:53 +0200 From: Tony Cho To: CC: , , , , , , , , , , , Subject: [PATCH V2 04/41] staging: wilc1000: wilc_wfi_cfgoperations.c : removes unused local variables Date: Mon, 12 Oct 2015 16:55:38 +0900 Message-ID: <1444636575-2486-4-git-send-email-tony.cho@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444636575-2486-1-git-send-email-tony.cho@atmel.com> References: <1444636575-2486-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 useless local variable, s32Error and returns directly zero from wilc_wfi_cfgoperations.c and also removes incorrect break in switch-case statement. The break is not useless which is being called right after return statement. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 30 +++++++---------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 04b8dae..a5617de 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1360,7 +1360,6 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac_addr) { struct wilc_priv *priv; - s32 s32Error = 0; priv = wiphy_priv(wiphy); @@ -1446,7 +1445,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, host_int_remove_key(priv->hWILCWFIDrv, mac_addr); } - return s32Error; + return 0; } /** @@ -1466,9 +1465,6 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie, void (*callback)(void *cookie, struct key_params *)) { - - s32 s32Error = 0; - struct wilc_priv *priv; struct key_params key_params; u32 i; @@ -1501,7 +1497,7 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, callback(cookie, &key_params); - return s32Error; /* priv->wilc_gtk->key_len ?0 : -ENOENT; */ + return 0; /* priv->wilc_gtk->key_len ?0 : -ENOENT; */ } /** @@ -1516,7 +1512,6 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, bool unicast, bool multicast) { - s32 s32Error = 0; struct wilc_priv *priv; @@ -1529,7 +1524,7 @@ static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 ke host_int_set_WEPDefaultKeyID(priv->hWILCWFIDrv, key_index); } - return s32Error; + return 0; } /** @@ -1545,7 +1540,6 @@ static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 ke static int get_station(struct wiphy *wiphy, struct net_device *dev, const u8 *mac, struct station_info *sinfo) { - s32 s32Error = 0; struct wilc_priv *priv; perInterface_wlan_t *nic; u32 i = 0; @@ -1569,10 +1563,8 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, } if (associatedsta == -1) { - s32Error = -ENOENT; - PRINT_ER("Station required is not associated : Error(%d)\n", s32Error); - - return s32Error; + PRINT_ER("Station required is not associated\n"); + return -ENOENT; } sinfo->filled |= BIT(NL80211_STA_INFO_INACTIVE_TIME); @@ -1608,7 +1600,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, PRINT_D(CORECONFIG_DBG, "*** stats[%d][%d][%d][%d][%d]\n", sinfo->signal, sinfo->rx_packets, sinfo->tx_packets, sinfo->tx_failed, sinfo->txrate.legacy); } - return s32Error; + return 0; } @@ -2248,7 +2240,6 @@ static int mgmt_tx(struct wiphy *wiphy, const struct ieee80211_mgmt *mgmt; struct p2p_mgmt_data *mgmt_tx; struct wilc_priv *priv; - s32 s32Error = 0; struct host_if_drv *pstrWFIDrv; u32 i; perInterface_wlan_t *nic; @@ -2386,7 +2377,7 @@ static int mgmt_tx(struct wiphy *wiphy, } else { PRINT_D(GENERIC_DBG, "This function transmits only management frames\n"); } - return s32Error; + return 0; } static int mgmt_tx_cancel_wait(struct wiphy *wiphy, @@ -2574,7 +2565,6 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic); static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, enum nl80211_iftype type, u32 *flags, struct vif_params *params) { - s32 s32Error = 0; struct wilc_priv *priv; perInterface_wlan_t *nic; u8 interface_type; @@ -2885,12 +2875,10 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, default: PRINT_ER("Unknown interface type= %d\n", type); - s32Error = -EINVAL; - return s32Error; - break; + return -EINVAL; } - return s32Error; + return 0; } /* (austin.2013-07-23)