Skip to contentSkip to conversation

rtw89: Remove redundant check of ret after call to rtw89_mac_enable_bb_rf

PATCH In review Colin King 3 participants 3 messages Oct 15, 2021 – Oct 18, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 rtw89: Remove redundant check of ret after call to rtw89_mac_enable_bb_rf

From: Colin Ian King <[email protected]>

The function rtw89_mac_enable_bb_rf is a void return type, so there is no return error code to ret, so the following check for an error in ret is redundant dead code and can be removed.

Addresses-Coverity: ("Logically dead code")

Fixes e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver")
---
 drivers/net/wireless/realtek/rtw89/mac.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/realtek/rtw89/mac.c +0 -2
index 0171a5a7b1de..69384c43c046 100644
@@ -2656,8 +2656,6 @@ int rtw89_mac_init(struct rtw89_dev *rtwdev)
 		goto fail;
 
 	rtw89_mac_enable_bb_rf(rtwdev);
-	if (ret)
-		goto fail;
 
 	ret = rtw89_mac_sys_init(rtwdev);
 	if (ret)
Signature · 1 line
2.32.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Colin King <[email protected]>
Sent: Friday, October 15, 2021 11:21 PM
To: Kalle Valo <[email protected]>; David S . Miller <[email protected]>; Jakub Kicinski <[email protected]>; Pkshih <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH][next] rtw89: Remove redundant check of ret after call to rtw89_mac_enable_bb_rf

From: Colin Ian King <[email protected]>

Quoted 7 lines

The function rtw89_mac_enable_bb_rf is a void return type, so there is no return error code to ret, so the following check for an error in ret is redundant dead code and can be removed.

Addresses-Coverity: ("Logically dead code")

Fixes e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver")
Quoted 22 lines
---
 drivers/net/wireless/realtek/rtw89/mac.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/realtek/rtw89/mac.c +0 -3
index 0171a5a7b1de..69384c43c046 100644
@@ -2656,8 +2656,6 @@ int rtw89_mac_init(struct rtw89_dev *rtwdev)
 		goto fail;
 
 	rtw89_mac_enable_bb_rf(rtwdev);
-	if (ret)
-		goto fail;
 
 	ret = rtw89_mac_sys_init(rtwdev);
 	if (ret)
--

2.32.0

------Please consider the environment before printing this e-mail.

#2 lore raw
In reply to Colin King
Quoted 10 lines · Colin King

From: Colin Ian King <[email protected]>

The function rtw89_mac_enable_bb_rf is a void return type, so there is no return error code to ret, so the following check for an error in ret is redundant dead code and can be removed.

Addresses-Coverity: ("Logically dead code")

Fixes e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver")

Patch applied to wireless-drivers-next.git, thanks.

f7e7e440550b rtw89: Remove redundant check of ret after call to rtw89_mac_enable_bb_rf

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches