Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH][next] ath11k: Use fallthrough pseudo-keyword
@ 2020-07-27 19:44 Gustavo A. R. Silva
  2020-07-27 19:44 ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2020-07-27 19:44 UTC (permalink / raw)
  To: Kalle Valo, David S. Miller, Jakub Kicinski
  Cc: ath11k, linux-wireless, netdev, linux-kernel, Gustavo A. R. Silva

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/net/wireless/ath/ath11k/core.c  |  2 +-
 drivers/net/wireless/ath/ath11k/dp.c    |  2 +-
 drivers/net/wireless/ath/ath11k/dp_rx.c |  3 +--
 drivers/net/wireless/ath/ath11k/mac.c   | 22 +++++++++++-----------
 4 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 905cd8beaf28..2fbcb2259fd9 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -706,7 +706,7 @@ static void ath11k_core_restart(struct work_struct *work)
 			break;
 		case ATH11K_STATE_RESTARTED:
 			ar->state = ATH11K_STATE_WEDGED;
-			/* fall through */
+			fallthrough;
 		case ATH11K_STATE_WEDGED:
 			ath11k_warn(ab,
 				    "device is wedged, will not restart radio %d\n", i);
diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
index 1d64c3c51ac9..141a046b9269 100644
--- a/drivers/net/wireless/ath/ath11k/dp.c
+++ b/drivers/net/wireless/ath/ath11k/dp.c
@@ -159,7 +159,7 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring,
 			break;
 		}
 		/* follow through when ring_num >= 3 */
-		/* fall through */
+		fallthrough;
 	case HAL_REO_EXCEPTION:
 	case HAL_REO_REINJECT:
 	case HAL_REO_CMD:
diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 791d971784ce..97137507a0bd 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -3709,8 +3709,7 @@ static bool ath11k_dp_rx_h_reo_err(struct ath11k *ar, struct sk_buff *msdu,
 		 * instead, it is good to drop such packets in mac80211
 		 * after incrementing the replay counters.
 		 */
-
-		/* fall through */
+		fallthrough;
 	default:
 		/* TODO: Review other errors and process them to mac80211
 		 * as appropriate.
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 07d3e031c75a..648eabadc094 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -1138,13 +1138,13 @@ ath11k_peer_assoc_h_vht_limit(u16 tx_mcs_set,
 			idx_limit = -1;
 
 		switch (idx_limit) {
-		case 0: /* fall through */
-		case 1: /* fall through */
-		case 2: /* fall through */
-		case 3: /* fall through */
-		case 4: /* fall through */
-		case 5: /* fall through */
-		case 6: /* fall through */
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+		case 5:
+		case 6:
 		case 7:
 			mcs = IEEE80211_VHT_MCS_SUPPORT_0_7;
 			break;
@@ -1156,7 +1156,7 @@ ath11k_peer_assoc_h_vht_limit(u16 tx_mcs_set,
 			break;
 		default:
 			WARN_ON(1);
-			/* fall through */
+			fallthrough;
 		case -1:
 			mcs = IEEE80211_VHT_MCS_NOT_SUPPORTED;
 			break;
@@ -1339,7 +1339,7 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar,
 		arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_160] = v;
 
 		arg->peer_he_mcs_count++;
-		/* fall through */
+		fallthrough;
 
 	default:
 		v = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_80);
@@ -2114,7 +2114,7 @@ void __ath11k_mac_scan_finish(struct ath11k *ar)
 		} else if (ar->scan.roc_notify) {
 			ieee80211_remain_on_channel_expired(ar->hw);
 		}
-		/* fall through */
+		fallthrough;
 	case ATH11K_SCAN_STARTING:
 		ar->scan.state = ATH11K_SCAN_IDLE;
 		ar->scan_channel = NULL;
@@ -4368,7 +4368,7 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
 		break;
 	case NL80211_IFTYPE_MESH_POINT:
 		arvif->vdev_subtype = WMI_VDEV_SUBTYPE_MESH_11S;
-		/* fall through */
+		fallthrough;
 	case NL80211_IFTYPE_AP:
 		arvif->vdev_type = WMI_VDEV_TYPE_AP;
 		break;
-- 
2.27.0


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

* Re: [PATCH][next] ath11k: Use fallthrough pseudo-keyword
  2020-07-27 19:44 [PATCH][next] ath11k: Use fallthrough pseudo-keyword Gustavo A. R. Silva
