Browse Source

fix unannotated fall-through warnings

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau 2 years ago
parent
commit
02dd2f2df7
2 changed files with 5 additions and 4 deletions
  1. 2 1
      interface.c
  2. 3 3
      proto-shell.c

+ 2 - 1
interface.c

@@ -245,7 +245,7 @@ interface_event(struct interface *iface, enum interface_event ev)
 	case IFEV_UP:
 		interface_error_flush(iface);
 		adev = iface->l3_dev.dev;
-		/* fall through */
+		fallthrough;
 	case IFEV_DOWN:
 	case IFEV_UP_FAILED:
 		alias_notify_device(iface->name, adev);
@@ -319,6 +319,7 @@ __interface_set_down(struct interface *iface, bool force)
 	case IFS_DOWN:
 		if (iface->main_dev.dev)
 			device_release(&iface->main_dev);
+		break;
 	case IFS_TEARDOWN:
 	default:
 		break;

+ 3 - 3
proto-shell.c

@@ -208,7 +208,7 @@ proto_shell_handler(struct interface_proto_state *proto,
 				return 0;
 			}
 		/* if no script task is running */
-		/* fall through */
+		fallthrough;
 		case S_IDLE:
 			action = "teardown";
 			state->renew_pending = false;
@@ -292,7 +292,7 @@ proto_shell_task_finish(struct proto_shell_state *state,
 	case S_IDLE:
 		if (task == &state->proto_task)
 			state->proto.proto_event(&state->proto, IFPEV_LINK_LOST);
-		/* fall through */
+		fallthrough;
 	case S_SETUP:
 		if (task == &state->proto_task)
 			proto_shell_handler(&state->proto, PROTO_CMD_TEARDOWN,
@@ -764,7 +764,7 @@ proto_shell_setup_failed(struct proto_shell_state *state)
 	switch (state->sm) {
 	case S_IDLE:
 		state->proto.proto_event(&state->proto, IFPEV_LINK_LOST);
-		/* fall through */
+		fallthrough;
 	case S_SETUP:
 		proto_shell_handler(&state->proto, PROTO_CMD_TEARDOWN, false);
 		break;