From patchwork Sun Nov 6 01:11:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Bai X-Patchwork-Id: 16055 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1259042wru; Sat, 5 Nov 2022 18:19:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YnZyQ2OkupmEQOx+zVbm63vWsGbiROYCKS4oqmEXFv80Vgj01/8qdoSImueVCXzYygA9E X-Received: by 2002:a17:902:ea0d:b0:187:3ad9:adc with SMTP id s13-20020a170902ea0d00b001873ad90adcmr25381512plg.7.1667697543984; Sat, 05 Nov 2022 18:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667697543; cv=none; d=google.com; s=arc-20160816; b=rnwDqcmJnjMx4q1Qu8wc+mWo2Bjk3ZjrjMF68NlLhnjIsgktTStJEavsHXWXNf20Xs sjMCo/fjCBOhpKukFs5+SK0BLTpSyoAiY68NhNmNwjrvPZJFF5CwgdQcvuFwCCE/17EM tAL4+0oJ76jzLF/xcfmhioSeA42xBxZqiXcdKFyOkpet1LVNfgNtoAEfNMH/1tm14J1x 0XOSEJwki9r5Uk4vLwt99UhxA+KoOI3ARNJ/mjxV3CSaW2lbeF0Jj1vYgp2eotVfXnrt dNwIK+evQ8J/M+q9BSHLVJzm1xEiAiJC12tLnqMX6ufVZTKLmvIAKmh2vmFEE5L5/8v8 3PXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JToYLUSSy/i5m9Py7IH/T54uqRiJj7SvKEgsJsBwYtc=; b=G/1v2yKU4ws7iXKiYQH34lKPJ462yHlfdGzqkYZffYnsahsAdxMuqnbDo6jOFI0ZIq RFBNI0nxL/rL9witnI+GlGIuWZgESB4bz4HNuYB8em7H30E990jO99ruK+LbUIuyYnRM HjGUIyXrSL1A1I93HrMyyP7vKkJhgJOXMpIYY2bDsmds19r8xfGAprgfsT8N07miTDVm xboNdrWaibPIgMUgYLSsRN7oT4r5O/81ich7PKh/5yfH2HWsceIYporeZYFIvekfPY6C 2sT2zWHEYuOP6YpafhcvMb4Tv6WamYTHO44bZBvumHM7CGcGY4PirVQKb2W277jKfgst R6vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="nXbPp/AM"; 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 k11-20020a170902d58b00b001865f8637a8si5033991plh.334.2022.11.05.18.18.50; Sat, 05 Nov 2022 18:19:03 -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=20210112 header.b="nXbPp/AM"; 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 S229608AbiKFBMH (ORCPT + 99 others); Sat, 5 Nov 2022 21:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbiKFBMF (ORCPT ); Sat, 5 Nov 2022 21:12:05 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54840B7DE for ; Sat, 5 Nov 2022 18:12:02 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id gw22so7606610pjb.3 for ; Sat, 05 Nov 2022 18:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JToYLUSSy/i5m9Py7IH/T54uqRiJj7SvKEgsJsBwYtc=; b=nXbPp/AMh7o0Q2A0+X5NJgL3T9bThZY7/7i7HS8rVo6kKjLjTn/FSRcAhYvB3W6jJH rNhQ5aHEiPF9TcpWiwnAa30VBvULLkG8uoOTt7BNVZ6jIL9lJrYnONOKH/qhA3J8Dxv8 9F+e3+Eeg+ukNXv5WAQZbljbSgvm4yqLTtPzv3mgjeU6vMfsWTFvmZEdppoY+KazwO1T KnebfvHO0Fm87p4RAOykSEyZdFJX8c+hKpX1ub8vHqBUxBH2c3bex04JO8j4XJCr9uqD dSCUWuPLFZU2GUPiLsEjs73vMCUyItsG5GYZl9qR5r8TaGsBsrZ4LM2ZpA+DN79rEyiK Y+xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JToYLUSSy/i5m9Py7IH/T54uqRiJj7SvKEgsJsBwYtc=; b=ThNV/S9dAeSPu0bK5NJU5LUaXGl8OzuS4zVpiFdCgZWhztkRMHMD7+liQM/fK54DGn Q5kwqlQz5cI5EnHfa7kvlLmw49V1hBbzPYHAHxUe+trSVJzlpZGo55ZnBnVAMUg2gVnU AZdvika3/77WR9w/LIDmW27wjjJYzG+40jpkV918GgxoQmtSx7qteoDWQfL1KHaYso6u NxyAYRUDBPa5a88+yNLcymMlqZtLpk3NqOvqisHXIQ2345/l51mN8st9oMQBemQVkz1u ku6Vatw5j3xxn/F8fk47Y/EvIKURA6mlhRMDPIdRHXKXl0HNm04ylfq1LWo99mxNCNea sflg== X-Gm-Message-State: ACrzQf0HTn6OPlmurpbRUij+3F7m+sTjonD6ZhnxmYJe/prmrM1dakYw 8NoLYs/DN8NuXQFU8Bo6jQo= X-Received: by 2002:a17:902:d4c3:b0:187:2b8:a4fa with SMTP id o3-20020a170902d4c300b0018702b8a4famr44532801plg.134.1667697121817; Sat, 05 Nov 2022 18:12:01 -0700 (PDT) Received: from jacob-Ubuntu (126.224.215.218.sta.wbroadband.net.au. [218.215.224.126]) by smtp.gmail.com with ESMTPSA id p27-20020aa79e9b000000b0052d4cb47339sm1823223pfq.151.2022.11.05.18.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Nov 2022 18:12:01 -0700 (PDT) From: Jacob Bai To: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Jacob Bai Subject: [PATCH v2 3/3] staging: rtl8192e: remove unnecesscary macro defines Date: Sun, 6 Nov 2022 12:11:45 +1100 Message-Id: <6cdf838429ca9b553fb572f55a53ec25fa4e5f6a.1667694826.git.jacob.bai.au@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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?1748707619802012326?= X-GMAIL-MSGID: =?utf-8?q?1748707619802012326?= remove useless macro defines Signed-off-by: Jacob Bai --- .../staging/rtl8192e/rtl8192e/r8192E_phy.c | 52 +++++++++---------- .../staging/rtl8192e/rtl8192e/r8192E_phy.h | 20 ------- 2 files changed, 26 insertions(+), 46 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index eabb4187d907..aad1842857c0 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -307,12 +307,12 @@ void rtl92e_config_mac(struct net_device *dev) struct r8192_priv *priv = rtllib_priv(dev); if (priv->bTXPowerDataReadFromEEPORM) { - dwArrayLen = MACPHY_Array_PGLength; - pdwArray = Rtl819XMACPHY_Array_PG; + dwArrayLen = RTL8192E_MAC_ARRAY_PG_LEN; + pdwArray = RTL8192E_MAC_ARRAY_PG; } else { - dwArrayLen = MACPHY_ArrayLength; - pdwArray = Rtl819XMACPHY_Array; + dwArrayLen = RTL8192E_MAC_ARRAY_LEN; + pdwArray = RTL8192E_MAC_ARRAY; } for (i = 0; i < dwArrayLen; i += 3) { if (pdwArray[i] == 0x318) @@ -332,14 +332,14 @@ static void _rtl92e_phy_config_bb(struct net_device *dev, u8 ConfigType) u16 AGCTAB_ArrayLen, PHY_REGArrayLen = 0; struct r8192_priv *priv = rtllib_priv(dev); - AGCTAB_ArrayLen = AGCTAB_ArrayLength; - Rtl819XAGCTAB_Array_Table = Rtl819XAGCTAB_Array; + AGCTAB_ArrayLen = RTL8192E_AGC_TAB_ARRAY_LEN; + Rtl819XAGCTAB_Array_Table = RTL8192E_AGC_TAB_ARRAY; if (priv->rf_type == RF_2T4R) { - PHY_REGArrayLen = PHY_REGArrayLength; - Rtl819XPHY_REGArray_Table = Rtl819XPHY_REGArray; + PHY_REGArrayLen = RTL8192E_PHY_REG_ARRAY_LEN; + Rtl819XPHY_REGArray_Table = RTL8192E_PHY_REG_ARRAY; } else if (priv->rf_type == RF_1T2R) { - PHY_REGArrayLen = PHY_REG_1T2RArrayLength; - Rtl819XPHY_REGArray_Table = Rtl819XPHY_REG_1T2RArray; + PHY_REGArrayLen = RTL8192E_PHY_REG_1T2R_ARRAY_LEN; + Rtl819XPHY_REGArray_Table = RTL8192E_PHY_REG_1T2R_ARRAY; } if (ConfigType == BaseBand_Config_PHY_REG) { @@ -668,50 +668,50 @@ u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath) switch (eRFPath) { case RF90_PATH_A: - for (i = 0; i < RadioA_ArrayLength; i += 2) { - if (Rtl819XRadioA_Array[i] == 0xfe) { + for (i = 0; i < RTL8192E_RADIOA_ARRAY_LEN; i += 2) { + if (RTL8192E_RADIOA_ARRAY[i] == 0xfe) { msleep(100); continue; } - rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioA_Array[i], + rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIOA_ARRAY[i], bMask12Bits, - Rtl819XRadioA_Array[i+1]); + RTL8192E_RADIOA_ARRAY[i+1]); } break; case RF90_PATH_B: - for (i = 0; i < RadioB_ArrayLength; i += 2) { - if (Rtl819XRadioB_Array[i] == 0xfe) { + for (i = 0; i < RTL8192E_RADIOB_ARRAY_LEN; i += 2) { + if (RTL8192E_RADIOB_ARRAY[i] == 0xfe) { msleep(100); continue; } - rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioB_Array[i], + rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIOB_ARRAY[i], bMask12Bits, - Rtl819XRadioB_Array[i+1]); + RTL8192E_RADIOB_ARRAY[i+1]); } break; case RF90_PATH_C: - for (i = 0; i < RadioC_ArrayLength; i += 2) { - if (Rtl819XRadioC_Array[i] == 0xfe) { + for (i = 0; i < RTL8192E_RADIOC_ARRAY_LEN; i += 2) { + if (RTL8192E_RADIOC_ARRAY[i] == 0xfe) { msleep(100); continue; } - rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioC_Array[i], + rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIOC_ARRAY[i], bMask12Bits, - Rtl819XRadioC_Array[i+1]); + RTL8192E_RADIOC_ARRAY[i+1]); } break; case RF90_PATH_D: - for (i = 0; i < RadioD_ArrayLength; i += 2) { - if (Rtl819XRadioD_Array[i] == 0xfe) { + for (i = 0; i < RTL8192E_RADIOD_ARRAY_LEN; i += 2) { + if (RTL8192E_RADIOD_ARRAY[i] == 0xfe) { msleep(100); continue; } - rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioD_Array[i], + rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIOD_ARRAY[i], bMask12Bits, - Rtl819XRadioD_Array[i+1]); + RTL8192E_RADIOD_ARRAY[i+1]); } break; diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h index e1c1f19b71a3..5e6527e835db 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h @@ -9,26 +9,6 @@ #define MAX_DOZE_WAITING_TIMES_9x 64 -#define AGCTAB_ArrayLength RTL8192E_AGC_TAB_ARRAY_LEN -#define MACPHY_ArrayLength RTL8192E_MAC_ARRAY_LEN -#define RadioA_ArrayLength RTL8192E_RADIOA_ARRAY_LEN -#define RadioB_ArrayLength RTL8192E_RADIOB_ARRAY_LEN -#define MACPHY_Array_PGLength RTL8192E_MAC_ARRAY_PG_LEN -#define RadioC_ArrayLength RTL8192E_RADIOC_ARRAY_LEN -#define RadioD_ArrayLength RTL8192E_RADIOD_ARRAY_LEN -#define PHY_REGArrayLength RTL8192E_PHY_REG_ARRAY_LEN -#define PHY_REG_1T2RArrayLength RTL8192E_PHY_REG_1T2R_ARRAY_LEN - -#define Rtl819XMACPHY_Array_PG RTL8192E_MAC_ARRAY_PG -#define Rtl819XMACPHY_Array RTL8192E_MAC_ARRAY -#define Rtl819XRadioA_Array RTL8192E_RADIOA_ARRAY -#define Rtl819XRadioB_Array RTL8192E_RADIOB_ARRAY -#define Rtl819XRadioC_Array RTL8192E_RADIOC_ARRAY -#define Rtl819XRadioD_Array RTL8192E_RADIOD_ARRAY -#define Rtl819XAGCTAB_Array RTL8192E_AGC_TAB_ARRAY -#define Rtl819XPHY_REGArray RTL8192E_PHY_REG_ARRAY -#define Rtl819XPHY_REG_1T2RArray RTL8192E_PHY_REG_1T2R_ARRAY - extern u32 rtl819XAGCTAB_Array[]; enum hw90_block {