The branch stable/14 has been updated by olce:

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

commit aab45924bdb10338654e25ab9ecec106b7eb368b
Author:     Olivier Certner <o...@freebsd.org>
AuthorDate: 2025-01-20 14:38:42 +0000
Commit:     Olivier Certner <o...@freebsd.org>
CommitDate: 2025-01-27 18:19:57 +0000

    smr: Load to accept pointers to const pointers
    
    Pointers passed to the smr_entered_load() and smr_serialized_load()
    macros are in the end used as arguments to atomic_load_*ptr(), so
    convert them to the now acceptable 'const uintptr_t *' ones (instead of
    'uintptr_tr *'), making these macros accept pointers to constant
    pointers.
    
    Reviewed by:    kib
    MFC after:      4 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D48497
    
    (cherry picked from commit 1ac0afaa962bc847294d5e6bf1e749b7ffa78cfd)
---
 sys/sys/smr_types.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/sys/smr_types.h b/sys/sys/smr_types.h
index 9da4a73c568c..0257236f7314 100644
--- a/sys/sys/smr_types.h
+++ b/sys/sys/smr_types.h
@@ -60,7 +60,8 @@ struct {                                                      
        \
  */
 #define        smr_entered_load(p, smr) ({                                     
\
        SMR_ASSERT(SMR_ENTERED((smr)), "smr_entered_load");             \
-       (__typeof((p)->__ptr))atomic_load_acq_ptr((uintptr_t *)&(p)->__ptr); \
+       (__typeof((p)->__ptr))atomic_load_acq_ptr(                      \
+           (const uintptr_t *)&(p)->__ptr);                            \
 })
 
 /*
@@ -70,7 +71,8 @@ struct {                                                      
        \
  */
 #define        smr_serialized_load(p, ex) ({                                   
\
        SMR_ASSERT(ex, "smr_serialized_load");                          \
-       (__typeof((p)->__ptr))atomic_load_ptr(&(p)->__ptr);             \
+       (__typeof((p)->__ptr))atomic_load_ptr(                          \
+           (const uintptr_t *)&(p)->__ptr);                            \
 })
 
 /*

Reply via email to