@ 2020-07-27 19:44 ` Joe Perches
  2020-07-27 23:44   ` Julian Calaby
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2020-07-27 19:44 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Kalle Valo, David S. Miller, Jakub Kicinski
  Cc: ath11k, linux-wireless, netdev, linux-kernel

On Mon, 2020-07-27 at 14:44 -0500, Gustavo A. R. Silva wrote:
> Replace the existing /* fall through */ comments and its variants with
> the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
> fall-through markings when it is the case.
[]
> diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
[]
> @@ -159,7 +159,7 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring,
>  			break;
>  		}
>  		/* follow through when ring_num >= 3 */
> -		/* fall through */
> +		fallthrough;

Likely the /* follow through ... */ comment can be deleted too



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

* Re: [PATCH][next] ath11k: Use fallthrough pseudo-keyword
  2020-07-27 19:44 ` Joe Perches
@ 2020-07-27 23:44   ` Julian Calaby
  2020-07-28  0:03     ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Julian Calaby @ 2020-07-27 23:44 UTC (permalink / raw)
  To: Joe Perches
  Cc: Gustavo A. R. Silva, Kalle Valo, David S. Miller, Jakub Kicinski,
	ath11k, linux-wireless, netdev, LKML

Hi Joe,

On Tue, Jul 28, 2020 at 5:48 AM Joe Perches <joe@perches.com> wrote:
>
> On Mon, 2020-07-27 at 14:44 -0500, Gustavo A. R. Silva wrote:
> > Replace the existing /* fall through */ comments and its variants with
> > the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
> > fall-through markings when it is the case.
> []
> > diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
> []
> > @@ -159,7 +159,7 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring,
> >                       break;
> >               }
> >               /* follow through when ring_num >= 3 */
> > -             /* fall through */
> > +             fallthrough;
>
> Likely the /* follow through ... */ comment can be deleted too

If the "when ring_num >= 3" comment is needed, how should this get
formatted? Maybe something like:

fallthrough; /* when ring_num >= 3 */

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

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

* Re: [PATCH][next] ath11k: Use fallthrough pseudo-keyword
  2020-07-27 23:44   ` Julian Calaby
@ 2020-07-28  0:03     ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2020-07-28  0:03 UTC (permalink / raw)
  To: Julian Calaby
  Cc: Gustavo A. R. Silva, Kalle Valo, David S. Miller, Jakub Kicinski,
	ath11k, linux-wireless, netdev, LKML

On Tue, 2020-07-28 at 09:44 +1000, Julian Calaby wrote:
> Hi Joe,
> 
> On Tue, Jul 28, 2020 at 5:48 AM Joe Perches <joe@perches.com> wrote:
> > On Mon, 2020-07-27 at 14:44 -0500, Gustavo A. R. Silva wrote:
> > > Replace the existing /* fall through */ comments and its variants with
> > > the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
> > > fall-through markings when it is the case.
> > []
> > > diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
> > []
> > > @@ -159,7 +159,7 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring,
> > >                       break;
> > >               }
> > >               /* follow through when ring_num >= 3 */
> > > -             /* fall through */
> > > +             fallthrough;
> > 
> > Likely the /* follow through ... */ comment can be deleted too
> 
> If the "when ring_num >= 3" comment is needed, how should this get
> formatted? Maybe something like:
> 
> fallthrough; /* when ring_num >= 3 */

Likely, or just removed as the test above is fairly clear

Existing code:

	case HAL_WBM2SW_RELEASE:
		if (ring_num < 3) {
			params.intr_batch_cntr_thres_entries =
					HAL_SRNG_INT_BATCH_THRESHOLD_TX;
			params.intr_timer_thres_us =
					HAL_SRNG_INT_TIMER_THRESHOLD_TX;
			break;
		}
		/* follow through when ring_num >= 3 */
		/* fall through */
	case HAL_REO_EXCEPTION:



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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 19:44 [PATCH][next] ath11k: Use fallthrough pseudo-keyword Gustavo A. R. Silva
2020-07-27 19:44 ` Joe Perches
2020-07-27 23:44   ` Julian Calaby
2020-07-28  0:03     ` Joe Perches

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org
	public-inbox-index linux-wireless

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git