Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 May 2010 06:18:03 +0000 (UTC)
From:      Poul-Henning Kamp <phk@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r208332 - in head/sys: amd64/include i386/include
Message-ID:  <201005200618.o4K6I3G3010713@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: phk
Date: Thu May 20 06:18:03 2010
New Revision: 208332
URL: http://svn.freebsd.org/changeset/base/208332

Log:
  Rename an argument from "exp" to "expect" since the former makes FlexeLint
  uneasy, in case anybody think it might be exp(3) in libm.
  
  This also makes it consistent with other archs.

Modified:
  head/sys/amd64/include/atomic.h
  head/sys/i386/include/atomic.h

Modified: head/sys/amd64/include/atomic.h
==============================================================================
--- head/sys/amd64/include/atomic.h	Thu May 20 06:16:13 2010	(r208331)
+++ head/sys/amd64/include/atomic.h	Thu May 20 06:18:03 2010	(r208332)
@@ -76,8 +76,8 @@
 void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v);	\
 void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
 
-int	atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src);
-int	atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src);
+int	atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src);
+int	atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src);
 u_int	atomic_fetchadd_int(volatile u_int *p, u_int v);
 u_long	atomic_fetchadd_long(volatile u_long *p, u_long v);
 
@@ -124,13 +124,13 @@ struct __hack
 /*
  * Atomic compare and set, used by the mutex functions
  *
- * if (*dst == exp) *dst = src (all 32 bit words)
+ * if (*dst == expect) *dst = src (all 32 bit words)
  *
  * Returns 0 on failure, non-zero on success
  */
 
 static __inline int
-atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
+atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src)
 {
 	u_char res;
 
@@ -143,7 +143,7 @@ atomic_cmpset_int(volatile u_int *dst, u
 	: "=a" (res),			/* 0 */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "a" (exp),			/* 3 */
+	  "a" (expect),			/* 3 */
 	  "m" (*dst)			/* 4 */
 	: "memory");
 
@@ -151,7 +151,7 @@ atomic_cmpset_int(volatile u_int *dst, u
 }
 
 static __inline int
-atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
+atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src)
 {
 	u_char res;
 
@@ -164,7 +164,7 @@ atomic_cmpset_long(volatile u_long *dst,
 	: "=a" (res),			/* 0 */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "a" (exp),			/* 3 */
+	  "a" (expect),			/* 3 */
 	  "m" (*dst)			/* 4 */
 	: "memory");
 

Modified: head/sys/i386/include/atomic.h
==============================================================================
--- head/sys/i386/include/atomic.h	Thu May 20 06:16:13 2010	(r208331)
+++ head/sys/i386/include/atomic.h	Thu May 20 06:18:03 2010	(r208332)
@@ -76,7 +76,7 @@
 void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v);	\
 void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
 
-int	atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src);
+int	atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src);
 u_int	atomic_fetchadd_int(volatile u_int *p, u_int v);
 
 #define	ATOMIC_STORE_LOAD(TYPE, LOP, SOP)			\
@@ -122,7 +122,7 @@ struct __hack
 /*
  * Atomic compare and set, used by the mutex functions
  *
- * if (*dst == exp) *dst = src (all 32 bit words)
+ * if (*dst == expect) *dst = src (all 32 bit words)
  *
  * Returns 0 on failure, non-zero on success
  */
@@ -130,7 +130,7 @@ struct __hack
 #ifdef CPU_DISABLE_CMPXCHG
 
 static __inline int
-atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
+atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src)
 {
 	u_char res;
 
@@ -147,7 +147,7 @@ atomic_cmpset_int(volatile u_int *dst, u
 	: "=q" (res),			/* 0 */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "r" (exp),			/* 3 */
+	  "r" (expect),			/* 3 */
 	  "m" (*dst)			/* 4 */
 	: "memory");
 
@@ -157,7 +157,7 @@ atomic_cmpset_int(volatile u_int *dst, u
 #else /* !CPU_DISABLE_CMPXCHG */
 
 static __inline int
-atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
+atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src)
 {
 	u_char res;
 
@@ -170,7 +170,7 @@ atomic_cmpset_int(volatile u_int *dst, u
 	: "=a" (res),			/* 0 */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "a" (exp),			/* 3 */
+	  "a" (expect),			/* 3 */
 	  "m" (*dst)			/* 4 */
 	: "memory");
 
@@ -292,10 +292,10 @@ ATOMIC_STORE_LOAD(long,	"cmpxchgl %0,%1"
 #ifndef WANT_FUNCTIONS
 
 static __inline int
-atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
+atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src)
 {
 
-	return (atomic_cmpset_int((volatile u_int *)dst, (u_int)exp,
+	return (atomic_cmpset_int((volatile u_int *)dst, (u_int)expect,
 	    (u_int)src));
 }
 



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