All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gdbstub: mark expected switch fall-throughs
@ 2019-02-26 19:16 Gustavo A. R. Silva
  2019-02-26 20:47 ` Jason Wessel
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-26 19:16 UTC (permalink / raw)
  To: Jason Wessel, Daniel Thompson
  Cc: kgdb-bugreport, linux-kernel, Gustavo A. R. Silva, Kees Cook

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warnings:

kernel/debug/gdbstub.c: In function ‘gdb_serial_stub’:
kernel/debug/gdbstub.c:1031:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (remcom_in_buffer[1] == '\0') {
       ^
kernel/debug/gdbstub.c:1036:3: note: here
   case 'C': /* Exception passing */
   ^~~~
kernel/debug/gdbstub.c:1040:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (tmp == 0)
       ^
kernel/debug/gdbstub.c:1043:3: note: here
   case 'c': /* Continue packet */
   ^~~~
kernel/debug/gdbstub.c:1050:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    dbg_activate_sw_breakpoints();
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/debug/gdbstub.c:1052:3: note: here
   default:
   ^~~~~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified
in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 kernel/debug/gdbstub.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c
index 7510dc687c0d..9f267b8905b4 100644
--- a/kernel/debug/gdbstub.c
+++ b/kernel/debug/gdbstub.c
@@ -1033,13 +1033,14 @@ int gdb_serial_stub(struct kgdb_state *ks)
 				return DBG_PASS_EVENT;
 			}
 #endif
+			/* Fall through */
 		case 'C': /* Exception passing */
 			tmp = gdb_cmd_exception_pass(ks);
 			if (tmp > 0)
 				goto default_handle;
 			if (tmp == 0)
 				break;
-			/* Fall through on tmp < 0 */
+			/* Fall through - on tmp < 0 */
 		case 'c': /* Continue packet */
 		case 's': /* Single step packet */
 			if (kgdb_contthread && kgdb_contthread != current) {
@@ -1048,7 +1049,7 @@ int gdb_serial_stub(struct kgdb_state *ks)
 				break;
 			}
 			dbg_activate_sw_breakpoints();
-			/* Fall through to default processing */
+			/* Fall through - to default processing */
 		default:
 default_handle:
 			error = kgdb_arch_handle_exception(ks->ex_vector,
-- 
2.21.0


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

* Re: [PATCH] gdbstub: mark expected switch fall-throughs
  2019-02-26 19:16 [PATCH] gdbstub: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-02-26 20:47 ` Jason Wessel
  2019-02-26 20:59   ` Gustavo A. R. Silva
  2019-04-01 19:57   ` Gustavo A. R. Silva
  0 siblings, 2 replies; 6+ messages in thread
From: Jason Wessel @ 2019-02-26 20:47 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Daniel Thompson
  Cc: kgdb-bugreport, linux-kernel, Kees Cook

We'll have to fix them at some point.

Acked-by: Jason Wessel <jason.wessel@windriver.com>


Cheers,
Jason.

