public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org
Subject: [PATCH RT] fix undefined references to kernel_sem
Date: Tue, 25 May 2010 00:04:28 +0200	[thread overview]
Message-ID: <20100524220428.GA17771@aepfle.de> (raw)

protect kernel_sem access with CONFIG_LOCK_KERNEL
lib/kernel_lock.c is compiled conditionally.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

---
 init/main.c      |    4 ++++
 kernel/lockdep.c |    2 ++
 2 files changed, 6 insertions(+)

--- linux-2.6.33-rt.orig/init/main.c
+++ linux-2.6.33-rt/init/main.c
@@ -629,9 +629,13 @@ asmlinkage void __init start_kernel(void
 		 * the lockdep state, so release the one known lock and
 		 * acquire it again after the self-test is done.
 		 */
+#ifdef CONFIG_LOCK_KERNEL
 		mutex_release(&kernel_sem.dep_map, 1, _THIS_IP_);
+#endif
 		locking_selftest();
+#ifdef CONFIG_LOCK_KERNEL
 		mutex_acquire(&kernel_sem.dep_map, 0, 0, _THIS_IP_);
+#endif
 	}
 
 #ifdef CONFIG_BLK_DEV_INITRD
--- linux-2.6.33-rt.orig/kernel/lockdep.c
+++ linux-2.6.33-rt/kernel/lockdep.c
@@ -3608,8 +3608,10 @@ void lockdep_init(void)
 	for (i = 0; i < CHAINHASH_SIZE; i++)
 		INIT_LIST_HEAD(chainhash_table + i);
 
+#ifdef CONFIG_LOCK_KERNEL
 	/* Hack alert ! */
 	lockdep_set_novalidate_class(&kernel_sem);
+#endif
 
 	lockdep_initialized = 1;
 }

                 reply	other threads:[~2010-05-24 22:16 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=20100524220428.GA17771@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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