RE: [PATCH] rtw89: remove unneeded variable
From: Pkshih
Date: Thu Nov 11 2021 - 00:19:47 EST
> -----Original Message-----
> From: cgel.zte@xxxxxxxxx <cgel.zte@xxxxxxxxx>
> Sent: Wednesday, November 10, 2021 8:12 PM
> To: kvalo@xxxxxxxxxxxxxx
> Cc: davem@xxxxxxxxxxxxx; kuba@xxxxxxxxxx; deng.changcheng@xxxxxxxxxx; Pkshih <pkshih@xxxxxxxxxxx>;
> linux-wireless@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Zeal Robot
> <zealci@xxxxxxxxxx>
> Subject: [PATCH] rtw89: remove unneeded variable
>
> From: Changcheng Deng <deng.changcheng@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> Signed-off-by: Changcheng Deng <deng.changcheng@xxxxxxxxxx>
Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
> ---
> 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