Author: lstewart
Date: Tue Jul 13 09:17:30 2010
New Revision: 209987
URL: http://svn.freebsd.org/changeset/base/209987

Log:
  - 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

Modified:
  head/sys/sys/pcpu.h

Modified: head/sys/sys/pcpu.h
==============================================================================
--- head/sys/sys/pcpu.h Tue Jul 13 08:55:52 2010        (r209986)
+++ head/sys/sys/pcpu.h Tue Jul 13 09:17:30 2010        (r209987)
@@ -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)
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to