linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mwifiex: clean up some inconsistent indenting
@ 2023-11-10  8:33 Jiapeng Chong
  2023-11-10 21:39 ` Johannes Berg
  2023-11-11  0:38 ` Jeff Johnson
  0 siblings, 2 replies; 4+ messages in thread
From: Jiapeng Chong @ 2023-11-10  8:33 UTC (permalink / raw)
  To: briannorris
  Cc: kvalo, linux-wireless, linux-kernel, Jiapeng Chong, Abaci Robot

No functional modification involved.

drivers/net/wireless/marvell/mwifiex/sta_event.c:789 mwifiex_process_sta_event() warn: inconsistent indenting.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7226
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/wireless/marvell/mwifiex/sta_event.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c
index df9cdd10a494..9dd3b6d71026 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
@@ -762,7 +762,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
 		mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n");
 		if (!adapter->pps_uapsd_mode &&
 		    (priv->port_open ||
-		     (priv->bss_mode == NL80211_IFTYPE_ADHOC)) &&
+		    (priv->bss_mode == NL80211_IFTYPE_ADHOC)) &&
 		    priv->media_connected && adapter->sleep_period.period) {
 			adapter->pps_uapsd_mode = true;
 			mwifiex_dbg(adapter, EVENT,
@@ -773,7 +773,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
 			if (mwifiex_check_last_packet_indication(priv)) {
 				if (adapter->data_sent ||
 				    (adapter->if_ops.is_port_ready &&
-				     !adapter->if_ops.is_port_ready(priv))) {
+				    !adapter->if_ops.is_port_ready(priv))) {
 					adapter->ps_state = PS_STATE_AWAKE;
 					adapter->pm_wakeup_card_req = false;
 					adapter->pm_wakeup_fw_try = false;
@@ -781,12 +781,10 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
 					break;
 				}
 				if (!mwifiex_send_null_packet
-					(priv,
-					 MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET |
-					 MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET))
-						adapter->ps_state =
-							PS_STATE_SLEEP;
-					return 0;
+				    (priv, MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET |
+				     MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET))
+					adapter->ps_state = PS_STATE_SLEEP;
+				return 0;
 			}
 		}
 		adapter->ps_state = PS_STATE_AWAKE;
-- 
2.20.1.7.g153144c


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

* Re: [PATCH] mwifiex: clean up some inconsistent indenting
  2023-11-10  8:33 [PATCH] mwifiex: clean up some inconsistent indenting Jiapeng Chong
@ 2023-11-10 21:39 ` Johannes Berg
  2023-11-11  0:38 ` Jeff Johnson
  1 sibling, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2023-11-10 21:39 UTC (permalink / raw)
  To: Jiapeng Chong, briannorris
  Cc: kvalo, linux-wireless, linux-kernel, Abaci Robot

On Fri, 2023-11-10 at 16:33 +0800, Jiapeng Chong wrote:
> No functional modification involved.
> 
> drivers/net/wireless/marvell/mwifiex/sta_event.c:789 mwifiex_process_sta_event() warn: inconsistent indenting.

OK, sure ...

