diff mbox

[v4,5/7] xen/atomic.h: fix: make atomic_read() param const

Message ID 1468565447-32761-1-git-send-email-czuzu@bitdefender.com (mailing list archive)
State New, archived
Headers show

Commit Message

Corneliu ZUZU July 15, 2016, 6:50 a.m. UTC
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>
---
Changed since v3: <nothing>
---
 xen/include/asm-arm/atomic.h | 2 +-
 xen/include/asm-x86/atomic.h | 2 +-
 xen/include/xen/atomic.h     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Julien Grall July 15, 2016, 9:31 a.m. UTC | #1
On 15/07/16 07:50, Corneliu ZUZU wrote:
> 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>

Regards,

> ---
> Changed since v3: <nothing>
> ---
>   xen/include/asm-arm/atomic.h | 2 +-
>   xen/include/asm-x86/atomic.h | 2 +-
>   xen/include/xen/atomic.h     | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h
> index a79420a..78dad29 100644
> --- a/xen/include/asm-arm/atomic.h
> +++ b/xen/include/asm-arm/atomic.h
> @@ -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;
>   }
> diff --git a/xen/include/asm-x86/atomic.h b/xen/include/asm-x86/atomic.h
> index 3e99b03..1729e29 100644
> --- a/xen/include/asm-x86/atomic.h
> +++ b/xen/include/asm-x86/atomic.h
> @@ -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);
>   }
> diff --git a/xen/include/xen/atomic.h b/xen/include/xen/atomic.h
> index d072912..6827468 100644
> --- a/xen/include/xen/atomic.h
> +++ b/xen/include/xen/atomic.h
> @@ -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
>
diff mbox

Patch

diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h
index a79420a..78dad29 100644
--- a/xen/include/asm-arm/atomic.h
+++ b/xen/include/asm-arm/atomic.h
@@ -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;
 }
diff --git a/xen/include/asm-x86/atomic.h b/xen/include/asm-x86/atomic.h
index 3e99b03..1729e29 100644
--- a/xen/include/asm-x86/atomic.h
+++ b/xen/include/asm-x86/atomic.h
@@ -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);
 }
diff --git a/xen/include/xen/atomic.h b/xen/include/xen/atomic.h
index d072912..6827468 100644
--- a/xen/include/xen/atomic.h
+++ b/xen/include/xen/atomic.h
@@ -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