diff mbox series

rtw89: remove unneeded variable

Message ID 20211110121135.151187-1-deng.changcheng@zte.com.cn (mailing list archive)
State Accepted
Commit 43863efeada6eda380bd08537d1e4719341dc50d
Delegated to: Kalle Valo
Headers show
Series rtw89: remove unneeded variable | expand

Commit Message

CGEL Nov. 10, 2021, 12:11 p.m. UTC
From: Changcheng Deng <deng.changcheng@zte.com.cn>

Fix the following coccicheck review:
./drivers/net/wireless/realtek/rtw89/mac.c: 1096: 5-8: Unneeded variable

Remove unneeded variable used to store return value.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
---
 drivers/net/wireless/realtek/rtw89/mac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Ping-Ke Shih Nov. 11, 2021, 5:19 a.m. UTC | #1
> -----Original Message-----
> From: cgel.zte@gmail.com <cgel.zte@gmail.com>
> Sent: Wednesday, November 10, 2021 8:12 PM
> To: kvalo@codeaurora.org
> Cc: davem@davemloft.net; kuba@kernel.org; deng.changcheng@zte.com.cn; Pkshih <pkshih@realtek.com>;
> linux-wireless@vger.kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Zeal Robot
> <zealci@zte.com.cn>
> Subject: [PATCH] rtw89: remove unneeded variable
> 
> From: Changcheng Deng <deng.changcheng@zte.com.cn>
> 
> Fix the following coccicheck review:
> ./drivers/net/wireless/realtek/rtw89/mac.c: 1096: 5-8: Unneeded variable
> 
> Remove unneeded variable used to store return value.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>

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

> ---
>  drivers/net/wireless/realtek/rtw89/mac.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
> index 0171a5a7b1de..b93ac242b305 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
> @@ -1093,7 +1093,6 @@ static int cmac_func_en(struct rtw89_dev *rtwdev, u8 mac_idx, bool en)
>  static int dmac_func_en(struct rtw89_dev *rtwdev)
>  {
>  	u32 val32;
> -	u32 ret = 0;
> 
>  	val32 = (B_AX_MAC_FUNC_EN | B_AX_DMAC_FUNC_EN | B_AX_MAC_SEC_EN |
>  		 B_AX_DISPATCHER_EN | B_AX_DLE_CPUIO_EN | B_AX_PKT_IN_EN |
> @@ -1107,7 +1106,7 @@ static int dmac_func_en(struct rtw89_dev *rtwdev)
>  		 B_AX_WD_RLS_CLK_EN);
>  	rtw89_write32(rtwdev, R_AX_DMAC_CLK_EN, val32);
> 
> -	return ret;
> +	return 0;
>  }
> 
>  static int chip_func_en(struct rtw89_dev *rtwdev)
> --
> 2.25.1
Kalle Valo Nov. 26, 2021, 4:11 p.m. UTC | #2
cgel.zte@gmail.com wrote:

> From: Changcheng Deng <deng.changcheng@zte.com.cn>
> 
> Fix the following coccicheck review:
> ./drivers/net/wireless/realtek/rtw89/mac.c: 1096: 5-8: Unneeded variable
> 
> Remove unneeded variable used to store return value.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

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

43863efeada6 rtw89: remove unneeded variable
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index 0171a5a7b1de..b93ac242b305 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -1093,7 +1093,6 @@  static int cmac_func_en(struct rtw89_dev *rtwdev, u8 mac_idx, bool en)
 static int dmac_func_en(struct rtw89_dev *rtwdev)
 {
 	u32 val32;
-	u32 ret = 0;
 
 	val32 = (B_AX_MAC_FUNC_EN | B_AX_DMAC_FUNC_EN | B_AX_MAC_SEC_EN |
 		 B_AX_DISPATCHER_EN | B_AX_DLE_CPUIO_EN | B_AX_PKT_IN_EN |
@@ -1107,7 +1106,7 @@  static int dmac_func_en(struct rtw89_dev *rtwdev)
 		 B_AX_WD_RLS_CLK_EN);
 	rtw89_write32(rtwdev, R_AX_DMAC_CLK_EN, val32);
 
-	return ret;
+	return 0;
 }
 
 static int chip_func_en(struct rtw89_dev *rtwdev)