Module: xenomai-forge
Branch: master
Commit: 66a9f5595335fac3835c1d1edfa1cb669590dd80
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=66a9f5595335fac3835c1d1edfa1cb669590dd80

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sat Nov 12 22:41:29 2011 +0100

arm: fix warning

---

 include/asm-arm/atomic.h |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index 0345b09..2a6c38e 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -363,10 +363,13 @@ xnarch_atomic_cmpxchg(xnarch_atomic_t *ptr,
                        "add pc, %1, #(0xffff0fc0 - 0xffff0fff)\n\t"
                        : "+r"(asm_old), "=&r"(asm_tmp), "=r"(asm_lr)
                        : "r"(asm_new), "r"(asm_ptr)
-                       : "ip", "cc", "memory");
-               if (likely(!asm_old))
-                       return oldval;
-       } while ((asm_old = *asm_ptr) == oldval);
+                       : "cc", "memory");
+               if (likely(!asm_old)) {
+                       asm_old = oldval;
+                       goto done;
+               }
+       } while (unlikely((asm_old = *asm_ptr) == oldval));
+  done:
        return asm_old;
 }
 
@@ -419,12 +422,11 @@ xnarch_atomic_sub_return(int i, xnarch_atomic_t *v)
 }
 
 static __inline__ void
-xnarch_atomic_set_mask(xnarch_atomic_t *v, long mask)
+xnarch_atomic_set_mask(unsigned long *v, long mask)
 {
        register unsigned long asm_old asm("r0");
        register unsigned long asm_new asm("r1");
-       register unsigned long *asm_ptr asm("r2") =
-               (unsigned long *)&v->counter;
+       register unsigned long *asm_ptr asm("r2") = v;
        register unsigned long asm_lr asm("lr");
        register unsigned long asm_tmp asm("r3");
 
@@ -442,12 +444,11 @@ xnarch_atomic_set_mask(xnarch_atomic_t *v, long mask)
 }
 
 static __inline__ void
-xnarch_atomic_clear_mask(xnarch_atomic_t *v, long mask)
+xnarch_atomic_clear_mask(unsigned long *v, long mask)
 {
        register unsigned long asm_old asm("r0");
        register unsigned long asm_new asm("r1");
-       register unsigned long *asm_ptr asm("r2") =
-               (unsigned long *)&v->counter;
+       register unsigned long *asm_ptr asm("r2") = v;
        register unsigned long asm_lr asm("lr");
        register unsigned long asm_tmp asm("r3");
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to