Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timers/arch_alarm.c:109:3: error: 'now' may be used uninitialized #14818

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

xiaoxiang781216
Copy link
Contributor

Summary

and timers/arch_alarm.c:150:51: error: 'ticks' may be used uninitialized

Impact

fix compiler warning

Testing

ci

and timers/arch_alarm.c:150:51: error: 'ticks' may be used uninitialized

Signed-off-by: Xiang Xiao <[email protected]>
@github-actions github-actions bot added Area: Drivers Drivers issues Size: XS The size of the change in this PR is very small labels Nov 16, 2024
Comment on lines -106 to +107
ONESHOT_TICK_CURRENT(g_oneshot_lower, &now);
clock_t now = 0;

ONESHOT_TICK_CURRENT(g_oneshot_lower, &now);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this modification is not necessary, since the ONESHOT_TICK_CURRENT will set it with the initial value. I think we did it just to fix the compiler warning, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the value doesn't set if the driver doesn't implement the related callback after #14619.

@raiden00pl raiden00pl merged commit 87d57d2 into apache:master Nov 16, 2024
27 checks passed
@xiaoxiang781216 xiaoxiang781216 deleted the timer2 branch November 17, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Drivers Drivers issues Size: XS The size of the change in this PR is very small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants