Skip to contentSkip to conversation

iwlegacy: remove redundant assignment to *res

PATCH In review Colin King 3 participants 3 messages Mar 30, 2019 – Apr 4, 2019

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 iwlegacy: remove redundant assignment to *res

From: Colin Ian King <[email protected]>

Currently 1 is being assigned to *res and then it is immediately updated with the computed result. The first assignment is redundant and can be removed.

---
 drivers/net/wireless/intel/iwlegacy/4965.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/intel/iwlegacy/4965.c +0 -1
index ce4144a89217..a20b6c885047 100644
@@ -577,7 +577,6 @@ il4965_math_div_round(s32 num, s32 denom, s32 * res)
 		sign = -sign;
 		denom = -denom;
 	}
-	*res = 1;
 	*res = ((num * 2 + denom) / (denom * 2)) * sign;
 
 	return 1;
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Colin King

From: Colin Ian King <[email protected]>

Currently 1 is being assigned to *res and then it is immediately updated with the computed result. The first assignment is redundant and can be removed.

Cheers,
-Mukesh

Quoted 16 lines
---
  drivers/net/wireless/intel/iwlegacy/4965.c | 1 -
  1 file changed, 1 deletion(-)
drivers/net/wireless/intel/iwlegacy/4965.c +0 -1
index ce4144a89217..a20b6c885047 100644
@@ -577,7 +577,6 @@ il4965_math_div_round(s32 num, s32 denom, s32 * res)
  		sign = -sign;
  		denom = -denom;
  	}
-	*res = 1;
  	*res = ((num * 2 + denom) / (denom * 2)) * sign;
 
  	return 1;
#2 lore raw
In reply to Colin King
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

Currently 1 is being assigned to *res and then it is immediately updated with the computed result. The first assignment is redundant and can be removed.

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

6603c5844a44 iwlegacy: remove redundant assignment to *res

Signature · 3 lines
https://patchwork.kernel.org/patch/10878565/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches