Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp320888rdh; Mon, 18 Dec 2023 22:59:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbSS9DP+fMLoHnRanTFlHWSuWlx0fMX+C02U+UV5golCOncESmGs7/6b+u6kdKmxUJutJ+ X-Received: by 2002:a05:6a00:2e89:b0:6d0:89be:e4a8 with SMTP id fd9-20020a056a002e8900b006d089bee4a8mr8351819pfb.37.1702969182150; Mon, 18 Dec 2023 22:59:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702969182; cv=none; d=google.com; s=arc-20160816; b=aPxcFu/USo930nXhJvruTI3dubRuxVdnKBhd0wfqlvy+zQ8MyMKvTGlyJUTsY3U09W l/4dVLSwgE6JgNBgsc0owWxammfjOH7ZP+mrzlgv5dLprrGPvb2ZxEyEyX7nyDrq33iZ 1+8psZSGQtNkmKUTN1EQ0/46TXJilo1HoLpe48/fUwFKZLMyEqLI1XmoZ/2gHZHN1DLh hsm+eeb7T4waxVIz9CXeVLcCdOiFUIxNy35N3ZxX2DdTcHq/hh4Kb5//3UOYgn2OvXrg 7ae8By9SlC5CcpzdqfC1FZY2LPHDmQfa0zileiKU/b6AKwmJpSeeHky7pmQXsBClM21L mBVQ== 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=jn9BjhOitrPMxm1lSgbwk7hh+pJFj4+LxEHdrLgc6m4=; fh=LUYBtLOSfwANM0G8xcuNzxmAdvH3wjuyldpKgyGS4VQ=; b=YKxPshJ3JU9VSr8HKfyjnDwAlyfBbGNySFC8wHvFRR+cWtDo4uM4rfTgux16Ip/eBC HAvrMQFojRnWGWpI51vbOAvDN8sD3ld34EkmoHJdt1rz+G5M4zepq4xed4sjDoEZx/aA V9AclgYlNZkVJZdL1kZLhWlE7tldBR1PYKV7ftxS+szYgFzSOWBGJ3jHk+AqIDMynoB/ JCNcZQB6x83giQrEtwi1CJeEap4k/oyKfjFujsVAWgscGZOx1qNN5Z8pefjkroOMajg1 VeWYGNyvne1b2zMC1HrmlKbGFelD4H8dKxRziPvv4SDMpI/IU4oqHVdRJLKyb55DvENV gKXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-957-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-957-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 h128-20020a625386000000b006d7745337a8si2957825pfb.111.2023.12.18.22.59.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 22:59:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-957-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-957-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-957-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 A8B132814AA for ; Tue, 19 Dec 2023 06:59:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8846513ADA; Tue, 19 Dec 2023 06:58:12 +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 78DD311702; 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 EED0A60F259C3; Tue, 19 Dec 2023 14:58:00 +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, linville@tuxdriver.com, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH wireless-next 06/11] wifi: rtlwifi: rtl8192ce: using calculate_bit_shift() Date: Tue, 19 Dec 2023 14:57:34 +0800 Message-Id: <20231219065739.1895666-7-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 the undefined bitwise shift behavior problem. Fixes: 0c8173385e54 ("rtl8192ce: Add new driver") Signed-off-by: Su Hui --- drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c | 6 +++--- drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c index da54e51badd3..fa70a7d5539f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c @@ -39,7 +39,7 @@ u32 rtl92c_phy_query_rf_reg(struct ieee80211_hw *hw, rfpath, regaddr); } - bitshift = _rtl92c_phy_calculate_bit_shift(bitmask); + bitshift = calculate_bit_shift(bitmask); readback_value = (original_value & bitmask) >> bitshift; spin_unlock(&rtlpriv->locks.rf_lock); @@ -110,7 +110,7 @@ void rtl92ce_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)); @@ -122,7 +122,7 @@ void rtl92ce_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)); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h index 7582a162bd11..c7a0d4c776f0 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h @@ -94,7 +94,6 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw, enum radio_path rfpath, u32 offset); u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw, enum radio_path rfpath, u32 offset); -u32 _rtl92c_phy_calculate_bit_shift(u32 bitmask); void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw, enum radio_path rfpath, u32 offset, u32 data); void _rtl92c_phy_fw_rf_serial_write(struct ieee80211_hw *hw, -- 2.30.2