Skip to content

Commit b6f8a92

Browse files
Nicolas Pitretorvalds
authored andcommitted
posix-timers: give lazy compilers some help optimizing code away
The OpenRISC compiler (so far) fails to optimize away a large portion of code containing a reference to posix_timer_event in alarmtimer.c when CONFIG_POSIX_TIMERS is unset. Let's give it a direct clue to let the build succeed. This fixes [linux-next:master 6682/7183] alarmtimer.c:undefined reference to `posix_timer_event' reported by kbuild test robot. Signed-off-by: Nicolas Pitre <nico@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 63980c8 commit b6f8a92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/time/alarmtimer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,
516516

517517
spin_lock_irqsave(&ptr->it_lock, flags);
518518
if ((ptr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) {
519-
if (posix_timer_event(ptr, 0) != 0)
519+
if (IS_ENABLED(CONFIG_POSIX_TIMERS) &&
520+
posix_timer_event(ptr, 0) != 0)
520521
ptr->it_overrun++;
521522
}
522523

0 commit comments

Comments
 (0)