diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-09-26 16:01:54 -0700 |
---|---|---|
committer | Ayush Garg <ayush.garg@samsung.com> | 2023-05-15 14:55:55 +0530 |
commit | 494704ac8782b80e38eca6cf6cd1b37499fc9f7d (patch) | |
tree | d6143a592bb060d3857f0baa4bf221c52f720b53 | |
parent | 01ebb4a74e5f34cc26f6e27a76c90ac125509c97 (diff) | |
download | bluez-494704ac8782b80e38eca6cf6cd1b37499fc9f7d.tar.gz bluez-494704ac8782b80e38eca6cf6cd1b37499fc9f7d.tar.bz2 bluez-494704ac8782b80e38eca6cf6cd1b37499fc9f7d.zip |
monitor/analyze: Fix scan-build warnings
This fixes the following warnings:
monitor/analyze.c:381:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:382:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:398:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:399:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:418:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:419:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:527:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(subtype);
^ ~~~~~~~~~~~~~~~
monitor/analyze.c:528:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(subtype);
^ ~~~~~~~~~~~~~~~
monitor/analyze.c:629:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:630:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:646:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:647:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:710:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:711:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
-rwxr-xr-x | monitor/analyze.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/monitor/analyze.c b/monitor/analyze.c index 4f0ebb23..74d8886b 100755 --- a/monitor/analyze.c +++ b/monitor/analyze.c @@ -377,12 +377,8 @@ static void del_index(struct timeval *tv, uint16_t index, static void command_pkt(struct timeval *tv, uint16_t index, const void *data, uint16_t size) { - const struct bt_hci_cmd_hdr *hdr = data; struct hci_dev *dev; - data += sizeof(*hdr); - size -= sizeof(*hdr); - dev = dev_lookup(index); if (!dev) return; @@ -397,9 +393,6 @@ static void evt_conn_complete(struct hci_dev *dev, struct timeval *tv, const struct bt_hci_evt_conn_complete *evt = data; struct hci_conn *conn; - data += sizeof(*evt); - size -= sizeof(*evt); - if (evt->status) return; @@ -417,9 +410,6 @@ static void evt_disconnect_complete(struct hci_dev *dev, struct timeval *tv, const struct bt_hci_evt_disconnect_complete *evt = data; struct hci_conn *conn; - data += sizeof(*evt); - size -= sizeof(*evt); - if (evt->status) return; @@ -524,13 +514,6 @@ static void evt_num_completed_packets(struct hci_dev *dev, struct timeval *tv, static void evt_le_meta_event(struct hci_dev *dev, struct timeval *tv, const void *data, uint16_t size) { - uint8_t subtype = get_u8(data); - - data += sizeof(subtype); - size -= sizeof(subtype); - - switch (subtype) { - } } static void event_pkt(struct timeval *tv, uint16_t index, @@ -625,12 +608,8 @@ static void acl_pkt(struct timeval *tv, uint16_t index, bool out, static void sco_pkt(struct timeval *tv, uint16_t index, const void *data, uint16_t size) { - const struct bt_hci_sco_hdr *hdr = data; struct hci_dev *dev; - data += sizeof(*hdr); - size -= sizeof(*hdr); - dev = dev_lookup(index); if (!dev) return; @@ -645,9 +624,6 @@ static void info_index(struct timeval *tv, uint16_t index, const struct btsnoop_opcode_index_info *hdr = data; struct hci_dev *dev; - data += sizeof(*hdr); - size -= sizeof(*hdr); - dev = dev_lookup(index); if (!dev) return; @@ -706,12 +682,8 @@ static void ctrl_msg(struct timeval *tv, uint16_t index, static void iso_pkt(struct timeval *tv, uint16_t index, const void *data, uint16_t size) { - const struct bt_hci_iso_hdr *hdr = data; struct hci_dev *dev; - data += sizeof(*hdr); - size -= sizeof(*hdr); - dev = dev_lookup(index); if (!dev) return; |