Skip to content

Commit

Permalink
rangelocks: remove unneeded cast of the atomic_load_ptr() result
Browse files Browse the repository at this point in the history
Noted and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D46465
  • Loading branch information
kostikbel committed Aug 28, 2024
1 parent 5378962 commit e1f4d62
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sys/kern/kern_rangelock.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ rangelock_cheat_drain(struct rangelock *lock)

DROP_GIANT();
for (;;) {
v = (uintptr_t)atomic_load_ptr(&lock->head);
v = atomic_load_ptr(&lock->head);
if ((v & RL_CHEAT_DRAINING) == 0)
break;
sleepq_add(&lock->head, NULL, "ranged1", 0, 0);
Expand All @@ -106,7 +106,7 @@ rangelock_cheat_lock(struct rangelock *lock, int locktype, bool trylock,
{
uintptr_t v, x;

v = (uintptr_t)atomic_load_ptr(&lock->head);
v = atomic_load_ptr(&lock->head);
if ((v & RL_CHEAT_CHEATING) == 0)
return (false);
if ((v & RL_CHEAT_DRAINING) != 0) {
Expand Down Expand Up @@ -190,7 +190,7 @@ rangelock_cheat_unlock(struct rangelock *lock, void *cookie)
{
uintptr_t v, x;

v = (uintptr_t)atomic_load_ptr(&lock->head);
v = atomic_load_ptr(&lock->head);
if ((v & RL_CHEAT_CHEATING) == 0)
return (false);

Expand Down Expand Up @@ -259,7 +259,7 @@ rangelock_cheat_destroy(struct rangelock *lock)
{
uintptr_t v;

v = (uintptr_t)atomic_load_ptr(&lock->head);
v = atomic_load_ptr(&lock->head);
if ((v & RL_CHEAT_CHEATING) == 0)
return (false);
MPASS(v == RL_CHEAT_CHEATING);
Expand Down

0 comments on commit e1f4d62

Please sign in to comment.