diff options
author | lstewart <lstewart@FreeBSD.org> | 2010-07-13 09:17:30 +0000 |
---|---|---|
committer | lstewart <lstewart@FreeBSD.org> | 2010-07-13 09:17:30 +0000 |
commit | 25b062c6156e7aba394485c908db87cc9434437a (patch) | |
tree | 4368c1f205d18c5bb0bbebfa3e2ed25d5edc8b50 /sys | |
parent | 424aa3c6cc46925eb8f768bd355252b57921105b (diff) | |
download | FreeBSD-src-25b062c6156e7aba394485c908db87cc9434437a.zip FreeBSD-src-25b062c6156e7aba394485c908db87cc9434437a.tar.gz |
- 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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/pcpu.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index a563ae7..42f9ca0 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) |