All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Su Hui <suhui@nfschina.com>, Kalle Valo <kvalo@kernel.org>,
	Sasha Levin <sashal@kernel.org>,
	pkshih@realtek.com, linux-wireless@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 21/22] wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift()
Date: Tue, 16 Jan 2024 15:04:15 -0500	[thread overview]
Message-ID: <20240116200432.260016-21-sashal@kernel.org> (raw)
In-Reply-To: <20240116200432.260016-1-sashal@kernel.org>

From: Su Hui <suhui@nfschina.com>

[ Upstream commit 5c16618bc06a41ad68fd8499a21d35ef57ca06c2 ]

Using calculate_bit_shift() to replace rtl8723_phy_calculate_bit_shift().
And fix an undefined bitwise shift behavior problem.

Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-12-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 5cf29f5a4b54..e6ac496e898e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
@@ -72,7 +72,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_irqrestore(&rtlpriv->locks.rf_lock, flags);
@@ -104,7 +104,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));
@@ -113,7 +113,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 1263b12db5dc..bbbbf61d7bcf 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
@@ -64,7 +64,7 @@ u32 rtl8723be_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
 	spin_lock_irqsave(&rtlpriv->locks.rf_lock, flags);
 
 	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_irqrestore(&rtlpriv->locks.rf_lock, flags);
@@ -92,7 +92,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.43.0


  parent reply	other threads:[~2024-01-16 20:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 20:03 [PATCH AUTOSEL 4.19 01/22] scsi: lpfc: Fix possible file string name overflow when updating firmware Sasha Levin
2024-01-16 20:03 ` [PATCH AUTOSEL 4.19 02/22] PCI: Add no PM reset quirk for NVIDIA Spectrum devices Sasha Levin
2024-01-16 20:03 ` [PATCH AUTOSEL 4.19 03/22] bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk Sasha Levin
2024-01-16 20:03 ` [PATCH AUTOSEL 4.19 04/22] ARM: dts: imx7s: Fix lcdif compatible Sasha Levin
2024-01-16 20:03   ` Sasha Levin
2024-01-16 20:03 ` [PATCH AUTOSEL 4.19 05/22] ARM: dts: imx7s: Fix nand-controller #size-cells Sasha Levin
2024-01-16 20:03   ` Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 06/22] wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus() Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 07/22] bpf: Add map and need_defer parameters to .map_fd_put_ptr() Sasha Levin
2024-01-17  4:16   ` Hou Tao
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 08/22] scsi: libfc: Don't schedule abort twice Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 09/22] scsi: libfc: Fix up timeout error in fc_fcp_rec_error() Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 10/22] ARM: dts: rockchip: fix rk3036 hdmi ports node Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 11/22] ARM: dts: imx25/27-eukrea: Fix RTC node name Sasha Levin
2024-01-16 20:04   ` Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 12/22] ARM: dts: imx: Use flash@0,0 pattern Sasha Levin
2024-01-16 20:04   ` Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 13/22] ARM: dts: imx27: Fix sram node Sasha Levin
2024-01-16 20:04   ` Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 14/22] ARM: dts: imx1: " Sasha Levin
2024-01-16 20:04   ` Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 15/22] ARM: dts: imx27-apf27dev: Fix LED name Sasha Levin
2024-01-16 20:04   ` Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 16/22] ARM: dts: imx23-sansa: Use preferred i2c-gpios properties Sasha Levin
2024-01-16 20:04   ` Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 17/22] ARM: dts: imx23/28: Fix the DMA controller node name Sasha Levin
2024-01-16 20:04   ` Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 18/22] md: Whenassemble the array, consult the superblock of the freshest device Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 19/22] wifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices Sasha Levin
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 20/22] wifi: rtlwifi: add calculate_bit_shift() Sasha Levin
2024-01-16 20:04 ` Sasha Levin [this message]
2024-01-16 20:04 ` [PATCH AUTOSEL 4.19 22/22] wifi: cfg80211: free beacon_ies when overridden from hidden BSS Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116200432.260016-21-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=stable@vger.kernel.org \
    --cc=suhui@nfschina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.