Commit 19186c7b authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Marcel Holtmann

Bluetooth: core: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-throughSigned-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 51c19bf3
...@@ -2825,7 +2825,7 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -2825,7 +2825,7 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
case HCI_AUTO_CONN_LINK_LOSS: case HCI_AUTO_CONN_LINK_LOSS:
if (ev->reason != HCI_ERROR_CONNECTION_TIMEOUT) if (ev->reason != HCI_ERROR_CONNECTION_TIMEOUT)
break; break;
/* Fall through */ fallthrough;
case HCI_AUTO_CONN_DIRECT: case HCI_AUTO_CONN_DIRECT:
case HCI_AUTO_CONN_ALWAYS: case HCI_AUTO_CONN_ALWAYS:
...@@ -4320,7 +4320,7 @@ static void hci_sync_conn_complete_evt(struct hci_dev *hdev, ...@@ -4320,7 +4320,7 @@ static void hci_sync_conn_complete_evt(struct hci_dev *hdev,
if (hci_setup_sync(conn, conn->link->handle)) if (hci_setup_sync(conn, conn->link->handle))
goto unlock; goto unlock;
} }
/* fall through */ fallthrough;
default: default:
conn->state = BT_CLOSED; conn->state = BT_CLOSED;
......
...@@ -443,8 +443,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event) ...@@ -443,8 +443,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event)
case HCI_DEV_SETUP: case HCI_DEV_SETUP:
if (hdev->manufacturer == 0xffff) if (hdev->manufacturer == 0xffff)
return NULL; return NULL;
fallthrough;
/* fall through */
case HCI_DEV_UP: case HCI_DEV_UP:
skb = bt_skb_alloc(HCI_MON_INDEX_INFO_SIZE, GFP_ATOMIC); skb = bt_skb_alloc(HCI_MON_INDEX_INFO_SIZE, GFP_ATOMIC);
......
...@@ -666,8 +666,7 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err) ...@@ -666,8 +666,7 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err)
l2cap_seq_list_free(&chan->srej_list); l2cap_seq_list_free(&chan->srej_list);
l2cap_seq_list_free(&chan->retrans_list); l2cap_seq_list_free(&chan->retrans_list);
fallthrough;
/* fall through */
case L2CAP_MODE_STREAMING: case L2CAP_MODE_STREAMING:
skb_queue_purge(&chan->tx_q); skb_queue_purge(&chan->tx_q);
...@@ -872,7 +871,8 @@ static inline u8 l2cap_get_auth_type(struct l2cap_chan *chan) ...@@ -872,7 +871,8 @@ static inline u8 l2cap_get_auth_type(struct l2cap_chan *chan)
else else
return HCI_AT_NO_BONDING; return HCI_AT_NO_BONDING;
} }
/* fall through */ fallthrough;
default: default:
switch (chan->sec_level) { switch (chan->sec_level) {
case BT_SECURITY_HIGH: case BT_SECURITY_HIGH:
...@@ -2983,8 +2983,7 @@ static void l2cap_tx_state_wait_f(struct l2cap_chan *chan, ...@@ -2983,8 +2983,7 @@ static void l2cap_tx_state_wait_f(struct l2cap_chan *chan,
break; break;
case L2CAP_EV_RECV_REQSEQ_AND_FBIT: case L2CAP_EV_RECV_REQSEQ_AND_FBIT:
l2cap_process_reqseq(chan, control->reqseq); l2cap_process_reqseq(chan, control->reqseq);
fallthrough;
/* Fall through */
case L2CAP_EV_RECV_FBIT: case L2CAP_EV_RECV_FBIT:
if (control && control->final) { if (control && control->final) {
...@@ -3311,7 +3310,7 @@ static inline __u8 l2cap_select_mode(__u8 mode, __u16 remote_feat_mask) ...@@ -3311,7 +3310,7 @@ static inline __u8 l2cap_select_mode(__u8 mode, __u16 remote_feat_mask)
case L2CAP_MODE_ERTM: case L2CAP_MODE_ERTM:
if (l2cap_mode_supported(mode, remote_feat_mask)) if (l2cap_mode_supported(mode, remote_feat_mask))
return mode; return mode;
/* fall through */ fallthrough;
default: default:
return L2CAP_MODE_BASIC; return L2CAP_MODE_BASIC;
} }
...@@ -3447,7 +3446,7 @@ static int l2cap_build_conf_req(struct l2cap_chan *chan, void *data, size_t data ...@@ -3447,7 +3446,7 @@ static int l2cap_build_conf_req(struct l2cap_chan *chan, void *data, size_t data
if (__l2cap_efs_supported(chan->conn)) if (__l2cap_efs_supported(chan->conn))
set_bit(FLAG_EFS_ENABLE, &chan->flags); set_bit(FLAG_EFS_ENABLE, &chan->flags);
/* fall through */ fallthrough;
default: default:
chan->mode = l2cap_select_mode(rfc.mode, chan->conn->feat_mask); chan->mode = l2cap_select_mode(rfc.mode, chan->conn->feat_mask);
break; break;
...@@ -4539,7 +4538,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, ...@@ -4539,7 +4538,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn,
goto done; goto done;
break; break;
} }
/* fall through */ fallthrough;
default: default:
l2cap_chan_set_err(chan, ECONNRESET); l2cap_chan_set_err(chan, ECONNRESET);
...@@ -7719,7 +7718,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon) ...@@ -7719,7 +7718,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon)
conn->mtu = hcon->hdev->le_mtu; conn->mtu = hcon->hdev->le_mtu;
break; break;
} }
/* fall through */ fallthrough;
default: default:
conn->mtu = hcon->hdev->acl_mtu; conn->mtu = hcon->hdev->acl_mtu;
break; break;
...@@ -7841,7 +7840,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, ...@@ -7841,7 +7840,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
case L2CAP_MODE_STREAMING: case L2CAP_MODE_STREAMING:
if (!disable_ertm) if (!disable_ertm)
break; break;
/* fall through */ fallthrough;
default: default:
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto done; goto done;
......
...@@ -284,7 +284,7 @@ static int l2cap_sock_listen(struct socket *sock, int backlog) ...@@ -284,7 +284,7 @@ static int l2cap_sock_listen(struct socket *sock, int backlog)
case L2CAP_MODE_STREAMING: case L2CAP_MODE_STREAMING:
if (!disable_ertm) if (!disable_ertm)
break; break;
/* fall through */ fallthrough;
default: default:
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto done; goto done;
...@@ -760,7 +760,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, ...@@ -760,7 +760,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname,
case L2CAP_MODE_STREAMING: case L2CAP_MODE_STREAMING:
if (!disable_ertm) if (!disable_ertm)
break; break;
/* fall through */ fallthrough;
default: default:
err = -EINVAL; err = -EINVAL;
break; break;
......
...@@ -4525,7 +4525,7 @@ static bool discovery_type_is_valid(struct hci_dev *hdev, uint8_t type, ...@@ -4525,7 +4525,7 @@ static bool discovery_type_is_valid(struct hci_dev *hdev, uint8_t type,
*mgmt_status = mgmt_le_support(hdev); *mgmt_status = mgmt_le_support(hdev);
if (*mgmt_status) if (*mgmt_status)
return false; return false;
/* Intentional fall-through */ fallthrough;
case DISCOV_TYPE_BREDR: case DISCOV_TYPE_BREDR:
*mgmt_status = mgmt_bredr_support(hdev); *mgmt_status = mgmt_bredr_support(hdev);
if (*mgmt_status) if (*mgmt_status)
...@@ -5901,7 +5901,7 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev, ...@@ -5901,7 +5901,7 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev,
case MGMT_LTK_P256_DEBUG: case MGMT_LTK_P256_DEBUG:
authenticated = 0x00; authenticated = 0x00;
type = SMP_LTK_P256_DEBUG; type = SMP_LTK_P256_DEBUG;
/* fall through */ fallthrough;
default: default:
continue; continue;
} }
......
...@@ -1658,7 +1658,7 @@ int smp_user_confirm_reply(struct hci_conn *hcon, u16 mgmt_op, __le32 passkey) ...@@ -1658,7 +1658,7 @@ int smp_user_confirm_reply(struct hci_conn *hcon, u16 mgmt_op, __le32 passkey)
memset(smp->tk, 0, sizeof(smp->tk)); memset(smp->tk, 0, sizeof(smp->tk));
BT_DBG("PassKey: %d", value); BT_DBG("PassKey: %d", value);
put_unaligned_le32(value, smp->tk); put_unaligned_le32(value, smp->tk);
/* Fall Through */ fallthrough;
case MGMT_OP_USER_CONFIRM_REPLY: case MGMT_OP_USER_CONFIRM_REPLY:
set_bit(SMP_FLAG_TK_VALID, &smp->flags); set_bit(SMP_FLAG_TK_VALID, &smp->flags);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment