Skip to contentSkip to conversation

build break in include/asm-x86_64/atomic.h

PATCH New Jon Mason 1 participant 1 message Oct 18, 2005 Atomic infrastructure

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/1 build break in include/asm-x86_64/atomic.h

While building the latest -mm kernel on x86-64, I hit a build break (see below).

....
CC [M] fs/ntfs/namei.o
In file included from include/linux/dcache.h:6,

                 from fs/ntfs/namei.c:23:

include/asm/atomic.h:383: error: parse error before '*' token include/asm/atomic.h:384: warning: function declaration isn't a prototype
include/asm/atomic.h: In function `atomic_scrub':
include/asm/atomic.h:385: error: `u32' undeclared (first use in this function)
include/asm/atomic.h:385: error: (Each undeclared identifier is reported only once
include/asm/atomic.h:385: error: for each function it appears in.) include/asm/atomic.h:385: error: parse error before "i" include/asm/atomic.h:386: error: `i' undeclared (first use in this function)
include/asm/atomic.h:386: error: `size' undeclared (first use in this function)
include/asm/atomic.h:386: error: `virt_addr' undeclared (first use in this function)
include/asm/atomic.h:386: warning: left-hand operand of comma expression has no effect
make[2]: *** [fs/ntfs/namei.o] Error 1
make[1]: *** [fs/ntfs] Error 2
make: *** [fs] Error 2

The problem is the atomic_scrub function is attempting to use 'u32', which is not defined at this point. If the 'u32's are defined (by including <asm/types.h>) or changed to 'unsigned int', there is no problem (and the kernel compiles, boots, and runs perfectly).

Below is a patch which changes the 'u32' to 'unsigned int'.

include/asm-x86_64/atomic.h renamed from include/asm-x86_64/atomic.h.orig +2 -2
@@ -380,9 +380,9 @@ __asm__ __volatile__(LOCK "orl %0,%1" \
 
 /* ECC atomic, DMA, SMP and interrupt safe scrub function */
 
-static __inline__ void atomic_scrub(u32 *virt_addr, u32 size)
+static __inline__ void atomic_scrub(unsigned int *virt_addr, unsigned int size)
 {
-	u32 i;
+	unsigned int i;
 	for (i = 0; i < size / 4; i++, virt_addr++)
 		/* Very carefully read and write to memory atomically
 		 * so we are interrupt, DMA and SMP safe.