public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] auxdisplay: panel: mark expected switch fall-throughs
@ 2017-10-12 21:35 Gustavo A. R. Silva
  2018-02-23 13:19 ` Miguel Ojeda
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 21:35 UTC (permalink / raw)
  To: Miguel Ojeda Sandonis; +Cc: linux-kernel, Gustavo A. R. Silva

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

In this particular case, notice that I replaced the "no break here,
fall through" comments with "fall through" comments, which is what
GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/auxdisplay/panel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
index 6911acd..8b80a97 100644
--- a/drivers/auxdisplay/panel.c
+++ b/drivers/auxdisplay/panel.c
@@ -1372,7 +1372,7 @@ static void panel_process_inputs(void)
 				break;
 			input->rise_timer = 0;
 			input->state = INPUT_ST_RISING;
-			/* no break here, fall through */
+			/* fall through */
 		case INPUT_ST_RISING:
 			if ((phys_curr & input->mask) != input->value) {
 				input->state = INPUT_ST_LOW;
@@ -1385,11 +1385,11 @@ static void panel_process_inputs(void)
 			}
 			input->high_timer = 0;
 			input->state = INPUT_ST_HIGH;
-			/* no break here, fall through */
+			/* fall through */
 		case INPUT_ST_HIGH:
 			if (input_state_high(input))
 				break;
-			/* no break here, fall through */
+			/* fall through */
 		case INPUT_ST_FALLING:
 			input_state_falling(input);
 		}
-- 
2.7.4

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

* Re: [PATCH] auxdisplay: panel: mark expected switch fall-throughs
  2017-10-12 21:35 [PATCH] auxdisplay: panel: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2018-02-23 13:19 ` Miguel Ojeda
  0 siblings, 0 replies; 2+ messages in thread
From: Miguel Ojeda @ 2018-02-23 13:19 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: linux-kernel

Hi Gustavo,

On Thu, Oct 12, 2017 at 11:35 PM, Gustavo A. R. Silva
<garsilva@embeddedor.com> wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> In this particular case, notice that I replaced the "no break here,
> fall through" comments with "fall through" comments, which is what
> GCC is expecting to find.
>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/auxdisplay/panel.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
> index 6911acd..8b80a97 100644
> --- a/drivers/auxdisplay/panel.c
> +++ b/drivers/auxdisplay/panel.c
> @@ -1372,7 +1372,7 @@ static void panel_process_inputs(void)
>                                 break;
>                         input->rise_timer = 0;
>                         input->state = INPUT_ST_RISING;
> -                       /* no break here, fall through */
> +                       /* fall through */
>                 case INPUT_ST_RISING:
>                         if ((phys_curr & input->mask) != input->value) {
>                                 input->state = INPUT_ST_LOW;
> @@ -1385,11 +1385,11 @@ static void panel_process_inputs(void)
>                         }
>                         input->high_timer = 0;
>                         input->state = INPUT_ST_HIGH;
> -                       /* no break here, fall through */
> +                       /* fall through */
>                 case INPUT_ST_HIGH:
>                         if (input_state_high(input))
>                                 break;
> -                       /* no break here, fall through */
> +                       /* fall through */

Thanks! I will put it in my queue (I sent a similar one a few days
ago, so I will pick yours).

Cheers,
Miguel

>                 case INPUT_ST_FALLING:
>                         input_state_falling(input);
>                 }
> --
> 2.7.4
>

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

end of thread, other threads:[~2018-02-23 13:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-12 21:35 [PATCH] auxdisplay: panel: mark expected switch fall-throughs Gustavo A. R. Silva
2018-02-23 13:19 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox