Skip to content

Commit a3bb826

Browse files
fabiobaltierinashif
authored andcommitted
tests: bluetooth: fix various shadowed declarations
Fix various -Werror=shadow errors. Signed-off-by: Fabio Baltieri <[email protected]>
1 parent 83132c7 commit a3bb826

File tree

10 files changed

+101
-103
lines changed

10 files changed

+101
-103
lines changed

tests/bluetooth/controller/ctrl_api/src/main.c

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -94,36 +94,36 @@ ZTEST(public, test_int_disconnect_loc)
9494
uint64_t err;
9595
int nr_free_ctx;
9696
struct node_tx *tx;
97-
struct ll_conn conn;
97+
struct ll_conn llconn;
9898

9999
struct pdu_data_llctrl_version_ind local_version_ind = {
100100
.version_number = LL_VERSION_NUMBER,
101101
.company_id = CONFIG_BT_CTLR_COMPANY_ID,
102102
.sub_version_number = CONFIG_BT_CTLR_SUBVERSION_NUMBER,
103103
};
104104

105-
test_setup(&conn);
106-
test_set_role(&conn, BT_HCI_ROLE_CENTRAL);
107-
ull_cp_state_set(&conn, ULL_CP_CONNECTED);
105+
test_setup(&llconn);
106+
test_set_role(&llconn, BT_HCI_ROLE_CENTRAL);
107+
ull_cp_state_set(&llconn, ULL_CP_CONNECTED);
108108

109109
nr_free_ctx = llcp_ctx_buffers_free();
110110
zassert_equal(nr_free_ctx, test_ctx_buffers_cnt());
111111

112-
err = ull_cp_version_exchange(&conn);
112+
err = ull_cp_version_exchange(&llconn);
113113
zassert_equal(err, BT_HCI_ERR_SUCCESS);
114114

115115
nr_free_ctx = llcp_ctx_buffers_free();
116116
zassert_equal(nr_free_ctx, test_ctx_buffers_cnt() - 1);
117117

118-
event_prepare(&conn);
119-
lt_rx(LL_VERSION_IND, &conn, &tx, &local_version_ind);
120-
lt_rx_q_is_empty(&conn);
121-
event_done(&conn);
118+
event_prepare(&llconn);
119+
lt_rx(LL_VERSION_IND, &llconn, &tx, &local_version_ind);
120+
lt_rx_q_is_empty(&llconn);
121+
event_done(&llconn);
122122

123123
/*
124124
* Now we disconnect before getting a response
125125
*/
126-
ull_cp_state_set(&conn, ULL_CP_DISCONNECTED);
126+
ull_cp_state_set(&llconn, ULL_CP_DISCONNECTED);
127127

128128
nr_free_ctx = llcp_ctx_buffers_free();
129129
zassert_equal(nr_free_ctx, test_ctx_buffers_cnt());
@@ -133,16 +133,16 @@ ZTEST(public, test_int_disconnect_loc)
133133
/*
134134
* nothing should happen when running a new event
135135
*/
136-
event_prepare(&conn);
137-
event_done(&conn);
136+
event_prepare(&llconn);
137+
event_done(&llconn);
138138

139139
nr_free_ctx = llcp_ctx_buffers_free();
140140
zassert_equal(nr_free_ctx, test_ctx_buffers_cnt());
141141

142142
/*
143143
* all buffers should still be empty
144144
*/
145-
lt_rx_q_is_empty(&conn);
145+
lt_rx_q_is_empty(&llconn);
146146
ut_rx_q_is_empty();
147147
}
148148

@@ -154,39 +154,39 @@ ZTEST(public, test_int_disconnect_rem)
154154
.company_id = 0xABCD,
155155
.sub_version_number = 0x1234,
156156
};
157-
struct ll_conn conn;
157+
struct ll_conn llconn;
158158

159-
test_setup(&conn);
159+
test_setup(&llconn);
160160

161161
/* Role */
162-
test_set_role(&conn, BT_HCI_ROLE_CENTRAL);
162+
test_set_role(&llconn, BT_HCI_ROLE_CENTRAL);
163163

164164
/* Connect */
165-
ull_cp_state_set(&conn, ULL_CP_CONNECTED);
165+
ull_cp_state_set(&llconn, ULL_CP_CONNECTED);
166166

167167
nr_free_ctx = llcp_ctx_buffers_free();
168168
zassert_equal(nr_free_ctx, test_ctx_buffers_cnt());
169169
/* Prepare */
170-
event_prepare(&conn);
170+
event_prepare(&llconn);
171171

