kgdb: Fix fall-through warning for Clang
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
@@ -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
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@@ -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
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
Reviewed-by Kees Cook <[email protected]>
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@@ -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
Daniel Thompson
AppliedQuoted 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@@ -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