Received: by 10.192.165.148 with SMTP id m20csp1847135imm; Sun, 6 May 2018 00:35:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrvjME0NebAOCbWJyFAlTm9jXowywJy+yxrzc8l29LpNF69CEb8at9G2fIhNJThqmPzmjD+ X-Received: by 2002:a65:4189:: with SMTP id a9-v6mr26758611pgq.118.1525592142766; Sun, 06 May 2018 00:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525592142; cv=none; d=google.com; s=arc-20160816; b=yTLfRJ6yB2kwQJOU74AMIEKoxQgs+S18MXdjENtY6vGqNvsC0MqWVU7bSzQ7P3wVC5 8KtqLy/sCVuSwQdgQ902bCy6W71pbnCxbR10zwoNJ0OFWc7if7sg3GSUz0Wc/TtpBSH3 +ggPC3XDiEcyHF6qK93mHAUd1bUT9o+979JOBM6yDjQw0xqI3K1glnj5EmBY1lQFy5rS n1Byof5D+288wfV4RnIKKm/6mbS9Go7cH3upuM0w5mgka/NrGZ2itTs+vp8ItlKrQvIv A+FyxoCX5TIkoOnhxGbjHTBwJMaSOVGNS1zZ2gFeBfgTOu0JKgOiAxChEQfQ88c5GGPw 5w/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nIKiWYrn1pz7uBUJDXQ4HQiB9EufPBf4St4Dhx1e660=; b=ID+Bu+RCXz6/Hh9P2hk7Noe7Zp5Nk9M5IuLW3V/K66iQ4qNr6iDl/Xw+/WXoZC2VI8 MhXfI0/Wtuap2f99GNN5mmHz5T6seE0gZBmckPD3pP0igwUK0m/5o5fa66SPKmpfKqbQ q4zUEJulTd5+MJr1JelV01dnrqjhsmwUdB+qfOmol4vWiWJJtTrvHjFD2ep8xUIEmDi9 9Z09lBZPUXGn4EYlW0V0q7ZSdeBA3Eq37oQbG7GYn60mhH/pw0jwZykecbG2Q+tJor4d j90qfsSkd+ZfxS2n1vRPNh50eNZCLCTPxc46q2P9Rn2/TIxih2P46ZW2BdX1MhJyyyWt XEvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G5df6HMR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2-v6si19114851plv.388.2018.05.06.00.35.28; Sun, 06 May 2018 00:35:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G5df6HMR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751864AbeEFHee (ORCPT + 99 others); Sun, 6 May 2018 03:34:34 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:38282 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751252AbeEFHdc (ORCPT ); Sun, 6 May 2018 03:33:32 -0400 Received: by mail-wr0-f193.google.com with SMTP id 94-v6so23538804wrf.5; Sun, 06 May 2018 00:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nIKiWYrn1pz7uBUJDXQ4HQiB9EufPBf4St4Dhx1e660=; b=G5df6HMRPJvXZZLY+nZHtEu0OYK3il6WYwXWxeGaAjtuwHMOmFAMV+sSxaq7GSCxNU FV938x8XoDq5I+9sxohKbuWuXYMauJfyVAvCUiWP2BIapc78YwH64gO8bXCJ9BXOATeQ pPLNQ0SgjJIcj/FQr1Ghm1vhOIftuapnrhMRayMh8PI3yLkikuj7Tf7RobmKlhcsU0L1 HhdQoZfd+qD1unVHSvB7KiUT48vIaXZh/4kVeOjVe4iVEElLBabGJM2ilKgmSFeNTLaK 973D7S1Kq1itado0UeNNySG5qNci0WoMlCEK5/n/fQbcJkz1yL/Y6+RubPv1qD10PuGF GcIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nIKiWYrn1pz7uBUJDXQ4HQiB9EufPBf4St4Dhx1e660=; b=N0f6UQZBojmF4IP6G2ukvEe/A+mYCRLDpV9AJkIEn/IlL3nZ8K7JGTxBsKBQ1rHtFg s3e0veGFUTA1A4LixQM/IPVcBgKYmDVpFP/IcPY54HRqogMJWXYvxnvRpYjjHHERdJFd Iy0/Nm2vjUcIWWSR/BdySrkNUh1m6RKjS5n8PQJ2J2bv4fy0wJnjM7kssi0Ft4f/75aT YuSn4En1lsdCu9v6N4YD0OtBXlpFFhkmKz/rCEwl1jWdxlsqqmsaWzTP51HoVttdg9df iSZmtrFNBP2sqnh2c6UMUx3I3/paL36d7P2+MJ3Br/vC7fde7yuT177xfFYQC+CWxRNu K/pQ== X-Gm-Message-State: ALQs6tBBC6UbkuPgOkTlCRAa1b3uzH4s20Ui0KtM6vTs6ynzx2iNyls3 pGoWz/bvhPqDPMvJ7Iq44AE= X-Received: by 2002:adf:a556:: with SMTP id j22-v6mr28867674wrb.155.1525592011097; Sun, 06 May 2018 00:33:31 -0700 (PDT) Received: from flashbox.your-server.de ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id u196-v6sm5180536wmf.30.2018.05.06.00.33.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 May 2018 00:33:30 -0700 (PDT) From: Nathan Chancellor To: devel@driverdev.osuosl.org Cc: Greg Kroah-Hartman , Aditya Shankar , Ganesh Krishna , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor Subject: [PATCH 2/3] staging: wilc1000: Remove useless function Date: Sun, 6 May 2018 00:33:32 -0700 Message-Id: <20180506073333.3770-2-natechancellor@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180506073333.3770-1-natechancellor@gmail.com> References: <20180506073333.3770-1-natechancellor@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.17.0