Fixed pedantic warnings for statement-expressions using __extension__

and by not using a statement-expression for the non-expression
__PCPU_SET().
This commit is contained in:
Bruce Evans 2003-11-17 04:40:58 +00:00
parent c33df8b251
commit 6a0d1abc5d
2 changed files with 8 additions and 8 deletions

View File

@ -68,7 +68,7 @@ extern struct pcpu *pcpup;
/*
* Evaluates to the address of the per-cpu variable name.
*/
#define __PCPU_PTR(name) ({ \
#define __PCPU_PTR(name) __extension__ ({ \
__pcpu_type(name) *__p; \
\
__asm __volatile("movq %%gs:%1,%0; addq %2,%0" \
@ -82,7 +82,7 @@ extern struct pcpu *pcpup;
/*
* Evaluates to the value of the per-cpu variable name.
*/
#define __PCPU_GET(name) ({ \
#define __PCPU_GET(name) __extension__ ({ \
__pcpu_type(name) __result; \
\
if (sizeof(__result) == 1) { \
@ -119,7 +119,7 @@ extern struct pcpu *pcpup;
/*
* Sets the value of the per-cpu variable name to value val.
*/
#define __PCPU_SET(name, val) ({ \
#define __PCPU_SET(name, val) { \
__pcpu_type(name) __val = (val); \
\
if (sizeof(__val) == 1) { \
@ -149,7 +149,7 @@ extern struct pcpu *pcpup;
} else { \
*__PCPU_PTR(name) = __val; \
} \
})
}
#define PCPU_GET(member) __PCPU_GET(pc_ ## member)
#define PCPU_PTR(member) __PCPU_PTR(pc_ ## member)

View File

@ -76,7 +76,7 @@ extern struct pcpu *pcpup;
/*
* Evaluates to the address of the per-cpu variable name.
*/
#define __PCPU_PTR(name) ({ \
#define __PCPU_PTR(name) __extension__ ({ \
__pcpu_type(name) *__p; \
\
__asm __volatile("movl %%fs:%1,%0; addl %2,%0" \
@ -90,7 +90,7 @@ extern struct pcpu *pcpup;
/*
* Evaluates to the value of the per-cpu variable name.
*/
#define __PCPU_GET(name) ({ \
#define __PCPU_GET(name) __extension__ ({ \
__pcpu_type(name) __result; \
\
if (sizeof(__result) == 1) { \
@ -121,7 +121,7 @@ extern struct pcpu *pcpup;
/*
* Sets the value of the per-cpu variable name to value val.
*/
#define __PCPU_SET(name, val) ({ \
#define __PCPU_SET(name, val) { \
__pcpu_type(name) __val = (val); \
\
if (sizeof(__val) == 1) { \
@ -145,7 +145,7 @@ extern struct pcpu *pcpup;
} else { \
*__PCPU_PTR(name) = __val; \
} \
})
}
#define PCPU_GET(member) __PCPU_GET(pc_ ## member)
#define PCPU_PTR(member) __PCPU_PTR(pc_ ## member)