2019-03-30 20:14:32

by Colin King

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Colin Ian King <[email protected]>
---
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;
--
2.20.1



2019-03-31 07:16:07

by Mukesh Ojha

[permalink] [raw]
Subject: Re: [PATCH] iwlegacy: remove redundant assignment to *res


On 3/31/2019 1:44 AM, Colin King wrote:
> 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.
>
> Signed-off-by: Colin Ian King <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>

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;

2019-04-04 10:15:11

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] iwlegacy: remove redundant assignment to *res

Colin King <[email protected]> wrote:

> 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.
>
> Signed-off-by: Colin Ian King <[email protected]>
> Reviewed-by: Mukesh Ojha <[email protected]>

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

6603c5844a44 iwlegacy: remove redundant assignment to *res

--
https://patchwork.kernel.org/patch/10878565/

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