mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Bowler <jbowler@acm.org>
To: <mingo@elte.hu>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.6.14-rc-mm1 include/linux/spinlock_up.h: make compilable without CONFIG_DEBUG_SPINLOCK
Date: Thu, 27 Oct 2005 23:53:46 -0700	[thread overview]
Message-ID: <001301c5db8c$59279d80$1001a8c0@kalmiopsis> (raw)

The 2.6.14-rc5-mm1 code fails to compile on a uniprocessor
system if CONFIG_DEBUG_SPINLOCK is not specified.  This seems
to be a simple error in the (MM) spinlock_up.h header where the
_raw_{read,write}_unlock macros are defined only in the DEBUG
branch, yet, in MM, are required in all cases.

The patch will apply cleanly to both 2.6.14 and 2.6.14-rc5-mm1,
however it is not required in 2.6.14 (though it seems to do no
harm).  The patch is confusing because it (effectively) moves
the #endif up rather than moving the _raw macros down.

Signed-off-by: John Bowler <jbowler@acm.org>

--- linux-2.6.14-rc5/include/linux/spinlock_up.h	2005-10-26 08:37:20.164248408 -0700
+++ patched/include/linux/spinlock_up.h	2005-10-26 12:15:13.458898975 -0700
@@ -47,6 +47,14 @@ static inline void __raw_spin_unlock(raw
 	lock->slock = 1;
 }
 
+#else /* DEBUG_SPINLOCK */
+#define __raw_spin_is_locked(lock)	((void)(lock), 0)
+/* for sched.c and kernel_lock.c: */
+# define __raw_spin_lock(lock)		do { (void)(lock); } while (0)
+# define __raw_spin_unlock(lock)	do { (void)(lock); } while (0)
+# define __raw_spin_trylock(lock)	({ (void)(lock); 1; })
+#endif /* DEBUG_SPINLOCK */
+
 /*
  * Read-write spinlocks. No debug version.
  */
@@ -57,14 +65,6 @@ static inline void __raw_spin_unlock(raw
 #define __raw_read_unlock(lock)		do { (void)(lock); } while (0)
 #define __raw_write_unlock(lock)	do { (void)(lock); } while (0)
 
-#else /* DEBUG_SPINLOCK */
-#define __raw_spin_is_locked(lock)	((void)(lock), 0)
-/* for sched.c and kernel_lock.c: */
-# define __raw_spin_lock(lock)		do { (void)(lock); } while (0)
-# define __raw_spin_unlock(lock)	do { (void)(lock); } while (0)
-# define __raw_spin_trylock(lock)	({ (void)(lock); 1; })
-#endif /* DEBUG_SPINLOCK */
-
 #define __raw_read_can_lock(lock)	(((void)(lock), 1))
 #define __raw_write_can_lock(lock)	(((void)(lock), 1))
 


                 reply	other threads:[~2005-10-28  7:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='001301c5db8c$59279d80$1001a8c0@kalmiopsis' \
    --to=jbowler@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®