Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5943757rwr; Mon, 24 Apr 2023 11:08:32 -0700 (PDT) X-Google-Smtp-Source: AKy350agBlc67Bav1VcCmp5sQW+utCFu04cqvF0QbPDOhXpJFCqSvvD8J+7YBRrHLtTw9Yp6pj+r X-Received: by 2002:a17:903:32d2:b0:1a9:3b64:3761 with SMTP id i18-20020a17090332d200b001a93b643761mr17287031plr.9.1682359712269; Mon, 24 Apr 2023 11:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682359712; cv=none; d=google.com; s=arc-20160816; b=uaStHkI+hsx66HRexI8PUc8n2lLZGedaFMpoqLkaYmvU9Ojc2ImxMYoAcBWqb3kq0E tIFzXpmjRnDdKz0EmWIcVx+0L7Xrfjjy1eKmOuOr59sXkv5bu3pSXCs3DguOibT14N9r YHTwUqLegyfn+ewdeFsXvQPwj6J9jX44F12tOFmK8zMAZVJaPdamoXbaALOy+rGoJuis PpAOUsI5V9aSUrfUmfP9h3J2wNnx3B5EFlDf+bDYBFIGtWg1/zKhcv70rilKwVaSZ/qb p30+pwA2PySilh2Mb8DB1LghVMvCQngJLgzwECNla+XAWiSLYRR+QT4blKzbyWoXQ8qX +adQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=pz7puxVNtolmzcAAwyFjNawuUpApiD7LRdlC7UvoCIo=; b=qUbYswRrMv46aCoflxV/DhdXFkEILDWlkvAwQGmmdDIAgiNICTOUWYbQ4XDHayOXpe 8FWoCPT2Huk/OSg+4g5JRI5IBgc2vD+EzLWENR/V2NejuLKOsWsSPKJr9Q68PqGdgxk+ NCsPXOm9Od0I8bPZ7WI4jg2l8cOhg8tjen4yaQoHFf189VKcurgTnv8qBMvenuiZJ7w6 mdDs7/Dr6IhDlbh86hkhKNXeZKrrwPaJZ2bQGhu6irub7yjDW4lxVidq7s9/oUl2vFte v13C1JJ38rEXT+bPmnA7UN5PQQ/lxNxB7hSQTAdzkuKRZH7b7o1h4e40OlAUzKhXTvOY io3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=YjDZliCE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j11-20020a17090276cb00b001a6477cf78csi11207410plt.295.2023.04.24.11.08.20; Mon, 24 Apr 2023 11:08:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=YjDZliCE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231842AbjDXSEQ (ORCPT + 99 others); Mon, 24 Apr 2023 14:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230343AbjDXSEO (ORCPT ); Mon, 24 Apr 2023 14:04:14 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79D857D83 for ; Mon, 24 Apr 2023 11:04:12 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-63d4595d60fso29940831b3a.0 for ; Mon, 24 Apr 2023 11:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682359452; x=1684951452; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pz7puxVNtolmzcAAwyFjNawuUpApiD7LRdlC7UvoCIo=; b=YjDZliCErZG6eMEe/1BMVzzbVztgISMWDi6eJlA/S29GGNg3j2iwgsvs9h5cFjzBC1 Z+bRVuCYOtAdWjxET6awwI4G3zCqkV1Bl+AfxuzwUyvlbED+T6VeYNqa3+vFdujhww3o Wf0LbZFvZDJ7lPyWZD8CZiSnhBVqeqQjlzEyXiYw1PANXpUiEGMbzSVmVNYZ8ej/OKI+ p9wBMgYLTfm546yip58JQp1M6Cp2CAE7hkE4W7Di9S+yvYBObwe2jkFbwOYTOevUmfgC 1y24XyIjW2mDTBmG2Agkb1I3j3qGeDZ4giudu0qKGmSTQKY1hGzaLpKufuboxDeTFP13 1atg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682359452; x=1684951452; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pz7puxVNtolmzcAAwyFjNawuUpApiD7LRdlC7UvoCIo=; b=Cz944xZ16Kj9hE6JmAozuwtsg6BSd53wzWnVrjm7G8mE2Cc2a2otDlV57cG6ws3VU2 S6At/ofI0k/b4PNki1JHLKvLsK60/EYQaPP9aGvS+F26ZToUUCkb32xd0iQKLp3Ln6nn WQlbLOh4h6ze/p8w4FyaMqH2HXtYAyAR7v/J2dexkKleENaxd/35mg7CWW8UQZHSHUz9 knt9hDmCac22QPJgYWJtb9ZRgKVlycrLIgb2jInvhQYNXAw1ZjjqcM3Xtwxh+K68wmvI BaEmX0CXveU5+JCBv5rkdTyCL9y4y8UNbhkBM3el6T2smdTRvxri3Vsm7zjkrDAKQqNs G8Kg== X-Gm-Message-State: AAQBX9d2O05WKt5qObognmEVEAoEcZiptNL9CMIt/0c8Pat0mt2ysuED 1aR5MZyM/3yEzDwvKp/42K8= X-Received: by 2002:a17:90a:6002:b0:246:865d:419a with SMTP id y2-20020a17090a600200b00246865d419amr20810032pji.6.1682359451869; Mon, 24 Apr 2023 11:04:11 -0700 (PDT) Received: from pop-os.localdomain ([103.251.210.208]) by smtp.gmail.com with ESMTPSA id u19-20020a17090abb1300b0024b2fc15befsm5797080pjr.44.2023.04.24.11.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 11:04:11 -0700 (PDT) Date: Mon, 24 Apr 2023 23:34:07 +0530 From: Yogesh Hegde To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/4] staging: rtl8192e: Remove unused rf_set_sens variable Message-ID: <5a9767fab76b1836ea7881994ffb3593c1ab12bf.1682358035.git.yogi.kernel@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLY, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rf_set_sens variable is declared but never set, so it is always NULL. This commit cleans up the unused rf_set_sens variable and removes the associated code that relied on it. Specifically, the following changes have been made: - Removed the `range->sensitivity` assignment, which was never used. - Removed the sensitivity level get implementation, which always returns an error code. - Removed the sensitivity level set implementation, which always returns an error code. - Removed the `rf_set_sens` variable. Suggested-by: Philipp Hortmann Signed-off-by: Yogesh Hegde --- Changes in v5: 1. Rebased onto latest staging-testing branch Changes in v4: 1. Split changes into patch series per feedback from gregkh@linuxfoundation.org Changes in v3: 1. Fixed description to fit within 75 chars 2. Added suggested tags per feedback from philipp.g.hortmann@gmail.com Changes in v2: 1. Removed function definition rf_set_sens 2. Removed usage of variable priv->rf_set_sens 3. Removed functions _rtl92e_wx_get_sens and _rtl92e_wx_set_sens 4. Cleaned up the variables sens and max_sens used in these functions Changes in v1: 1. Fix comparison to NULL of variable rf_set_sens --- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 19 ++----------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index 285dac32c074..08145e1f814c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -231,7 +231,6 @@ struct r8192_priv { struct rt_stats stats; struct iw_statistics wstats; - short (*rf_set_sens)(struct net_device *dev, short sens); u8 (*rf_set_chan)(struct net_device *dev, u8 ch); struct rx_desc *rx_ring[MAX_RX_QUEUE]; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index cb28288a618b..cc1af367f37d 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -311,10 +311,6 @@ static int _rtl92e_wx_get_range(struct net_device *dev, /* ~130 Mb/s real (802.11n) */ range->throughput = 130 * 1000 * 1000; - if (priv->rf_set_sens != NULL) - /* signal level threshold range */ - range->sensitivity = priv->max_sens; - range->max_qual.qual = 100; range->max_qual.level = 0; range->max_qual.noise = 0; @@ -813,10 +809,7 @@ static int _rtl92e_wx_get_sens(struct net_device *dev, { struct r8192_priv *priv = rtllib_priv(dev); - if (priv->rf_set_sens == NULL) - return -1; /* we have not this support for this radio */ - wrqu->sens.value = priv->sens; - return 0; + return -1; } static int _rtl92e_wx_set_sens(struct net_device *dev, @@ -831,15 +824,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev, return 0; mutex_lock(&priv->wx_mutex); - if (priv->rf_set_sens == NULL) { - err = -1; /* we have not this support for this radio */ - goto exit; - } - if (priv->rf_set_sens(dev, wrqu->sens.value) == 0) - priv->sens = wrqu->sens.value; - else - err = -EINVAL; - + err = -1; exit: mutex_unlock(&priv->wx_mutex); -- 2.34.1