From e0dfdd6723256ee1d3aa76fe8e2dde5811a1631e Mon Sep 17 00:00:00 2001 From: Lingao Meng Date: Wed, 28 Jul 2021 04:45:51 -0700 Subject: [PATCH] Bluetooth: Fix -Wunused-but-set-variable Fix -Wunused-but-set-variable Signed-off-by: Lingao Meng --- subsys/bluetooth/host/att.c | 6 +----- subsys/bluetooth/host/gatt.c | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 87fd5a257a0..a8be79e20fb 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -435,12 +435,8 @@ static inline bool att_chan_is_connected(struct bt_att_chan *chan) static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf, bt_att_chan_sent_t cb) { - struct bt_att_hdr *hdr; - - hdr = (void *)buf->data; - BT_DBG("chan %p flags %u code 0x%02x", chan, atomic_get(chan->flags), - hdr->code); + ((struct bt_att_hdr *)buf->data)->code); return chan_send(chan, buf, cb); } diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 386946a0b04..eeb801a7b8a 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -4348,7 +4348,7 @@ static void gatt_write_ccc_rsp(struct bt_conn *conn, uint8_t err, /* if write to CCC failed we remove subscription and notify app */ if (err) { struct gatt_sub *sub; - sys_snode_t *node, *tmp, *prev = NULL; + sys_snode_t *node, *tmp; sub = gatt_sub_find(conn); if (!sub) { @@ -4360,8 +4360,6 @@ static void gatt_write_ccc_rsp(struct bt_conn *conn, uint8_t err, gatt_sub_remove(conn, sub, tmp, params); break; } - - prev = node; } } else if (!params->value) { /* Notify with NULL data to complete unsubscribe */