Skip to contentSkip to conversation

Fix sparse parse error in lppaca.h

PATCH In review Bryan O'Sullivan 2 participants 2 messages Jan 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix sparse parse error in lppaca.h

sparse can't parse a struct definition in include/asm-powerpc/lppaca.h, even though gcc can accept it. The form looks like this:

        struct __attribute__((whatever)) foo { };

An equivalent that both gcc and sparse can handle is

        struct foo { } __attribute__((whatever));

This is the only definition of this type in the tree, and fixing it is easier than fixing sparse.

include/asm-powerpc/lppaca.h +2 -2
diff -r 89be36ca2767 include/asm-powerpc/lppaca.h
@@ -31,7 +31,7 @@
 
 /* The Hypervisor barfs if the lppaca crosses a page boundary.  A 1k
  * alignment is sufficient to prevent this */
-struct __attribute__((__aligned__(0x400))) lppaca {
+struct lppaca {
 //=============================================================================
 // CACHE_LINE_1 0x0000 - 0x007F Contains read-only data
 // NOTE: The xDynXyz fields are fields that will be dynamically changed by
@@ -129,7 +129,7 @@
 // CACHE_LINE_4-5 0x0100 - 0x01FF Contains PMC interrupt data
 //=============================================================================
 	u8	pmc_save_area[256];	// PMC interrupt Area           x00-xFF
-};
+} __attribute__((__aligned__(0x400)));
 
 extern struct lppaca lppaca[];
 
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Bryan O'Sullivan

sparse can't parse a struct definition in include/asm-powerpc/lppaca.h, even though gcc can accept it. The form looks like this:

        struct __attribute__((whatever)) foo { };
Quoted 8 lines

An equivalent that both gcc and sparse can handle is

        struct foo { } __attribute__((whatever));

This is the only definition of this type in the tree, and fixing it is easier than fixing sparse.

Oops.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson