Received: by 10.192.165.148 with SMTP id m20csp2709059imm; Sun, 6 May 2018 22:55:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrl5v1GNB2ApOI2B7oVFzEJyBgTNxSuAnIh5rCIMSmWbWfMqFlhCartPpSToMKnVpW+9sLD X-Received: by 2002:a17:902:8e8b:: with SMTP id bg11-v6mr33494325plb.95.1525672542033; Sun, 06 May 2018 22:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525672541; cv=none; d=google.com; s=arc-20160816; b=WBAAchvm9l5Z+eRn3DD+xFOeBjL/Hc+GEXOmRlMsoekihUo+tyBx0H8OU2odumzWjJ IN6iwyYMzs6uRJItbULenoW5ybE4DOPJuCTy0h58hb4w87MAHN9D0588D77WWiGiAdP4 G5NqZqS09S941KwBvACD5pUrF0PxE6DeC9ePoTolyFELIxzLIeU3hZcy0n8H9XImsYAE NQe8TvP2De8BfdlyGgrmu/pZSlUTvOxNaGw5eR1r08DAMQJRE+hAP4T/qjBCxmNyKnas S8O3iWLhbcMdkKdVykVayO+sOwcGu6W2igd7Z/dzOC7P4ZhgsbPBmcM0haVeOqHT6sZ0 zKiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=OZ+yVj78q8vD8OLVpnsijx1j4acSkbCB+O5TzNL0lCg=; b=jxaLx6tZu/3HcoWDBsV1X8rtEliPSjOc+UyUyMonCcy33K1FFiSFG946bEoMRCPzPL Kb4gTgeedhasUklVk3KlZw4UbcgmD+8F1415iaIhnjnSx+WzgAsC47HkdorQGOUdALE+ gqiUfNWgOv4N4qt2LolXDAe+g6WWv/EvyDpb+TA2HBZw3UuEEIE5NPau/z9HpHSf7bSs Sa4rl6Zvk/VJZSMoUfxpqmXqFsRKSNbK1ABVMU5i+Z+19ZCBR0VgALQBnwKIQcfIYizk SX/Pz5M+2Qd9eMR5Nkx/mipVjmNCDWSPqPIY7fATq6sO9Zouo5aOIQjZ+ecqfqOiuRRs W9tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h62si21467601pfg.308.2018.05.06.22.55.27; Sun, 06 May 2018 22:55:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751907AbeEGFy7 (ORCPT + 99 others); Mon, 7 May 2018 01:54:59 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:32076 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751830AbeEGFy6 (ORCPT ); Mon, 7 May 2018 01:54:58 -0400 X-IronPort-AV: E=Sophos;i="5.49,372,1520924400"; d="scan'208";a="13878727" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 06 May 2018 22:54:57 -0700 Received: from ajaysk-VirtualBox (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com (10.10.76.37) with Microsoft SMTP Server id 14.3.352.0; Sun, 6 May 2018 22:54:56 -0700 Date: Mon, 7 May 2018 11:24:51 +0530 From: Ajay Singh To: Nathan Chancellor CC: , Greg Kroah-Hartman , , , Ganesh Krishna , Aditya Shankar Subject: Re: [PATCH 2/3] staging: wilc1000: Remove useless function Message-ID: <20180507112451.574f72ac@ajaysk-VirtualBox> In-Reply-To: <20180506073333.3770-2-natechancellor@gmail.com> References: <20180506073333.3770-1-natechancellor@gmail.com> <20180506073333.3770-2-natechancellor@gmail.com> Organization: Microchip Technology X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 6 May 2018 00:33:32 -0700 Nathan Chancellor wrote: > GCC warns that 'wid' is unused in wilc_remove_key and it's correct; > the variable is only local. Get rid of the function (since it just > returns zero) and shuffle the remaining code into one if statement. > > Signed-off-by: Nathan Chancellor Reviewed-by: Ajay Singh > --- > drivers/staging/wilc1000/host_interface.c | 12 ------------ > drivers/staging/wilc1000/host_interface.h | 1 - > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++--------- > 3 files changed, 5 insertions(+), 22 deletions(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c > b/drivers/staging/wilc1000/host_interface.c index > 3fd4c8e62da6..b5f3829e9903 100644 --- > a/drivers/staging/wilc1000/host_interface.c +++ > b/drivers/staging/wilc1000/host_interface.c @@ -2606,18 +2606,6 @@ > static void timer_connect_cb(struct timer_list *t) > wilc_enqueue_cmd(&msg); } > > -s32 wilc_remove_key(struct host_if_drv *hif_drv, const u8 *sta_addr) > -{ > - struct wid wid; > - > - wid.id = (u16)WID_REMOVE_KEY; > - wid.type = WID_STR; > - wid.val = (s8 *)sta_addr; > - wid.size = 6; > - > - return 0; > -} > - > int wilc_remove_wep_key(struct wilc_vif *vif, u8 index) > { > int result = 0; > diff --git a/drivers/staging/wilc1000/host_interface.h > b/drivers/staging/wilc1000/host_interface.h index > 7a26f341e0ba..08b3ba7df8b4 100644 --- > a/drivers/staging/wilc1000/host_interface.h +++ > b/drivers/staging/wilc1000/host_interface.h @@ -303,7 +303,6 @@ > struct add_sta_param { }; > > struct wilc_vif; > -s32 wilc_remove_key(struct host_if_drv *hif_drv, const u8 *sta_addr); > int wilc_remove_wep_key(struct wilc_vif *vif, u8 index); > int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index); > int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 > len, diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index > 76b4afaef423..b499fb987395 100644 --- > a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ > b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1054,15 > +1054,11 @@ static int del_key(struct wiphy *wiphy, struct net_device > *netdev, } } > > - if (key_index >= 0 && key_index <= 3) { > - if (priv->wep_key_len[key_index]) { > - memset(priv->wep_key[key_index], 0, > - priv->wep_key_len[key_index]); > - priv->wep_key_len[key_index] = 0; > - wilc_remove_wep_key(vif, key_index); > - } > - } else { > - wilc_remove_key(priv->hif_drv, mac_addr); > + if (key_index >= 0 && key_index <= 3 && > priv->wep_key_len[key_index]) { > + memset(priv->wep_key[key_index], 0, > + priv->wep_key_len[key_index]); > + priv->wep_key_len[key_index] = 0; > + wilc_remove_wep_key(vif, key_index); > } > > return 0;