From patchwork Wed Jun 7 15:01:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Hegde X-Patchwork-Id: 104567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp279475vqr; Wed, 7 Jun 2023 08:23:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4rVp+j1GJOT4S9ynJ+DXshrMr37GgsZVRY/HGwzzaiz/Vt7yuAvR9T/IWSon0F4QbNmgov X-Received: by 2002:a05:6a00:c84:b0:64f:5406:d59e with SMTP id a4-20020a056a000c8400b0064f5406d59emr7204885pfv.17.1686151381990; Wed, 07 Jun 2023 08:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686151381; cv=none; d=google.com; s=arc-20160816; b=SBPy3mGEB8krWJjcQbE/ze4OAFhDmfS4OIS7TY6A4B09+4bmvMGfaF4kFvsMRfIHD0 8M6uSNb5Y58cGYdJFaiiRTHvhZpLEDv1Iob3C2GodE7CUBaYX9tIbeIFjCDGqOznJbK/ /sJ+wZ/9q7GwAqllux1EckqxcGSmIS5ewLvCtAtBeiR+bLTq7V8gAKp8lLGaZpwsVk3y yH9CF7YchsG0bPVRXuAi5iOk8lNj5/myciwgiPCIWb0gmIHZ0sxaTOQ8/jdRUkwasxNT 1QCowAZM5gA5zg5E20MJv3799VB0a78XpRQkyY27Hblg7Q4dsMt7zH9AL5RfZxt6lIA1 Rfkg== 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=lESAI44jK8lmdOmkk5nFnrQMYUILCez8k/el0obunUU=; b=M3Ox7whbaMeJ3qM48tMoSQbd8ThT0p+LPHZJ9xZdxZ0oEm4rf3Hv0+oFIdIMEXFh/e Y18LETq8R1TaHpx3ZvIQoJ85GKMKf6lFeZAgHCohNa/zGHUbBovNHIezNxtAzqtAdsRw nsANDoNEjKVQ760A78znyhzU8woD9z6gWs6faRZzvgJFCnQwuuvnHU8f01J28mlzoRdy T7Psq18VsAzc3B5Ne5cUBBHs94LrDBueOzOrNEX0fhogBbL2Bf/2eLl0MEZ6bv89Gy84 TlGRTAk5rW0jstK1q8oHE7mh1O/Pa8DoYhMXA6RgX4Af+M6JD+1yTFuoYpjcBl/OpmKg L03A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=cbMzcV5C; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id az9-20020a056a02004900b00513973cb8b8si8939574pgb.202.2023.06.07.08.22.46; Wed, 07 Jun 2023 08:23:01 -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=cbMzcV5C; 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 S239408AbjFGPB5 (ORCPT + 99 others); Wed, 7 Jun 2023 11:01:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241010AbjFGPBt (ORCPT ); Wed, 7 Jun 2023 11:01:49 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A9741FCE for ; Wed, 7 Jun 2023 08:01:46 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-651e298be3fso7364855b3a.2 for ; Wed, 07 Jun 2023 08:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686150105; x=1688742105; 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=lESAI44jK8lmdOmkk5nFnrQMYUILCez8k/el0obunUU=; b=cbMzcV5Cw0osxGhAezosV9ljOtfaU9OauaLrcoXOALU+qc8nULFnG/ku+12tzlgADH qPCtrcZBg2u6SAkBXAI5C4y/Vq307naZ74laDdP73+HpvrSGIVNDDf9DxCeWpSrJ5c4j aYQ5/YgPo0eOCDV1nNnyZ3g6V8YglQUhj0xAvVW/e7k8/9kkb6Bp1ZTRotED90hNfwAK K+Dw0rTLraaaM/2eCqM6LfGyCq8foEIXJWSzK0qtdhIo5FW4xOMhvO5U7aqaMTe0mjGJ JySf/nps6k3eb4pfLtp0Qp+qlg2uE1XDnziSfUWAkXm0cPJ3lrLEV7hHcw6E22roPNTt zSGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686150105; x=1688742105; 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=lESAI44jK8lmdOmkk5nFnrQMYUILCez8k/el0obunUU=; b=JhpOzB7BmsEzbsr3WvVoZTFuJyqnfu6dosy4i9jilkdJ2rqe7aKy7OE3r5iskvgtP6 MOCHVfG8iDhfbcre1XhxDGap54SuMeQpgDaJ3Skt8sTSGdXDeb3LdBUZUBntoo7a8/P2 pCJBH2Hz6MN5KRpxC3BmBe08NoHbZ5YoyhHQ9NgDGgM/rmah+5PMnIHk0d5q2gU9mKPI /YtVCChbFOegFRkIKbcBfeiT4eECgZhazusaGpXQofp+rhlAjrnhXzN1FMVbZw2MW9Su 72WY21vTvqBHO9E2w3+c+9OhLtkTH3ZU2esf7603HgdLhHoeFbckPEJONLF2TfOvcKhn J/sw== X-Gm-Message-State: AC+VfDyvIkzdNqNIr8e2/OY7/8Ol296Y0Hp8/Ijq7CDmwWl1CL2edWBs WRrwGpJLPA9tAhoeKo3boPE= X-Received: by 2002:a05:6a00:1782:b0:662:56b4:c2f2 with SMTP id s2-20020a056a00178200b0066256b4c2f2mr1648793pfg.25.1686150105470; Wed, 07 Jun 2023 08:01:45 -0700 (PDT) Received: from yogi-Zephyrus ([103.251.210.211]) by smtp.gmail.com with ESMTPSA id c14-20020aa78e0e000000b0063d24fcc2besm8523788pfr.125.2023.06.07.08.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 08:01:45 -0700 (PDT) Date: Wed, 7 Jun 2023 20:31:41 +0530 From: Yogesh Hegde To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] staging: rtl8192e: Remove variable SetWirelessMode Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768057198548184898?= X-GMAIL-MSGID: =?utf-8?q?1768057871484611350?= The variable SetWirelessMode is set in only one place throughout the driver. This patch removes the variable and calls the real function directly instead, eliminating the unnecessary indirection. Additionally, the removal of the variable aligns with the checkpatch guidelines by removing the use of CamelCase. Signed-off-by: Yogesh Hegde --- v2: Removed the variable and called the function direction instead of just renaming the variable as suggested by Greg Kroah-Hartman . --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtllib.h | 1 - drivers/staging/rtl8192e/rtllib_softmac.c | 16 +++++++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 17b70dde7eeb..bbe0864e1348 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -716,7 +716,6 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->check_nic_enough_desc = _rtl92e_check_nic_enough_desc; priv->rtllib->handle_assoc_response = _rtl92e_handle_assoc_response; priv->rtllib->handle_beacon = _rtl92e_handle_beacon; - priv->rtllib->SetWirelessMode = rtl92e_set_wireless_mode; priv->rtllib->LeisurePSLeave = rtl92e_leisure_ps_leave; priv->rtllib->SetBWModeHandler = rtl92e_set_bw_mode; priv->rf_set_chan = rtl92e_set_channel; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 4aa5ce9f7792..68a3b8af3119 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1710,7 +1710,6 @@ struct rtllib_device { enum ht_channel_width bandwidth, enum ht_extchnl_offset Offset); bool (*GetNmodeSupportBySecCfg)(struct net_device *dev); - void (*SetWirelessMode)(struct net_device *dev, u8 wireless_mode); bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev); u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee); void (*InitialGainHandler)(struct net_device *dev, u8 Operation); diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 7c4cba6dcf46..ed171eca4916 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -19,6 +19,7 @@ #include #include #include "dot11d.h" +#include "rtl8192e/rtl_core.h" static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl); @@ -1503,7 +1504,7 @@ static void rtllib_associate_complete_wq(void *data) netdev_info(ieee->dev, "Using G rates:%d\n", ieee->rate); } else { ieee->rate = 22; - ieee->SetWirelessMode(ieee->dev, IEEE_B); + rtl92e_set_wireless_mode(ieee->dev, IEEE_B); netdev_info(ieee->dev, "Using B rates:%d\n", ieee->rate); } if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { @@ -1687,14 +1688,12 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, (ieee->modulation & RTLLIB_OFDM_MODULATION)) { ieee->rate = 108; - ieee->SetWirelessMode(ieee->dev, - IEEE_G); + rtl92e_set_wireless_mode(ieee->dev, IEEE_G); netdev_info(ieee->dev, "Using G rates\n"); } else { ieee->rate = 22; - ieee->SetWirelessMode(ieee->dev, - IEEE_B); + rtl92e_set_wireless_mode(ieee->dev, IEEE_B); netdev_info(ieee->dev, "Using B rates\n"); } @@ -2276,11 +2275,10 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb) } /* Dummy wirless mode setting to avoid encryption issue */ if (bSupportNmode) { - ieee->SetWirelessMode(ieee->dev, - ieee->current_network.mode); + rtl92e_set_wireless_mode(ieee->dev, ieee->current_network.mode); } else { /*TODO*/ - ieee->SetWirelessMode(ieee->dev, IEEE_G); + rtl92e_set_wireless_mode(ieee->dev, IEEE_G); } if ((ieee->current_network.mode == IEEE_N_24G) && @@ -2615,7 +2613,7 @@ static void rtllib_start_ibss_wq(void *data) } ieee->current_network.qos_data.supported = 0; - ieee->SetWirelessMode(ieee->dev, IEEE_G); + rtl92e_set_wireless_mode(ieee->dev, IEEE_G); ieee->current_network.mode = ieee->mode; ieee->current_network.atim_window = 0; ieee->current_network.capability = WLAN_CAPABILITY_IBSS;