aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorLawrence Stewart <lstewart@FreeBSD.org>2010-07-13 09:17:30 +0000
committerLawrence Stewart <lstewart@FreeBSD.org>2010-07-13 09:17:30 +0000
commit7d1d80fddb9d7afb9d5f521f2c345e651ef54712 (patch)
tree4368c1f205d18c5bb0bbebfa3e2ed25d5edc8b50 /sys/sys
parentadc5f0109d6b85b8f8679114d199a3ab3a8f01f9 (diff)
downloadsrc-7d1d80fddb9d7afb9d5f521f2c345e651ef54712.tar.gz
src-7d1d80fddb9d7afb9d5f521f2c345e651ef54712.zip
- 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
Notes
Notes: svn path=/head/; revision=209987
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/pcpu.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index a563ae7374c0..42f9ca0122d5 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -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)