iwlegacy: remove redundant assignment to *res
diff mbox series

Message ID 20190330201422.8024-1-colin.king@canonical.com
State Accepted
Commit 6603c5844a44fc58f0a3c9cbb57b35b75d7d86be
Delegated to: Kalle Valo
Headers show
Series
  • iwlegacy: remove redundant assignment to *res
Related show

Commit Message

Colin King March 30, 2019, 8:14 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/intel/iwlegacy/4965.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Mukesh Ojha March 31, 2019, 7:15 a.m. UTC | #1
On 3/31/2019 1:44 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh

> ---
>   drivers/net/wireless/intel/iwlegacy/4965.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/wireless/intel/iwlegacy/4965.c b/drivers/net/wireless/intel/iwlegacy/4965.c
> index ce4144a89217..a20b6c885047 100644
> --- a/drivers/net/wireless/intel/iwlegacy/4965.c
> +++ b/drivers/net/wireless/intel/iwlegacy/4965.c
> @@ -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;
Kalle Valo April 4, 2019, 10:15 a.m. UTC | #2
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> 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.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

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

6603c5844a44 iwlegacy: remove redundant assignment to *res

Patch
diff mbox series

diff --git a/drivers/net/wireless/intel/iwlegacy/4965.c b/drivers/net/wireless/intel/iwlegacy/4965.c
index ce4144a89217..a20b6c885047 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965.c
@@ -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;