From patchwork Mon Dec 9 04:20:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 848739 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A43C155C87 for ; Mon, 9 Dec 2024 04:20:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733718047; cv=none; b=N2HMlPXsmtQ35Ct/4Fns4apvYEPA7VexA8MFQ8u3ZjdFxcxsq1WloXEt3VdBTVryJt0WRF2hlwGmPxvzT55ddTSgHyKTf+IpFNELIHUAB7AQ7PaZn1umTEQ7RVNbfRP75Xn3kehlDqInLYKuxZufeN1UxiU+Mv0aHYn9dAy6RSc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733718047; c=relaxed/simple; bh=lGfr7KtA3bsyDsLD58iUkG+U5d9eEt89c+PZcrlJsQo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=B0rufHpp+4XqrMcfGd/2oIZcOuXY4evKQ1PdKLMWmW+HlkzcHkmE7Jt2QWsGsFmwLI0omqgnjwNIwrOrjxheRK5v4l1s4APd0uk/HRRD7WH9ZFPl6BXcGrBYKP1P94bt/kFUGkZldoSk+S+LIuYJDU8YqWZxf4/wb4r8bMIlNbE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=dquYRmTT; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="dquYRmTT" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4B94KfMB2004744, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1733718041; bh=lGfr7KtA3bsyDsLD58iUkG+U5d9eEt89c+PZcrlJsQo=; h=From:To:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:Content-Type; b=dquYRmTT4/V7C33zrFnv8g8WKBz8x1JQsbANwk1vFfBjmw9Qz9e01GYzMLIz9ffOV eaQacOrJia/XUHCDF3pMr/lfH0U+RjGp7ROY7BudafFPEOsn63HYlXinex9AC+fuIi H/j0fyugtGhikIg1DnQHfO9TQ7NKBXuGk7/dlDW/3W71Ekph/86kmnb/piGmuwGLKV yR0NmIWy6rekJV/v/svWKtGDGUsrGn8cCmtXeOYgJV6pTvUs+FfERgXubnjDPyfBdo EHKQUpqUHeRIGI+kBz9UXdpWTErAlpHvoX+Lky0hVltGIFWvFFyQNSZL9aOzej2ERd ol3SYQiXlnyXA== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4B94KfMB2004744 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 9 Dec 2024 12:20:41 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 9 Dec 2024 12:20:42 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 9 Dec 2024 12:20:41 +0800 From: Ping-Ke Shih To: Subject: [PATCH 1/2] wifi: rtw89: 8852c: rfk: refine target channel calculation in _rx_dck_channel_calc() Date: Mon, 9 Dec 2024 12:20:19 +0800 Message-ID: <20241209042020.21290-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) The channel is not possibly 0, so original code is fine. Still want to avoid Coverity warning, so ensure -32 offset for the channel number which is larger than 125 only. Actually, don't change logic at all. Addresses-Coverity-ID: 1628150 ("Overflowed constant") Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c b/drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c index bd17c0a1c684..b92e2ce4f4ad 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c @@ -1769,10 +1769,10 @@ u8 _rx_dck_channel_calc(struct rtw89_dev *rtwdev, const struct rtw89_chan *chan) target_ch = chan->channel - 33; } } else if (chan->band_type == RTW89_BAND_6G) { - if (chan->channel >= 1 && chan->channel <= 125) - target_ch = chan->channel + 32; - else + if (chan->channel > 125) target_ch = chan->channel - 32; + else + target_ch = chan->channel + 32; } else { target_ch = chan->channel; } From patchwork Mon Dec 9 04:20:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 850116 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95D3415623A for ; Mon, 9 Dec 2024 04:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733718049; cv=none; b=eAfJ4aPMoN2MS7yH+ui5TQVP+CBK+s+Rkey5OiyhHxUmdjlgz9Ir8YLsN/r3ELKM/JTv/I7KZp8aOQFrnjXhQTIWHW0awVNB+8vmNozzUlHCHh2VuXW7VMO7Wd+qaTk0cqvCQLTgNH8sc/N+TFOC2+nax5yXzBqjZATeN/TMUDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733718049; c=relaxed/simple; bh=i0dM9Hr5HyP/vIVVBKyn902HZ3bHfypemt2y7QM7YxQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fWOUji3irAGuf7B5xAxLNNaEZeyxNX96Y0ZJAc0cgRX5RolptPc1Wgo9CGpMbdmy3LbyOTSGgZlhBXQDrChVytbuWVoxtfVROlvJXRqWQCST+Ykw2aVJMwQbQQxxu/koZB33VbHmxcoeup0ljiA9OjSonDJh6vZVyULiRbuFFMM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=HIfBgUg4; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="HIfBgUg4" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4B94KiNkA004747, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1733718044; bh=i0dM9Hr5HyP/vIVVBKyn902HZ3bHfypemt2y7QM7YxQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=HIfBgUg4nWzvX6r2DuscaA1ZHy9ikH+SqHvGwRhJoPE/8vp0AVAQd/UdZ3Z1c+qmM 6IPemr8atSzl+J/PAuoa5JpPnbiraofnde2MAEjLmkeEqh6gtKzJOjaydiw+uNZDYY cntlKz5X0tk1p21ItlDiufL4BsLry8vQCOX4fWSnd9eyjaJrV8d8knbije1AGr6Ia3 4kOCWHorS3oukf+AATFfpy1Nxgso55+Q79sRoYTIm6KnRlIc+yKdEjGFQK5gVRq9Co Nv95BNDX1hxROVa2rUvp6fxF4YE+5X7IOQGYESt9z9K4eMJ14onG6igOV3A7jZOfm0 mMEbfdTgf3Irw== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4B94KiNkA004747 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 9 Dec 2024 12:20:44 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 9 Dec 2024 12:20:44 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 9 Dec 2024 12:20:44 +0800 From: Ping-Ke Shih To: Subject: [PATCH 2/2] wifi: rtw89: 8851b: rfk: remove unnecessary assignment of return value of _dpk_dgain_read() Date: Mon, 9 Dec 2024 12:20:20 +0800 Message-ID: <20241209042020.21290-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241209042020.21290-1-pkshih@realtek.com> References: <20241209042020.21290-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) The return value of _dpk_dgain_read() is not used afterward, so remove it safely. Addresses-Coverity-ID: 1504753 ("Unused value") Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c b/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c index 364e36354225..f72b3ac6f149 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c @@ -2199,7 +2199,7 @@ static u8 _dpk_agc(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy, if (dgain > 0x5fc || dgain < 0x556) { _dpk_one_shot(rtwdev, phy, path, D_SYNC); - dgain = _dpk_dgain_read(rtwdev); + _dpk_dgain_read(rtwdev); } if (agc_cnt == 0) {