Skip to content

Commit 7906d33

Browse files
ndrs-psthenrikbrixandersen
authored andcommitted
style: samples: comply with MISRA C:2012 Rule 15.6
Add missing braces to comply with MISRA C:2012 Rule 15.6 and also following Zephyr's style guideline. Signed-off-by: Pisit Sawangvonganan <[email protected]>
1 parent 57b5f71 commit 7906d33

File tree

4 files changed

+8
-4
lines changed
  • samples
    • bluetooth/tmap_peripheral/src
    • drivers/virtualization/ivshmem/doorbell/src
    • shields/x_nucleo_iks01a3/standard/src
    • subsys/debug/debugmon/src

4 files changed

+8
-4
lines changed

samples/bluetooth/tmap_peripheral/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,9 @@ int main(void)
298298
if (peer_is_ums) {
299299
/* Play media with MCP */
300300
err = mcp_send_cmd(BT_MCS_OPC_PLAY);
301-
if (err != 0)
301+
if (err != 0) {
302302
printk("Error sending media play command!\n");
303+
}
303304

304305
/* Start timer to send media pause command */
305306
k_work_schedule(&media_pause_set_work, K_MSEC(2000));

samples/drivers/virtualization/ivshmem/doorbell/src/ivshmem.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ static void ivshmem_sample_doorbell(void)
197197
int ret;
198198

199199
ret = setup_ivshmem(true);
200-
if (ret < 0)
200+
if (ret < 0) {
201201
return;
202+
}
202203
ivshmem_event_loop(&shmem_ctx);
203204
/*
204205
* if ivshmem_event_loop() returns, it means the function failed

samples/shields/x_nucleo_iks01a3/standard/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,9 @@ int main(void)
341341
stts751_config(stts751);
342342
lis2dw12_config(lis2dw12);
343343
lsm6dso_config(lsm6dso);
344-
if (lis2de12_on_dil24)
344+
if (lis2de12_on_dil24) {
345345
lis2de12_config(lis2de12);
346+
}
346347

347348
while (1) {
348349
/* Get sensor samples */

samples/subsys/debug/debugmon/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ void z_arm_debug_monitor(void)
5151
printk("Entered debug monitor interrupt\n");
5252

5353
/* Spin in breakpoint. Other, higher-priority interrupts will continue to execute */
54-
while (true)
54+
while (true) {
5555
;
56+
}
5657
}
5758

5859
int main(void)

0 commit comments

Comments
 (0)