From patchwork Sat Mar 25 08:36:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hortmann X-Patchwork-Id: 74861 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp291420vqo; Sat, 25 Mar 2023 02:06:25 -0700 (PDT) X-Google-Smtp-Source: AKy350al/NEtL/iKsqGUNCXR+ryw5OH+VVo8VuXTM11xBPBrihdOotzmuLsXCwA+TybPfUyvsTAo X-Received: by 2002:a17:90a:1953:b0:23f:7196:2faf with SMTP id 19-20020a17090a195300b0023f71962fafmr6113329pjh.19.1679735184866; Sat, 25 Mar 2023 02:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679735184; cv=none; d=google.com; s=arc-20160816; b=mTruoY1mjTUXcrVkoe9K1oMHMNmw7CLoWUGtKATEISQ/CXkEiR6wIcfhuG2mTENzMc 1M0Gt+YH+Y6EzfS0NZ3L7dyfipc2YbMDqT0q3nr4U1ik6gdHCO06U1IlULImdGr3/DLE Nk4ztWiXOgxoxhIp5BNxyS9hOIWJvHP59r/9z8gMKIsjLZ1J8TpU+gy1nHSdlF8ZAbnC gRv5WyzcQ79dFR/Log/ZERlvgkaz5U4uP8vDFlUcCcw8ZkrMeDSb9I+dbJ6JWMvs0NrE 8xGpCd2cmRl07jPVAknPif1vp8lLJOMT1oztaBmCDwcToRxkdOF5Fx+aZJvW2lptfrV9 cinQ== 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=pego/p9EbPQyvAXkY7L5ybuHyA9HZAjsDB9bAcQ4kms=; b=rqHdEZ3JIknHik4OEj+ERhAHAZW8Y32XnKhnrTgSrFmjmrvlq3WyTcNtYott6L+7iy NM93Fkk9ge9Re1I/eLi30DkEoHknl7IsbrPwDhRFGfI2OVQtRyQQR02pVNyMCKa7MKyC axm90gw3vqrq+h1TOJNz2l9gBhBaaYNOScUWxcIaFkRrfJTj2B6g+b4spOIhWKjhVQkn 5BD5jSPc7mgtjLs5atX189D0T+oB/a0zHF98go3AS80Sh0ZpKwamRfCYsuLaECNSA/SX E+VmAZSv7Hs+iH4FHFXpL/tv14SDPgPgqJp+dazBDswgU+PS400NoXtPdXNIMgc7hHuO O2wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="aapVrq2/"; 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 o12-20020a1709026b0c00b001a1799a0db6si22441451plk.63.2023.03.25.02.06.11; Sat, 25 Mar 2023 02:06:24 -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="aapVrq2/"; 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 S232200AbjCYIgv (ORCPT + 99 others); Sat, 25 Mar 2023 04:36:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232237AbjCYIga (ORCPT ); Sat, 25 Mar 2023 04:36:30 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A868B18A84 for ; Sat, 25 Mar 2023 01:36:25 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-93075ee221bso14103566b.0 for ; Sat, 25 Mar 2023 01:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679733385; 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=pego/p9EbPQyvAXkY7L5ybuHyA9HZAjsDB9bAcQ4kms=; b=aapVrq2/VavaaG/pVw2Cdc5FlASE0YKac34GycF9wfB/uU2GuL2lyUe8sm3fUpY2tH 1MOnseF8UrPyFaLBUfq13uob6mSvXrvw/hgmk4IkD3ETPvskFZaJZsD3WncmYjFVtaU4 HFzbviED50eIuTTtFZYyWeW7/M9PrDR15oBomiu0GRNkWtupcLkbxgiHUjaNK3VahVDH w/fJypydGVoY3n6ZUubkMZ6zXSQxwppabGgUdPmVwmrdmSgdq5MyzBTNjDRHs3gx9LHp cqfiiMqWirzJD1Fnjh7T6dDwt+Pj3GaV9Yag67OysTQ1hI4r4avb7jxMQDAcudbBruAY hViw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679733385; 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=pego/p9EbPQyvAXkY7L5ybuHyA9HZAjsDB9bAcQ4kms=; b=3c1ah8qQadttZP5O1QrLo50glk/qkumN0qDbbZTSE+fp28cHCXtLwtVRsT1HKvna1x NHOtf/0jusBv3hA1aN4/SU0DPAxvkvwxltC/P9rkijd33wwFrozDxtAYEFK8ojMVojEh TFeaxU7DZtDCOtutIjQg+SFEUZpqmrGAvoyj2QwHBySVC6/uF2VnS3p/pU+e/+VM03cX KIBrCC9Sae6E5ouxY3bw1aLTiaFR78VRVDu85tkw/gqSKakCBuYelM6KHhW2CWdFuwmW B6CuATTeMDf/wApVOSg7dd1V3V3hdsigu/itDParWUFXoBtuIMKZytEYWQAJoQQ0jz+r IZuQ== X-Gm-Message-State: AAQBX9cfDEeRW9fH3WPAXKbTcxJMyQv+wIyPdXT5lQq8lm8cRrIIceUE var1scbqhZsmTiGD0N1/2oTaqGhKqTY= X-Received: by 2002:a17:906:748b:b0:8f0:ba09:4abe with SMTP id e11-20020a170906748b00b008f0ba094abemr4117514ejl.2.1679733385189; Sat, 25 Mar 2023 01:36:25 -0700 (PDT) Received: from matrix-ESPRIMO-P710 (p57935146.dip0.t-ipconnect.de. [87.147.81.70]) by smtp.gmail.com with ESMTPSA id ot17-20020a170906ccd100b008e51a1fd7bfsm11648296ejb.172.2023.03.25.01.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Mar 2023 01:36:24 -0700 (PDT) Date: Sat, 25 Mar 2023 09:36:23 +0100 From: Philipp Hortmann To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 06/11] staging: rtl8192e: Remove priv->rf_chip in _rtl92e_phy_switch_channel_step Message-ID: <1b9e10de4f539aa24150275c80ec4bbd925c853d.1679732276.git.philipp.g.hortmann@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1761330001208357367?= X-GMAIL-MSGID: =?utf-8?q?1761330001208357367?= priv->rf_chip is initialized to RF_8256 and never changed. Remove condition in function _rtl92e_phy_switch_channel_step as it is dead code. Signed-off-by: Philipp Hortmann --- .../staging/rtl8192e/rtl8192e/r8192E_phy.c | 83 ++++--------------- 1 file changed, 16 insertions(+), 67 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index b528b8ab4b2b..73e426e052b0 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -14,24 +14,6 @@ #include "table.h" -static u32 RF_CHANNEL_TABLE_ZEBRA[] = { - 0, - 0x085c, - 0x08dc, - 0x095c, - 0x09dc, - 0x0a5c, - 0x0adc, - 0x0b5c, - 0x0bdc, - 0x0c5c, - 0x0cdc, - 0x0d5c, - 0x0ddc, - 0x0e5c, - 0x0f72, -}; - /*************************Define local function prototype**********************/ static u32 _rtl92e_phy_rf_fw_read(struct net_device *dev, @@ -608,58 +590,25 @@ static u8 _rtl92e_phy_switch_channel_step(struct net_device *dev, u8 channel, 0, 0, 0); RfDependCmdCnt = 0; - switch (priv->rf_chip) { - case RF_8225: - if (!(channel >= 1 && channel <= 14)) { - netdev_err(dev, - "Invalid channel requested for 8225: %d\n", - channel); - return false; - } - _rtl92e_phy_set_sw_chnl_cmd_array(dev, - ieee->RfDependCmd, - RfDependCmdCnt++, - MAX_RFDEPENDCMD_CNT, - CmdID_RF_WriteReg, - rZebra1_Channel, - RF_CHANNEL_TABLE_ZEBRA[channel], - 10); - _rtl92e_phy_set_sw_chnl_cmd_array(dev, - ieee->RfDependCmd, - RfDependCmdCnt++, - MAX_RFDEPENDCMD_CNT, - CmdID_End, 0, 0, 0); - break; - - case RF_8256: - if (!(channel >= 1 && channel <= 14)) { - netdev_err(dev, - "Invalid channel requested for 8256: %d\n", - channel); - return false; - } - _rtl92e_phy_set_sw_chnl_cmd_array(dev, - ieee->RfDependCmd, - RfDependCmdCnt++, - MAX_RFDEPENDCMD_CNT, - CmdID_RF_WriteReg, - rZebra1_Channel, - channel, 10); - _rtl92e_phy_set_sw_chnl_cmd_array(dev, - ieee->RfDependCmd, - RfDependCmdCnt++, - MAX_RFDEPENDCMD_CNT, - CmdID_End, 0, 0, 0); - break; - - case RF_8258: - break; - default: - netdev_warn(dev, "Unknown RF Chip ID\n"); + if (!(channel >= 1 && channel <= 14)) { + netdev_err(dev, + "Invalid channel requested for 8256: %d\n", + channel); return false; } - + _rtl92e_phy_set_sw_chnl_cmd_array(dev, + ieee->RfDependCmd, + RfDependCmdCnt++, + MAX_RFDEPENDCMD_CNT, + CmdID_RF_WriteReg, + rZebra1_Channel, + channel, 10); + _rtl92e_phy_set_sw_chnl_cmd_array(dev, + ieee->RfDependCmd, + RfDependCmdCnt++, + MAX_RFDEPENDCMD_CNT, + CmdID_End, 0, 0, 0); do { switch (*stage) {