Author: hselasky
Date: Thu Feb 16 12:20:57 2017
New Revision: 313807
URL: https://svnweb.freebsd.org/changeset/base/313807

Log:
  Allow passing a constant atomic_t to atomic_read().
  
  Obtained from:                kmacy @
  MFC after:            1 week
  Sponsored by:         Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/asm/atomic.h

Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/asm/atomic.h        Thu Feb 16 
12:08:52 2017        (r313806)
+++ head/sys/compat/linuxkpi/common/include/asm/atomic.h        Thu Feb 16 
12:20:57 2017        (r313807)
@@ -81,9 +81,9 @@ atomic_set_mask(unsigned int mask, atomi
 }
 
 static inline int
-atomic_read(atomic_t *v)
+atomic_read(const atomic_t *v)
 {
-       return atomic_load_acq_int(&v->counter);
+       return atomic_load_acq_int(&__DECONST(atomic_t *, v)->counter);
 }
 
 static inline int
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to