Bluetooth: controller: Fix warning with no dup filter

Conditionally declare the iterator variable to avoid a warning when
compiling the controller without any duplicate filter entries.

Change-Id: I69e23d4c594db18172dc57d45e7925243fe2da69
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2017-04-07 16:02:52 +02:00 committed by Johan Hedberg
commit 923c470f5d

View file

@ -1009,7 +1009,6 @@ static void le_advertising_report(struct pdu_data *pdu_data, uint8_t *b,
uint8_t data_len; uint8_t data_len;
uint8_t *rssi; uint8_t *rssi;
uint8_t info_len; uint8_t info_len;
int i;
if (!(event_mask & BIT64(BT_EVT_BIT_LE_META_EVENT)) || if (!(event_mask & BIT64(BT_EVT_BIT_LE_META_EVENT)) ||
!(le_event_mask & BIT64(BT_EVT_BIT_LE_ADVERTISING_REPORT))) { !(le_event_mask & BIT64(BT_EVT_BIT_LE_ADVERTISING_REPORT))) {
@ -1019,6 +1018,8 @@ static void le_advertising_report(struct pdu_data *pdu_data, uint8_t *b,
#if CONFIG_BLUETOOTH_CONTROLLER_DUP_FILTER_LEN > 0 #if CONFIG_BLUETOOTH_CONTROLLER_DUP_FILTER_LEN > 0
/* check for duplicate filtering */ /* check for duplicate filtering */
if (dup_count >= 0) { if (dup_count >= 0) {
int i;
for (i = 0; i < dup_count; i++) { for (i = 0; i < dup_count; i++) {
if (!memcmp(&adv->payload.adv_ind.addr[0], if (!memcmp(&adv->payload.adv_ind.addr[0],
&dup_filter[i].addr.a.val[0], &dup_filter[i].addr.a.val[0],