* [PATCH][next] i2c: busses: Use fallthrough pseudo-keyword
@ 2020-07-16 22:03 Gustavo A. R. Silva
2020-07-20 14:59 ` Jean Delvare
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2020-07-16 22:03 UTC (permalink / raw)
To: Jean Delvare; +Cc: linux-i2c, linux-kernel, Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
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(-)
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
index 2b14fef5bf26..34862ad3423e 100644
--- a/drivers/i2c/busses/i2c-amd8111.c
+++ b/drivers/i2c/busses/i2c-amd8111.c
@@ -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,
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 1fc7ae77753d..638e7f7c66cc 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -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:
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
index 05aa92a3fbe0..970ccdcbb889 100644
--- a/drivers/i2c/busses/i2c-viapro.c
+++ b/drivers/i2c/busses/i2c-viapro.c
@@ -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) {
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][next] i2c: busses: Use fallthrough pseudo-keyword
2020-07-16 22:03 [PATCH][next] i2c: busses: Use fallthrough pseudo-keyword Gustavo A. R. Silva
@ 2020-07-20 14:59 ` Jean Delvare
2020-07-20 15:10 ` Gustavo A. R. Silva
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2020-07-20 14:59 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: linux-i2c, linux-kernel, Gustavo A. R. Silva
Hi Gustavo,
On Thu, 16 Jul 2020 17:03:07 -0500, Gustavo A. R. Silva wrote:
> Replace the existing /* fall through */ comments and its variants with
> the new pseudo-keyword macro fallthrough[1].
>
> [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
>
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> 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(-)
>
> diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
> index 2b14fef5bf26..34862ad3423e 100644
> --- a/drivers/i2c/busses/i2c-amd8111.c
> +++ b/drivers/i2c/busses/i2c-amd8111.c
> @@ -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,
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index 1fc7ae77753d..638e7f7c66cc 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -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:
> diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
> index 05aa92a3fbe0..970ccdcbb889 100644
> --- a/drivers/i2c/busses/i2c-viapro.c
> +++ b/drivers/i2c/busses/i2c-viapro.c
> @@ -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.
Reviewed-by: Jean Delvare <jdelvare@suse.de>
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.c
drivers/i2c/busses/i2c-mv64xxx.c
drivers/i2c/busses/i2c-omap.c
drivers/i2c/busses/i2c-synquacer.c
drivers/i2c/busses/i2c-ibm_iic.c
drivers/i2c/busses/i2c-aspeed.c
drivers/i2c/busses/scx200_acb.c
drivers/i2c/busses/i2c-digicolor.c
drivers/i2c/busses/i2c-opal.c
Are they covered by another patch of yours?
Thanks,
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] i2c: busses: Use fallthrough pseudo-keyword
2020-07-20 14:59 ` Jean Delvare
@ 2020-07-20 15:10 ` Gustavo A. R. Silva
0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2020-07-20 15:10 UTC (permalink / raw)
To: Jean Delvare, Gustavo A. R. Silva; +Cc: linux-i2c, linux-kernel
Hi,
On 7/20/20 09:59, Jean Delvare wrote:
> Hi Gustavo,
>
> On Thu, 16 Jul 2020 17:03:07 -0500, Gustavo A. R. Silva wrote:
>> Replace the existing /* fall through */ comments and its variants with
>> the new pseudo-keyword macro fallthrough[1].
>>
>> [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>> ---
>> 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(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
>> index 2b14fef5bf26..34862ad3423e 100644
>> --- a/drivers/i2c/busses/i2c-amd8111.c
>> +++ b/drivers/i2c/busses/i2c-amd8111.c
>> @@ -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,
>> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
>> index 1fc7ae77753d..638e7f7c66cc 100644
>> --- a/drivers/i2c/busses/i2c-i801.c
>> +++ b/drivers/i2c/busses/i2c-i801.c
>> @@ -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:
>> diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
>> index 05aa92a3fbe0..970ccdcbb889 100644
>> --- a/drivers/i2c/busses/i2c-viapro.c
>> +++ b/drivers/i2c/busses/i2c-viapro.c
>> @@ -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.
>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
>
Thanks for this.
> 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.c
> drivers/i2c/busses/i2c-mv64xxx.c
> drivers/i2c/busses/i2c-omap.c
> drivers/i2c/busses/i2c-synquacer.c
> drivers/i2c/busses/i2c-ibm_iic.c
> drivers/i2c/busses/i2c-aspeed.c
> drivers/i2c/busses/scx200_acb.c
> drivers/i2c/busses/i2c-digicolor.c
> drivers/i2c/busses/i2c-opal.c
>
> Are they covered by another patch of yours?
>
Yep; I have a queue of pending patches I'm about to send. :)
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-20 15:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-16 22:03 [PATCH][next] i2c: busses: Use fallthrough pseudo-keyword Gustavo A. R. Silva
2020-07-20 14:59 ` Jean Delvare
2020-07-20 15:10 ` Gustavo A. R. Silva
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.