2008-10-13 23:04:18

by Simon Holm Thøgersen

[permalink] [raw]
Subject: [PATCH] x86/paravirt: fix compile warning for !SMP builds

This fixes the following compile warning for !SMP builds:

arch/x86/kernel/paravirt-spinlocks.c:11: warning: 'default_spin_lock_flags' defined but not used

that was introduced by 63d3a75d (x86/paravirt: add spin_lock_flags lock op).

Signed-off-by: Simon Holm Thøgersen <[email protected]>
---
arch/x86/kernel/paravirt-spinlocks.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/paravirt-spinlocks.c b/arch/x86/kernel/paravirt-spinlocks.c
index 0e9f198..ebcb33d 100644
--- a/arch/x86/kernel/paravirt-spinlocks.c
+++ b/arch/x86/kernel/paravirt-spinlocks.c
@@ -7,13 +7,13 @@

#include <asm/paravirt.h>

+#ifdef CONFIG_SMP
static void default_spin_lock_flags(struct raw_spinlock *lock, unsigned long flags)
{
__raw_spin_lock(lock);
}

struct pv_lock_ops pv_lock_ops = {
-#ifdef CONFIG_SMP
.spin_is_locked = __ticket_spin_is_locked,
.spin_is_contended = __ticket_spin_is_contended,

@@ -21,8 +21,10 @@ struct pv_lock_ops pv_lock_ops = {
.spin_lock_flags = default_spin_lock_flags,
.spin_trylock = __ticket_spin_trylock,
.spin_unlock = __ticket_spin_unlock,
-#endif
};
+#else
+struct pv_lock_ops pv_lock_ops;
+#endif
EXPORT_SYMBOL(pv_lock_ops);

void __init paravirt_use_bytelocks(void)
--
1.5.6.2.255.gbed62