Skip to content

Commit

Permalink
Bluetooth: controller: Work around compiler silliness
Browse files Browse the repository at this point in the history
For some reason GCC 9.x doesn't seem to be able to realize that set_num
will always be > 0 and so the local variable status will always be
initialized. Use a do {} while instead to keep it happy.

Signed-off-by: Carles Cufi <[email protected]>
  • Loading branch information
carlescufi committed Jun 12, 2020
1 parent 999c59c commit 8617e93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/bluetooth/controller/hci/hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ static void le_set_ext_adv_enable(struct net_buf *buf, struct net_buf **evt)

s = (void *) cmd->s;
enable = cmd->enable;
while (set_num--) {
do {
/* TODO: duration and events parameter use. */
#if defined(CONFIG_BT_HCI_MESH_EXT)
status = ll_adv_enable(s->handle, cmd->enable, 0, 0, 0, 0, 0);
Expand All @@ -1765,7 +1765,7 @@ static void le_set_ext_adv_enable(struct net_buf *buf, struct net_buf **evt)
}

s++;
}
} while (--set_num);

ccst = hci_cmd_complete(evt, sizeof(*ccst));
ccst->status = status;
Expand Down

0 comments on commit 8617e93

Please sign in to comment.