Commit 5491120e authored by Andrei Emeltchenko's avatar Andrei Emeltchenko Committed by Johan Hedberg

Bluetooth: Clean up l2cap_chan_add

Change elseif to switch. This make sense even more with following
patches which otherwise have to add more elseifs statements.
Signed-off-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent cf4cd009
...@@ -320,7 +320,8 @@ static void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan) ...@@ -320,7 +320,8 @@ static void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
chan->conn = conn; chan->conn = conn;
if (chan->chan_type == L2CAP_CHAN_CONN_ORIENTED) { switch (chan->chan_type) {
case L2CAP_CHAN_CONN_ORIENTED:
if (conn->hcon->type == LE_LINK) { if (conn->hcon->type == LE_LINK) {
/* LE connection */ /* LE connection */
chan->omtu = L2CAP_LE_DEFAULT_MTU; chan->omtu = L2CAP_LE_DEFAULT_MTU;
...@@ -331,12 +332,16 @@ static void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan) ...@@ -331,12 +332,16 @@ static void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
chan->scid = l2cap_alloc_cid(conn); chan->scid = l2cap_alloc_cid(conn);
chan->omtu = L2CAP_DEFAULT_MTU; chan->omtu = L2CAP_DEFAULT_MTU;
} }
} else if (chan->chan_type == L2CAP_CHAN_CONN_LESS) { break;
case L2CAP_CHAN_CONN_LESS:
/* Connectionless socket */ /* Connectionless socket */
chan->scid = L2CAP_CID_CONN_LESS; chan->scid = L2CAP_CID_CONN_LESS;
chan->dcid = L2CAP_CID_CONN_LESS; chan->dcid = L2CAP_CID_CONN_LESS;
chan->omtu = L2CAP_DEFAULT_MTU; chan->omtu = L2CAP_DEFAULT_MTU;
} else { break;
default:
/* Raw socket can send/recv signalling messages only */ /* Raw socket can send/recv signalling messages only */
chan->scid = L2CAP_CID_SIGNALING; chan->scid = L2CAP_CID_SIGNALING;
chan->dcid = L2CAP_CID_SIGNALING; chan->dcid = L2CAP_CID_SIGNALING;
......
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