aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2007-11-14 20:01:33 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-14 21:45:47 -0500
commit2f1f53bdc6531696934f6ee7bbdfa2ab4f4f62a3 (patch)
tree04800c44bc0bd4f36782dd11d5d637899aee7a9f /arch/cris/arch-v10
parent2e2cd8bad6e03ceea73495ee6d557044213d95de (diff)
CRISv10 fasttimer: Scrap INLINE and name timeval_cmp better
Scrap the local __INLINE__ macro, and rename timeval_cmp to fasttime_cmp. Inline macro was completely unnecessary since the macro was defined locally to be inline. timeval_cmp was inaccurately named since it does comparison on struct fasttimer_t and not on struct timeval. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Mikael Starvik <mikael.starvik@axis.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/cris/arch-v10')
-rw-r--r--arch/cris/arch-v10/kernel/fasttimer.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/cris/arch-v10/kernel/fasttimer.c b/arch/cris/arch-v10/kernel/fasttimer.c
index 645d7059b401..c1a3a2100ee7 100644
--- a/arch/cris/arch-v10/kernel/fasttimer.c
+++ b/arch/cris/arch-v10/kernel/fasttimer.c
@@ -46,8 +46,6 @@ static int sanity_failed;
46#define D2(x) 46#define D2(x)
47#define DP(x) 47#define DP(x)
48 48
49#define __INLINE__ inline
50
51static unsigned int fast_timer_running; 49static unsigned int fast_timer_running;
52static unsigned int fast_timers_added; 50static unsigned int fast_timers_added;
53static unsigned int fast_timers_started; 51static unsigned int fast_timers_started;
@@ -118,13 +116,13 @@ int timer_freq_settings[NUM_TIMER_STATS];
118int timer_delay_settings[NUM_TIMER_STATS]; 116int timer_delay_settings[NUM_TIMER_STATS];
119 117
120/* Not true gettimeofday, only checks the jiffies (uptime) + useconds */ 118/* Not true gettimeofday, only checks the jiffies (uptime) + useconds */
121void __INLINE__ do_gettimeofday_fast(struct fasttime_t *tv) 119inline void do_gettimeofday_fast(struct fasttime_t *tv)
122{ 120{
123 tv->tv_jiff = jiffies; 121 tv->tv_jiff = jiffies;
124 tv->tv_usec = GET_JIFFIES_USEC(); 122 tv->tv_usec = GET_JIFFIES_USEC();
125} 123}
126 124
127int __INLINE__ timeval_cmp(struct fasttime_t *t0, struct fasttime_t *t1) 125inline int fasttime_cmp(struct fasttime_t *t0, struct fasttime_t *t1)
128{ 126{
129 /* Compare jiffies. Takes care of wrapping */ 127 /* Compare jiffies. Takes care of wrapping */
130 if (time_before(t0->tv_jiff, t1->tv_jiff)) 128 if (time_before(t0->tv_jiff, t1->tv_jiff))
@@ -140,7 +138,7 @@ int __INLINE__ timeval_cmp(struct fasttime_t *t0, struct fasttime_t *t1)
140 return 0; 138 return 0;
141} 139}
142 140
143void __INLINE__ start_timer1(unsigned long delay_us) 141inline void start_timer1(unsigned long delay_us)
144{ 142{
145 int freq_index = 0; /* This is the lowest resolution */ 143 int freq_index = 0; /* This is the lowest resolution */
146 unsigned long upper_limit = MAX_DELAY_US; 144 unsigned long upper_limit = MAX_DELAY_US;
@@ -264,7 +262,7 @@ void start_one_shot_timer(struct fast_timer *t,
264 fast_timers_added++; 262 fast_timers_added++;
265 263
266 /* Check if this should timeout before anything else */ 264 /* Check if this should timeout before anything else */
267 if (tmp == NULL || timeval_cmp(&t->tv_expires, &tmp->tv_expires) < 0) 265 if (tmp == NULL || fasttime_cmp(&t->tv_expires, &tmp->tv_expires) < 0)
268 { 266 {
269 /* Put first in list and modify the timer value */ 267 /* Put first in list and modify the timer value */
270 t->prev = NULL; 268 t->prev = NULL;
@@ -280,8 +278,8 @@ void start_one_shot_timer(struct fast_timer *t,
280 start_timer1(delay_us); 278 start_timer1(delay_us);
281 } else { 279 } else {
282 /* Put in correct place in list */ 280 /* Put in correct place in list */
283 while (tmp->next && 281 while (tmp->next && fasttime_cmp(&t->tv_expires,
284 timeval_cmp(&t->tv_expires, &tmp->next->tv_expires) > 0) 282 &tmp->next->tv_expires) > 0)
285 { 283 {
286 tmp = tmp->next; 284 tmp = tmp->next;
287 } 285 }
@@ -382,7 +380,7 @@ timer1_handler(int irq, void *dev_id)
382 D1(printk(KERN_DEBUG "t: %is %06ius\n", 380 D1(printk(KERN_DEBUG "t: %is %06ius\n",
383 tv.tv_jiff, tv.tv_usec)); 381 tv.tv_jiff, tv.tv_usec));
384 382
385 if (timeval_cmp(&t->tv_expires, &tv) <= 0) 383 if (fasttime_cmp(&t->tv_expires, &tv) <= 0)
386 { 384 {
387 /* Yes it has expired */ 385 /* Yes it has expired */
388#ifdef FAST_TIMER_LOG 386#ifdef FAST_TIMER_LOG