i2c: busses: Use fallthrough pseudo-keyword
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 21 Jul 2020 23:05:10 +0000 (18:05 -0500)
committerWolfram Sang <wsa@kernel.org>
Thu, 23 Jul 2020 20:04:08 +0000 (22:04 +0200)
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].

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

Acked-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-amd8111.c
drivers/i2c/busses/i2c-aspeed.c
drivers/i2c/busses/i2c-designware-pcidrv.c
drivers/i2c/busses/i2c-digicolor.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-mv64xxx.c
drivers/i2c/busses/i2c-synquacer.c
drivers/i2c/busses/i2c-viapro.c
drivers/i2c/busses/scx200_acb.c
drivers/i2c/i2c-slave-eeprom.c

index 2b14fef..34862ad 100644 (file)
@@ -381,7 +381,7 @@ static s32 amd8111_access(struct i2c_adapter * adap, u16 addr,
                        if (status)
                                return status;
                        len = min_t(u8, len, I2C_SMBUS_BLOCK_MAX);
-                       /* fall through */
+                       fallthrough;
                case I2C_SMBUS_I2C_BLOCK_DATA:
                        for (i = 0; i < len; i++) {
                                status = amd_ec_read(smbus, AMD_SMB_DATA + i,
index f51702d..3126807 100644 (file)
@@ -504,7 +504,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
                        goto error_and_stop;
                }
                irq_handled |= ASPEED_I2CD_INTR_TX_ACK;
-               /* fall through */
+               fallthrough;
        case ASPEED_I2C_MASTER_TX_FIRST:
                if (bus->buf_index < msg->len) {
                        bus->master_state = ASPEED_I2C_MASTER_TX;
@@ -520,7 +520,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
                /* RX may not have completed yet (only address cycle) */
                if (!(irq_status & ASPEED_I2CD_INTR_RX_DONE))
                        goto out_no_complete;
-               /* fall through */
+               fallthrough;
        case ASPEED_I2C_MASTER_RX:
                if (unlikely(!(irq_status & ASPEED_I2CD_INTR_RX_DONE))) {
                        dev_err(bus->dev, "master failed to RX\n");
index 8522134..55c83a7 100644 (file)
@@ -90,7 +90,7 @@ static int mfld_setup(struct pci_dev *pdev, struct dw_pci_controller *c)
        switch (pdev->device) {
        case 0x0817:
                dev->timings.bus_freq_hz = I2C_MAX_STANDARD_MODE_FREQ;
-               /* fall through */
+               fallthrough;
        case 0x0818:
        case 0x0819:
                c->bus_num = pdev->device - 0x817 + 3;
index 332f004..f67639d 100644 (file)
@@ -187,7 +187,7 @@ static irqreturn_t dc_i2c_irq(int irq, void *dev_id)
                        break;
                }
                i2c->state = STATE_WRITE;
-               /* fall through */
+               fallthrough;
        case STATE_WRITE:
                if (i2c->msgbuf_ptr < i2c->msg->len)
                        dc_i2c_write_buf(i2c);
index 1fc7ae7..638e7f7 100644 (file)
@@ -1765,19 +1765,19 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
        case PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS1:
        case PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS2:
                priv->features |= FEATURE_IDF;
-               /* fall through */
+               fallthrough;
        default:
                priv->features |= FEATURE_BLOCK_PROC;
                priv->features |= FEATURE_I2C_BLOCK_READ;
                priv->features |= FEATURE_IRQ;
-               /* fall through */
+               fallthrough;
        case PCI_DEVICE_ID_INTEL_82801DB_3:
                priv->features |= FEATURE_SMBUS_PEC;
                priv->features |= FEATURE_BLOCK_BUFFER;
-               /* fall through */
+               fallthrough;
        case PCI_DEVICE_ID_INTEL_82801CA_3:
                priv->features |= FEATURE_HOST_NOTIFY;
-               /* fall through */
+               fallthrough;
        case PCI_DEVICE_ID_INTEL_82801BA_2:
        case PCI_DEVICE_ID_INTEL_82801AB_3:
        case PCI_DEVICE_ID_INTEL_82801AA_3:
index 829b8c9..8d9d4ff 100644 (file)
@@ -251,7 +251,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
                                MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK;
                        break;
                }
-               /* FALLTHRU */
+               fallthrough;
        case MV64XXX_I2C_STATUS_MAST_WR_ADDR_2_ACK: /* 0xd0 */
        case MV64XXX_I2C_STATUS_MAST_WR_ACK: /* 0x28 */
                if ((drv_data->bytes_left == 0)
@@ -282,14 +282,14 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
                                MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK;
                        break;
                }
-               /* FALLTHRU */
+               fallthrough;
        case MV64XXX_I2C_STATUS_MAST_RD_ADDR_2_ACK: /* 0xe0 */
                if (drv_data->bytes_left == 0) {
                        drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP;
                        drv_data->state = MV64XXX_I2C_STATE_IDLE;
                        break;
                }
-               /* FALLTHRU */
+               fallthrough;
        case MV64XXX_I2C_STATUS_MAST_RD_DATA_ACK: /* 0x50 */
                if (status != MV64XXX_I2C_STATUS_MAST_RD_DATA_ACK)
                        drv_data->action = MV64XXX_I2C_ACTION_CONTINUE;
@@ -417,8 +417,7 @@ mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data)
                        "mv64xxx_i2c_do_action: Invalid action: %d\n",
                        drv_data->action);
                drv_data->rc = -EIO;
-
-               /* FALLTHRU */
+               fallthrough;
        case MV64XXX_I2C_ACTION_SEND_STOP:
                drv_data->cntl_bits &= ~MV64XXX_I2C_REG_CONTROL_INTEN;
                writel(drv_data->cntl_bits | MV64XXX_I2C_REG_CONTROL_STOP,
index c9a3dba..31be181 100644 (file)
@@ -398,8 +398,7 @@ static irqreturn_t synquacer_i2c_isr(int irq, void *dev_id)
 
                if (i2c->state == STATE_READ)
                        goto prepare_read;
-
-               /* fall through */
+               fallthrough;
 
        case STATE_WRITE:
                if (bsr & SYNQUACER_I2C_BSR_LRB) {
index 05aa92a..970ccdc 100644 (file)
@@ -228,7 +228,7 @@ static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
                        goto exit_unsupported;
                if (read_write == I2C_SMBUS_READ)
                        outb_p(data->block[0], SMBHSTDAT0);
-               /* Fall through */
+               fallthrough;
        case I2C_SMBUS_BLOCK_DATA:
                outb_p(command, SMBHSTCMD);
                if (read_write == I2C_SMBUS_WRITE) {
index bd9afa3..7b42a18 100644 (file)
@@ -151,7 +151,7 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status)
 
        case state_repeat_start:
                outb(inb(ACBCTL1) | ACBCTL1_START, ACBCTL1);
-               /* fallthrough */
+               fallthrough;
 
        case state_quick:
                if (iface->address_byte & 1) {
index 593f2fd..5c7ae42 100644 (file)
@@ -66,7 +66,7 @@ static int i2c_slave_eeprom_slave_cb(struct i2c_client *client,
        case I2C_SLAVE_READ_PROCESSED:
                /* The previous byte made it to the bus, get next one */
                eeprom->buffer_idx++;
-               /* fallthrough */
+               fallthrough;
        case I2C_SLAVE_READ_REQUESTED:
                spin_lock(&eeprom->buffer_lock);
                *val = eeprom->buffer[eeprom->buffer_idx & eeprom->address_mask];