rt2x00: Use fallthrough pseudo-keyword
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 21 Aug 2020 06:20:52 +0000 (01:20 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 27 Aug 2020 13:05:48 +0000 (16:05 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200821062052.GA8618@embeddedor
drivers/net/wireless/ralink/rt2x00/rt2400pci.c
drivers/net/wireless/ralink/rt2x00/rt2500pci.c
drivers/net/wireless/ralink/rt2x00/rt2800lib.c
drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
drivers/net/wireless/ralink/rt2x00/rt2800usb.c
drivers/net/wireless/ralink/rt2x00/rt61pci.c
drivers/net/wireless/ralink/rt2x00/rt73usb.c

index c1ac933349d13a19c6f0aca6595c2c519846bcfe..c8bb378148c391f5fab124f26524c78c91308287 100644 (file)
@@ -1291,7 +1291,7 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev,
                        break;
                case 2: /* Failure, excessive retries */
                        __set_bit(TXDONE_EXCESSIVE_RETRY, &txdesc.flags);
-                       /* Fall through - this is a failed frame! */
+                       fallthrough;    /* this is a failed frame! */
                default: /* Failure */
                        __set_bit(TXDONE_FAILURE, &txdesc.flags);
                }
index 0859adebd86080809ae1bd0b93565c1bad784e4d..2e015c16cd4bfb487c18653ffc5096e064b7c93c 100644 (file)
@@ -1419,7 +1419,7 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev,
                        break;
                case 2: /* Failure, excessive retries */
                        __set_bit(TXDONE_EXCESSIVE_RETRY, &txdesc.flags);
-                       /* Fall through - this is a failed frame! */
+                       fallthrough;    /* this is a failed frame! */
                default: /* Failure */
                        __set_bit(TXDONE_FAILURE, &txdesc.flags);
                }
index a779fe771a551795457d9b92b952a2a82d611c72..fed6d21cd6ce19c8d728902a9925f5b782196e28 100644 (file)
@@ -928,7 +928,7 @@ static void rt2800_rate_from_status(struct skb_frame_desc *skbdesc,
        switch (rt2x00_get_field32(status, TX_STA_FIFO_PHYMODE)) {
        case RATE_MODE_HT_GREENFIELD:
                flags |= IEEE80211_TX_RC_GREEN_FIELD;
-               /* fall through */
+               fallthrough;
        case RATE_MODE_HT_MIX:
                flags |= IEEE80211_TX_RC_MCS;
                break;
@@ -2567,7 +2567,7 @@ static void rt2800_config_channel_rf3052(struct rt2x00_dev *rt2x00dev,
                switch (rt2x00dev->default_ant.tx_chain_num) {
                case 1:
                        rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 1);
-                       /* fall through */
+                       fallthrough;
                case 2:
                        rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 1);
                        break;
@@ -2576,7 +2576,7 @@ static void rt2800_config_channel_rf3052(struct rt2x00_dev *rt2x00dev,
                switch (rt2x00dev->default_ant.rx_chain_num) {
                case 1:
                        rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 1);
-                       /* fall through */
+                       fallthrough;
                case 2:
                        rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 1);
                        break;
@@ -2768,10 +2768,10 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev,
        switch (rt2x00dev->default_ant.tx_chain_num) {
        case 3:
                rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 1);
-               /* fallthrough */
+               fallthrough;
        case 2:
                rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 1);
-               /* fallthrough */
+               fallthrough;
        case 1:
                rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 1);
                break;
@@ -2780,10 +2780,10 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev,
        switch (rt2x00dev->default_ant.rx_chain_num) {
        case 3:
                rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 1);
-               /* fallthrough */
+               fallthrough;
        case 2:
                rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 1);
-               /* fallthrough */
+               fallthrough;
        case 1:
                rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 1);
                break;
@@ -3005,10 +3005,10 @@ static void rt2800_config_channel_rf3853(struct rt2x00_dev *rt2x00dev,
        switch (rt2x00dev->default_ant.tx_chain_num) {
        case 3:
                rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 1);
-               /* fallthrough */
+               fallthrough;
        case 2:
                rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 1);
-               /* fallthrough */
+               fallthrough;
        case 1:
                rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 1);
                break;
