Commit cab1826e authored by John Stultz's avatar John Stultz Committed by Linus Torvalds

[PATCH] linux-2.5.57_timer-none_A0.patch

This creates an empty timer_opt structure (timer_none) which is then
used as a default initializer to the timer pointer.  This lets us avoid
having to check before dereferencing the timer in future code.
parent 9e535055
......@@ -78,7 +78,8 @@ spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED;
EXPORT_SYMBOL(i8253_lock);
struct timer_opts* timer;
extern struct timer_opts timer_none;
struct timer_opts* timer = &timer_none;
/*
* This version of gettimeofday has microsecond resolution
......
......@@ -2,6 +2,6 @@
# Makefile for x86 timers
#
obj-y := timer.o timer_tsc.o timer_pit.o
obj-y := timer.o timer_none.o timer_tsc.o timer_pit.o
obj-$(CONFIG_X86_CYCLONE) += timer_cyclone.o
#include <asm/timer.h>
static int init_none(void)
{
return 0;
}
static void mark_offset_none(void)
{
/* nothing needed */
}
static unsigned long get_offset_none(void)
{
return 0;
}
/* tsc timer_opts struct */
struct timer_opts timer_none = {
.init = init_none,
.mark_offset = mark_offset_none,
.get_offset = get_offset_none,
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment