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; From patchwork Wed Jun 7 15:02:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Hegde X-Patchwork-Id: 104570 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp279850vqr; Wed, 7 Jun 2023 08:23:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ51znwIozvPCSRk65gso5FygoncEAAZeCs8XkFWXzgdyG6UPkdS3YtnDcQJtwuCDhj6SGeF X-Received: by 2002:a25:216:0:b0:b99:f8a2:85bc with SMTP id 22-20020a250216000000b00b99f8a285bcmr6243061ybc.22.1686151420493; Wed, 07 Jun 2023 08:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686151420; cv=none; d=google.com; s=arc-20160816; b=YUIEEG2vSP2jgU93reGXpVcYM9Pap8tcLAbX+Uy1ufondqkz1oQJoP1GCi5onWgenS ZDrsS5cThUdb9e8z2BZPaMu8fNiZi10EZESlC64X3apO5hVCb8/fJ1So0LF+9WNlVcZn 5kekscq5YjVG+o5iodTuB52lRWgNFe6zkUKFuYP/bWOv+DMFHSx134x7gW5ZaE47sSlC AfdOTlhUkQlHxvtjJ2xzgBqOPDdkAaAS/dYLmIuRm2+fl0W8QzCSti7zedgCfGX5nZkz 72bJsEoUwnI/htX8P51SntOQt5BFtuWKSJnxqJvvXlje5HqMXHmBTr9YDHlHXAaqyJ97 SFYA== 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=zG5lPa3pt3CBh78GFYF12trQ1TmiLPYaWhXfF67zHG0=; b=H8rJ4pMD7lub9MhrMiKBFIhZQvcdBhyNU0SxBO5EaJjm5U62xlwDLoeMja5K9FwURO B4RmmauFTYPWAD/HYUlFmlmqCxsmK6yNGd6yWtpKru3b7cD+gurfvSRdYJyjpDk9mnz7 qP37lioNB40mmElKxONO2BuL3LBizohYYf1jv5Qgl41g49UvTBNSlcAd3bfufNxogz+l ONJc5TKI9i22UUviIXZBiSsXXCIIZeG3g+LILOPJAKpbZLPwNAlKQdqzrrylT1nqWMdc spQEMhZ00LY4DYpAlf4paFfla/4kTsaLNBJrgzGVdzjCSr4H/xYbpY2Rorig8rldtoL5 1Pmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=fvS9ICf7; 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 em3-20020a17090b014300b0024e2afd72a3si1180108pjb.182.2023.06.07.08.23.25; Wed, 07 Jun 2023 08:23:40 -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=fvS9ICf7; 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 S239729AbjFGPCb (ORCPT + 99 others); Wed, 7 Jun 2023 11:02:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241181AbjFGPCS (ORCPT ); Wed, 7 Jun 2023 11:02:18 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6360B2101 for ; Wed, 7 Jun 2023 08:02:12 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-65314ee05c6so3535154b3a.1 for ; Wed, 07 Jun 2023 08:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686150131; x=1688742131; 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=zG5lPa3pt3CBh78GFYF12trQ1TmiLPYaWhXfF67zHG0=; b=fvS9ICf7N5XMNdzgrh45C2R3ReuaMK6GJBriQnHXs0Czvd5kFAFdhB2MeUD11cgxww Y9juJb9+7UyrACHWPXzuyF4j3BtDCEnCpxOEaD2Zmn9+xYt9zKPCyhS54JSo3FJpeLtD paBmgmY+Og8RqX9BHdfL7KguvfxIsK8DXboc8CvH4tz1gk1kL3gfaV/0k8lRJ9dseVkO ZTay6y56HSk2Vag9sf3Ok3MqubW3yh8OX67pXgHoxS5tT14V7YcJtrZx3MQ6QiS2j0WD 3ZOJvzK9jx7W0SFciPjJKsXqQFJjoNS2M9F8oxFpLfC5QZNxiJDwxNXvLkFothhoTuOf V7yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686150131; x=1688742131; 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=zG5lPa3pt3CBh78GFYF12trQ1TmiLPYaWhXfF67zHG0=; b=eejv+j4EK9Hx0fqcq9yxXCKmWhI38AJ49iPA+BUuduSlgtFkymrKIgxpUu2IYadT0R oVONjTE4MD2bY2eJADSaGZyEKst5hBnQvLHl7i3EveiseA0S2DEdqdJmAp5+mYTBiyEr X9xlZ3gPRGtWcd1anHuk+j7e5uuk4r4CwVmgzkF5VQEb56KBUFZoFrCD4g6ozG9gIfiU j9j+4/U5y00Vdvky9bMAie1njKB6sy8NHesz/1605rwBcdqcvbBOyRYNEZD1uz9bXcqi 2apsOuju33X2AU47+IIlwr6/gQsDRSX04nxCzeHU/g4+Eo9d7hyZDw+FyNLsHIxVsM+L RWog== X-Gm-Message-State: AC+VfDwdzWXGw0HenlOccPJ7mCt4LInSzFkZOE6nMgSKsVyyAj6PaQw8 5JuqJfzxC1l6UsejpEevY+k= X-Received: by 2002:a05:6a00:2284:b0:64d:6c6f:84f2 with SMTP id f4-20020a056a00228400b0064d6c6f84f2mr3234856pfe.19.1686150130489; Wed, 07 Jun 2023 08:02:10 -0700 (PDT) Received: from yogi-Zephyrus ([103.251.210.211]) by smtp.gmail.com with ESMTPSA id c14-20020aa78e0e000000b0063d24fcc2besm8524214pfr.125.2023.06.07.08.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 08:02:10 -0700 (PDT) Date: Wed, 7 Jun 2023 20:32:06 +0530 From: Yogesh Hegde To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] staging: rtl8192e: Remove variable SetBWModeHandler Message-ID: <0af9595916447a28e27c249f3696fe107382ca53.1686149467.git.yogi.kernel@gmail.com> 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?1768057912345340704?= X-GMAIL-MSGID: =?utf-8?q?1768057912345340704?= The variable SetBWModeHandler 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/rtl819x_HTProc.c | 8 ++++---- drivers/staging/rtl8192e/rtllib.h | 3 --- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 6 +++--- 4 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 bbe0864e1348..6f6c31344441 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -717,7 +717,6 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->handle_assoc_response = _rtl92e_handle_assoc_response; priv->rtllib->handle_beacon = _rtl92e_handle_beacon; priv->rtllib->LeisurePSLeave = rtl92e_leisure_ps_leave; - priv->rtllib->SetBWModeHandler = rtl92e_set_bw_mode; priv->rf_set_chan = rtl92e_set_channel; priv->rtllib->start_send_beacons = rtl92e_start_beacon; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index fe30a291e64c..ad92a8230055 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -6,6 +6,8 @@ */ #include "rtllib.h" #include "rtl819x_HT.h" +#include "rtl8192e/r8192E_phy.h" + u8 MCS_FILTER_ALL[16] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 @@ -835,12 +837,10 @@ static void HTSetConnectBwModeCallback(struct rtllib_device *ieee) ieee->set_chan(ieee->dev, ieee->current_network.channel); - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, - ht_info->CurSTAExtChnlOffset); + rtl92e_set_bw_mode(ieee->dev, HT_CHANNEL_WIDTH_20_40, ht_info->CurSTAExtChnlOffset); } else { ieee->set_chan(ieee->dev, ieee->current_network.channel); - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, - HT_EXTCHNL_OFFSET_NO_EXT); + rtl92e_set_bw_mode(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); } ht_info->sw_bw_in_progress = false; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 68a3b8af3119..d22a586043f2 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1706,9 +1706,6 @@ struct rtllib_device { /* check whether Tx hw resource available */ short (*check_nic_enough_desc)(struct net_device *dev, int queue_index); - void (*SetBWModeHandler)(struct net_device *dev, - enum ht_channel_width bandwidth, - enum ht_extchnl_offset Offset); bool (*GetNmodeSupportBySecCfg)(struct net_device *dev); bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev); u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee); diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index d85a32d2d050..9fb4fee93990 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -15,6 +15,7 @@ #include "rtllib.h" #include "dot11d.h" +#include "rtl8192e/r8192E_phy.h" /* FIXME: add A freqs */ const long rtllib_wlan_frequencies[] = { @@ -359,8 +360,7 @@ void rtllib_wx_sync_scan_wq(void *data) b40M = 1; chan_offset = ieee->ht_info->CurSTAExtChnlOffset; bandwidth = (enum ht_channel_width)ieee->ht_info->bCurBW40MHz; - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, - HT_EXTCHNL_OFFSET_NO_EXT); + rtl92e_set_bw_mode(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); } rtllib_start_scan_syncro(ieee, 0); @@ -372,7 +372,7 @@ void rtllib_wx_sync_scan_wq(void *data) ieee->set_chan(ieee->dev, chan - 2); else ieee->set_chan(ieee->dev, chan); - ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset); + rtl92e_set_bw_mode(ieee->dev, bandwidth, chan_offset); } else { ieee->set_chan(ieee->dev, chan); } From patchwork Wed Jun 7 15:02:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Hegde X-Patchwork-Id: 104575 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp280718vqr; Wed, 7 Jun 2023 08:24:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oHC7Ql/MalktJuELNILCf7FGNKYn3UyuctwBy+kOV/WucCTc7NSoZOWbFYJv9g+DQA0LQ X-Received: by 2002:a05:6808:148:b0:398:5aee:77f7 with SMTP id h8-20020a056808014800b003985aee77f7mr3538924oie.12.1686151499049; Wed, 07 Jun 2023 08:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686151499; cv=none; d=google.com; s=arc-20160816; b=hqdu0Ck8grrgYN7LhPzUvb0Bs1JnZNU9L83Qbl+GelhAIUxfzMyOdIhb0HhQkllMg6 HpSDy/o2J4zgconuU262nOjpEGtndat1vd4a/iOZ7pjJH7Qk9JpSjiz7PgaeBibou5xJ 8SwoyS7Zdu8/aMB/Vsj3HTm3CSmjPUp0utq60v5Y6TtY/gJViQZ4cPieeLIqoGZ8iCLt 2WNy1TX2p5N2oh5YnQ+/rP2ZVw9Seu9nYKeg5HPIo4JJfLHj2puOEH4MaAJlFHA4ViKV jQUnVTCqi7PGuLDLrp4p9+j4RvqMvKvB4VGPQPHXGzVxvbdDE9Aof3F4tx7X7NEvSalu z4Dw== 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=b2ADMSx2umuqEvoBHVVXSUc2jdp3ipOUY5DdCNizpaM=; b=p7NF9P9apBPFjIBkRNw8I913b5a7UoEaB6oiSIOT+ZNvrhmoLgA1nCBq/2YtCXYVvJ ATYbe/SueEdxLYhPGvpGs0Hvrt9uNbNd2iXQZ+XSk4EWrO3VJK2gL5dB1MZtJrWZofdq /XLy7Pru3RFPjHs4O7CiQfXJki7roLsAYxsH0s3Vd1dFul7vehzEtnHxJyyoU8TxA1Gg HmmhunIR5KWTLTmRTUegdBT2TnWelCs59ReYK0b5FwKqIS/fHY4xhmjsk78gJ+E4xZJs beNunhcODH0tYmogX9ibPX7kqMWCG7j7qtCOtQZZw3w7XNJbz+fJOqltDTdw0vUpE0d0 nnow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ij1M2eNT; 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 oj14-20020a17090b4d8e00b0025698fca606si1243059pjb.109.2023.06.07.08.24.44; Wed, 07 Jun 2023 08:24:58 -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=ij1M2eNT; 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 S240463AbjFGPCt (ORCPT + 99 others); Wed, 7 Jun 2023 11:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241248AbjFGPCh (ORCPT ); Wed, 7 Jun 2023 11:02:37 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D18C91FCE for ; Wed, 7 Jun 2023 08:02:35 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-653f9c7b3e4so3246891b3a.2 for ; Wed, 07 Jun 2023 08:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686150155; x=1688742155; 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=b2ADMSx2umuqEvoBHVVXSUc2jdp3ipOUY5DdCNizpaM=; b=ij1M2eNTekSpxOUXRRF9mkoieb28xM8pDUyZvBwBHImPB/I8Dh23nA6BKXriRZHOBg sN2xUJ/8QIlJ3TOJ4LHh7Nz9FwqHC9qwA3Lt5DYd25lREOJbFEmRZCt1Z5C6R1IlcyLk wpKi9BygFhPohF7qI3PN5gFtAjf2yYO43QCg8CeHezxHbMn7CwFoeebEAKX29SS0s1gq k3ZP+QvEFKva1gko2SCEDopH92454YqJg4kie+gIAe1khkRCTDgkFUWs1KSWw17vYoqS deL5iF59WFlekjH6IXXOuVu/kx1IJlI87ByglKBI3h96jl4TicMuN/L38X+cBA+RkLo3 7G9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686150155; x=1688742155; 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=b2ADMSx2umuqEvoBHVVXSUc2jdp3ipOUY5DdCNizpaM=; b=ZX4emvEyGVzzgNksHJ5yiOmgt9fnfjTWfpQ+y/4MuRGPxSM7ta3Ra5AkCRA1lbiG93 r/s6DTCEjE1fpP4ZYouZnj0tPiEd5KHow3jM5M2shs0/fYU0MW7Z2Q7ZLgnjtWt6ODEw a4lcnnY/nOBqq12fB0rE8mv27h5vvH8SyIJeyto9Md23/WRsNDv/N7UZhbVnkIHZfuaD D/pgIyKeFP9ueIEBriltvd1TyX5/UfeFuCxhCJsMW7pUxdei/+zoakrvPaHPDZS5gsC7 q/8TtE0RXL8m4Qw4QEpQCwmOR+rFBF54gSuJ5VTq9VOeHKwNXycOVIMvAXU6yWxaC4R2 D+Pw== X-Gm-Message-State: AC+VfDxNR3eb6i515MRL2HLm35CyIrCkcGjZ5r7hzCK2XbSG/kHKCM5+ 0IGvQ4HUtCsj6qtAO2UWlV0IGrDKMOw= X-Received: by 2002:a05:6a00:b8a:b0:654:9d3a:f970 with SMTP id g10-20020a056a000b8a00b006549d3af970mr4634432pfj.31.1686150155142; Wed, 07 Jun 2023 08:02:35 -0700 (PDT) Received: from yogi-Zephyrus ([103.251.210.211]) by smtp.gmail.com with ESMTPSA id y24-20020aa78058000000b00634dde2992bsm2300379pfm.132.2023.06.07.08.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 08:02:34 -0700 (PDT) Date: Wed, 7 Jun 2023 20:32:31 +0530 From: Yogesh Hegde To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] staging: rtl8192e: Remove variable LeisurePSLeave 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?1768057994405860799?= X-GMAIL-MSGID: =?utf-8?q?1768057994405860799?= The variable LeisurePSLeave 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_rx.c | 3 ++- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 6f6c31344441..231903002233 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->LeisurePSLeave = rtl92e_leisure_ps_leave; priv->rf_set_chan = rtl92e_set_channel; priv->rtllib->start_send_beacons = rtl92e_start_beacon; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index d22a586043f2..f7fd8b77db99 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1719,7 +1719,6 @@ struct rtllib_device { void (*rtllib_ips_leave_wq)(struct net_device *dev); void (*rtllib_ips_leave)(struct net_device *dev); - void (*LeisurePSLeave)(struct net_device *dev); /* This must be the last item so that it points to the data * allocated beyond this structure by alloc_rtllib diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index d44bf261de54..d8acede4b808 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -35,6 +35,7 @@ #include "rtllib.h" #include "dot11d.h" +#include "rtl8192e/rtl_ps.h" static void rtllib_rx_mgt(struct rtllib_device *ieee, struct sk_buff *skb, struct rtllib_rx_stats *stats); @@ -1212,7 +1213,7 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast, if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + ieee->link_detect_info.NumTxOkInPeriod) > 8) || (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) { - ieee->LeisurePSLeave(ieee->dev); + rtl92e_leisure_ps_leave(ieee->dev); } } } diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 9fb4fee93990..07c46ad4f20e 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -16,6 +16,7 @@ #include "rtllib.h" #include "dot11d.h" #include "rtl8192e/r8192E_phy.h" +#include "rtl8192e/rtl_ps.h" /* FIXME: add A freqs */ const long rtllib_wlan_frequencies[] = { @@ -341,7 +342,7 @@ void rtllib_wx_sync_scan_wq(void *data) chan = ieee->current_network.channel; - ieee->LeisurePSLeave(ieee->dev); + rtl92e_leisure_ps_leave(ieee->dev); /* notify AP to be in PS mode */ rtllib_sta_ps_send_null_frame(ieee, 1); rtllib_sta_ps_send_null_frame(ieee, 1); From patchwork Wed Jun 7 15:02:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Hegde X-Patchwork-Id: 104571 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp280360vqr; Wed, 7 Jun 2023 08:24:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nx+oRvV0ZRV+22MYRCq6FbdXlpmEYV5s2hDsdHVHIpdQiPOIWbAMGAr1WROPUGcm1YZg+ X-Received: by 2002:a05:6a20:6a03:b0:101:5743:fd01 with SMTP id p3-20020a056a206a0300b001015743fd01mr4267934pzk.25.1686151461865; Wed, 07 Jun 2023 08:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686151461; cv=none; d=google.com; s=arc-20160816; b=HbBddd07qUW/6m+Fs8i/1/HOLHrZF32t2SGFUCmV+h7dxFeLyrrC3zuZpqmebkSIaW 0GhKrIyR5FFYAzpKnKt3WwchEQhbV4nxvXX2F7U3XQEs2f32j/MEtHWxIDvYV9tYpBVz K6QxcpdrK0+S5F2YVsKHEyTWEok0SPutLBwiEc5G60NqrcGlnDF15UYCCdbAx2DfwmaL LcaHZtKqM+11zLmh4bxHUDFHFJjjITu7ChzBEyUkZH6uktrKXU4AXo6O9ibky+MaMX4r /7/KnpMy/mX9ghotP3CZDZR1qXeafaQimz7weOZdR08/MVol3YWN6cyQ1pUKzeXE3j4a na/A== 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=ciCWuo7mkukE2uWGAYr6I0+J8XwMl63aYshkUdvmROQ=; b=rUxXavCNer4J3s9JWIhS3gkNvYS4osLzu+5/YxXkKk3H9d1hp41QLY+eRI4DGVuB8o FOOWSfi7kGEa2MojkNxSUxPSDqm3xg9ouW7d0c4Db+ix+AY3DNKI1etyGiMDbTst46K5 hAh/q5UL8P9KVFB8iP8Su87m4BSIxFajC12M4xQNDV6FapzhlYyzTUwH7XW5Jn5NOR2O AsoxbzyER9Bt5h+rL6DyAx3OUvVrWgSvhlyWSNXQXfbuXxBwbMkpNVcj1KkP8N0b/Ejo /6945RaSSB8FfPO4zyWFYO8hmIGCCz2oW7/iSDfDaNmr5qgw0AEsCjxr/ng4maronrJk xaGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=VCxEtwdU; 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 q3-20020a656a83000000b00543a6ba4a98si5883873pgu.228.2023.06.07.08.24.05; Wed, 07 Jun 2023 08:24:21 -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=VCxEtwdU; 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 S236333AbjFGPFH (ORCPT + 99 others); Wed, 7 Jun 2023 11:05:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241249AbjFGPC7 (ORCPT ); Wed, 7 Jun 2023 11:02:59 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C47821FC1 for ; Wed, 7 Jun 2023 08:02:54 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso6713282a12.3 for ; Wed, 07 Jun 2023 08:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686150174; x=1688742174; 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=ciCWuo7mkukE2uWGAYr6I0+J8XwMl63aYshkUdvmROQ=; b=VCxEtwdUm8HLNHQcljdU0bHwGkU554jQ9c9dorWKjf7VEN+f0JQeiDrT0d8aIgdBoN ssCPxv4w0oIcMiuOB25ZSy4jxoJc6BdNi0gjR8oJ9T2tSRYX8CxiR4GZck0qC3LvU1mc 2wtdVzce0PnIs7CErGRS3EP8l4VAFSeIao8Y+HNAJKGZc6oK/nvcPgrOb9f1rVpyih7I hqU0Mv2k0lVHOjN/vKKaGgJ/S4nxQaPDZR+fCrLJKS/pcSZRASNWCdjLhuLjl/DU+y+I VEeqg185Kio6zQl52dkxPSPNtJ/AoKjAwZo7Zj03NO044l57kDn0+PMAVtvsEt6Sztls 3n/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686150174; x=1688742174; 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=ciCWuo7mkukE2uWGAYr6I0+J8XwMl63aYshkUdvmROQ=; b=eyfvK0X61P5Gz/cOl5e+aoNB+XtAhOfxVXMwWZsBJVznBa09RqKA5Y9fdo69S9ZB+R Eyqmpmnt8VoSI2WQvBMmEXta5Evrxdj5O57c7U7nIq2yvVBxGtCcYfmJyuSg4NquJ2QK M34+clsN3/Vt3WbebGh7wjjn8tNsM/oJh+nobcfxXNBUks4q1sRkbj7iQv/GVGHtlCzC CXmYfgZwwmap4r9Z05POoqIT0iXSuWBNigQR2o2Fu7zkrBmtg6l3oClNxEzG8ZojftaG dKZnusMg3GctGl2LnJeuR2kgnNf1FKlLtpquxCugQel/tyMgOB3wG3M/0L5yMyBvz7j4 glNA== X-Gm-Message-State: AC+VfDwAo8gL6iZBjN4GYaz7iV+hL8H4BAkg0MTtv0uPZcP83ZHB0dKo KCE9G1MLXn2xna0gh8o6M80= X-Received: by 2002:a17:90a:598b:b0:253:26e5:765a with SMTP id l11-20020a17090a598b00b0025326e5765amr4456240pji.48.1686150174229; Wed, 07 Jun 2023 08:02:54 -0700 (PDT) Received: from yogi-Zephyrus ([103.251.210.211]) by smtp.gmail.com with ESMTPSA id nn4-20020a17090b38c400b002562cfb81dfsm1486061pjb.28.2023.06.07.08.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 08:02:53 -0700 (PDT) Date: Wed, 7 Jun 2023 20:32:50 +0530 From: Yogesh Hegde To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] staging: rtl8192e: Remove variable InitialGainHandler Message-ID: <15852c9ce64695e60b8dfa3d459ad5b1d26ba07e.1686149467.git.yogi.kernel@gmail.com> 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?1768057954953866509?= X-GMAIL-MSGID: =?utf-8?q?1768057954953866509?= The variable InitialGainHandler 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/r8192E_phy.c | 4 ++-- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtllib.h | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 641e993aaa86..5385bb099c56 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -1129,11 +1129,11 @@ void rtl92e_scan_op_backup(struct net_device *dev, u8 Operation) if (priv->up) { switch (Operation) { case SCAN_OPT_BACKUP: - priv->rtllib->InitialGainHandler(dev, IG_Backup); + rtl92e_init_gain(dev, IG_Backup); break; case SCAN_OPT_RESTORE: - priv->rtllib->InitialGainHandler(dev, IG_Restore); + rtl92e_init_gain(dev, IG_Restore); break; } } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 231903002233..8218319ad834 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -731,7 +731,6 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) priv->rtllib->SetHwRegHandler = rtl92e_set_reg; priv->rtllib->AllowAllDestAddrHandler = rtl92e_set_monitor_mode; - priv->rtllib->InitialGainHandler = rtl92e_init_gain; priv->rtllib->rtllib_ips_leave_wq = rtl92e_rtllib_ips_leave_wq; priv->rtllib->rtllib_ips_leave = rtl92e_rtllib_ips_leave; priv->rtllib->ScanOperationBackupHandler = rtl92e_scan_op_backup; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index f7fd8b77db99..92ed1b493f6b 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1709,7 +1709,6 @@ struct rtllib_device { bool (*GetNmodeSupportBySecCfg)(struct net_device *dev); bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev); u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee); - void (*InitialGainHandler)(struct net_device *dev, u8 Operation); void (*ScanOperationBackupHandler)(struct net_device *dev, u8 Operation); void (*SetHwRegHandler)(struct net_device *dev, u8 variable, u8 *val); From patchwork Wed Jun 7 15:03:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Hegde X-Patchwork-Id: 104603 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp301816vqr; Wed, 7 Jun 2023 08:58:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5iDmg/rgEk2Fe35CjRn504jVg/LK9vC0R7cXFsS57DoCzVdB+CzhZOqfGtpbegJkGteaX8 X-Received: by 2002:a05:6a00:a82:b0:647:e45f:1a4c with SMTP id b2-20020a056a000a8200b00647e45f1a4cmr2298313pfl.11.1686153528255; Wed, 07 Jun 2023 08:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686153528; cv=none; d=google.com; s=arc-20160816; b=pyQP7CNIEjWhaPVqcbeMLmYGmPlWOgzM8jgDpP99Jz8deTR0F3yRo2ZuFuaBv17Nd5 KOJmV66jC3fiLTwC3GQlJRWdfZpEIlV1jy9YAASLjro8gGvb+yDEiXGR3gbBGI3LnT9S uXoMVWCynk4we8pRPVbtDv7A+vCZnFkGY78k4gWp1/zPXI6MFe3cjv+eZ+3lBrC+UbW9 xj3uVNrBZx2xTR+LquZfFplHfjNCWMmDbeDm8mmFJD7uLEncCQCluSM8gDtWwPaKJksa CyXjFWqd9FgQFmMex2gjzHLgw7sjB3v7i+JFz9Tne1LjABAQgBwvIlHF/DQUd0+AhOYZ WKcw== 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=Msfw3FZTKqUZwLFrkysjS96Cdf9AFaQ0r06ieq0j1EI=; b=gRcBtrDa9f0jYTzaIAmmrlJkQWE46jfVu+Js1C5yZoJWpZvXscx3BjeNuyJ9/iezrZ bk7hiia6CBQQlWKc5/eqdJqTBf+XrloAqK2IxRvz49cxAxYr5TPgf1gaA2wyGhLUkh2p iVJsE6/HOwDse0ZTywGUbm+pe6Q+kJwcthybxtiDe97K9NpCPgXs556GelzRgu5GjFaQ /l8DQdNgamInUvWkZIJBTUVnSklq73nYzDs30NOMrG4WFHQq92l+yJTQSq/zRDeKWvMb 3TcfQ89DGOnYG2uvq3Fmw2vHZJI43afFy3wFJ1tsl5/pA60gIHQngDMWHeQIrbIaLhoJ yWIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="ae8/YKfo"; 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 y23-20020a626417000000b006620f8fae9asi1096548pfb.371.2023.06.07.08.58.34; Wed, 07 Jun 2023 08:58:48 -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="ae8/YKfo"; 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 S235775AbjFGPDX (ORCPT + 99 others); Wed, 7 Jun 2023 11:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235973AbjFGPDN (ORCPT ); Wed, 7 Jun 2023 11:03:13 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 719411FF7 for ; Wed, 7 Jun 2023 08:03:12 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-662b85f4640so146604b3a.0 for ; Wed, 07 Jun 2023 08:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686150192; x=1688742192; 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=Msfw3FZTKqUZwLFrkysjS96Cdf9AFaQ0r06ieq0j1EI=; b=ae8/YKfoLrOaxVyfBu/iJH3C6PAtvFYaQurwvNiYf1D9kRVaGAfUs0+4s1rxmS0/f1 QAWo9JqKmCam0wf0B/CDYNnWcMId90CBErwYs1nGzPp6KLjyfu/699sLJqpmxt44Ju2j y3EvTLYYI9qZZKAJEawMh9XwfYCBcNYwTt/kJGrhTlbB+GTP+xgjgi3dW9JE74V1jvPM rktd/zKC2Ndwf0oe7MKoP0os2CLh4V3jyJRzSrZNZftsDfqNwp1+siCwC2y1pw4Nn3Bh I/ZlWvthFgDf27Ix00KcIyLDulsUnkl4rWRBXM1+FZIOMt/KRPwxvapLDLA0E/0P60z6 R2ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686150192; x=1688742192; 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=Msfw3FZTKqUZwLFrkysjS96Cdf9AFaQ0r06ieq0j1EI=; b=TO3zJ7cVBz0ItF300BrMDwFdrN12vbLRc/doY5BC/GT17r5KTCR4tsmAhFsioe/Fvv K7BcOHwDiU3rCOEbFAWTQuIoYt8VXDQfG4hRe6ugZCE/44AKP49JdKIhbAE9nhZlyIUZ 6Oei7N+Sr4vSCN04yR+fE7rHPxUlN63t4Ago1enpskkH33gx5/RP7w0v9BqkwVsklhbe rkg9XBhEJR74kHywNUAn/Iauc7F2inA07h6pi/9midTWaLjduAgultfktgTLZ76wQLkD 184wLYW3k3UZ7DVn6RR7EdxYlXGY2UjDHzl0SEf277MbIXFfom+OHkqH0cOuPVmIVUlM +lbA== X-Gm-Message-State: AC+VfDxG0JaNZ1z7sxHmE1xkqV+iNJmJrRvKiduyxp0Zkgug+mp/1Dls qWu1QVQElGYHVRDnm3fCcZw= X-Received: by 2002:a17:903:234c:b0:1ae:1659:bfe2 with SMTP id c12-20020a170903234c00b001ae1659bfe2mr2531711plh.34.1686150191792; Wed, 07 Jun 2023 08:03:11 -0700 (PDT) Received: from yogi-Zephyrus ([103.251.210.211]) by smtp.gmail.com with ESMTPSA id ld6-20020a170902fac600b001b04c2023e3sm10569143plb.218.2023.06.07.08.03.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 08:03:11 -0700 (PDT) Date: Wed, 7 Jun 2023 20:33:07 +0530 From: Yogesh Hegde To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] staging: rtl8192e: Remove DRV_NAME definition in rtllib_debug.h Message-ID: <41c6c24e703eedf6fb4febcf4cc7ef180af1db58.1686149467.git.yogi.kernel@gmail.com> 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?1768060121620606457?= X-GMAIL-MSGID: =?utf-8?q?1768060121620606457?= The macro DRV_NAME is defined twice within the driver, once in "rtl_core.h" and again in "rtllib_debug.h". The definition in "rtllib_debug.h" overrides the definition in "rtl_core.h", resulting in warnings during compilation. This patch removes the redundant definition in "rtllib_debug.h" to avoid the warnings. Signed-off-by: Yogesh Hegde --- v2: No changes. --- drivers/staging/rtl8192e/rtllib_debug.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_debug.h b/drivers/staging/rtl8192e/rtllib_debug.h index f6b23defe225..ab8bd5fc4ca0 100644 --- a/drivers/staging/rtl8192e/rtllib_debug.h +++ b/drivers/staging/rtl8192e/rtllib_debug.h @@ -9,11 +9,6 @@ #include -/* Allow files to override DRV_NAME */ -#ifndef DRV_NAME -#define DRV_NAME "rtllib_92e" -#endif - extern u32 rt_global_debug_component; /* These are the defines for rt_global_debug_component */