Skip to content

Commit

Permalink
Input: mark expected switch fall-throughs
Browse files Browse the repository at this point in the history
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

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

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Gustavo A. R. Silva authored and Dmitry Torokhov committed Aug 8, 2018
1 parent 6cad4e2 commit 17a4ed5
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions drivers/input/joystick/db9.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ static unsigned char db9_saturn_read_packet(struct parport *port, unsigned char
db9_saturn_write_sub(port, type, 3, powered, 0);
return data[0] = 0xe3;
}
/* else: fall through */
default:
return data[0];
}
Expand All @@ -278,11 +279,14 @@ static int db9_saturn_report(unsigned char id, unsigned char data[60], struct in
switch (data[j]) {
case 0x16: /* multi controller (analog 4 axis) */
input_report_abs(dev, db9_abs[5], data[j + 6]);
/* fall through */
case 0x15: /* mission stick (analog 3 axis) */
input_report_abs(dev, db9_abs[3], data[j + 4]);
input_report_abs(dev, db9_abs[4], data[j + 5]);
/* fall through */
case 0x13: /* racing controller (analog 1 axis) */
input_report_abs(dev, db9_abs[2], data[j + 3]);
/* fall through */
case 0x34: /* saturn keyboard (udlr ZXC ASD QE Esc) */
case 0x02: /* digital pad (digital 2 axis + buttons) */
input_report_abs(dev, db9_abs[0], !(data[j + 1] & 128) - !(data[j + 1] & 64));
Expand Down Expand Up @@ -376,6 +380,7 @@ static void db9_timer(struct timer_list *t)
input_report_abs(dev2, ABS_X, (data & DB9_RIGHT ? 0 : 1) - (data & DB9_LEFT ? 0 : 1));
input_report_abs(dev2, ABS_Y, (data & DB9_DOWN ? 0 : 1) - (data & DB9_UP ? 0 : 1));
input_report_key(dev2, BTN_TRIGGER, ~data & DB9_FIRE1);
/* fall through */

case DB9_MULTI_0802:

Expand Down
1 change: 1 addition & 0 deletions drivers/input/keyboard/adp5589-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ static int adp5589_probe(struct i2c_client *client,
switch (id->driver_data) {
case ADP5585_02:
kpad->support_row5 = true;
/* fall through */
case ADP5585_01:
kpad->is_adp5585 = true;
kpad->var = &const_adp5585;
Expand Down
1 change: 1 addition & 0 deletions drivers/input/mouse/appletouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ static int atp_status_check(struct urb *urb)
dev->info->datalen, dev->urb->actual_length);
dev->overflow_warned = true;
}
/* fall through */
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
Expand Down
1 change: 1 addition & 0 deletions drivers/input/mouse/cyapa_gen5.c
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,7 @@ static int cyapa_gen5_do_operational_check(struct cyapa *cyapa)
}

cyapa->state = CYAPA_STATE_GEN5_APP;
/* fall through */

case CYAPA_STATE_GEN5_APP:
/*
Expand Down
1 change: 1 addition & 0 deletions drivers/input/mouse/cyapa_gen6.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ static int cyapa_gen6_operational_check(struct cyapa *cyapa)
}

cyapa->state = CYAPA_STATE_GEN6_APP;
/* fall through */

case CYAPA_STATE_GEN6_APP:
/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/mouse/elantech.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse)
*/
if (packet[3] & 0x80)
fingers = 4;
/* pass through... */
/* fall through */
case 1:
/*
* byte 1: . . . . x11 x10 x9 x8
Expand Down
4 changes: 3 additions & 1 deletion drivers/input/mouse/sermouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ static void sermouse_process_ms(struct sermouse *sermouse, signed char data)
switch (sermouse->type) {

case SERIO_MS:
sermouse->type = SERIO_MP;
sermouse->type = SERIO_MP;
/* fall through */

case SERIO_MP:
if ((data >> 2) & 3) break; /* M++ Wireless Extension packet. */
Expand All @@ -150,6 +151,7 @@ static void sermouse_process_ms(struct sermouse *sermouse, signed char data)
case SERIO_MZP:
case SERIO_MZPP:
input_report_key(dev, BTN_SIDE, (data >> 5) & 1);
/* fall through */

case SERIO_MZ:
input_report_key(dev, BTN_MIDDLE, (data >> 4) & 1);
Expand Down
1 change: 1 addition & 0 deletions drivers/input/touchscreen/elo.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ static int elo_connect(struct serio *serio, struct serio_driver *drv)

case 1: /* 6-byte protocol */
input_set_abs_params(input_dev, ABS_PRESSURE, 0, 15, 0, 0);
/* fall through */

case 2: /* 4-byte protocol */
input_set_abs_params(input_dev, ABS_X, 96, 4000, 0, 0);
Expand Down

0 comments on commit 17a4ed5

Please sign in to comment.