Skip to contentSkip to conversation

auxdisplay: panel: mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Oct 12, 2017 – Feb 23, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 auxdisplay: panel: mark expected switch fall-throughs

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.

---
 drivers/auxdisplay/panel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/auxdisplay/panel.c +3 -3
index 6911acd..8b80a97 100644
@@ -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);
 		}
Signature · 1 line
2.7.4
#1 lore raw

Hi Gustavo,

Quoted 26 lines · 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.

---
 drivers/auxdisplay/panel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/auxdisplay/panel.c +1 -1
index 6911acd..8b80a97 100644
@@ -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;

drivers/auxdisplay/panel.c static void panel_process_inputs(void) · line 1392

Quoted 10 lines
drivers/auxdisplay/panel.c +2 -2
@@ -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

Quoted 6 lines
drivers/auxdisplay/panel.c +0 -1
                case INPUT_ST_FALLING:
                        input_state_falling(input);
                }
--

2.7.4