[ofa-general] build warnings on rhel4 U6

Jack Morgenstein jackm at dev.mellanox.co.il
Sun Feb 22 23:28:34 PST 2009


On Friday 06 February 2009 21:39, Brian J. Murrell wrote:
> I get these warnings trying to build with RHEL4U6 and ofa_kernel from OFED 1.4:
> 
> include/linux/jbd.h:1204:1: warning: "assert_spin_locked" redefined
> In file included from include/linux/wait.h:25,
>                  from include/linux/fs.h:12,
>                  from /cache/build/BUILD/lustre-kernel-2.6.9/lustre/kernel-ib-devel/usr/src/ofa_kernel/kernel_addons/backport/2.6.9_U6/include/linux/fs.h:4,
>                  from /cache/build/BUILD/lustre-1.6.7.50/lustre/lvfs/fsfilt.c:42:
> /cache/build/BUILD/lustre-kernel-2.6.9/lustre/kernel-ib-devel/usr/src/ofa_kernel/kernel_addons/backport/2.6.9_U6/include/linux/spinlock.h:8:1: warning: this is the location of the previous definition
> 
> The code in question is (from jbd.h):
> 
> #ifdef __KERNEL__
> 
> #ifdef CONFIG_SMP
> #define assert_spin_locked(lock)	J_ASSERT(spin_is_locked(lock))
> #else
> #define assert_spin_locked(lock)	do {} while(0)
> #endif
> 
> and (from the backport spinlock.h):
> 
> #ifndef BACKPORT_LINUX_SPINLOCK_H
> #define BACKPORT_LINUX_SPINLOCK_H
> 
> #include_next <linux/spinlock.h>
> 
> #define spin_lock_nested(lock, subclass) spin_lock(lock)
> 
> #define assert_spin_locked(lock)  do { (void)(lock); } while(0)
> 
> #endif
> 
> Any thoughts on how to resolve?
> 
> b.
In the backport spinlock.h file, try the following:

#ifndef assert_spin_locked
#define assert_spin_locked(lock)  do { (void)(lock); } while(0)
#endif

- Jack



More information about the general mailing list