On 2/26/19 1:16 PM, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
> 
> This patch fixes the following warnings:
> 
> kernel/debug/gdbstub.c: In function ‘gdb_serial_stub’:
> kernel/debug/gdbstub.c:1031:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>      if (remcom_in_buffer[1] == '\0') {
>         ^
> kernel/debug/gdbstub.c:1036:3: note: here
>     case 'C': /* Exception passing */
>     ^~~~
> kernel/debug/gdbstub.c:1040:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>      if (tmp == 0)
>         ^
> kernel/debug/gdbstub.c:1043:3: note: here
>     case 'c': /* Continue packet */
>     ^~~~
> kernel/debug/gdbstub.c:1050:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
>      dbg_activate_sw_breakpoints();
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> kernel/debug/gdbstub.c:1052:3: note: here
>     default:
>     ^~~~~~~
> 
> Warning level 3 was used: -Wimplicit-fallthrough=3
> 
> Notice that, in this particular case, the code comment is modified
> in accordance with what GCC is expecting to find.
> 
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>   kernel/debug/gdbstub.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c
> index 7510dc687c0d..9f267b8905b4 100644
> --- a/kernel/debug/gdbstub.c
> +++ b/kernel/debug/gdbstub.c
> @@ -1033,13 +1033,14 @@ int gdb_serial_stub(struct kgdb_state *ks)
>   				return DBG_PASS_EVENT;
>   			}
>   #endif
> +			/* Fall through */
>   		case 'C': /* Exception passing */
>   			tmp = gdb_cmd_exception_pass(ks);
>   			if (tmp > 0)
>   				goto default_handle;
>   			if (tmp == 0)
>   				break;
> -			/* Fall through on tmp < 0 */
> +			/* Fall through - on tmp < 0 */
>   		case 'c': /* Continue packet */
>   		case 's': /* Single step packet */
>   			if (kgdb_contthread && kgdb_contthread != current) {
> @@ -1048,7 +1049,7 @@ int gdb_serial_stub(struct kgdb_state *ks)
>   				break;
>   			}
>   			dbg_activate_sw_breakpoints();
> -			/* Fall through to default processing */
> +			/* Fall through - to default processing */
>   		default:
>   default_handle:
>   			error = kgdb_arch_handle_exception(ks->ex_vector,
> 


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

* Re: [PATCH] gdbstub: mark expected switch fall-throughs
  2019-02-26 20:47 ` Jason Wessel
@ 2019-02-26 20:59   ` Gustavo A. R. Silva
  2019-04-01 19:57   ` Gustavo A. R. Silva
  1 sibling, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-26 20:59 UTC (permalink / raw)
  To: Jason Wessel, Daniel Thompson; +Cc: kgdb-bugreport, linux-kernel, Kees Cook



On 2/26/19 2:47 PM, Jason Wessel wrote:
> We'll have to fix them at some point.
> 

Yep. And we're about to fix them all.

> Acked-by: Jason Wessel <jason.wessel@windriver.com>
> 

Thanks, Jason.

--
Gustavo

> 
> Cheers,
> Jason.
> 
> On 2/26/19 1:16 PM, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>> cases where we are expecting to fall through.
>>
>> This patch fixes the following warnings:
>>
>> kernel/debug/gdbstub.c: In function ‘gdb_serial_stub’:
>> kernel/debug/gdbstub.c:1031:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>      if (remcom_in_buffer[1] == '\0') {
>>         ^
>> kernel/debug/gdbstub.c:1036:3: note: here
>>     case 'C': /* Exception passing */
>>     ^~~~
>> kernel/debug/gdbstub.c:1040:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>      if (tmp == 0)
>>         ^
>> kernel/debug/gdbstub.c:1043:3: note: here
>>     case 'c': /* Continue packet */
>>     ^~~~
>> kernel/debug/gdbstub.c:1050:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>      dbg_activate_sw_breakpoints();
>>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/debug/gdbstub.c:1052:3: note: here
>>     default:
>>     ^~~~~~~
>>
>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>
>> Notice that, in this particular case, the code comment is modified
>> in accordance with what GCC is expecting to find.
>>
>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>>   kernel/debug/gdbstub.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c
>> index 7510dc687c0d..9f267b8905b4 100644
>> --- a/kernel/debug/gdbstub.c
>> +++ b/kernel/debug/gdbstub.c
>> @@ -1033,13 +1033,14 @@ int gdb_serial_stub(struct kgdb_state *ks)
>>                   return DBG_PASS_EVENT;
>>               }
>>   #endif
>> +            /* Fall through */
>>           case 'C': /* Exception passing */
>>               tmp = gdb_cmd_exception_pass(ks);
>>               if (tmp > 0)
>>                   goto default_handle;
>>               if (tmp == 0)
>>                   break;
>> -            /* Fall through on tmp < 0 */
>> +            /* Fall through - on tmp < 0 */
>>           case 'c': /* Continue packet */
>>           case 's': /* Single step packet */
>>               if (kgdb_contthread && kgdb_contthread != current) {
>> @@ -1048,7 +1049,7 @@ int gdb_serial_stub(struct kgdb_state *ks)
>>                   break;
>>               }
>>               dbg_activate_sw_breakpoints();
>> -            /* Fall through to default processing */
>> +            /* Fall through - to default processing */
>>           default:
>>   default_handle:
>>               error = kgdb_arch_handle_exception(ks->ex_vector,
>>
> 

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

* Re: [PATCH] gdbstub: mark expected switch fall-throughs
  2019-02-26 20:47 ` Jason Wessel
  2019-02-26 20:59   ` Gustavo A. R. Silva
@ 2019-04-01 19:57   ` Gustavo A. R. Silva
  2019-04-04 10:12     ` Daniel Thompson
  1 sibling, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-01 19:57 UTC (permalink / raw)
  To: Jason Wessel, Daniel Thompson; +Cc: kgdb-bugreport, linux-kernel, Kees Cook



On 2/26/19 2:47 PM, Jason Wessel wrote:
> We'll have to fix them at some point.
> 
> Acked-by: Jason Wessel <jason.wessel@windriver.com>
> 

Thank you, Jason.

Friendly ping:

Who can take this?

Thanks
--
Gustavo

> 
> Cheers,
> Jason.
> 
> On 2/26/19 1:16 PM, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>> cases where we are expecting to fall through.
>>
>> This patch fixes the following warnings:
>>
>> kernel/debug/gdbstub.c: In function ‘gdb_serial_stub’:
>> kernel/debug/gdbstub.c:1031:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>      if (remcom_in_buffer[1] == '\0') {
>>         ^
>> kernel/debug/gdbstub.c:1036:3: note: here
>>     case 'C': /* Exception passing */
>>     ^~~~
>> kernel/debug/gdbstub.c:1040:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>      if (tmp == 0)
>>         ^
>> kernel/debug/gdbstub.c:1043:3: note: here
>>     case 'c': /* Continue packet */
>>     ^~~~
>> kernel/debug/gdbstub.c:1050:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>      dbg_activate_sw_breakpoints();
>>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/debug/gdbstub.c:1052:3: note: here
>>     default:
>>     ^~~~~~~
>>
>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>
>> Notice that, in this particular case, the code comment is modified
>> in accordance with what GCC is expecting to find.
>>
>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>>   kernel/debug/gdbstub.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c
>> index 7510dc687c0d..9f267b8905b4 100644
>> --- a/kernel/debug/gdbstub.c
>> +++ b/kernel/debug/gdbstub.c
>> @@ -1033,13 +1033,14 @@ int gdb_serial_stub(struct kgdb_state *ks)
>>                   return DBG_PASS_EVENT;
>>               }
>>   #endif
>> +            /* Fall through */
>>           case 'C': /* Exception passing */
>>               tmp = gdb_cmd_exception_pass(ks);
>>               if (tmp > 0)
>>                   goto default_handle;
>>               if (tmp == 0)
>>                   break;
>> -            /* Fall through on tmp < 0 */
>> +            /* Fall through - on tmp < 0 */
>>           case 'c': /* Continue packet */
>>           case 's': /* Single step packet */
>>               if (kgdb_contthread && kgdb_contthread != current) {
>> @@ -1048,7 +1049,7 @@ int gdb_serial_stub(struct kgdb_state *ks)
>>                   break;
>>               }
>>               dbg_activate_sw_breakpoints();
>> -            /* Fall through to default processing */
>> +            /* Fall through - to default processing */
>>           default:
>>   default_handle:
>>               error = kgdb_arch_handle_exception(ks->ex_vector,
>>
> 

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

* Re: [PATCH] gdbstub: mark expected switch fall-throughs
  2019-04-01 19:57   ` Gustavo A. R. Silva
@ 2019-04-04 10:12     ` Daniel Thompson
  2019-04-04 16:02       ` Gustavo A. R. Silva
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Thompson @ 2019-04-04 10:12 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: Jason Wessel, kgdb-bugreport, linux-kernel, Kees Cook

On Mon, Apr 01, 2019 at 02:57:36PM -0500, Gustavo A. R. Silva wrote:
> 
> 
> On 2/26/19 2:47 PM, Jason Wessel wrote:
> > We'll have to fix them at some point.
> > 
> > Acked-by: Jason Wessel <jason.wessel@windriver.com>
> > 
> 
> Thank you, Jason.
> 
> Friendly ping:
> 
> Who can take this?

I happy to put it in my tree (probably next week).


Daniel.

> 
> Thanks
> --
> Gustavo
> 
> > 
> > Cheers,
> > Jason.
> > 
> > On 2/26/19 1:16 PM, Gustavo A. R. Silva wrote:
> >> In preparation to enabling -Wimplicit-fallthrough, mark switch
> >> cases where we are expecting to fall through.
> >>
> >> This patch fixes the following warnings:
> >>
> >> kernel/debug/gdbstub.c: In function ‘gdb_serial_stub’:
> >> kernel/debug/gdbstub.c:1031:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >>      if (remcom_in_buffer[1] == '\0') {
> >>         ^
> >> kernel/debug/gdbstub.c:1036:3: note: here
> >>     case 'C': /* Exception passing */
> >>     ^~~~
> >> kernel/debug/gdbstub.c:1040:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >>      if (tmp == 0)
> >>         ^
> >> kernel/debug/gdbstub.c:1043:3: note: here
> >>     case 'c': /* Continue packet */
> >>     ^~~~
> >> kernel/debug/gdbstub.c:1050:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >>      dbg_activate_sw_breakpoints();
> >>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> kernel/debug/gdbstub.c:1052:3: note: here
> >>     default:
> >>     ^~~~~~~
> >>
> >> Warning level 3 was used: -Wimplicit-fallthrough=3
> >>
> >> Notice that, in this particular case, the code comment is modified
> >> in accordance with what GCC is expecting to find.
> >>
> >> This patch is part of the ongoing efforts to enable
> >> -Wimplicit-fallthrough.
> >>
> >> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> >> ---
> >>   kernel/debug/gdbstub.c | 5 +++--
> >>   1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c
> >> index 7510dc687c0d..9f267b8905b4 100644
> >> --- a/kernel/debug/gdbstub.c
> >> +++ b/kernel/debug/gdbstub.c
> >> @@ -1033,13 +1033,14 @@ int gdb_serial_stub(struct kgdb_state *ks)
> >>                   return DBG_PASS_EVENT;
> >>               }
> >>   #endif
> >> +            /* Fall through */
> >>           case 'C': /* Exception passing */
> >>               tmp = gdb_cmd_exception_pass(ks);
> >>               if (tmp > 0)
> >>                   goto default_handle;
> >>               if (tmp == 0)
> >>                   break;
> >> -            /* Fall through on tmp < 0 */
> >> +            /* Fall through - on tmp < 0 */
> >>           case 'c': /* Continue packet */
> >>           case 's': /* Single step packet */
> >>               if (kgdb_contthread && kgdb_contthread != current) {
> >> @@ -1048,7 +1049,7 @@ int gdb_serial_stub(struct kgdb_state *ks)
> >>                   break;
> >>               }
> >>               dbg_activate_sw_breakpoints();
> >> -            /* Fall through to default processing */
> >> +            /* Fall through - to default processing */
> >>           default:
> >>   default_handle:
> >>               error = kgdb_arch_handle_exception(ks->ex_vector,
> >>
> > 

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

* Re: [PATCH] gdbstub: mark expected switch fall-throughs
  2019-04-04 10:12     ` Daniel Thompson
@ 2019-04-04 16:02       ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-04 16:02 UTC (permalink / raw)
  To: Daniel Thompson; +Cc: Jason Wessel, kgdb-bugreport, linux-kernel, Kees Cook



On 4/4/19 5:12 AM, Daniel Thompson wrote:
> On Mon, Apr 01, 2019 at 02:57:36PM -0500, Gustavo A. R. Silva wrote:
>>
>>
>> On 2/26/19 2:47 PM, Jason Wessel wrote:
>>> We'll have to fix them at some point.
>>>
>>> Acked-by: Jason Wessel <jason.wessel@windriver.com>
>>>
>>
>> Thank you, Jason.
>>
>> Friendly ping:
>>
>> Who can take this?
> 
> I happy to put it in my tree (probably next week).
> 

Awesome. :)

Thanks, Daniel.
--
Gustavo

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

end of thread, other threads:[~2019-04-04 16:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-26 19:16 [PATCH] gdbstub: mark expected switch fall-throughs Gustavo A. R. Silva
2019-02-26 20:47 ` Jason Wessel
2019-02-26 20:59   ` Gustavo A. R. Silva
2019-04-01 19:57   ` Gustavo A. R. Silva
2019-04-04 10:12     ` Daniel Thompson
2019-04-04 16:02       ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.