> +++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
> @@ -762,7 +762,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
>  		mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n");
>  		if (!adapter->pps_uapsd_mode &&
>  		    (priv->port_open ||
> -		     (priv->bss_mode == NL80211_IFTYPE_ADHOC)) &&
> +		    (priv->bss_mode == NL80211_IFTYPE_ADHOC)) &&
>  		    priv->media_connected && adapter->sleep_period.period) {
>  			adapter->pps_uapsd_mode = true;
>  			mwifiex_dbg(adapter, EVENT,
> @@ -773,7 +773,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
>  			if (mwifiex_check_last_packet_indication(priv)) {
>  				if (adapter->data_sent ||
>  				    (adapter->if_ops.is_port_ready &&
> -				     !adapter->if_ops.is_port_ready(priv))) {
> +				    !adapter->if_ops.is_port_ready(priv))) {
>  					adapter->ps_state = PS_STATE_AWAKE;
>  					adapter->pm_wakeup_card_req = false;
>  					adapter->pm_wakeup_fw_try = false;


Seems fine.

> @@ -781,12 +781,10 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
>  					break;
>  				}
>  				if (!mwifiex_send_null_packet
> -					(priv,
> -					 MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET |
> -					 MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET))
> -						adapter->ps_state =
> -							PS_STATE_SLEEP;
> -					return 0;
> +				    (priv, MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET |
> +				     MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET))
> +					adapter->ps_state = PS_STATE_SLEEP;
> +				return 0;
> 

🤷‍♀️️
That's not really an improvement is it? You've just indented the
function arguments as if they were part another part of the condition? I
mean, sure, it was awful - but ... maybe better break the 80 cols rule
(which isn't one any more anyway)?

johannes

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

* Re: [PATCH] mwifiex: clean up some inconsistent indenting
  2023-11-10  8:33 [PATCH] mwifiex: clean up some inconsistent indenting Jiapeng Chong
  2023-11-10 21:39 ` Johannes Berg
@ 2023-11-11  0:38 ` Jeff Johnson
  2023-11-11  0:57   ` Johannes Berg
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Johnson @ 2023-11-11  0:38 UTC (permalink / raw)
  To: Jiapeng Chong, briannorris
  Cc: kvalo, linux-wireless, linux-kernel, Abaci Robot

On 11/10/2023 12:33 AM, Jiapeng Chong wrote:
> No functional modification involved.
> 
> drivers/net/wireless/marvell/mwifiex/sta_event.c:789 mwifiex_process_sta_event() warn: inconsistent indenting.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7226
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/net/wireless/marvell/mwifiex/sta_event.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c
> index df9cdd10a494..9dd3b6d71026 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
> @@ -762,7 +762,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
>  		mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n");
>  		if (!adapter->pps_uapsd_mode &&
>  		    (priv->port_open ||
> -		     (priv->bss_mode == NL80211_IFTYPE_ADHOC)) &&
> +		    (priv->bss_mode == NL80211_IFTYPE_ADHOC)) &&

this change looks incorrect to me
this condition is *inside* the parenthesis from the beginning of the
previous line, and hence this should align after that parenthesis, not
with that parenthesis, which is what the existing code is doing

>  		    priv->media_connected && adapter->sleep_period.period) {
>  			adapter->pps_uapsd_mode = true;
>  			mwifiex_dbg(adapter, EVENT,
> @@ -773,7 +773,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
>  			if (mwifiex_check_last_packet_indication(priv)) {
>  				if (adapter->data_sent ||
>  				    (adapter->if_ops.is_port_ready &&
> -				     !adapter->if_ops.is_port_ready(priv))) {
> +				    !adapter->if_ops.is_port_ready(priv))) {

same thing here

>  					adapter->ps_state = PS_STATE_AWAKE;
>  					adapter->pm_wakeup_card_req = false;
>  					adapter->pm_wakeup_fw_try = false;


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

* Re: [PATCH] mwifiex: clean up some inconsistent indenting
  2023-11-11  0:38 ` Jeff Johnson
@ 2023-11-11  0:57   ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2023-11-11  0:57 UTC (permalink / raw)
  To: Jeff Johnson, Jiapeng Chong, briannorris
  Cc: kvalo, linux-wireless, linux-kernel, Abaci Robot

On Fri, 2023-11-10 at 16:38 -0800, Jeff Johnson wrote:
> > drivers/net/wireless/marvell/mwifiex/sta_event.c:789 mwifiex_process_sta_event() warn: inconsistent indenting.
> > 
> > Reported-by: Abaci Robot <abaci@linux.alibaba.com>

> >  		if (!adapter->pps_uapsd_mode &&
> >  		    (priv->port_open ||
> > -		     (priv->bss_mode == NL80211_IFTYPE_ADHOC)) &&
> > +		    (priv->bss_mode == NL80211_IFTYPE_ADHOC)) &&
> 
> this change looks incorrect to me
> this condition is *inside* the parenthesis from the beginning of the
> previous line, and hence this should align after that parenthesis, not
> with that parenthesis, which is what the existing code is doing

Hah, you're right, I completely missed that! I guess someone should fix
their tools :)

johannes

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

end of thread, other threads:[~2023-11-11  0:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-10  8:33 [PATCH] mwifiex: clean up some inconsistent indenting Jiapeng Chong
2023-11-10 21:39 ` Johannes Berg
2023-11-11  0:38 ` Jeff Johnson
2023-11-11  0:57   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).