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 <pisit@ndrsolution.com>
This commit is contained in:
Pisit Sawangvonganan 2024-08-21 03:15:42 +07:00 committed by Anas Nashif
parent 6a64490c34
commit 6fb4ff354b
2 changed files with 6 additions and 3 deletions

View file

@ -133,13 +133,14 @@ void queue_thread(void *arg1, void *arg2, void *arg3)
current_queue++; current_queue++;
k_mutex_unlock(&fetch_queue_mtx); k_mutex_unlock(&fetch_queue_mtx);
for (int i = 0; i < THREADS_NUM; i++) for (int i = 0; i < THREADS_NUM; i++) {
k_thread_create(&tthread[i+THREADS_NUM*queue_num], k_thread_create(&tthread[i+THREADS_NUM*queue_num],
tstack[i+THREADS_NUM*queue_num], STACK_SIZE, tstack[i+THREADS_NUM*queue_num], STACK_SIZE,
test_thread, test_thread,
(void *)&sender[queue_num], (void *)&sender[queue_num],
(void *)&receiver[queue_num], (void *)&queue_num, (void *)&receiver[queue_num], (void *)&queue_num,
K_PRIO_PREEMPT(10), 0, K_NO_WAIT); K_PRIO_PREEMPT(10), 0, K_NO_WAIT);
}
/* Wait until sender queue is not empty */ /* Wait until sender queue is not empty */
while (sender[queue_num].count != 0) { while (sender[queue_num].count != 0) {
@ -173,11 +174,12 @@ int main(void)
/* Capture initial time stamp */ /* Capture initial time stamp */
start_time = k_cycle_get_32(); start_time = k_cycle_get_32();
for (int i = 0; i < QUEUE_NUM; i++) for (int i = 0; i < QUEUE_NUM; i++) {
k_thread_create(&qthread[i], qstack[i], STACK_SIZE, k_thread_create(&qthread[i], qstack[i], STACK_SIZE,
queue_thread, queue_thread,
(void *)&sender[i], (void *)&receiver[i], (void *)&sender[i], (void *)&receiver[i],
(void *)&i, K_PRIO_PREEMPT(11), 0, K_NO_WAIT); (void *)&i, K_PRIO_PREEMPT(11), 0, K_NO_WAIT);
}
/* Wait until all queues are not processed */ /* Wait until all queues are not processed */
while (queues_remain > 0) { while (queues_remain > 0) {

View file

@ -79,8 +79,9 @@ static void test_trigger_mode(const struct device *dev)
{ {
struct sensor_trigger trig; struct sensor_trigger trig;
if (set_sampling_freq(dev) != 0) if (set_sampling_freq(dev) != 0) {
return; return;
}
trig.type = SENSOR_TRIG_DATA_READY; trig.type = SENSOR_TRIG_DATA_READY;
trig.chan = SENSOR_CHAN_ACCEL_XYZ; trig.chan = SENSOR_CHAN_ACCEL_XYZ;