Skip to content

Commit eba6120

Browse files
firewire: mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: drivers/firewire/core-device.c: In function ‘set_broadcast_channel’: drivers/firewire/core-device.c:969:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (data & cpu_to_be32(1 << 31)) { ^ drivers/firewire/core-device.c:974:3: note: here case RCODE_ADDRESS_ERROR: ^~~~ drivers/firewire/core-iso.c: In function ‘manage_channel’: drivers/firewire/core-iso.c:308:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if ((data[0] & bit) == (data[1] & bit)) ^ drivers/firewire/core-iso.c:312:3: note: here default: ^~~~~~~ drivers/firewire/core-topology.c: In function ‘count_ports’: drivers/firewire/core-topology.c:69:23: warning: this statement may fall through [-Wimplicit-fallthrough=] (*child_port_count)++; ~~~~~~~~~~~~~~~~~~~^~ drivers/firewire/core-topology.c:70:3: note: here case SELFID_PORT_PARENT: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 Notice that in some cases, 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. Cc: Kees Cook <keescook@chromium.org> Cc: Mathieu Malaterre <malat@debian.org> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (reworded a comment) Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
1 parent 5f9e832 commit eba6120

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/firewire/core-device.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ static void set_broadcast_channel(struct fw_device *device, int generation)
957957
device->bc_implemented = BC_IMPLEMENTED;
958958
break;
959959
}
960-
/* else fall through to case address error */
960+
/* else, fall through - to case address error */
961961
case RCODE_ADDRESS_ERROR:
962962
device->bc_implemented = BC_UNIMPLEMENTED;
963963
}

‎drivers/firewire/core-iso.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation,
284284
if ((data[0] & bit) == (data[1] & bit))
285285
continue;
286286

287-
/* 1394-1995 IRM, fall through to retry. */
287+
/* fall through - It's a 1394-1995 IRM, retry. */
288288
default:
289289
if (retry) {
290290
retry--;

‎drivers/firewire/core-topology.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ static u32 *count_ports(u32 *sid, int *total_port_count, int *child_port_count)
5454
switch (port_type) {
5555
case SELFID_PORT_CHILD:
5656
(*child_port_count)++;
57+
/* fall through */
5758
case SELFID_PORT_PARENT:
5859
case SELFID_PORT_NCONN:
5960
(*total_port_count)++;

0 commit comments

Comments
 (0)