[PATCH] rtw88: remove unnecessary variable

Subsystems: realtek wireless driver (rtw88), the rest

STALE1970d LANDED

Landed in mainline as 4a7ea94377c9 on 2021-03-15.

2 messages, 2 authors, 2021-03-15 · open the first message on its own page

[PATCH] rtw88: remove unnecessary variable

From: samirweng1979 <hidden>
Date: 2021-02-23 07:59:55

From: wengjianfeng <redacted>

The variable ret is defined at the beginning and initialized
to 0 until the function returns ret, and the variable ret is
not reassigned.Therefore, we do not need to define the variable
ret, just return 0 directly at the end of the function.

Signed-off-by: wengjianfeng <redacted>
---
 drivers/net/wireless/realtek/rtw88/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index e6989c0..4c7e3e4 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1393,7 +1393,6 @@ static int rtw_chip_parameter_setup(struct rtw_dev *rtwdev)
 	struct rtw_chip_info *chip = rtwdev->chip;
 	struct rtw_hal *hal = &rtwdev->hal;
 	struct rtw_efuse *efuse = &rtwdev->efuse;
-	int ret = 0;
 
 	switch (rtw_hci_type(rtwdev)) {
 	case RTW_HCI_TYPE_PCIE:
@@ -1431,7 +1430,7 @@ static int rtw_chip_parameter_setup(struct rtw_dev *rtwdev)
 
 	hal->bfee_sts_cap = 3;
 
-	return ret;
+	return 0;
 }
 
 static int rtw_chip_efuse_enable(struct rtw_dev *rtwdev)
-- 
1.9.1

Re: [PATCH] rtw88: remove unnecessary variable

From: Kalle Valo <hidden>
Date: 2021-03-15 08:24:27

samirweng1979 [off-list ref] wrote:
From: wengjianfeng <redacted>

The variable ret is defined at the beginning and initialized
to 0 until the function returns ret, and the variable ret is
not reassigned.Therefore, we do not need to define the variable
ret, just return 0 directly at the end of the function.

Signed-off-by: wengjianfeng <redacted>
Patch applied to wireless-drivers-next.git, thanks.

4a7ea94377c9 rtw88: remove unnecessary variable

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210223075438.13676-1-samirweng1979@163.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help