Skip to content

Commit dc11ffb

Browse files
jenmwmsnashif
authored andcommitted
kernel: timeout: fix missing final else
z_timeout_end_calc() was missing final else statement in the if else if construct. This commit pulls the last condition into a final else {} to comply with guideline 15.7. Signed-off-by: Jennifer Williams <[email protected]>
1 parent a3c7e45 commit dc11ffb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

kernel/timeout.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,13 @@ uint64_t sys_clock_timeout_end_calc(k_timeout_t timeout)
310310
return UINT64_MAX;
311311
} else if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) {
312312
return sys_clock_tick_get();
313-
}
313+
} else {
314314

315-
dt = timeout.ticks;
315+
dt = timeout.ticks;
316316

317-
if (IS_ENABLED(CONFIG_TIMEOUT_64BIT) && Z_TICK_ABS(dt) >= 0) {
318-
return Z_TICK_ABS(dt);
317+
if (IS_ENABLED(CONFIG_TIMEOUT_64BIT) && Z_TICK_ABS(dt) >= 0) {
318+
return Z_TICK_ABS(dt);
319+
}
320+
return sys_clock_tick_get() + MAX(1, dt);
319321
}
320-
return sys_clock_tick_get() + MAX(1, dt);
321322
}

0 commit comments

Comments
 (0)