lkml.org 
[lkml]   [2002]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] reduce code in generic spinlock.h
Robert Love wrote:
> It will not apply to Linus's current tree, however, because of the IRQ
> rewrite that is now applied. If you pull his BK tree and diff against
> that, you should be OK... most notably, the preemption code has moved to
> preempt.h.

OK, this just made it simpler. Just remove the preempt ifdef and the
extra spinlock calls. Patch against latest BK attached.

--
Dave Hansen
haveblue@us.ibm.com
diff -Nru a/include/linux/spinlock.h b/include/linux/spinlock.h
--- a/include/linux/spinlock.h Tue Jul 23 13:56:42 2002
+++ b/include/linux/spinlock.h Tue Jul 23 13:56:42 2002
@@ -119,8 +119,6 @@

#endif /* !SMP */

-#ifdef CONFIG_PREEMPT
-
#define spin_lock(lock) \
do { \
preempt_disable(); \
@@ -147,20 +145,6 @@
#define write_unlock(lock) ({_raw_write_unlock(lock); preempt_enable();})
#define write_trylock(lock) ({preempt_disable();_raw_write_trylock(lock) ? \
1 : ({preempt_enable(); 0;});})
-
-#else
-
-#define spin_lock(lock) _raw_spin_lock(lock)
-#define spin_trylock(lock) _raw_spin_trylock(lock)
-#define spin_unlock(lock) _raw_spin_unlock(lock)
-#define spin_unlock_no_resched(lock) _raw_spin_unlock(lock)
-
-#define read_lock(lock) _raw_read_lock(lock)
-#define read_unlock(lock) _raw_read_unlock(lock)
-#define write_lock(lock) _raw_write_lock(lock)
-#define write_unlock(lock) _raw_write_unlock(lock)
-#define write_trylock(lock) _raw_write_trylock(lock)
-#endif

/* "lock on reference count zero" */
#ifndef ATOMIC_DEC_AND_LOCK
\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.089 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site