diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2019-05-07 16:50:20 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2019-05-07 16:50:20 +0200 |
commit | 08c45ed6805c09e3d3e4aa3e61898a28460d8fa0 (patch) | |
tree | 394053b5f9855851a8a386aca1f49f3a9816cdef /tools/btmgmt.c | |
parent | acb2de0d82641ace502346ff5672ff7f28f4fccd (diff) | |
download | bluez-08c45ed6805c09e3d3e4aa3e61898a28460d8fa0.tar.gz |
tools: Walk rp->opcodes directly instead of interim variable
Diffstat (limited to 'tools/btmgmt.c')
-rw-r--r-- | tools/btmgmt.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/btmgmt.c b/tools/btmgmt.c index 78b9fda2a..f631de4aa 100644 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -1037,7 +1037,6 @@ static void commands_rsp(uint8_t status, uint16_t len, const void *param, { const struct mgmt_rp_read_commands *rp = param; uint16_t num_commands, num_events; - const uint16_t *opcode; size_t expected_len; int i; @@ -1064,17 +1063,15 @@ static void commands_rsp(uint8_t status, uint16_t len, const void *param, goto done; } - opcode = rp->opcodes; - print("%u commands:", num_commands); for (i = 0; i < num_commands; i++) { - uint16_t op = get_le16(opcode++); + uint16_t op = get_le16(rp->opcodes + i); print("\t%s (0x%04x)", mgmt_opstr(op), op); } print("%u events:", num_events); for (i = 0; i < num_events; i++) { - uint16_t ev = get_le16(opcode++); + uint16_t ev = get_le16(rp->opcodes + num_commands + i); print("\t%s (0x%04x)", mgmt_evstr(ev), ev); } |