mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-17 08:01:56 +08:00
Fix warnings in <sys/refcount.h>
This commit is contained in:
parent
2956924a34
commit
11750f1f83
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user