summaryrefslogtreecommitdiffstats
path: root/kernel/arch/metag/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/metag/include/asm')
-rw-r--r--kernel/arch/metag/include/asm/atomic.h3
-rw-r--r--kernel/arch/metag/include/asm/atomic_lnkget.h2
-rw-r--r--kernel/arch/metag/include/asm/cmpxchg_lnkget.h2
-rw-r--r--kernel/arch/metag/include/asm/uaccess.h3
4 files changed, 5 insertions, 5 deletions
diff --git a/kernel/arch/metag/include/asm/atomic.h b/kernel/arch/metag/include/asm/atomic.h
index 470e365f0..8ff0a7086 100644
--- a/kernel/arch/metag/include/asm/atomic.h
+++ b/kernel/arch/metag/include/asm/atomic.h
@@ -39,11 +39,10 @@
#define atomic_dec(v) atomic_sub(1, (v))
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+#define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v)
#endif
-#define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v)
-
#include <asm-generic/atomic64.h>
#endif /* __ASM_METAG_ATOMIC_H */
diff --git a/kernel/arch/metag/include/asm/atomic_lnkget.h b/kernel/arch/metag/include/asm/atomic_lnkget.h
index a62581815..88fa25fae 100644
--- a/kernel/arch/metag/include/asm/atomic_lnkget.h
+++ b/kernel/arch/metag/include/asm/atomic_lnkget.h
@@ -61,7 +61,7 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \
" CMPT %0, #HI(0x02000000)\n" \
" BNZ 1b\n" \
: "=&d" (temp), "=&da" (result) \
- : "da" (&v->counter), "bd" (i) \
+ : "da" (&v->counter), "br" (i) \
: "cc"); \
\
smp_mb(); \
diff --git a/kernel/arch/metag/include/asm/cmpxchg_lnkget.h b/kernel/arch/metag/include/asm/cmpxchg_lnkget.h
index 0154e2807..2369ad394 100644
--- a/kernel/arch/metag/include/asm/cmpxchg_lnkget.h
+++ b/kernel/arch/metag/include/asm/cmpxchg_lnkget.h
@@ -73,7 +73,7 @@ static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
" DCACHE [%2], %0\n"
#endif
"2:\n"
- : "=&d" (temp), "=&da" (retval)
+ : "=&d" (temp), "=&d" (retval)
: "da" (m), "bd" (old), "da" (new)
: "cc"
);
diff --git a/kernel/arch/metag/include/asm/uaccess.h b/kernel/arch/metag/include/asm/uaccess.h
index 8282cbce7..273e61225 100644
--- a/kernel/arch/metag/include/asm/uaccess.h
+++ b/kernel/arch/metag/include/asm/uaccess.h
@@ -204,8 +204,9 @@ extern unsigned long __must_check __copy_user_zeroing(void *to,
static inline unsigned long
copy_from_user(void *to, const void __user *from, unsigned long n)
{
- if (access_ok(VERIFY_READ, from, n))
+ if (likely(access_ok(VERIFY_READ, from, n)))
return __copy_user_zeroing(to, from, n);
+ memset(to, 0, n);
return n;
}