Skip to contentSkip to conversation

staging: dpaa2-ethsw: fix switch/case fallthrough warning

PATCH Superseded Marian Posteuca 2 participants 2 messages Jul 20, 2020 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: dpaa2-ethsw: fix switch/case fallthrough warning

Fix the fallthrough warning that is reported by checkpatch.

---
 drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/fsl-dpaa2/ethsw/ethsw.c +2 -1
index 2fb75a7c9314..4986591097dc 100644
@@ -1362,7 +1362,8 @@ static int port_switchdev_blocking_event(struct notifier_block *unused,
 		return NOTIFY_DONE;
 
 	switch (event) {
-	case SWITCHDEV_PORT_OBJ_ADD: /* fall through */
+	case SWITCHDEV_PORT_OBJ_ADD:
+		fallthrough;
 	case SWITCHDEV_PORT_OBJ_DEL:
 		return ethsw_switchdev_port_obj_event(event, dev, ptr);
 	case SWITCHDEV_PORT_ATTR_SET:
Signature · 1 line
2.26.2
#1 lore raw
Quoted 12 lines · Marian Posteuca

Fix the fallthrough warning that is reported by checkpatch.

---
 drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/fsl-dpaa2/ethsw/ethsw.c +0 -0
index 2fb75a7c9314..4986591097dc 100644

drivers/staging/fsl-dpaa2/ethsw/ethsw.c static int port_switchdev_blocking_event(struct notifier_block *unused, · line 1366

Quoted 6 lines
drivers/staging/fsl-dpaa2/ethsw/ethsw.c +2 -1
@@ -1362,7 +1362,8 @@ static int port_switchdev_blocking_event(struct notifier_block *unused,
 		return NOTIFY_DONE;
 
 	switch (event) {
-	case SWITCHDEV_PORT_OBJ_ADD: /* fall through */
+	case SWITCHDEV_PORT_OBJ_ADD:
+		fallthrough;

This comment is better removed instead of
converted to fallthrough;

It's no different than a multiple case block like:

	switch (val) {
	case FOO:
	case BAR:
		foobar();
		break;
	default:
		return baz;
	}

etc...