diff mbox

[v3,7/8] arm/atomic.h: remove '__' prefix for __atomic_add_unless()

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

Commit Message

Corneliu ZUZU July 14, 2016, 9:14 a.m. UTC
The built-in leading underscores ('__') don't serve any purpose, so rename
__atomic_add_unless() -> atomic_add_unless().

Signed-off-by: Corneliu ZUZU <czuzu@bitdefender.com>
---
 xen/include/asm-arm/arm32/atomic.h | 2 +-
 xen/include/asm-arm/arm64/atomic.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Julien Grall July 14, 2016, 10 a.m. UTC | #1
Hi Corneliu,

On 14/07/16 10:14, Corneliu ZUZU wrote:
> The built-in leading underscores ('__') don't serve any purpose, so rename
> __atomic_add_unless() -> atomic_add_unless().

The leading underscores are from the Linux code. We decided to keep 
those files unmodified to help syncing atomic code.

So I am not in favor of dropping the '__'. If you want to use these 
functions in the common code, then a wrapper in "asm-arm/atomic.h" 
should be introduced.

Regards,

>
> Signed-off-by: Corneliu ZUZU <czuzu@bitdefender.com>
> ---
>   xen/include/asm-arm/arm32/atomic.h | 2 +-
>   xen/include/asm-arm/arm64/atomic.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/include/asm-arm/arm32/atomic.h b/xen/include/asm-arm/arm32/atomic.h
> index 78de60f..dc95518 100644
> --- a/xen/include/asm-arm/arm32/atomic.h
> +++ b/xen/include/asm-arm/arm32/atomic.h
> @@ -121,7 +121,7 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
>   	return oldval;
>   }
>
> -static inline int __atomic_add_unless(atomic_t *v, int a, int u)
> +static inline int atomic_add_unless(atomic_t *v, int a, int u)
>   {
>   	int oldval, newval;
>   	unsigned long tmp;
> diff --git a/xen/include/asm-arm/arm64/atomic.h b/xen/include/asm-arm/arm64/atomic.h
> index d640bef..f0e83be 100644
> --- a/xen/include/asm-arm/arm64/atomic.h
> +++ b/xen/include/asm-arm/arm64/atomic.h
> @@ -114,7 +114,7 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
>   	return oldval;
>   }
>
> -static inline int __atomic_add_unless(atomic_t *v, int a, int u)
> +static inline int atomic_add_unless(atomic_t *v, int a, int u)
>   {
>   	int c, old;
>
>
Corneliu ZUZU July 14, 2016, 10:03 a.m. UTC | #2
On 7/14/2016 1:00 PM, Julien Grall wrote:
> Hi Corneliu,
>
> On 14/07/16 10:14, Corneliu ZUZU wrote:
>> The built-in leading underscores ('__') don't serve any purpose, so 
>> rename
>> __atomic_add_unless() -> atomic_add_unless().
>
> The leading underscores are from the Linux code. We decided to keep 
> those files unmodified to help syncing atomic code.
>
> So I am not in favor of dropping the '__'. If you want to use these 
> functions in the common code, then a wrapper in "asm-arm/atomic.h" 
> should be introduced.
>
> Regards,

Ok, great. Either add a wrapper or maybe keeping the underscores on X86 
too and not including it's prototype in <xen/atomic.h>. What would you 
prefer?

Zuzu C.
Stefano Stabellini July 14, 2016, 10:50 a.m. UTC | #3
On Thu, 14 Jul 2016, Corneliu ZUZU wrote:
> On 7/14/2016 1:00 PM, Julien Grall wrote:
> > Hi Corneliu,
> > 
> > On 14/07/16 10:14, Corneliu ZUZU wrote:
> > > The built-in leading underscores ('__') don't serve any purpose, so rename
> > > __atomic_add_unless() -> atomic_add_unless().
> > 
> > The leading underscores are from the Linux code. We decided to keep those
> > files unmodified to help syncing atomic code.
> > 
> > So I am not in favor of dropping the '__'. If you want to use these
> > functions in the common code, then a wrapper in "asm-arm/atomic.h" should be
> > introduced.
> > 
> > Regards,
> 
> Ok, great. Either add a wrapper or maybe keeping the underscores on X86 too
> and not including it's prototype in <xen/atomic.h>. What would you prefer?

Add a wrapper
diff mbox

Patch

diff --git a/xen/include/asm-arm/arm32/atomic.h b/xen/include/asm-arm/arm32/atomic.h
index 78de60f..dc95518 100644
--- a/xen/include/asm-arm/arm32/atomic.h
+++ b/xen/include/asm-arm/arm32/atomic.h
@@ -121,7 +121,7 @@  static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
 	return oldval;
 }
 
-static inline int __atomic_add_unless(atomic_t *v, int a, int u)
+static inline int atomic_add_unless(atomic_t *v, int a, int u)
 {
 	int oldval, newval;
 	unsigned long tmp;
diff --git a/xen/include/asm-arm/arm64/atomic.h b/xen/include/asm-arm/arm64/atomic.h
index d640bef..f0e83be 100644
--- a/xen/include/asm-arm/arm64/atomic.h
+++ b/xen/include/asm-arm/arm64/atomic.h
@@ -114,7 +114,7 @@  static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
 	return oldval;
 }
 
-static inline int __atomic_add_unless(atomic_t *v, int a, int u)
+static inline int atomic_add_unless(atomic_t *v, int a, int u)
 {
 	int c, old;