Skip to contentSkip to conversation

Staging: rtl8188eu: Remove unused variable.

PATCH In review Vatika Harlalka 2 participants 2 messages Mar 1, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8188eu: Remove unused variable.

The patch was recognized by this Coccinelle script. The return value of the function need not be assigned to a variable.

@@
identifier f, ret;
type T;
@@
(
- ret =
+ return
f(...);
- return ret;

|

- T ret =
+ return
f(...);
- return ret;
)

---
 drivers/staging/rtl8188eu/hal/fw.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8188eu/hal/fw.c +1 -3
index 3b28754..8f1fdf1 100644
@@ -230,7 +230,5 @@ int rtl88eu_download_fw(struct adapter *adapt)
 	_rtl88e_write_fw(adapt, pfwdata, fwsize);
 	_rtl88e_enable_fw_download(adapt, false);
 
-	err = _rtl88e_fw_free_to_go(adapt);
-
-	return err;
+	return _rtl88e_fw_free_to_go(adapt);
 }
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · On Sunday 01 March 2015 20:46:25 Vatika Harlalka wrote:
drivers/staging/rtl8188eu/hal/fw.c +0 -0
index 3b28754..8f1fdf1 100644

drivers/staging/rtl8188eu/hal/fw.c int rtl88eu_download_fw(struct adapter *adapt) · line 234

Quoted 8 lines
drivers/staging/rtl8188eu/hal/fw.c +1 -3
@@ -230,7 +230,5 @@ int rtl88eu_download_fw(struct adapter *adapt)
        _rtl88e_write_fw(adapt, pfwdata, fwsize);
        _rtl88e_enable_fw_download(adapt, false);
 
-       err = _rtl88e_fw_free_to_go(adapt);
-
-       return err;
+       return _rtl88e_fw_free_to_go(adapt);
 }

I'm guessing that you introduce a compiler warning with this patch, and the subject line does not describe what you actually do, because the variable is not unused already, and you remove the only use but not the variable.

Arnd