Skip to contentSkip to conversation

platform/x86: dell-laptop: Mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 2 participants 3 messages Jul 5, 2018 – Feb 19, 2019 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: dell-laptop: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

---
 drivers/platform/x86/dell-laptop.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/dell-laptop.c +2 -0
index f1fa861..1938f11 100644
@@ -1565,8 +1565,10 @@ static ssize_t kbd_led_timeout_store(struct device *dev,
 		switch (unit) {
 		case KBD_TIMEOUT_DAYS:
 			value *= 24;
+			/* fall through */
 		case KBD_TIMEOUT_HOURS:
 			value *= 60;
+			/* fall through */
 		case KBD_TIMEOUT_MINUTES:
 			value *= 60;
 			unit = KBD_TIMEOUT_SECONDS;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 4 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

I've applied this patch, but not the acer or sony fall through patches due to the pending questions there. Happy to revisit those as needed, but closing these out of the patch queue.

Quoted 23 lines
---
 drivers/platform/x86/dell-laptop.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/dell-laptop.c +2 -0
index f1fa861..1938f11 100644
@@ -1565,8 +1565,10 @@ static ssize_t kbd_led_timeout_store(struct device *dev,
 		switch (unit) {
 		case KBD_TIMEOUT_DAYS:
 			value *= 24;
+			/* fall through */
 		case KBD_TIMEOUT_HOURS:
 			value *= 60;
+			/* fall through */
 		case KBD_TIMEOUT_MINUTES:
 			value *= 60;
 			unit = KBD_TIMEOUT_SECONDS;
Signature · 1 line
2.7.4
Signature · 2 lines
Darren Hart
VMware Open Source Technology Center
#2 lore raw
Quoted 10 lines · Darren Hart
Quoted 4 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

I've applied this patch, but not the acer or sony fall through patches due to the pending questions there. Happy to revisit those as needed, but closing these out of the patch queue.

Thanks, Darren.

I'll send separate patches for those that are still pending. Hopefully, I'll get some feedback this time.

--
Gustavo

Quoted 24 lines
Quoted 23 lines
---
 drivers/platform/x86/dell-laptop.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/dell-laptop.c +2 -0
index f1fa861..1938f11 100644
@@ -1565,8 +1565,10 @@ static ssize_t kbd_led_timeout_store(struct device *dev,
 		switch (unit) {
 		case KBD_TIMEOUT_DAYS:
 			value *= 24;
+			/* fall through */
 		case KBD_TIMEOUT_HOURS:
 			value *= 60;
+			/* fall through */
 		case KBD_TIMEOUT_MINUTES:
 			value *= 60;
 			unit = KBD_TIMEOUT_SECONDS;
Signature · 1 line
2.7.4