Skip to contentSkip to conversation

staging: rtlwifi: remove unnecessary statement

PATCH In review Jules Irenge 2 participants 2 messages Mar 15, 2019 – Mar 17, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtlwifi: remove unnecessary statement

Remove unnecessary assignment statement
and variable before return from function.
Issue suggested by Coccinelle using ret.cocci.

---
 drivers/staging/rtlwifi/phydm/phydm_rainfo.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_rainfo.c +3 -5
index ed740a93c8b6..c9837fbde54d 100644
@@ -926,8 +926,7 @@ void odm_refresh_basic_rate_mask(void *dm_void) {}
 
 u8 phydm_rate_order_compute(void *dm_void, u8 rate_idx)
 {
-	u8 rate_order = 0;
-
+	
 	if (rate_idx >= ODM_RATEVHTSS4MCS0) {
 		rate_idx -= ODM_RATEVHTSS4MCS0;
 		/**/
@@ -950,9 +949,8 @@ u8 phydm_rate_order_compute(void *dm_void, u8 rate_idx)
 		rate_idx -= ODM_RATEMCS8;
 		/**/
 	}
-	rate_order = rate_idx;
-
-	return rate_order;
+	
+	return rate_idx;
 }
 
 static void phydm_ra_common_info_update(void *dm_void)
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 14 lines · Jules Irenge

Remove unnecessary assignment statement
and variable before return from function.
Issue suggested by Coccinelle using ret.cocci.

---
 drivers/staging/rtlwifi/phydm/phydm_rainfo.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_rainfo.c +0 -0
index ed740a93c8b6..c9837fbde54d 100644

drivers/staging/rtlwifi/phydm/phydm_rainfo.c void odm_refresh_basic_rate_mask(void *dm_void) {} · line 929

Quoted 6 lines
drivers/staging/rtlwifi/phydm/phydm_rainfo.c +1 -2
@@ -926,8 +926,7 @@ void odm_refresh_basic_rate_mask(void *dm_void) {}
 
 u8 phydm_rate_order_compute(void *dm_void, u8 rate_idx)
 {
-	u8 rate_order = 0;
-
+	

No need to keep a blank line here, and you have trailing whitespace, which checkpatch.pl should have told you about :(

thanks,

greg k-h