All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Robert Love <rml@mvista.com>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	linux-kernel@vger.kernel.org, Adam G Litke <aglitke@us.ibm.com>
Subject: Re: [PATCH] reduce code in generic spinlock.h
Date: Tue, 23 Jul 2002 12:41:21 -0700	[thread overview]
Message-ID: <3D3DB161.7090303@us.ibm.com> (raw)
In-Reply-To: 1027442320.3581.100.camel@sinai

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

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

[-- Attachment #2: spinlock-cleanup-bk0723.diff --]
[-- Type: text/plain, Size: 1072 bytes --]

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

      parent reply	other threads:[~2002-07-23 19:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-23 16:28 [PATCH] reduce code in generic spinlock.h Dave Hansen
2002-07-23 16:38 ` Robert Love
2002-07-23 16:41   ` Dave Hansen
2002-07-23 19:41   ` Dave Hansen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D3DB161.7090303@us.ibm.com \
    --to=haveblue@us.ibm.com \
    --cc=aglitke@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@mvista.com \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.