Bluetooth: controller: Work around compiler silliness

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 <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2020-06-12 19:38:45 +02:00 committed by Carles Cufí
commit 8617e93b84

View file

@ -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);
@ -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;