Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp321192rdh; Mon, 18 Dec 2023 23:00:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZa+mtfnWsppcBYsTUDJy0wVkP01mGR2Y577bmuuXXXpQMTAEmCYGa2HzOuCUi/TfWptyU X-Received: by 2002:a05:6a20:da9a:b0:194:aa69:159a with SMTP id iy26-20020a056a20da9a00b00194aa69159amr506284pzb.49.1702969221291; Mon, 18 Dec 2023 23:00:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702969221; cv=none; d=google.com; s=arc-20160816; b=MSJAfdsW7EDy5XgP5HQ/aTpS+OjGxpthk1KI2NjiQqeOeo+gF1J24t5SUEMDI1TUQQ bvVlJxax7hsyqKLWPG4LBpGi4+pVlz1/CFLI/38lgwV3t1uCyX9NKKoxH+DroxaYfZfy 16EitjtxjBW58LstGFeM5p5n5tF0/PCPa+7M58xFeBVn9tOBUXNgfLCNtJwuc+pl6L1a ns8zGoy1JKK5Y46bqrobpQvUY8wLv49PxRO7NzsFgC1YevDok+2RqNptUgv1jq4vxXUy 411wGAuUiIdgZgXqu7mdHI8mlM96lLQ0cIzHMXUd9Qk5ywmoi0Rn3HykQF2zLSC1SkLm wz8w== 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=nw1qh4NtsX/Avw5j09QbWWL6vYPrma7DNcz1OBf7uBQ=; fh=jh6lmXP29mqnjpwaf9kid5yOOtk0Mrxh8ua/eiPYLmc=; b=RPp41+U89i6b9mfjVnAoPYOD7Ix5ALQIkxiuju6lXRl5zbtcX0tO/mlq9jcfJUUhFd GdIzUh8sycscUe4FSNelSFmupsaeAC6tnlGu/0SwyCa3WWziRWyPCNtjh/zR4LsZnoNV PkQ6PSiyYPQ18jGuXhm5/ozUHQ8Jwk6Is4T9XNPVe/YnoHViTPFQ6NS+VTL03t6tnmuV 8NPoTDM4sW12wKcMobvS+3x3ZytdaOYbLVAq8iG+qlKEjMEYVM7DZxXWTRW6aXpjtMj+ l0++BuX7l1Z3wSN+i31UlB9eikn+i2Xn+742jocyN8ULfWWlezQrXefNEo1+eaIn8bMj jRkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-959-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-959-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id br3-20020a056a00440300b006cd8cddf8c5si5185945pfb.14.2023.12.18.23.00.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 23:00:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-959-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-959-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-959-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E50B9281754 for ; Tue, 19 Dec 2023 07:00:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 557CE14AAA; Tue, 19 Dec 2023 06:58:13 +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 8FA8E11729; Tue, 19 Dec 2023 06:58:10 +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 C621060F259C4; Tue, 19 Dec 2023 14:57:59 +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 , Larry.Finger@lwfinger.net, george0505@realtek.com, linville@tuxdriver.com, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH wireless-next 05/11] wifi: rtlwifi: rtl8192cu: using calculate_bit_shift() Date: Tue, 19 Dec 2023 14:57:33 +0800 Message-Id: <20231219065739.1895666-6-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 _rtl92c_phy_calculate_bit_shift(). And fix an undefined bitwise shift behavior problem. Fixes: f0a39ae738d6 ("rtlwifi: rtl8192cu: Add routine phy") Signed-off-by: Su Hui --- drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c index a8d9fe269f31..0b8cb7e61fd8 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c @@ -32,7 +32,7 @@ u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw, original_value = _rtl92c_phy_fw_rf_serial_read(hw, rfpath, regaddr); } - bitshift = _rtl92c_phy_calculate_bit_shift(bitmask); + bitshift = calculate_bit_shift(bitmask); readback_value = (original_value & bitmask) >> bitshift; rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE, "regaddr(%#x), rfpath(%#x), bitmask(%#x), original_value(%#x)\n", @@ -56,7 +56,7 @@ void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw, original_value = _rtl92c_phy_rf_serial_read(hw, rfpath, regaddr); - bitshift = _rtl92c_phy_calculate_bit_shift(bitmask); + bitshift = calculate_bit_shift(bitmask); data = ((original_value & (~bitmask)) | (data << bitshift)); @@ -67,7 +67,7 @@ void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw, original_value = _rtl92c_phy_fw_rf_serial_read(hw, rfpath, regaddr); - bitshift = _rtl92c_phy_calculate_bit_shift(bitmask); + bitshift = calculate_bit_shift(bitmask); data = ((original_value & (~bitmask)) | (data << bitshift)); -- 2.30.2