172172
/* Rx */
173-
lt_tx(LL_VERSION_IND, &conn, &remote_version_ind);
173+
lt_tx(LL_VERSION_IND, &llconn, &remote_version_ind);
174174

175175
nr_free_ctx = llcp_ctx_buffers_free();
176176
zassert_equal(nr_free_ctx, test_ctx_buffers_cnt());
177177

178178
/* Disconnect before we reply */
179179

180180
/* Done */
181-
event_done(&conn);
181+
event_done(&llconn);
182182

183-
ull_cp_state_set(&conn, ULL_CP_DISCONNECTED);
183+
ull_cp_state_set(&llconn, ULL_CP_DISCONNECTED);
184184

185185
/* Prepare */
186-
event_prepare(&conn);
186+
event_prepare(&llconn);
187187

188188
/* Done */
189-
event_done(&conn);
189+
event_done(&llconn);
190190

191191
nr_free_ctx = llcp_ctx_buffers_free();
192192
zassert_equal(nr_free_ctx, test_ctx_buffers_cnt());
@@ -400,57 +400,57 @@ ZTEST(internal, test_int_mem_tx)
400400
CONFIG_BT_CTLR_LLCP_CONN * \
401401
CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM)
402402
#endif /* LLCP_TX_CTRL_BUF_QUEUE_ENABLE */
403-
struct ll_conn conn;
403+
struct ll_conn llconn;
404404
struct node_tx *txl[TX_BUFFER_POOL_SIZE];
405405
struct proc_ctx *ctx;
406406

407407
ull_cp_init();
408-
ull_llcp_init(&conn);
408+
ull_llcp_init(&llconn);
409409

410410
ctx = llcp_create_local_procedure(PROC_CONN_UPDATE);
411411

412412
for (int i = 0U; i < TX_BUFFER_POOL_SIZE; i++) {
413-
peek = llcp_tx_alloc_peek(&conn, ctx);
413+
peek = llcp_tx_alloc_peek(&llconn, ctx);
414414

415415
/* The previous tx alloc peek should be valid */
416416
zassert_true(peek, NULL);
417417

418-
txl[i] = llcp_tx_alloc(&conn, ctx);
418+
txl[i] = llcp_tx_alloc(&llconn, ctx);
419419

420420
/* The previous alloc should be valid */
421421
zassert_not_null(txl[i], NULL);
422422
}
423423

424-
peek = llcp_tx_alloc_peek(&conn, ctx);
424+
peek = llcp_tx_alloc_peek(&llconn, ctx);
425425

426426
/* The last tx alloc peek should fail */
427427
zassert_false(peek, NULL);
428428

429429
/* Release all */
430430
for (int i = 0U; i < TX_BUFFER_POOL_SIZE; i++) {
431-
ull_cp_release_tx(&conn, txl[i]);
431+
ull_cp_release_tx(&llconn, txl[i]);
432432
}
433433

434434
for (int i = 0U; i < TX_BUFFER_POOL_SIZE; i++) {
435-
peek = llcp_tx_alloc_peek(&conn, ctx);
435+
peek = llcp_tx_alloc_peek(&llconn, ctx);
436436

437437
/* The previous tx alloc peek should be valid */
438438
zassert_true(peek, NULL);
439439

440-
txl[i] = llcp_tx_alloc(&conn, ctx);
440+
txl[i] = llcp_tx_alloc(&llconn, ctx);
441441

442442
/* The previous alloc should be valid */
443443
zassert_not_null(txl[i], NULL);
444444
}
445445

446-
peek = llcp_tx_alloc_peek(&conn, ctx);
446+
peek = llcp_tx_alloc_peek(&llconn, ctx);
447447

448448
/* The last tx alloc peek should fail */
449449
zassert_false(peek, NULL);
450450

451451
/* Release all */
452452
for (int i = 0U; i < TX_BUFFER_POOL_SIZE; i++) {
453-
ull_cp_release_tx(&conn, txl[i]);
453+
ull_cp_release_tx(&llconn, txl[i]);
454454
}
455455
}
456456

@@ -475,85 +475,85 @@ ZTEST(internal, test_int_create_proc)
475475

476476
ZTEST(internal, test_int_llcp_init)
477477
{
478-
struct ll_conn conn;
478+
struct ll_conn llconn;
479479

480480
ull_cp_init();
481481

482-
ull_llcp_init(&conn);
482+
ull_llcp_init(&llconn);
483483

484-
memset(&conn.llcp, 0xAA, sizeof(conn.llcp));
484+
memset(&llconn.llcp, 0xAA, sizeof(llconn.llcp));
485485

486-
ull_llcp_init(&conn);
486+
ull_llcp_init(&llconn);
487487

488-
zassert_equal(conn.llcp.local.pause, 0);
489-
zassert_equal(conn.llcp.remote.pause, 0);
488+
zassert_equal(llconn.llcp.local.pause, 0);
489+
zassert_equal(llconn.llcp.remote.pause, 0);
490490
}
491491

