Blame SOURCES/0034-rtw89-fix-maybe-uninitialized-error-RHEL-only.patch

56e3f4
From 12844a206de3d543be87b9fbe8af014ca353a974 Mon Sep 17 00:00:00 2001
56e3f4
From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= <ihuguet@redhat.com>
56e3f4
Date: Fri, 21 Jan 2022 08:49:04 +0100
56e3f4
Subject: [PATCH 34/36] rtw89: fix maybe-uninitialized error (RHEL only)
56e3f4
MIME-Version: 1.0
56e3f4
Content-Type: text/plain; charset=UTF-8
56e3f4
Content-Transfer-Encoding: 8bit
56e3f4
56e3f4
Bugzilla: http://bugzilla.redhat.com/2033291
56e3f4
Upstream-status: RHEL8 only
56e3f4
56e3f4
Fix build error of "maybe uninitialized variable", refering to _cur
56e3f4
variable in rtw8852a.c, function rtw8852a_btc_set_wl_txpwr_ctrl.
56e3f4
In fact it will never be uninitialized in this case because _reg values
56e3f4
used here are within the acceptable range for rtw89_mac_txpwr_read32 so
56e3f4
it will not return an error in this case.
56e3f4
56e3f4
Upstream kernel is built with -Wno-maybe-uninitialized so this warning
56e3f4
does not prevent from building. However, that flag was added after RHEL8
56e3f4
kernel fork, so we build without it.
56e3f4
56e3f4
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
56e3f4
---
56e3f4
 drivers/net/wireless/realtek/rtw89/rtw8852a.c | 4 +++-
56e3f4
 1 file changed, 3 insertions(+), 1 deletion(-)
56e3f4
56e3f4
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852a.c b/drivers/net/wireless/realtek/rtw89/rtw8852a.c
56e3f4
index 6b75e4bc7352..15337c638317 100644
56e3f4
--- a/drivers/net/wireless/realtek/rtw89/rtw8852a.c
56e3f4
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852a.c
56e3f4
@@ -1806,9 +1806,11 @@ rtw8852a_btc_set_wl_txpwr_ctrl(struct rtw89_dev *rtwdev, u32 txpwr_val)
56e3f4
 		const u32 _reg = __btc_cr_ ## _case;			\
56e3f4
 		u32 _val = __btc_ctrl_val_ ## _case(txpwr_val);		\
56e3f4
 		u32 _cur, _wrt;						\
56e3f4
+		int ret;						\
56e3f4
 		rtw89_debug(rtwdev, RTW89_DBG_TXPWR,			\
56e3f4
 			    "btc ctrl %s: 0x%x\n", #_case, _val);	\
56e3f4
-		rtw89_mac_txpwr_read32(rtwdev, RTW89_PHY_0, _reg, &_cur);\
56e3f4
+		ret = rtw89_mac_txpwr_read32(rtwdev, RTW89_PHY_0, _reg, &_cur);\
56e3f4
+		if (ret) break;						\
56e3f4
 		rtw89_debug(rtwdev, RTW89_DBG_TXPWR,			\
56e3f4
 			    "btc ctrl ori 0x%x: 0x%x\n", _reg, _cur);	\
56e3f4
 		_wrt = __do_clr(_val) ?					\
56e3f4
-- 
56e3f4
2.13.6
56e3f4