git: e1f4d623779d - main - rangelocks: remove unneeded cast of the atomic_load_ptr() result

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Wed, 28 Aug 2024 14:50:01 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=e1f4d623779df3b05b58ca06aaa8ae0b0a1c9ef7

commit e1f4d623779df3b05b58ca06aaa8ae0b0a1c9ef7
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-08-28 13:30:04 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-08-28 14:35:06 +0000

    rangelocks: remove unneeded cast of the atomic_load_ptr() result
    
    Noted and reviewed by:  markj
    Sponsored by:   The FreeBSD Foundation
    Differential revision:  https://reviews.freebsd.org/D46465
---
 sys/kern/kern_rangelock.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c
index 580910597c08..3a11059a7f64 100644
--- a/sys/kern/kern_rangelock.c
+++ b/sys/kern/kern_rangelock.c
@@ -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);
@@ -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) {
@@ -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);
 
@@ -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);