@@ -3017,10 +3017,10 @@ static void rt2800_config_channel_rf3853(struct rt2x00_dev *rt2x00dev,
        switch (rt2x00dev->default_ant.rx_chain_num) {
        case 3:
                rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 1);
-               /* fallthrough */
+               fallthrough;
        case 2:
                rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 1);
-               /* fallthrough */
+               fallthrough;
        case 1:
                rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 1);
                break;
@@ -4216,14 +4216,14 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
                                   rf->channel > 14);
                rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G2_EN,
                                   rf->channel <= 14);
-               /* fall-through */
+               fallthrough;
        case 2:
                /* Turn on secondary PAs */
                rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN,
                                   rf->channel > 14);
                rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN,
                                   rf->channel <= 14);
-               /* fall-through */
+               fallthrough;
        case 1:
                /* Turn on primary PAs */
                rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN,
@@ -4241,12 +4241,12 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
                /* Turn on tertiary LNAs */
                rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN, 1);
                rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN, 1);
-               /* fall-through */
+               fallthrough;
        case 2:
                /* Turn on secondary LNAs */
                rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
                rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
-               /* fall-through */
+               fallthrough;
        case 1:
                /* Turn on primary LNAs */
                rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
@@ -5438,10 +5438,10 @@ void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev)
                switch (rt2x00dev->default_ant.tx_chain_num) {
                case 3:
                        rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G2_EN, 1);
-                       /* fall through */
+                       fallthrough;
                case 2:
                        rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 1);
-                       /* fall through */
+                       fallthrough;
                case 1:
                default:
                        rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1);
@@ -5451,10 +5451,10 @@ void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev)
                switch (rt2x00dev->default_ant.tx_chain_num) {
                case 3:
                        rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A2_EN, 1);
-                       /* fall through */
+                       fallthrough;
                case 2:
                        rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, 1);
-                       /* fall through */
+                       fallthrough;
                case 1:
                default:
                        rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, 1);
@@ -10100,10 +10100,10 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
        switch (rx_chains) {
        case 3:
                spec->ht.mcs.rx_mask[2] = 0xff;
-               /* fall through */
+               fallthrough;
        case 2:
                spec->ht.mcs.rx_mask[1] = 0xff;
-               /* fall through */
+               fallthrough;
        case 1:
                spec->ht.mcs.rx_mask[0] = 0xff;
                spec->ht.mcs.rx_mask[4] = 0x1; /* MCS32 */
index 110bb391c372ba2cce97702a721b19c64a926be6..6e7c1475726177350d5f8f64c9227e9b52793b9e 100644 (file)
@@ -593,7 +593,6 @@ void rt2800mmio_queue_init(struct data_queue *queue)
                break;
 
        case QID_ATIM:
-               /* fallthrough */
        default:
                BUG();
                break;
index 4cc64fe481a71e6c99162b6473c06bd6d6e1ba28..d08b251ec5a265496a1c5f207aa01d43a63ffc9a 100644 (file)
@@ -746,7 +746,6 @@ static void rt2800usb_queue_init(struct data_queue *queue)
                break;
 
        case QID_ATIM:
-               /* fallthrough */
        default:
                BUG();
                break;
index eefce76fc99b3cfebf1fa2a92cd5ff007bc5d3cc..43c3cdd13710a0f9e1046835ddaeb966116b1584 100644 (file)
@@ -2130,7 +2130,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
                        break;
                case 6: /* Failure, excessive retries */
                        __set_bit(TXDONE_EXCESSIVE_RETRY, &txdesc.flags);
-                       /* Fall through - this is a failed frame! */
+                       fallthrough;    /* this is a failed frame! */
                default: /* Failure */
                        __set_bit(TXDONE_FAILURE, &txdesc.flags);
                }
@@ -2953,7 +2953,6 @@ static void rt61pci_queue_init(struct data_queue *queue)
                break;
 
        case QID_ATIM:
-               /* fallthrough */
        default:
                BUG();
                break;
index e908c303b6772d2a3dbda1235e6cdb58e954332e..e69793773d8704e2a1ac6f4aa406dc8b01d285cc 100644 (file)
@@ -2373,7 +2373,6 @@ static void rt73usb_queue_init(struct data_queue *queue)
                break;
 
        case QID_ATIM:
-               /* fallthrough */
        default:
                BUG();
                break;