staging: dpaa2-ethsw: fix switch/case fallthrough warning
PATCH 1/1 staging: dpaa2-ethsw: fix switch/case fallthrough warning
Fix the fallthrough warning that is reported by checkpatch.
Signed-off-by Marian Posteuca <[email protected]>
--- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
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;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
Quoted 12 lines · Marian Posteuca
Fix the fallthrough warning that is reported by checkpatch.
Signed-off-by Marian Posteuca <[email protected]>--- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/fsl-dpaa2/ethsw/ethsw.c +0
-0
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...