i2c: busses: Use fallthrough pseudo-keyword
PATCH 1/1 i2c: busses: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1].
--- drivers/i2c/busses/i2c-amd8111.c | 2 +- drivers/i2c/busses/i2c-i801.c | 8 ++++---- drivers/i2c/busses/i2c-viapro.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/i2c/busses/i2c-amd8111.c +1 -1
@@ -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,
drivers/i2c/busses/i2c-i801.c +4 -4
@@ -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 :
drivers/i2c/busses/i2c-viapro.c +1 -1
@@ -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 ) {
Signature · 1 line
2.27.0
Hi Gustavo,
Quoted 58 lines · Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1].
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/i2c/busses/i2c-amd8111.c | 2 +- drivers/i2c/busses/i2c-i801.c | 8 ++++---- drivers/i2c/busses/i2c-viapro.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)drivers/i2c/busses/i2c-amd8111.c +1
-1@@ -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,drivers/i2c/busses/i2c-i801.c +4
-4@@ -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 :drivers/i2c/busses/i2c-viapro.c +0
-0
drivers/i2c/busses/i2c-viapro.c static s32 vt596_access(struct i2c_adapter *adap, u16 addr, · line 234
Quoted 8 lines
drivers/i2c/busses/i2c-viapro.c +1
-1@@ -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 ) {
Looks good to me, thanks for doing that.
However I see many occurrences in other drivers within drivers/i2c/busses, which are not covered by this patch:
drivers/i2c/busses/i2c-designware-pcidrv.cdrivers/i2c/busses/i2c-mv64xxx.cdrivers/i2c/busses/i2c-omap.cdrivers/i2c/busses/i2c-synquacer.cdrivers/i2c/busses/i2c-ibm_iic.cdrivers/i2c/busses/i2c-aspeed.cdrivers/i2c/busses/scx200_acb.cdrivers/i2c/busses/i2c-digicolor.cdrivers/i2c/busses/i2c-opal.c
Are they covered by another patch of yours?
Thanks,
Signature · 2 lines
Jean Delvare SUSE L3 Support
Hi,
Quoted 72 lines · Jean Delvare
Hi Gustavo,
Quoted 58 lines · Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1].
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/i2c/busses/i2c-amd8111.c | 2 +- drivers/i2c/busses/i2c-i801.c | 8 ++++---- drivers/i2c/busses/i2c-viapro.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)drivers/i2c/busses/i2c-amd8111.c +1
-1@@ -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,drivers/i2c/busses/i2c-i801.c +4
-4@@ -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 :drivers/i2c/busses/i2c-viapro.c +0
-0drivers/i2c/busses/i2c-viapro.c static s32 vt596_access(struct i2c_adapter *adap, u16 addr, · line 234
Quoted 8 lines
drivers/i2c/busses/i2c-viapro.c +1
-1@@ -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 ) {Looks good to me, thanks for doing that.
Quoted 2 lines
Reviewed-by Jean Delvare <[email protected]>
Thanks for this.
Quoted 13 lines
However I see many occurrences in other drivers within
drivers/i2c/busses, which are not covered by this patch:
drivers/i2c/busses/i2c-designware-pcidrv.cdrivers/i2c/busses/i2c-mv64xxx.cdrivers/i2c/busses/i2c-omap.cdrivers/i2c/busses/i2c-synquacer.cdrivers/i2c/busses/i2c-ibm_iic.cdrivers/i2c/busses/i2c-aspeed.cdrivers/i2c/busses/scx200_acb.cdrivers/i2c/busses/i2c-digicolor.cdrivers/i2c/busses/i2c-opal.c
Quoted 2 lines
Are they covered by another patch of yours?
Yep; I have a queue of pending patches I'm about to send. :)
Thanks
--
Gustavo