Skip to contentSkip to conversation

kgdb: Fix fall-through warning for Clang

PATCH Applied Gustavo A. R. Silva 4 participants 4 messages May 28, 2021 – Jun 17, 2021 KGDB / KDB /debug_core

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kgdb: Fix fall-through warning for Clang

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

---
JFYI: We had thousands of these sorts of warnings and now we are down
to just 25 in linux-next. This is one of those last remaining warnings.

 kernel/debug/debug_core.c | 1 +
 1 file changed, 1 insertion(+)
kernel/debug/debug_core.c +1 -0
index 4708aec492df..431749dd9ab6 100644
@@ -1038,6 +1038,7 @@ dbg_notify_reboot(struct notifier_block *this, unsigned long code, void *x)
 	switch (kgdbreboot) {
 	case 1:
 		kgdb_breakpoint();
+		goto done;
 	case -1:
 		goto done;
 	}
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Gustavo A. R. Silva

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

---
JFYI: We had thousands of these sorts of warnings and now we are down
to just 25 in linux-next. This is one of those last remaining warnings.

So close! :)

-Kees

Quoted 19 lines
 kernel/debug/debug_core.c | 1 +
 1 file changed, 1 insertion(+)
kernel/debug/debug_core.c +1 -0
index 4708aec492df..431749dd9ab6 100644
@@ -1038,6 +1038,7 @@ dbg_notify_reboot(struct notifier_block *this, unsigned long code, void *x)
 	switch (kgdbreboot) {
 	case 1:
 		kgdb_breakpoint();
+		goto done;
 	case -1:
 		goto done;
 	}
Signature · 1 line
2.27.0
Signature · 1 line
Kees Cook
#2 lore raw
Quoted 5 lines · Kees Cook
Quoted 4 lines · Gustavo A. R. Silva

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

Quoted 8 lines
Quoted 6 lines

---
JFYI: We had thousands of these sorts of warnings and now we are down
to just 25 in linux-next. This is one of those last remaining warnings.

So close! :)

Almost there!

Quoted 1 line

Thanks

--
Gustavo

Quoted 23 lines

-Kees

Quoted 19 lines
 kernel/debug/debug_core.c | 1 +
 1 file changed, 1 insertion(+)
kernel/debug/debug_core.c +1 -0
index 4708aec492df..431749dd9ab6 100644
@@ -1038,6 +1038,7 @@ dbg_notify_reboot(struct notifier_block *this, unsigned long code, void *x)
 	switch (kgdbreboot) {
 	case 1:
 		kgdb_breakpoint();
+		goto done;
 	case -1:
 		goto done;
 	}
Signature · 1 line
2.27.0
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 6 lines · Gustavo A. R. Silva

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

Applied, thanks.

Quoted 22 lines

---
JFYI: We had thousands of these sorts of warnings and now we are down
to just 25 in linux-next. This is one of those last remaining warnings.

 kernel/debug/debug_core.c | 1 +
 1 file changed, 1 insertion(+)
kernel/debug/debug_core.c +1 -0
index 4708aec492df..431749dd9ab6 100644
@@ -1038,6 +1038,7 @@ dbg_notify_reboot(struct notifier_block *this, unsigned long code, void *x)
 	switch (kgdbreboot) {
 	case 1:
 		kgdb_breakpoint();
+		goto done;
 	case -1:
 		goto done;
 	}
Signature · 1 line
2.27.0