Skip to content

Commit 3603d83

Browse files
tychofrei02carlescufi
authored andcommitted
Bluetooth: Controller: change condition in while to Boolean
Use `do { ... } while (false)` instead of `do { ... } while (0)`. Signed-off-by: frei tycho <tfrei@baumer.com>
1 parent f0dae15 commit 3603d83

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h

+21-21
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
do { \
105105
DEBUG_PORT->DIRSET = DEBUG_PIN_MASK; \
106106
DEBUG_PORT->OUTCLR = DEBUG_PIN_MASK; \
107-
} while (0)
107+
} while (false)
108108

109109
#define DEBUG_CPU_SLEEP(flag) \
110110
do { \
@@ -115,7 +115,7 @@
115115
DEBUG_PORT->OUTCLR = DEBUG_PIN0; \
116116
DEBUG_PORT->OUTSET = DEBUG_PIN0; \
117117
} \
118-
} while (0)
118+
} while (false)
119119

120120
#define DEBUG_TICKER_ISR(flag) \
121121
do { \
@@ -126,7 +126,7 @@
126126
DEBUG_PORT->OUTSET = DEBUG_PIN1; \
127127
DEBUG_PORT->OUTCLR = DEBUG_PIN1; \
128128
} \
129-
} while (0)
129+
} while (false)
130130

131131
#define DEBUG_TICKER_TASK(flag) \
132132
do { \
@@ -137,7 +137,7 @@
137137
DEBUG_PORT->OUTSET = DEBUG_PIN1; \
138138
DEBUG_PORT->OUTCLR = DEBUG_PIN1; \
139139
} \
140-
} while (0)
140+
} while (false)
141141

142142
#define DEBUG_TICKER_JOB(flag) \
143143
do { \
@@ -148,7 +148,7 @@
148148
DEBUG_PORT->OUTSET = DEBUG_PIN2; \
149149
DEBUG_PORT->OUTCLR = DEBUG_PIN2; \
150150
} \
151-
} while (0)
151+
} while (false)
152152

153153
#define DEBUG_RADIO_ISR(flag) \
154154
do { \
@@ -159,7 +159,7 @@
159159
DEBUG_PORT->OUTSET = DEBUG_PIN7; \
160160
DEBUG_PORT->OUTCLR = DEBUG_PIN7; \
161161
} \
162-
} while (0)
162+
} while (false)
163163

164164
#define DEBUG_RADIO_XTAL(flag) \
165165
do { \
@@ -170,7 +170,7 @@
170170
DEBUG_PORT->OUTSET = DEBUG_PIN8; \
171171
DEBUG_PORT->OUTCLR = DEBUG_PIN8; \
172172
} \
173-
} while (0)
173+
} while (false)
174174

175175
#define DEBUG_RADIO_ACTIVE(flag) \
176176
do { \
@@ -181,7 +181,7 @@
181181
DEBUG_PORT->OUTSET = DEBUG_PIN9; \
182182
DEBUG_PORT->OUTCLR = DEBUG_PIN9; \
183183
} \
184-
} while (0)
184+
} while (false)
185185

186186
#define DEBUG_RADIO_CLOSE(flag) \
187187
do { \
@@ -191,7 +191,7 @@
191191
} else { \
192192
DEBUG_PORT->OUTCLR = DEBUG_CLOSE_MASK; \
193193
} \
194-
} while (0)
194+
} while (false)
195195

196196
#define DEBUG_RADIO_PREPARE_A(flag) \
197197
do { \
@@ -202,7 +202,7 @@
202202
DEBUG_PORT->OUTCLR = DEBUG_PIN3; \
203203
DEBUG_PORT->OUTSET = DEBUG_PIN3; \
204204
} \
205-
} while (0)
205+
} while (false)
206206

207207
#define DEBUG_RADIO_START_A(flag) \
208208
do { \
@@ -213,7 +213,7 @@
213213
DEBUG_PORT->OUTCLR = DEBUG_PIN3; \
214214
DEBUG_PORT->OUTSET = DEBUG_PIN3; \
215215
} \
216-
} while (0)
216+
} while (false)
217217

218218
#define DEBUG_RADIO_CLOSE_A(flag) \
219219
do { \
@@ -223,7 +223,7 @@
223223
} else { \
224224
DEBUG_PORT->OUTCLR = DEBUG_PIN3; \
225225
} \
226-
} while (0)
226+
} while (false)
227227

228228
#define DEBUG_RADIO_PREPARE_S(flag) \
229229
do { \
@@ -234,7 +234,7 @@
234234
DEBUG_PORT->OUTCLR = DEBUG_PIN4; \
235235
DEBUG_PORT->OUTSET = DEBUG_PIN4; \
236236
} \
237-
} while (0)
237+
} while (false)
238238

