diff mbox series

[next] rtw89: Remove redundant check of ret after call to rtw89_mac_enable_bb_rf

Message ID 20211015152113.33179-1-colin.king@canonical.com (mailing list archive)
State Accepted
Commit f7e7e440550b0b176df3d2ea3e76106bc89915d9
Delegated to: Kalle Valo
Headers show
Series [next] rtw89: Remove redundant check of ret after call to rtw89_mac_enable_bb_rf | expand

Commit Message

Colin King Oct. 15, 2021, 3:21 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/realtek/rtw89/mac.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Ping-Ke Shih Oct. 18, 2021, 1:30 a.m. UTC | #1
> -----Original Message-----
> From: Colin King <colin.king@canonical.com>
> Sent: Friday, October 15, 2021 11:21 PM
> To: Kalle Valo <kvalo@codeaurora.org>; David S . Miller <davem@davemloft.net>; Jakub Kicinski
> <kuba@kernel.org>; Pkshih <pkshih@realtek.com>; linux-wireless@vger.kernel.org;
> netdev@vger.kernel.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH][next] rtw89: Remove redundant check of ret after call to rtw89_mac_enable_bb_rf
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

> ---
>  drivers/net/wireless/realtek/rtw89/mac.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c
> b/drivers/net/wireless/realtek/rtw89/mac.c
> index 0171a5a7b1de..69384c43c046 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
> @@ -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.
Kalle Valo Oct. 18, 2021, 12:31 p.m. UTC | #2
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

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

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

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index 0171a5a7b1de..69384c43c046 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -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)