git: 62af5b9dc620 - main - atomics: Constify loads: Remove now superfluous uses of DECONST()

From: Olivier Certner <olce_at_FreeBSD.org>
Date: Mon, 20 Jan 2025 15:50:45 UTC
The branch main has been updated by olce:

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

commit 62af5b9dc6205289a0ace964d060fba64e71ef28
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2025-01-20 14:28:37 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-01-20 15:49:52 +0000

    atomics: Constify loads: Remove now superfluous uses of DECONST()
    
    No functional change (intended).
    
    Reviewed by:    kib
    MFC after:      4 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D48497
---
 sys/compat/linuxkpi/common/include/linux/seqlock.h | 2 +-
 sys/sys/atomic_san.h                               | 3 +--
 sys/sys/seqc.h                                     | 4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/seqlock.h b/sys/compat/linuxkpi/common/include/linux/seqlock.h
index 48e42efc10fe..554fdfd6e202 100644
--- a/sys/compat/linuxkpi/common/include/linux/seqlock.h
+++ b/sys/compat/linuxkpi/common/include/linux/seqlock.h
@@ -99,7 +99,7 @@ lkpi_write_seqcount_invalidate(seqc_t *seqcp)
 static inline seqc_t
 lkpi_seqprop_sequence(const seqc_t *seqcp)
 {
-	return (atomic_load_int(__DECONST(seqc_t *, seqcp)));
+	return (atomic_load_int(seqcp));
 }
 #define	seqprop_sequence(s)	lkpi_seqprop_sequence(&(s)->seqc)
 
diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h
index 06c6c98ec8a8..9a82ff6762c6 100644
--- a/sys/sys/atomic_san.h
+++ b/sys/sys/atomic_san.h
@@ -266,8 +266,7 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX);
 #define	atomic_fcmpset_rel_ptr		ATOMIC_SAN(fcmpset_rel_ptr)
 #define	atomic_fetchadd_ptr		ATOMIC_SAN(fetchadd_ptr)
 #define	atomic_load_ptr(x)						\
-	((__typeof(*x))ATOMIC_SAN(load_ptr)(				\
-	    __DECONST(volatile uintptr_t *, (x))))
+	((__typeof(*x))ATOMIC_SAN(load_ptr)((const volatile uintptr_t *)(x)))
 #define	atomic_load_acq_ptr		ATOMIC_SAN(load_acq_ptr)
 #define	atomic_load_consume_ptr(x)					\
 	((__typeof(*x))atomic_load_acq_ptr((const volatile uintptr_t *)(x)))
diff --git a/sys/sys/seqc.h b/sys/sys/seqc.h
index 6472c2e3cfd7..17854b6f4adb 100644
--- a/sys/sys/seqc.h
+++ b/sys/sys/seqc.h
@@ -78,14 +78,14 @@ static __inline seqc_t
 seqc_read_any(const seqc_t *seqcp)
 {
 
-	return (atomic_load_acq_int(__DECONST(seqc_t *, seqcp)));
+	return (atomic_load_acq_int(seqcp));
 }
 
 static __inline seqc_t
 seqc_read_notmodify(const seqc_t *seqcp)
 {
 
-	return (atomic_load_acq_int(__DECONST(seqc_t *, seqcp)) & ~SEQC_MOD);
+	return (atomic_load_acq_int(seqcp) & ~SEQC_MOD);
 }
 
 static __inline seqc_t