Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2010 09:17:30 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209987 - head/sys/sys
Message-ID:  <201007130917.o6D9HUb3079995@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007130917.o6D9HUb3079995>