Bluetooth: L2CAP: Fix set but not used variables
If debugs are disabled scid and dcid variables were never read. This also fix mixed values of scid and dcid in le_disconn_req. Change-Id: I3b435dd0640c5c65ab5fe68e33dd25e3c9e0026e Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
parent
efec1aa79d
commit
b00e747ddf
1 changed files with 4 additions and 6 deletions
|
@ -863,17 +863,16 @@ static void le_disconn_req(struct bt_l2cap *l2cap, uint8_t ident,
|
||||||
struct bt_l2cap_le_chan *chan;
|
struct bt_l2cap_le_chan *chan;
|
||||||
struct bt_l2cap_disconn_req *req = (void *)buf->data;
|
struct bt_l2cap_disconn_req *req = (void *)buf->data;
|
||||||
struct bt_l2cap_disconn_rsp *rsp;
|
struct bt_l2cap_disconn_rsp *rsp;
|
||||||
uint16_t scid, dcid;
|
uint16_t scid;
|
||||||
|
|
||||||
if (buf->len < sizeof(*req)) {
|
if (buf->len < sizeof(*req)) {
|
||||||
BT_ERR("Too small LE conn req packet size");
|
BT_ERR("Too small LE conn req packet size");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dcid = sys_le16_to_cpu(req->dcid);
|
|
||||||
scid = sys_le16_to_cpu(req->scid);
|
scid = sys_le16_to_cpu(req->scid);
|
||||||
|
|
||||||
BT_DBG("scid 0x%04x dcid 0x%04x", dcid, scid);
|
BT_DBG("scid 0x%04x dcid 0x%04x", scid, sys_le16_to_cpu(req->dcid));
|
||||||
|
|
||||||
chan = l2cap_remove_tx_cid(conn, scid);
|
chan = l2cap_remove_tx_cid(conn, scid);
|
||||||
if (!chan) {
|
if (!chan) {
|
||||||
|
@ -1007,7 +1006,7 @@ static void le_disconn_rsp(struct bt_l2cap *l2cap, uint8_t ident,
|
||||||
struct bt_conn *conn = l2cap->chan.chan.conn;
|
struct bt_conn *conn = l2cap->chan.chan.conn;
|
||||||
struct bt_l2cap_le_chan *chan;
|
struct bt_l2cap_le_chan *chan;
|
||||||
struct bt_l2cap_disconn_rsp *rsp = (void *)buf->data;
|
struct bt_l2cap_disconn_rsp *rsp = (void *)buf->data;
|
||||||
uint16_t dcid, scid;
|
uint16_t dcid;
|
||||||
|
|
||||||
if (buf->len < sizeof(*rsp)) {
|
if (buf->len < sizeof(*rsp)) {
|
||||||
BT_ERR("Too small LE disconn rsp packet size");
|
BT_ERR("Too small LE disconn rsp packet size");
|
||||||
|
@ -1015,9 +1014,8 @@ static void le_disconn_rsp(struct bt_l2cap *l2cap, uint8_t ident,
|
||||||
}
|
}
|
||||||
|
|
||||||
dcid = sys_le16_to_cpu(rsp->dcid);
|
dcid = sys_le16_to_cpu(rsp->dcid);
|
||||||
scid = sys_le16_to_cpu(rsp->scid);
|
|
||||||
|
|
||||||
BT_DBG("dcid 0x%04x scid 0x%04x", dcid, scid);
|
BT_DBG("dcid 0x%04x scid 0x%04x", dcid, sys_le16_to_cpu(rsp->scid));
|
||||||
|
|
||||||
chan = l2cap_remove_tx_cid(conn, dcid);
|
chan = l2cap_remove_tx_cid(conn, dcid);
|
||||||
if (!chan) {
|
if (!chan) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue