lkml.org 
[lkml]   [2007]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 08/23] clocksource: drop duplicate register checking
This is something Thomas already dropped, and I'm just sticking
with that .. If you register your clocksource _twice_ your kernel will
likely not work correctly (and might crash).

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

---
kernel/time/clocksource.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)

Index: linux-2.6.19/kernel/time/clocksource.c
===================================================================
--- linux-2.6.19.orig/kernel/time/clocksource.c
+++ linux-2.6.19/kernel/time/clocksource.c
@@ -186,16 +186,12 @@ int clocksource_register(struct clocksou
unsigned long flags;

spin_lock_irqsave(&clocksource_lock, flags);
- if (unlikely(!list_empty(&c->list) && __is_registered(c->name))) {
- printk("register_clocksource: Cannot register %s clocksource. "
- "Already registered!", c->name);
- ret = -EBUSY;
- } else {
- INIT_LIST_HEAD(&c->list);
- __sorted_list_add(c);
- /* scan the registered clocksources, and pick the best one */
- next_clocksource = select_clocksource();
- }
+ __sorted_list_add(c);
+
+ /*
+ * scan the registered clocksources, and pick the best one
+ */
+ next_clocksource = select_clocksource();
spin_unlock_irqrestore(&clocksource_lock, flags);
return ret;
}
@@ -212,9 +208,6 @@ void clocksource_rating_change(struct cl
{
unsigned long flags;

- if (unlikely(list_empty(&c->list)))
- return;
-
spin_lock_irqsave(&clocksource_lock, flags);

/*
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-01-31 04:45    [W:0.183 / U:13.476 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site