- The sum variable used in DPCPU_SUM needs to be of the same type as the

DPCPU variable, rather than a pointer to the type.

- Zero # bytes equivalent to sizeof(object), not sizeof(ptr_to_object).

- Remove an unnecessary __typeof.

Sponsored by:	FreeBSD Foundation
Submitted by:	jmallet
MFC after:	3 days
This commit is contained in:
lstewart 2010-07-13 09:17:30 +00:00
parent 424aa3c6cc
commit 25b062c615

View File

@ -112,7 +112,7 @@ extern uintptr_t dpcpu_off[];
#define DPCPU_SUM(n) __extension__ \
({ \
u_int _i; \
__typeof(DPCPU_PTR(n)) sum; \
__typeof(*DPCPU_PTR(n)) sum; \
\
sum = 0; \
CPU_FOREACH(_i) { \
@ -137,8 +137,7 @@ extern uintptr_t dpcpu_off[];
u_int _i; \
\
CPU_FOREACH(_i) { \
bzero(DPCPU_ID_PTR(_i, n), \
sizeof(__typeof(DPCPU_PTR(n)))); \
bzero(DPCPU_ID_PTR(_i, n), sizeof(*DPCPU_PTR(n))); \
} \
} while(0)