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);