Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp27536rdb; Tue, 16 Jan 2024 13:50:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWoJN2vEfBvTPgbhyIvOgnxKopakywL5tqo7jKRbnAyt6P+MXHqCtyyAbFERCxKTTWTkai X-Received: by 2002:a17:906:30d4:b0:a2c:2aab:9231 with SMTP id b20-20020a17090630d400b00a2c2aab9231mr2962287ejb.69.1705441805672; Tue, 16 Jan 2024 13:50:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705441805; cv=pass; d=google.com; s=arc-20160816; b=bhBPfPmI9k3/I7g5xzMuczc66OTo0hyZyEhvod7CsleOfXISutxjJDgLU8bJk/pLU9 QP0eLqn76AxdtoEbKmTOvooKwfmQzhzWigZ6x0Eyfb4lMgUyrtfhx/8kDyAXimhW2H0A hgBqp/coClwLVYQBLy7DsbwWz4fBr0yZIUdzBZu0rmxLJxqcubjffbrUuoS+mN/XkwsX CatBgQKhMCzxnz/LO1rP0zj0fokJxsjAIXC762TCUPL5tks3gEB8DjL9A7eeEtIwcqpy K5brIWwO1BHo35lKCEfm9oEUSffM9Jx2m4H5WIrQErXfyMad9VnNZA+jnFtMjJbyNUJY 0GKw== ARC-Message-Signature: i=2; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=0yul0RFuC2plLKY7Gh5uKvAfF76ipa23j4WsyB5/R0U=; fh=2r8u/aouwP6z4eVmw50I2rWsUxwslL62bC0Hi4VQ088=; b=Tr9he/rcqD90wZcbGN8++FFpGJPEjgpnNCKE9lYrRrTrgh86A7eklew4O56VPvVj17 9LetaQk60fwZYSIgRyzfpPzBbE896ZllwQEJcz52Gm2486yLuGQ/6mKZ4NJe2C5aq9pB kUTwNx3hBrg1/yg3sdfVEz6GR8w9bHZ9M0oCrU12DAsubr1W8pjI4ntQGUK9kTe7Fjsu zEsrUbXocwRK+npsamOAlz/0dNw48nXS589BekMmEcnDz8fIHaGYk4Ha43BoLz3VuGRb gEjtmqrgVEIIXdE0AWPwNvi/VfHoqn8BtQ/vY+ToVYu2pRUKKOC76n7mRYyHUSnHtt58 6jWw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qm3iPT9c; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2051-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2051-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b8-20020a170906490800b00a2e96a15c66si547723ejq.882.2024.01.16.13.50.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 13:50:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2051-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qm3iPT9c; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2051-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2051-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6C3DB1F2AF43 for ; Tue, 16 Jan 2024 21:50:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE9C3161B64; Tue, 16 Jan 2024 20:02:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qm3iPT9c" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A48DD161B61; Tue, 16 Jan 2024 20:02:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705435350; cv=none; b=VaNJwrjMg0831qA5Fm63dZIm8T2auF1yoQvMEaX4CugIqbhA/eYQGIpXYjSUrs+5Pqw8JYxXIkeEa43un+x2zbIaeFLSqpizdQnSbhsrdel/edFtrckpBR1bpjaZKEYDZPi54qbN7UbI214fX8Pi2cbh+mM7ONdQmMaT0VveRiU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705435350; c=relaxed/simple; bh=ZNJAjmvsm4KAmFk54qSGT8JQhQEBdskQSPW4CqrTcKw=; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version:X-stable: X-Patchwork-Hint:X-stable-base:Content-Transfer-Encoding; b=eby8o3KMzo6cenb782SVBtu5lHniZVo1qtkGJhpjDovnoPjT7tQlEakZNS8Y7Zhe0CxLkBPWCpaFcJkqlBIZ/8xqG8zRQVvSruh22W9+SPrfMQpmrnMd6LXuN36cmMTRHbpDatL+0NqYxrWk9OWpTbmM7uImhYYp4cDJ5TsYRBg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qm3iPT9c; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CFA7C433F1; Tue, 16 Jan 2024 20:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705435350; bh=ZNJAjmvsm4KAmFk54qSGT8JQhQEBdskQSPW4CqrTcKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qm3iPT9c8nQkJD3TuRkSH4ea+YkKNd2QN4/BjzKkSI/S5ZO9vmF8ZJuGgkcfwW6+l YsjWy1lv3mQH6l8+AuF5aBnLzW646LMv5F2G8VZebeDVRbMavgNnePEHSysh7j8DPl s1KF+pwmdos0QZnFeJF23RR3Ewyxx0jAtv+uVivh7PYCUZ5dzISGqngWnrwMcgOxkm QrqvNXCunIeaJgcmW8UjpAjXCvobI8E7zS3BvsWAQzhEhcbwTIQiVcHhozgZ+MbywF 0/DqVfB/H9luH6uGuT/PFB8r3v+ZYRvoV/jBCTa9wf2W6zKBMVRTeQQesElb1dCC8V uePyFQun4mssg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Su Hui , Kalle Valo , Sasha Levin , pkshih@realtek.com, linux-wireless@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 40/44] wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift() Date: Tue, 16 Jan 2024 15:00:09 -0500 Message-ID: <20240116200044.258335-40-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116200044.258335-1-sashal@kernel.org> References: <20240116200044.258335-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.208 Content-Transfer-Encoding: 8bit From: Su Hui [ 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 Signed-off-by: Kalle Valo Link: https://msgid.link/20231219065739.1895666-12-suhui@nfschina.com Signed-off-by: Sasha Levin --- 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 fa0eed434d4f..d26dda8e46fd 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 f09f55b0468a..35dfea54ae9c 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.43.0