Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp323831rdh; Mon, 18 Dec 2023 23:05:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3FHMWoSIWClheSJwmmf6NuuYwVKZFGWEW776GDOxdxjUU0618xBmFNFEiO5U9Ypp6dSTR X-Received: by 2002:a05:6a00:1d26:b0:6ce:2732:58a with SMTP id a38-20020a056a001d2600b006ce2732058amr21733460pfx.59.1702969513887; Mon, 18 Dec 2023 23:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702969513; cv=none; d=google.com; s=arc-20160816; b=VrzZSiC7ahUMOlpN54hNKBCdZYWm2oqm9TBPK5EzGpgcs1kvATQzTWobPAvt5SJapF U9ydb5UpocE2ymWZRmwDbqskr9O3mpmqDRL0v4GQWO4OjHdvNpeStmFX1dhrBEdJ+HCo zAe1/g+488wY7yWv7yPi6k4lyiNXXkUkDCFW+MH+ICVJ4RdnvyfkGRK8u2bKjVUovvav 4u7ppfkLd9G5kSHZJ6b7dEZP3Egz1PN98evCFWlCj0IECjGzOYE8hc1ta6BsagC05CSM k49tZx0o5zn1zarMo/lR/+g8LYHtlh01I5pQCdVTKSd74t442d5Y1y0JyyKsk3nGN944 HHeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:in-reply-to:message-id:date :subject:cc:to:from; bh=tEgq81+k3Q3SKLJ+Qt0E9m6UIsn0sX2b5jxHWGGX+nI=; fh=oAKK2Tmfich+PEAEhU13cYP9znewSj73CMUuWFedCmY=; b=c+Kw7YxuVSOizaUN76L7dJbPuse4KVj4KwaugtLi2WWEjBctFNwN0J+hmWE6EeocpT 8Zwkpi9sG5u2gZaYiWltZ5ACdXqK3WPo6ubPbYsxIa+55zkkyko6AvMampdmkAf8uy7E Tm26i3MIToIPoXNsVPv3lH8L7wzZZc+Xfav5YRJE1o0H25HPj6bN5RymJR3nZL1wSzM3 Huqb8FPE7TZrPQEBeSJPWz3iGvnW8ITYGjQWJqj6AIN3nh+liZvEZmGbHNLAz3uW4fai fAdMPSBOj9m6jyCq0X6mizn7WeIktiKilmJNfjRJDF5DOxEUpGvgM3wjUrzykN4PLLYF Aobg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-962-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-962-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z9-20020a63e549000000b005ca4098bf58si11596714pgj.647.2023.12.18.23.05.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 23:05:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-962-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-962-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-962-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A464EB22CED for ; Tue, 19 Dec 2023 07:01:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FEFB881E; Tue, 19 Dec 2023 06:58:42 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from mail.nfschina.com (unknown [42.101.60.195]) by smtp.subspace.kernel.org (Postfix) with SMTP id 98198883A; Tue, 19 Dec 2023 06:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nfschina.com Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 64F0360F0D2BB; Tue, 19 Dec 2023 14:58:08 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: pkshih@realtek.com, kvalo@kernel.org Cc: Su Hui , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH wireless-next 11/11] wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift() Date: Tue, 19 Dec 2023 14:57:39 +0800 Message-Id: <20231219065739.1895666-12-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231219065739.1895666-1-suhui@nfschina.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Using calculate_bit_shift() to replace rtl8723_phy_calculate_bit_shift(). And fix an undefined bitwise shift behavior problem. Signed-off-by: Su Hui --- drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 6 +++--- drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c index fe9b407dc2af..71e29b103da5 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c @@ -49,7 +49,7 @@ u32 rtl8723e_phy_query_rf_reg(struct ieee80211_hw *hw, rfpath, regaddr); } - bitshift = rtl8723_phy_calculate_bit_shift(bitmask); + bitshift = calculate_bit_shift(bitmask); readback_value = (original_value & bitmask) >> bitshift; spin_unlock(&rtlpriv->locks.rf_lock); @@ -80,7 +80,7 @@ void rtl8723e_phy_set_rf_reg(struct ieee80211_hw *hw, original_value = rtl8723_phy_rf_serial_read(hw, rfpath, regaddr); - bitshift = rtl8723_phy_calculate_bit_shift(bitmask); + bitshift = calculate_bit_shift(bitmask); data = ((original_value & (~bitmask)) | (data << bitshift)); @@ -89,7 +89,7 @@ void rtl8723e_phy_set_rf_reg(struct ieee80211_hw *hw, rtl8723_phy_rf_serial_write(hw, rfpath, regaddr, data); } else { if (bitmask != RFREG_OFFSET_MASK) { - bitshift = rtl8723_phy_calculate_bit_shift(bitmask); + bitshift = calculate_bit_shift(bitmask); data = ((original_value & (~bitmask)) | (data << bitshift)); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c index 2b9313cb93db..094cb36153f5 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c @@ -41,7 +41,7 @@ u32 rtl8723be_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath, spin_lock(&rtlpriv->locks.rf_lock); original_value = rtl8723_phy_rf_serial_read(hw, rfpath, regaddr); - bitshift = rtl8723_phy_calculate_bit_shift(bitmask); + bitshift = calculate_bit_shift(bitmask); readback_value = (original_value & bitmask) >> bitshift; spin_unlock(&rtlpriv->locks.rf_lock); @@ -68,7 +68,7 @@ void rtl8723be_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path path, if (bitmask != RFREG_OFFSET_MASK) { original_value = rtl8723_phy_rf_serial_read(hw, path, regaddr); - bitshift = rtl8723_phy_calculate_bit_shift(bitmask); + bitshift = calculate_bit_shift(bitmask); data = ((original_value & (~bitmask)) | (data << bitshift)); } -- 2.30.2