linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARC: kgdb: add 'fallthrough' to prevent a warning
@ 2021-04-22  5:16 Randy Dunlap
  2021-04-22 15:12 ` Vineet Gupta
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2021-04-22  5:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Vineet Gupta, linux-snps-arc

Use the 'fallthrough' macro to document that this switch case
does indeed fall through to the next case.

../arch/arc/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
../arch/arc/kernel/kgdb.c:141:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
  141 |   if (kgdb_hex2long(&ptr, &addr))
      |      ^
../arch/arc/kernel/kgdb.c:144:2: note: here
  144 |  case 'D':
      |  ^~~~

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
---
 arch/arc/kernel/kgdb.c |    1 +
 1 file changed, 1 insertion(+)

--- linux-next-20210420.orig/arch/arc/kernel/kgdb.c
+++ linux-next-20210420/arch/arc/kernel/kgdb.c
@@ -140,6 +140,7 @@ int kgdb_arch_handle_exception(int e_vec
 		ptr = &remcomInBuffer[1];
 		if (kgdb_hex2long(&ptr, &addr))
 			regs->ret = addr;
+		fallthrough;
 
 	case 'D':
 	case 'k':

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARC: kgdb: add 'fallthrough' to prevent a warning
  2021-04-22  5:16 [PATCH] ARC: kgdb: add 'fallthrough' to prevent a warning Randy Dunlap
@ 2021-04-22 15:12 ` Vineet Gupta
  0 siblings, 0 replies; 2+ messages in thread
From: Vineet Gupta @ 2021-04-22 15:12 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel; +Cc: linux-snps-arc

On 4/21/21 10:16 PM, Randy Dunlap wrote:
> Use the 'fallthrough' macro to document that this switch case
> does indeed fall through to the next case.
>
> ../arch/arc/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
> ../arch/arc/kernel/kgdb.c:141:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    141 |   if (kgdb_hex2long(&ptr, &addr))
>        |      ^
> ../arch/arc/kernel/kgdb.c:144:2: note: here
>    144 |  case 'D':
>        |  ^~~~
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: linux-snps-arc@lists.infradead.org

Thx for the fix Randy. Added to for-curr !

-Vineet

> ---
>   arch/arc/kernel/kgdb.c |    1 +
>   1 file changed, 1 insertion(+)
>
> --- linux-next-20210420.orig/arch/arc/kernel/kgdb.c
> +++ linux-next-20210420/arch/arc/kernel/kgdb.c
> @@ -140,6 +140,7 @@ int kgdb_arch_handle_exception(int e_vec
>   		ptr = &remcomInBuffer[1];
>   		if (kgdb_hex2long(&ptr, &addr))
>   			regs->ret = addr;
> +		fallthrough;
>   
>   	case 'D':
>   	case 'k':


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-22 15:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22  5:16 [PATCH] ARC: kgdb: add 'fallthrough' to prevent a warning Randy Dunlap
2021-04-22 15:12 ` Vineet Gupta

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).