* [PATCH] sh: kgdb: Mark expected switch fall-throughs
@ 2019-10-30 7:17 Kuninori Morimoto
2019-10-30 8:44 ` Daniel Thompson
0 siblings, 1 reply; 6+ messages in thread
From: Kuninori Morimoto @ 2019-10-30 7:17 UTC (permalink / raw)
To: Yoshinori Sato, Rich Felker
Cc: Daniel Thompson, Will Deacon, Douglas Anderson, Paul Burton,
Christophe Leroy, linux-sh, linux-kernel
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mark switch cases where we are expecting to fall through.
This patch fixes the following error:
LINUX/arch/sh/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
LINUX/arch/sh/kernel/kgdb.c:267:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (kgdb_hex2long(&ptr, &addr))
^
LINUX/arch/sh/kernel/kgdb.c:269:2: note: here
case 'D':
^~~~
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
arch/sh/kernel/kgdb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c
index 6d61f8c..0d5f3c9 100644
--- a/arch/sh/kernel/kgdb.c
+++ b/arch/sh/kernel/kgdb.c
@@ -266,6 +266,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
ptr = &remcomInBuffer[1];
if (kgdb_hex2long(&ptr, &addr))
linux_regs->pc = addr;
+ /* fallthrough */
case 'D':
case 'k':
atomic_set(&kgdb_cpu_doing_single_step, -1);
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] sh: kgdb: Mark expected switch fall-throughs
2019-10-30 7:17 [PATCH] sh: kgdb: Mark expected switch fall-throughs Kuninori Morimoto
@ 2019-10-30 8:44 ` Daniel Thompson
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Thompson @ 2019-10-30 8:44 UTC (permalink / raw)
To: Kuninori Morimoto
Cc: Yoshinori Sato, Rich Felker, Will Deacon, Douglas Anderson,
Paul Burton, Christophe Leroy, linux-sh, linux-kernel, joe
On Wed, Oct 30, 2019 at 04:17:53PM +0900, Kuninori Morimoto wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following error:
>
> LINUX/arch/sh/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
> LINUX/arch/sh/kernel/kgdb.c:267:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
> if (kgdb_hex2long(&ptr, &addr))
> ^
> LINUX/arch/sh/kernel/kgdb.c:269:2: note: here
> case 'D':
> ^~~~
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Just FYI this is likely to be converted to be the fallthrough
pseudo-keyword shortly after introductionb but IIRC the keyword is only
available in linux-next right now (and the conversion, from Joe Perches,
is script based so it is likely the change will get picked up by the
script without you having to do anything explicit).
Daniel.
> ---
> arch/sh/kernel/kgdb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c
> index 6d61f8c..0d5f3c9 100644
> --- a/arch/sh/kernel/kgdb.c
> +++ b/arch/sh/kernel/kgdb.c
> @@ -266,6 +266,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
> ptr = &remcomInBuffer[1];
> if (kgdb_hex2long(&ptr, &addr))
> linux_regs->pc = addr;
> + /* fallthrough */
> case 'D':
> case 'k':
> atomic_set(&kgdb_cpu_doing_single_step, -1);
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sh: kgdb: Mark expected switch fall-throughs
2019-12-10 8:39 ` [PATCH] " Kuninori Morimoto
2019-12-10 8:47 ` Christophe Leroy
@ 2019-12-11 15:18 ` Daniel Thompson
1 sibling, 0 replies; 6+ messages in thread
From: Daniel Thompson @ 2019-12-11 15:18 UTC (permalink / raw)
To: Kuninori Morimoto
Cc: Andrew Morton, Greg Kroah-Hartman, Yoshinori Sato, Rich Felker,
Will Deacon, Douglas Anderson, Paul Burton, Christophe Leroy,
linux-sh, linux-kernel
On Tue, Dec 10, 2019 at 05:39:00PM +0900, Kuninori Morimoto wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following error:
>
> LINUX/arch/sh/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
> LINUX/arch/sh/kernel/kgdb.c:267:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
> if (kgdb_hex2long(&ptr, &addr))
> ^
> LINUX/arch/sh/kernel/kgdb.c:269:2: note: here
> case 'D':
> ^~~~
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> ---
> arch/sh/kernel/kgdb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c
> index 6d61f8c..0d5f3c9 100644
> --- a/arch/sh/kernel/kgdb.c
> +++ b/arch/sh/kernel/kgdb.c
> @@ -266,6 +266,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
> ptr = &remcomInBuffer[1];
> if (kgdb_hex2long(&ptr, &addr))
> linux_regs->pc = addr;
> + /* fallthrough */
Since v5.5-rc1 there is the fallthrough pseudo keyword to document
these cases:
https://elixir.bootlin.com/linux/v5.5-rc1/source/Documentation/process/coding-style.rst#L59
Daniel.
> case 'D':
> case 'k':
> atomic_set(&kgdb_cpu_doing_single_step, -1);
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sh: kgdb: Mark expected switch fall-throughs
2019-12-10 8:39 ` [PATCH] " Kuninori Morimoto
@ 2019-12-10 8:47 ` Christophe Leroy
2019-12-11 15:18 ` Daniel Thompson
1 sibling, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2019-12-10 8:47 UTC (permalink / raw)
To: Kuninori Morimoto, Andrew Morton
Cc: Greg Kroah-Hartman, Yoshinori Sato, Rich Felker, Daniel Thompson,
Will Deacon, Douglas Anderson, Paul Burton, linux-sh,
linux-kernel, stable
On 12/10/2019 08:39 AM, Kuninori Morimoto wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following error:
>
> LINUX/arch/sh/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
> LINUX/arch/sh/kernel/kgdb.c:267:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
> if (kgdb_hex2long(&ptr, &addr))
> ^
> LINUX/arch/sh/kernel/kgdb.c:269:2: note: here
> case 'D':
> ^~~~
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
I guess you should also add:
Fixes: ab6e570ba33d ("sh: Generic kgdb stub support.")
Cc: stable@vger.kernel.org
Christophe
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] sh: kgdb: Mark expected switch fall-throughs
2019-12-10 8:38 [PATCH][resend] " Kuninori Morimoto
@ 2019-12-10 8:39 ` Kuninori Morimoto
2019-12-10 8:47 ` Christophe Leroy
2019-12-11 15:18 ` Daniel Thompson
0 siblings, 2 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2019-12-10 8:39 UTC (permalink / raw)
To: Andrew Morton
Cc: Greg Kroah-Hartman, Yoshinori Sato, Rich Felker, Daniel Thompson,
Will Deacon, Douglas Anderson, Paul Burton, Christophe Leroy,
linux-sh, linux-kernel
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mark switch cases where we are expecting to fall through.
This patch fixes the following error:
LINUX/arch/sh/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
LINUX/arch/sh/kernel/kgdb.c:267:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (kgdb_hex2long(&ptr, &addr))
^
LINUX/arch/sh/kernel/kgdb.c:269:2: note: here
case 'D':
^~~~
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
---
arch/sh/kernel/kgdb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c
index 6d61f8c..0d5f3c9 100644
--- a/arch/sh/kernel/kgdb.c
+++ b/arch/sh/kernel/kgdb.c
@@ -266,6 +266,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
ptr = &remcomInBuffer[1];
if (kgdb_hex2long(&ptr, &addr))
linux_regs->pc = addr;
+ /* fallthrough */
case 'D':
case 'k':
atomic_set(&kgdb_cpu_doing_single_step, -1);
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] sh: kgdb: Mark expected switch fall-throughs
2019-12-10 0:26 [PATCH][resend] " Kuninori Morimoto
@ 2019-12-10 0:27 ` Kuninori Morimoto
0 siblings, 0 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2019-12-10 0:27 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Yoshinori Sato, Rich Felker, Daniel Thompson, Will Deacon,
Douglas Anderson, Paul Burton, Christophe Leroy, linux-sh,
linux-kernel, Daniel Thompson
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mark switch cases where we are expecting to fall through.
This patch fixes the following error:
LINUX/arch/sh/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
LINUX/arch/sh/kernel/kgdb.c:267:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (kgdb_hex2long(&ptr, &addr))
^
LINUX/arch/sh/kernel/kgdb.c:269:2: note: here
case 'D':
^~~~
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
---
arch/sh/kernel/kgdb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c
index 6d61f8c..0d5f3c9 100644
--- a/arch/sh/kernel/kgdb.c
+++ b/arch/sh/kernel/kgdb.c
@@ -266,6 +266,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
ptr = &remcomInBuffer[1];
if (kgdb_hex2long(&ptr, &addr))
linux_regs->pc = addr;
+ /* fallthrough */
case 'D':
case 'k':
atomic_set(&kgdb_cpu_doing_single_step, -1);
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-12-11 15:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 7:17 [PATCH] sh: kgdb: Mark expected switch fall-throughs Kuninori Morimoto
2019-10-30 8:44 ` Daniel Thompson
2019-12-10 0:26 [PATCH][resend] " Kuninori Morimoto
2019-12-10 0:27 ` [PATCH] " Kuninori Morimoto
2019-12-10 8:38 [PATCH][resend] " Kuninori Morimoto
2019-12-10 8:39 ` [PATCH] " Kuninori Morimoto
2019-12-10 8:47 ` Christophe Leroy
2019-12-11 15:18 ` 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).