239239
#define DEBUG_RADIO_START_S(flag) \
240240
do { \
@@ -245,7 +245,7 @@
245245
DEBUG_PORT->OUTCLR = DEBUG_PIN4; \
246246
DEBUG_PORT->OUTSET = DEBUG_PIN4; \
247247
} \
248-
} while (0)
248+
} while (false)
249249

250250
#define DEBUG_RADIO_CLOSE_S(flag) \
251251
do { \
@@ -255,7 +255,7 @@
255255
} else { \
256256
DEBUG_PORT->OUTCLR = DEBUG_PIN4; \
257257
} \
258-
} while (0)
258+
} while (false)
259259

260260
#define DEBUG_RADIO_PREPARE_O(flag) \
261261
do { \
@@ -266,7 +266,7 @@
266266
DEBUG_PORT->OUTCLR = DEBUG_PIN5; \
267267
DEBUG_PORT->OUTSET = DEBUG_PIN5; \
268268
} \
269-
} while (0)
269+
} while (false)
270270

271271
#define DEBUG_RADIO_START_O(flag) \
272272
do { \
@@ -277,7 +277,7 @@
277277
DEBUG_PORT->OUTCLR = DEBUG_PIN5; \
278278
DEBUG_PORT->OUTSET = DEBUG_PIN5; \
279279
} \
280-
} while (0)
280+
} while (false)
281281

282282
#define DEBUG_RADIO_CLOSE_O(flag) \
283283
do { \
@@ -287,7 +287,7 @@
287287
} else { \
288288
DEBUG_PORT->OUTCLR = DEBUG_PIN5; \
289289
} \
290-
} while (0)
290+
} while (false)
291291

292292
#define DEBUG_RADIO_PREPARE_M(flag) \
293293
do { \
@@ -298,7 +298,7 @@
298298
DEBUG_PORT->OUTCLR = DEBUG_PIN6; \
299299
DEBUG_PORT->OUTSET = DEBUG_PIN6; \
300300
} \
301-
} while (0)
301+
} while (false)
302302

303303
#define DEBUG_RADIO_START_M(flag) \
304304
do { \
@@ -309,7 +309,7 @@
309309
DEBUG_PORT->OUTCLR = DEBUG_PIN6; \
310310
DEBUG_PORT->OUTSET = DEBUG_PIN6; \
311311
} \
312-
} while (0)
312+
} while (false)
313313

314314
#define DEBUG_RADIO_CLOSE_M(flag) \
315315
do { \
@@ -319,7 +319,7 @@
319319
} else { \
320320
DEBUG_PORT->OUTCLR = DEBUG_PIN6; \
321321
} \
322-
} while (0)
322+
} while (false)
323323

324324
#else
325325
#define DEBUG_SETUP()

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static uint8_t force_md_cnt;
8585
if (force_md_cnt) { \
8686
force_md_cnt--; \
8787
} \
88-
} while (0)
88+
} while (false)
8989

9090
#define FORCE_MD_CNT_GET() force_md_cnt
9191

@@ -95,7 +95,7 @@ static uint8_t force_md_cnt;
9595
(trx_cnt >= ((CONFIG_BT_BUF_ACL_TX_COUNT) - 1))) { \
9696
force_md_cnt = BT_CTLR_FORCE_MD_COUNT; \
9797
} \
98-
} while (0)
98+
} while (false)
9999

100100
#else /* !CONFIG_BT_CTLR_FORCE_MD_COUNT */
101101
#define FORCE_MD_CNT_INIT()

subsys/bluetooth/controller/ll_sw/openisa/hal/RV32M1/debug.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extern const struct device *vega_debug_portd;
102102
\
103103
gpio_pin_set(DEBUG0_PORT, DEBUG0_PIN, 1); \
104104
gpio_pin_set(DEBUG0_PORT, DEBUG0_PIN, 0); \
105-
} while (0)
105+
} while (false)
106106

107107
#define DEBUG_CPU_SLEEP(flag) gpio_pin_set(DEBUG0_PORT, DEBUG0_PIN, flag)
108108

@@ -126,7 +126,7 @@ extern const struct device *vega_debug_portd;
126126
gpio_pin_set(DEBUG5_PORT, DEBUG5_PIN, flag); \
127127
gpio_pin_set(DEBUG6_PORT, DEBUG6_PIN, flag); \
128128
} \
129-
} while (0)
129+
} while (false)
130130

131131
#define DEBUG_RADIO_PREPARE_A(flag) \
132132
gpio_pin_set(DEBUG3_PORT, DEBUG3_PIN, flag)

0 commit comments

Comments
 (0)