492492
ZTEST(internal, test_int_local_pending_requests)
493493
{
494-
struct ll_conn conn;
494+
struct ll_conn llconn;
495495
struct proc_ctx *peek_ctx;
496496
struct proc_ctx *dequeue_ctx;
497497
struct proc_ctx ctx;
498498

499499
ull_cp_init();
500-
ull_tx_q_init(&conn.tx_q);
501-
ull_llcp_init(&conn);
500+
ull_tx_q_init(&llconn.tx_q);
501+
ull_llcp_init(&llconn);
502502

503-
peek_ctx = llcp_lr_peek(&conn);
503+
peek_ctx = llcp_lr_peek(&llconn);
504504
zassert_is_null(peek_ctx, NULL);
505505

506-
dequeue_ctx = llcp_lr_dequeue(&conn);
506+
dequeue_ctx = llcp_lr_dequeue(&llconn);
507507
zassert_is_null(dequeue_ctx, NULL);
508508

509-
llcp_lr_enqueue(&conn, &ctx);
510-
peek_ctx = (struct proc_ctx *)sys_slist_peek_head(&conn.llcp.local.pend_proc_list);
509+
llcp_lr_enqueue(&llconn, &ctx);
510+
peek_ctx = (struct proc_ctx *)sys_slist_peek_head(&llconn.llcp.local.pend_proc_list);
511511
zassert_equal_ptr(peek_ctx, &ctx, NULL);
512512

513-
peek_ctx = llcp_lr_peek(&conn);
513+
peek_ctx = llcp_lr_peek(&llconn);
514514
zassert_equal_ptr(peek_ctx, &ctx, NULL);
515515

516-
dequeue_ctx = llcp_lr_dequeue(&conn);
516+
dequeue_ctx = llcp_lr_dequeue(&llconn);
517517
zassert_equal_ptr(dequeue_ctx, &ctx, NULL);
518518

519-
peek_ctx = llcp_lr_peek(&conn);
519+
peek_ctx = llcp_lr_peek(&llconn);
520520
zassert_is_null(peek_ctx, NULL);
521521

522-
dequeue_ctx = llcp_lr_dequeue(&conn);
522+
dequeue_ctx = llcp_lr_dequeue(&llconn);
523523
zassert_is_null(dequeue_ctx, NULL);
524524
}
525525

526526
ZTEST(internal, test_int_remote_pending_requests)
527527
{
528-
struct ll_conn conn;
528+
struct ll_conn llconn;
529529
struct proc_ctx *peek_ctx;
530530
struct proc_ctx *dequeue_ctx;
531531
struct proc_ctx ctx;
532532

533533
ull_cp_init();
534-
ull_tx_q_init(&conn.tx_q);
535-
ull_llcp_init(&conn);
534+
ull_tx_q_init(&llconn.tx_q);
535+
ull_llcp_init(&llconn);
536536

537-
peek_ctx = llcp_rr_peek(&conn);
537+
peek_ctx = llcp_rr_peek(&llconn);
538538
zassert_is_null(peek_ctx, NULL);
539539

540-
dequeue_ctx = llcp_rr_dequeue(&conn);
540+
dequeue_ctx = llcp_rr_dequeue(&llconn);
541541
zassert_is_null(dequeue_ctx, NULL);
542542

543-
llcp_rr_enqueue(&conn, &ctx);
544-
peek_ctx = (struct proc_ctx *)sys_slist_peek_head(&conn.llcp.remote.pend_proc_list);
543+
llcp_rr_enqueue(&llconn, &ctx);
544+
peek_ctx = (struct proc_ctx *)sys_slist_peek_head(&llconn.llcp.remote.pend_proc_list);
545545
zassert_equal_ptr(peek_ctx, &ctx, NULL);
546546

547-
peek_ctx = llcp_rr_peek(&conn);
547+
peek_ctx = llcp_rr_peek(&llconn);
548548
zassert_equal_ptr(peek_ctx, &ctx, NULL);
549549

550-
dequeue_ctx = llcp_rr_dequeue(&conn);
550+
dequeue_ctx = llcp_rr_dequeue(&llconn);
551551
zassert_equal_ptr(dequeue_ctx, &ctx, NULL);
552552

553-
peek_ctx = llcp_rr_peek(&conn);
553+
peek_ctx = llcp_rr_peek(&llconn);
554554
zassert_is_null(peek_ctx, NULL);
555555

556-
dequeue_ctx = llcp_rr_dequeue(&conn);
556+
dequeue_ctx = llcp_rr_dequeue(&llconn);
557557
zassert_is_null(dequeue_ctx, NULL);
558558
}
559559

