* [PATCH] kdb: kdb_support: mark expected switch fall-throughs
@ 2018-08-05 2:48 Gustavo A. R. Silva
2018-08-15 14:34 ` Daniel Thompson
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-05 2:48 UTC (permalink / raw)
To: Jason Wessel, Daniel Thompson
Cc: kgdb-bugreport, linux-kernel, Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Notice that in this particular case, I replaced the code comments with
a proper "fall through" annotation, which is what GCC is expecting
to find.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
kernel/debug/kdb/kdb_support.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/debug/kdb/kdb_support.c b/kernel/debug/kdb/kdb_support.c
index 990b3cc..89ac604 100644
--- a/kernel/debug/kdb/kdb_support.c
+++ b/kernel/debug/kdb/kdb_support.c
@@ -432,7 +432,7 @@ int kdb_getphysword(unsigned long *word, unsigned long addr, size_t size)
*word = w8;
break;
}
- /* drop through */
+ /* fall through */
default:
diag = KDB_BADWIDTH;
kdb_printf("kdb_getphysword: bad width %ld\n", (long) size);
@@ -481,7 +481,7 @@ int kdb_getword(unsigned long *word, unsigned long addr, size_t size)
*word = w8;
break;
}
- /* drop through */
+ /* fall through */
default:
diag = KDB_BADWIDTH;
kdb_printf("kdb_getword: bad width %ld\n", (long) size);
@@ -525,7 +525,7 @@ int kdb_putword(unsigned long addr, unsigned long word, size_t size)
diag = kdb_putarea(addr, w8);
break;
}
- /* drop through */
+ /* fall through */
default:
diag = KDB_BADWIDTH;
kdb_printf("kdb_putword: bad width %ld\n", (long) size);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kdb: kdb_support: mark expected switch fall-throughs
2018-08-05 2:48 [PATCH] kdb: kdb_support: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2018-08-15 14:34 ` Daniel Thompson
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Thompson @ 2018-08-15 14:34 UTC (permalink / raw)
To: Gustavo A. R. Silva, Jason Wessel; +Cc: kgdb-bugreport, linux-kernel
On 05/08/18 03:48, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Notice that in this particular case, I replaced the code comments with
> a proper "fall through" annotation, which is what GCC is expecting
> to find.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
> ---
> kernel/debug/kdb/kdb_support.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/debug/kdb/kdb_support.c b/kernel/debug/kdb/kdb_support.c
> index 990b3cc..89ac604 100644
> --- a/kernel/debug/kdb/kdb_support.c
> +++ b/kernel/debug/kdb/kdb_support.c
> @@ -432,7 +432,7 @@ int kdb_getphysword(unsigned long *word, unsigned long addr, size_t size)
> *word = w8;
> break;
> }
> - /* drop through */
> + /* fall through */
> default:
> diag = KDB_BADWIDTH;
> kdb_printf("kdb_getphysword: bad width %ld\n", (long) size);
> @@ -481,7 +481,7 @@ int kdb_getword(unsigned long *word, unsigned long addr, size_t size)
> *word = w8;
> break;
> }
> - /* drop through */
> + /* fall through */
> default:
> diag = KDB_BADWIDTH;
> kdb_printf("kdb_getword: bad width %ld\n", (long) size);
> @@ -525,7 +525,7 @@ int kdb_putword(unsigned long addr, unsigned long word, size_t size)
> diag = kdb_putarea(addr, w8);
> break;
> }
> - /* drop through */
> + /* fall through */
> default:
> diag = KDB_BADWIDTH;
> kdb_printf("kdb_putword: bad width %ld\n", (long) size);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-15 14:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-05 2:48 [PATCH] kdb: kdb_support: mark expected switch fall-throughs Gustavo A. R. Silva
2018-08-15 14:34 ` Daniel Thompson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).