Re: [tip:x86/build] x86/build: Remove -Wno-sign-compare

From: Waiman Long
Date: Tue May 12 2015 - 13:51:57 EST


On 05/12/2015 04:53 AM, Ingo Molnar wrote:
* Ingo Molnar<mingo@xxxxxxxxxx> wrote:

Here's the full list of warnings for allmod64:

make bzImage:

include/linux/blkdev.h:624:26: warning: switch condition has boolean value [-Wswitch-bool]
./arch/x86/include/asm/qspinlock.h:28:2: warning: implicit declaration of function ?pv_queued_spin_lock_slowpath? [-Wimplicit-function-declaration]
./arch/x86/include/asm/qspinlock.h:33:2: warning: implicit declaration of function ?pv_queued_spin_unlock? [-Wimplicit-function-declaration]
./arch/x86/include/asm/qspinlock.h:28:2: warning: implicit declaration of function ?pv_queued_spin_lock_slowpath? [-Wimplicit-function-declaration]
./arch/x86/include/asm/qspinlock.h:33:2: warning: implicit declaration of function ?pv_queued_spin_unlock? [-Wimplicit-function-declaration]
./arch/x86/include/asm/qspinlock.h:28:2: warning: implicit declaration of function ?pv_queued_spin_lock_slowpath? [-Wimplicit-function-declaration]
./arch/x86/include/asm/qspinlock.h:33:2: warning: implicit declaration of function ?pv_queued_spin_unlock? [-Wimplicit-function-declaration]
./arch/x86/include/asm/qspinlock.h:28:2: warning: implicit declaration of function ?pv_queued_spin_lock_slowpath? [-Wimplicit-function-declaration]
./arch/x86/include/asm/qspinlock.h:33:2: warning: implicit declaration of function ?pv_queued_spin_unlock? [-Wimplicit-function-declaration]
And that comes from tip:locking/core, but those warnings do not show
up with GCC 4.9.2: so it's either a GCC 5.0.1 bug, or we missed
something with the WIP queued pv spinlocks changes that newer GCC is
able to notice.

Thanks,

Ingo

The only way this can happen is when __ASSEMBLY__ is defined and asm/qspinlock.h is included. Could you apply the following patch to see if it can fix the compilation warnings? I don't have a gcc 5 compiler on hand to verify that.

Cheers,
Longman


---
arch/x86/include/asm/qspinlock.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h
index 9d51fae..3ea1c57 100644
--- a/arch/x86/include/asm/qspinlock.h
+++ b/arch/x86/include/asm/qspinlock.h
@@ -17,7 +17,10 @@ static inline void native_queued_spin_unlock(struct qspinlock *lock)
smp_store_release((u8 *)lock, 0);
}

-#ifdef CONFIG_PARAVIRT_SPINLOCKS
+/*
+ * Disable the PV code for assembly to prevent compilation warnings.
+ */
+#if defined(CONFIG_PARAVIRT_SPINLOCKS) && !defined(__ASSEMBLY__)
extern void native_queued_spin_lock_slowpath(struct qspinlock *lock, u32 val);
extern void __pv_init_lock_hash(void);
extern void __pv_queued_spin_lock_slowpath(struct qspinlock *lock, u32 val);
--


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/