Skip to content

Commit

Permalink
Fix timers/arch_alarm.c:109:3: error: 'now' may be used uninitialized
Browse files Browse the repository at this point in the history
and timers/arch_alarm.c:150:51: error: 'ticks' may be used uninitialized

Signed-off-by: Xiang Xiao <[email protected]>
  • Loading branch information
xiaoxiang781216 authored and raiden00pl committed Nov 16, 2024
1 parent f269300 commit 87d57d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/timers/arch_alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ static void udelay_coarse(useconds_t microseconds)
static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower,
FAR void *arg)
{
clock_t now;
ONESHOT_TICK_CURRENT(g_oneshot_lower, &now);
clock_t now = 0;

ONESHOT_TICK_CURRENT(g_oneshot_lower, &now);
#ifdef CONFIG_SCHED_TICKLESS
nxsched_alarm_tick_expiration(now);
#else
Expand Down Expand Up @@ -140,7 +140,7 @@ static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower,
void up_alarm_set_lowerhalf(FAR struct oneshot_lowerhalf_s *lower)
{
#ifdef CONFIG_SCHED_TICKLESS
clock_t ticks;
clock_t ticks = 0;
#endif

g_oneshot_lower = lower;
Expand Down Expand Up @@ -318,7 +318,7 @@ int weak_function up_alarm_tick_start(clock_t ticks)

if (g_oneshot_lower != NULL)
{
clock_t now;
clock_t now = 0;
clock_t delta;

ONESHOT_TICK_CURRENT(g_oneshot_lower, &now);
Expand Down

0 comments on commit 87d57d2

Please sign in to comment.