summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2019-02-11 12:48:21 -0500
committerGustavo A. R. Silva <gustavo@embeddedor.com>2019-07-25 21:09:37 -0400
commiteba6120de93b8d5f2987fac1f533c35b53eaa771 (patch)
treec66af3f907360b44f394824bcfe83aaa221f9897
parent5f9e832c137075045d15cd6899ab0505cfb2ca4b (diff)
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>
-rw-r--r--drivers/firewire/core-device.c2
-rw-r--r--drivers/firewire/core-iso.c2
-rw-r--r--drivers/firewire/core-topology.c1
3 files changed, 3 insertions, 2 deletions
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
index 3dc1cbf849db..b785e936244f 100644
--- a/drivers/firewire/core-device.c
+++ b/drivers/firewire/core-device.c
@@ -957,7 +957,7 @@ static void set_broadcast_channel(struct fw_device *device, int generation)
957 device->bc_implemented = BC_IMPLEMENTED; 957 device->bc_implemented = BC_IMPLEMENTED;
958 break; 958 break;
959 } 959 }
960 /* else fall through to case address error */ 960 /* else, fall through - to case address error */
961 case RCODE_ADDRESS_ERROR: 961 case RCODE_ADDRESS_ERROR:
962 device->bc_implemented = BC_UNIMPLEMENTED; 962 device->bc_implemented = BC_UNIMPLEMENTED;
963 } 963 }
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c
index 42566b7be8f5..df8a56a979b9 100644
--- a/drivers/firewire/core-iso.c
+++ b/drivers/firewire/core-iso.c
@@ -284,7 +284,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation,
284 if ((data[0] & bit) == (data[1] & bit)) 284 if ((data[0] & bit) == (data[1] & bit))
285 continue; 285 continue;
286 286
287 /* 1394-1995 IRM, fall through to retry. */ 287 /* fall through - It's a 1394-1995 IRM, retry. */
288 default: 288 default:
289 if (retry) { 289 if (retry) {
290 retry--; 290 retry--;
diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c
index 46bd22dde535..94a13fca8267 100644
--- a/drivers/firewire/core-topology.c
+++ b/drivers/firewire/core-topology.c
@@ -54,6 +54,7 @@ static u32 *count_ports(u32 *sid, int *total_port_count, int *child_port_count)
54 switch (port_type) { 54 switch (port_type) {
55 case SELFID_PORT_CHILD: 55 case SELFID_PORT_CHILD:
56 (*child_port_count)++; 56 (*child_port_count)++;
57 /* fall through */
57 case SELFID_PORT_PARENT: 58 case SELFID_PORT_PARENT:
58 case SELFID_PORT_NCONN: 59 case SELFID_PORT_NCONN:
59 (*total_port_count)++; 60 (*total_port_count)++;