xen/atomic.h: fix: make atomic_read() param const
authorCorneliu ZUZU <czuzu@bitdefender.com>
Fri, 15 Jul 2016 10:44:10 +0000 (13:44 +0300)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 15 Jul 2016 12:33:55 +0000 (13:33 +0100)
This wouldn't let me make a param of a function that used atomic_read() const.

Signed-off-by: Corneliu ZUZU <czuzu@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/include/asm-arm/atomic.h
xen/include/asm-x86/atomic.h
xen/include/xen/atomic.h

index b81e50d70a4c61e8aca06cbb5aa0464134bedad8..91f05c836e4496ed9ea6fa6af8e5d2643083e368 100644 (file)
@@ -102,7 +102,7 @@ void __bad_atomic_size(void);
  * strex/ldrex monitor on some implementations. The reason we can use it for
  * atomic_set() is the clrex or dummy strex done on every exception return.
  */
-static inline int atomic_read(atomic_t *v)
+static inline int atomic_read(const atomic_t *v)
 {
     return *(volatile int *)&v->counter;
 }
index 3e99b030ed52c9f0ed76f90417916884647cdeb8..1729e293a261f84fe61d66d2fce1ae7bfdfe6697 100644 (file)
@@ -80,7 +80,7 @@ void __bad_atomic_size(void);
     }                                                     \
 })
 
-static inline int atomic_read(atomic_t *v)
+static inline int atomic_read(const atomic_t *v)
 {
     return read_atomic(&v->counter);
 }
index d07291258bfc5d71483a2b07ae5ebbff5f7566de..6827468abdede09e6414b750b7e10abda18f03e5 100644 (file)
@@ -32,7 +32,7 @@ typedef struct { int counter; } atomic_t;
  *
  * Atomically reads the value of @v.
  */
-static inline int atomic_read(atomic_t *v);
+static inline int atomic_read(const atomic_t *v);
 
 /**
  * _atomic_read - read atomic variable non-atomically