Skip to contentSkip to conversation

hwmon: (corsair-cpro) Fix fall-through warnings for Clang

PATCH RESEND Superseded Gustavo A. R. Silva 3 participants 4 messages Mar 5, 2021 – May 18, 2021

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 hwmon: (corsair-cpro) Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/hwmon/corsair-cpro.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/corsair-cpro.c +1 -0
index 591929ec217a..fa6aa4fc8b52 100644
@@ -310,6 +310,7 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
maintainer Acked-by on v1 1/1
#1 lore raw

On 06.03.21 at 10:53:59 CET, Gustavo A. R. Silva wrote

Quoted 7 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 17 lines
---
 drivers/hwmon/corsair-cpro.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/corsair-cpro.c +1 -0
index 591929ec217a..fa6aa4fc8b52 100644
@@ -310,6 +310,7 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
#2 lore raw
Quoted 10 lines · Marius Zachmann

On 06.03.21 at 10:53:59 CET, Gustavo A. R. Silva wrote

Quoted 7 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Thanks, Marius.

--
Gustavo

Quoted 22 lines
Quoted 18 lines
---
 drivers/hwmon/corsair-cpro.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/corsair-cpro.c +1 -0
index 591929ec217a..fa6aa4fc8b52 100644
@@ -310,6 +310,7 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
#3 lore raw
In reply to Marius Zachmann

Hi all,

If you don't mind, I'm taking this in my -next[1] branch for v5.14.

Thanks
--
Gustavo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp

Quoted 32 lines · Marius Zachmann

On 06.03.21 at 10:53:59 CET, Gustavo A. R. Silva wrote

Quoted 7 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 17 lines
---
 drivers/hwmon/corsair-cpro.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/corsair-cpro.c +1 -0
index 591929ec217a..fa6aa4fc8b52 100644
@@ -310,6 +310,7 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}