[rtems-libbsd commit] Fix warnings in <sys/refcount.h>

Sebastian Huber sebh at rtems.org
Tue Jan 10 10:06:12 UTC 2017


Module:    rtems-libbsd
Branch:    master
Commit:    11750f1f83b5c40dbfac12b320a476ffbfa7c808
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=11750f1f83b5c40dbfac12b320a476ffbfa7c808

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Oct 24 13:14:35 2016 +0200

Fix warnings in <sys/refcount.h>

---

 freebsd/sys/sys/refcount.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/freebsd/sys/sys/refcount.h b/freebsd/sys/sys/refcount.h
index 4611664..32f7f6e 100644
--- a/freebsd/sys/sys/refcount.h
+++ b/freebsd/sys/sys/refcount.h
@@ -50,7 +50,7 @@ refcount_acquire(volatile u_int *count)
 {
 
 	KASSERT(*count < UINT_MAX, ("refcount %p overflowed", count));
-	atomic_add_acq_int(count, 1);	
+	atomic_add_acq_int((volatile int *)count, 1);	
 }
 
 static __inline int
@@ -59,7 +59,7 @@ refcount_release(volatile u_int *count)
 	u_int old;
 
 	/* XXX: Should this have a rel membar? */
-	old = atomic_fetchadd_int(count, -1);
+	old = atomic_fetchadd_int((volatile int *)count, -1);
 	KASSERT(old > 0, ("negative refcount %p", count));
 	return (old == 1);
 }




More information about the vc mailing list