All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: rtlwifi: phydm: Remove parentheses
@ 2019-03-30 15:13 Nishka Dasgupta
  2019-03-30 15:27 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Nishka Dasgupta @ 2019-03-30 15:13 UTC (permalink / raw)
  To: gregkh, outreachy-kernel; +Cc: Nishka Dasgupta

Remove unnecessary parentheses on the right hand side and simplify expression. 
Issue first detected using Coccinelle.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
---
Changes in v2:
- Change `status = status & <expression>` to `status &= <expression>`,
  to make the code more readable.

 drivers/staging/rtlwifi/phydm/phydm_debug.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtlwifi/phydm/phydm_debug.c b/drivers/staging/rtlwifi/phydm/phydm_debug.c
index 91f2c054d83b..13b34dc33011 100644
--- a/drivers/staging/rtlwifi/phydm/phydm_debug.c
+++ b/drivers/staging/rtlwifi/phydm/phydm_debug.c
@@ -51,20 +51,18 @@ static inline void phydm_check_dmval_txagc(struct phy_dm_struct *dm, u32 used,
 				      (power_index << 16) | (power_index << 8) |
 				      (power_index);
 			for (i = 0; i < ODM_RATEVHTSS2MCS9; i += 4)
-				status = (status &
-					  phydm_api_set_txagc(
-						  dm, power_index,
-						  (enum odm_rf_radio_path)
+				status &= phydm_api_set_txagc(
+						   dm, power_index,
+						   (enum odm_rf_radio_path)
 							  dm_value[1],
-						  i, false));
+						   i, false);
 		} else if (dm->support_ic_type & ODM_RTL8197F) {
 			for (i = 0; i <= ODM_RATEMCS15; i++)
-				status = (status &
-					  phydm_api_set_txagc(
-						  dm, power_index,
-						  (enum odm_rf_radio_path)
+				status &= phydm_api_set_txagc(
+						   dm, power_index,
+						   (enum odm_rf_radio_path)
 							  dm_value[1],
-						  i, false));
+						   i, false);
 		}
 
 		if (status)
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH v2] staging: rtlwifi: phydm: Remove parentheses
  2019-03-30 15:13 [PATCH v2] staging: rtlwifi: phydm: Remove parentheses Nishka Dasgupta
@ 2019-03-30 15:27 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2019-03-30 15:27 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: gregkh, outreachy-kernel



On Sat, 30 Mar 2019, 'Nishka Dasgupta' via outreachy-kernel wrote:

> Remove unnecessary parentheses on the right hand side and simplify expression.

The simplification should be explained in the commit log.
The log message should be under 80 characters wide.

julia

> Issue first detected using Coccinelle.
>
> Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> ---
> Changes in v2:
> - Change `status = status & <expression>` to `status &= <expression>`,
>   to make the code more readable.
>
>  drivers/staging/rtlwifi/phydm/phydm_debug.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/rtlwifi/phydm/phydm_debug.c b/drivers/staging/rtlwifi/phydm/phydm_debug.c
> index 91f2c054d83b..13b34dc33011 100644
> --- a/drivers/staging/rtlwifi/phydm/phydm_debug.c
> +++ b/drivers/staging/rtlwifi/phydm/phydm_debug.c
> @@ -51,20 +51,18 @@ static inline void phydm_check_dmval_txagc(struct phy_dm_struct *dm, u32 used,
>  				      (power_index << 16) | (power_index << 8) |
>  				      (power_index);
>  			for (i = 0; i < ODM_RATEVHTSS2MCS9; i += 4)
> -				status = (status &
> -					  phydm_api_set_txagc(
> -						  dm, power_index,
> -						  (enum odm_rf_radio_path)
> +				status &= phydm_api_set_txagc(
> +						   dm, power_index,
> +						   (enum odm_rf_radio_path)
>  							  dm_value[1],
> -						  i, false));
> +						   i, false);
>  		} else if (dm->support_ic_type & ODM_RTL8197F) {
>  			for (i = 0; i <= ODM_RATEMCS15; i++)
> -				status = (status &
> -					  phydm_api_set_txagc(
> -						  dm, power_index,
> -						  (enum odm_rf_radio_path)
> +				status &= phydm_api_set_txagc(
> +						   dm, power_index,
> +						   (enum odm_rf_radio_path)
>  							  dm_value[1],
> -						  i, false));
> +						   i, false);
>  		}
>
>  		if (status)
> --
> 2.19.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190330151341.3891-1-nishka.dasgupta%40yahoo.com.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-30 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-30 15:13 [PATCH v2] staging: rtlwifi: phydm: Remove parentheses Nishka Dasgupta
2019-03-30 15:27 ` [Outreachy kernel] " Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.