From 0284bf0b1c5c2239a830f4f69461c61eada633a5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 May 2019 16:47:13 +0200 Subject: [PATCH] adapter: Walk rp->opcodes directly instead of interim variable --- src/adapter.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 160a6ca52..cef25616f 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -8940,7 +8940,6 @@ static void read_commands_complete(uint8_t status, uint16_t length, { const struct mgmt_rp_read_commands *rp = param; uint16_t num_commands, num_events; - const uint16_t *opcode; size_t expected_len; int i; @@ -8970,10 +8969,8 @@ static void read_commands_complete(uint8_t status, uint16_t length, return; } - opcode = rp->opcodes; - for (i = 0; i < num_commands; i++) { - uint16_t op = get_le16(opcode++); + uint16_t op = get_le16(rp->opcodes + i); if (op == MGMT_OP_ADD_DEVICE) { DBG("enabling kernel-side connection control"); -- 2.47.3