tests/bluetooth/controller/ctrl_chmu/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ static void chmu_setup(void *data)
5151
test_setup(&conn);
5252
}
5353

54-
static bool is_instant_reached(struct ll_conn *conn, uint16_t instant)
54+
static bool is_instant_reached(struct ll_conn *llconn, uint16_t instant)
5555
{
56-
return ((event_counter(conn) - instant) & 0xFFFF) <= 0x7FFF;
56+
return ((event_counter(llconn) - instant) & 0xFFFF) <= 0x7FFF;
5757
}
5858

5959
ZTEST(chmu, test_channel_map_update_central_loc)

tests/bluetooth/controller/ctrl_cis_create/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ static void cis_create_setup(void *data)
6666
RESET_FAKE(ll_conn_iso_stream_get);
6767
}
6868

69-
static bool is_instant_reached(struct ll_conn *conn, uint16_t instant)
69+
static bool is_instant_reached(struct ll_conn *llconn, uint16_t instant)
7070
{
71-
return ((event_counter(conn) - instant) & 0xFFFF) <= 0x7FFF;
71+
return ((event_counter(llconn) - instant) & 0xFFFF) <= 0x7FFF;
7272
}
7373

7474
#define MAX_xDU 160

tests/bluetooth/controller/ctrl_collision/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ static void collision_setup(void *data)
141141
} while (0)
142142

143143

144-
static bool is_instant_reached(struct ll_conn *conn, uint16_t instant)
144+
static bool is_instant_reached(struct ll_conn *llconn, uint16_t instant)
145145
{
146-
return ((event_counter(conn) - instant) & 0xFFFF) <= 0x7FFF;
146+
return ((event_counter(llconn) - instant) & 0xFFFF) <= 0x7FFF;
147147
}
148148

149149
ZTEST(collision, test_phy_update_central_loc_collision)

tests/bluetooth/controller/ctrl_conn_update/src/main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,21 @@ static struct ll_conn conn;
170170

171171
#if defined(CONFIG_BT_CTLR_CONN_PARAM_REQ)
172172
#if defined(CONFIG_BT_CTLR_USER_CPR_ANCHOR_POINT_MOVE)
173-
bool ull_handle_cpr_anchor_point_move(struct ll_conn *conn, uint16_t *offsets, uint8_t *status)
173+
bool ull_handle_cpr_anchor_point_move(struct ll_conn *llconn, uint16_t *offsets, uint8_t *status)
174174
{
175175
ztest_copy_return_data(status, 1);
176176
return ztest_get_return_value();
177177
}
178178
#endif /* CONFIG_BT_CTLR_USER_CPR_ANCHOR_POINT_MOVE */
179179

180-
static void test_unmask_feature_conn_param_req(struct ll_conn *conn)
180+
static void test_unmask_feature_conn_param_req(struct ll_conn *llconn)
181181
{
182-
conn->llcp.fex.features_used &= ~BIT64(BT_LE_FEAT_BIT_CONN_PARAM_REQ);
182+
llconn->llcp.fex.features_used &= ~BIT64(BT_LE_FEAT_BIT_CONN_PARAM_REQ);
183183
}
184184

185-
static bool test_get_feature_conn_param_req(struct ll_conn *conn)
185+
static bool test_get_feature_conn_param_req(struct ll_conn *llconn)
186186
{
187-
return (conn->llcp.fex.features_used & BIT64(BT_LE_FEAT_BIT_CONN_PARAM_REQ));
187+
return (llconn->llcp.fex.features_used & BIT64(BT_LE_FEAT_BIT_CONN_PARAM_REQ));
188188
}
189189
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
190190

@@ -206,9 +206,9 @@ static void conn_update_setup(void *data)
206206
lll->event_counter = 0;
207207
}
208208

209-
static bool is_instant_reached(struct ll_conn *conn, uint16_t instant)
209+
static bool is_instant_reached(struct ll_conn *llconn, uint16_t instant)
210210
{
211-
return ((event_counter(conn) - instant) & 0xFFFF) <= 0x7FFF;
211+
return ((event_counter(llconn) - instant) & 0xFFFF) <= 0x7FFF;
212212
}
213213

214214
#if defined(CONFIG_BT_CTLR_CONN_PARAM_REQ)

0 commit comments

Comments
 (0)