Skip to contentSkip to conversation

i2c: designware: Use fallthrough pseudo-keyword

PATCH In review Gustavo A. R. Silva 4 participants 7 messages Jul 21, 2020 – Jul 23, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: designware: Use fallthrough pseudo-keyword

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

---
 drivers/i2c/busses/i2c-designware-pcidrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-pcidrv.c +1 -1
index 8522134f9ea9..55c83a7a24f3 100644
@@ -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;
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Gustavo A. R. Silva

Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1].

Quoted 1 line

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

Perhaps you may do it as Link: tag?

Quoted 21 lines
---
 drivers/i2c/busses/i2c-designware-pcidrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-pcidrv.c +1 -2
index 8522134f9ea9..55c83a7a24f3 100644
@@ -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;
--

2.27.0

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 6 lines · Andy Shevchenko
Quoted 3 lines · Gustavo A. R. Silva

Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1].

Quoted 7 lines
Quoted 1 line

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

Perhaps you may do it as Link: tag?

mmh... that's a good suggestion; thanks, Andy.

--
Gustavo

Quoted 26 lines
Quoted 21 lines
---
 drivers/i2c/busses/i2c-designware-pcidrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-pcidrv.c +1 -2
index 8522134f9ea9..55c83a7a24f3 100644
@@ -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;
--

2.27.0

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw

Hi Wolfram,

Quoted 11 lines · Wolfram Sang
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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

Perhaps you may do it as Link: tag?

mmh... that's a good suggestion; thanks, Andy.

If you want to resend, please only one patch for all I2C drivers. The change is "cosmetic" enough to do that IMO.

The reason why I'm sending separate patches for this is because the drivers have different maintainers.

Also, I think theses patches are fine as is; and I will consider using a link tag for new patches.

Thanks
--
Gustavo

#5 lore raw
Quoted 7 lines
Quoted 4 lines

If you want to resend, please only one patch for all I2C drivers. The change is "cosmetic" enough to do that IMO.

The reason why I'm sending separate patches for this is because the drivers have different maintainers.

I see. Still, people can ack parts of a patch they are responsible for. I ack this way every now and then for cleanup patches, too.

That being said. All v2 and newer patches squashed into one and applied to for-next.

#6 lore raw
Quoted 3 lines · Wolfram Sang

I see. Still, people can ack parts of a patch they are responsible for. I ack this way every now and then for cleanup patches, too.

OK, I've got it. I'll take this into account for the next time.

Quoted 3 lines

That being said. All v2 and newer patches squashed into one and applied to for-next.

Awesome. :)

Thanks
--
Gustavo