aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-09 19:36:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-09 19:36:10 -0500
commitf4d68930a88219ffda60f137dcc858e4f5db6680 (patch)
tree024c8ae8d288a858b6b1c58ae8c1ef7dcfa481f8
parent3510ca19a82ba4c6a17af79c1f0448622a406efa (diff)
parentbb3fc5ddef93836a36a39308cf7eca82ef0a1c4c (diff)
Merge tag 'nios2-v4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2
Pull nios2 updates from Ley Foon Tan: - nios2: Remove unnecessary #ifdef guards - nios2: Switch to generic __xchg() - nios2: Fix unused variable warning * tag 'nios2-v4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2: nios2: Remove unnecessary #ifdef guards nios2: Switch to generic __xchg() nios2: Fix unused variable warning
-rw-r--r--arch/nios2/include/asm/cmpxchg.h47
-rw-r--r--arch/nios2/kernel/setup.c2
-rw-r--r--arch/nios2/lib/memmove.c2
-rw-r--r--arch/nios2/lib/memset.c2
4 files changed, 1 insertions, 52 deletions
diff --git a/arch/nios2/include/asm/cmpxchg.h b/arch/nios2/include/asm/cmpxchg.h
index 85938711542d..a7978f14d157 100644
--- a/arch/nios2/include/asm/cmpxchg.h
+++ b/arch/nios2/include/asm/cmpxchg.h
@@ -9,53 +9,6 @@
9#ifndef _ASM_NIOS2_CMPXCHG_H 9#ifndef _ASM_NIOS2_CMPXCHG_H
10#define _ASM_NIOS2_CMPXCHG_H 10#define _ASM_NIOS2_CMPXCHG_H
11 11
12#include <linux/irqflags.h>
13
14#define xchg(ptr, x) \
15 ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
16
17struct __xchg_dummy { unsigned long a[100]; };
18#define __xg(x) ((volatile struct __xchg_dummy *)(x))
19
20static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
21 int size)
22{
23 unsigned long tmp, flags;
24
25 local_irq_save(flags);
26
27 switch (size) {
28 case 1:
29 __asm__ __volatile__(
30 "ldb %0, %2\n"
31 "stb %1, %2\n"
32 : "=&r" (tmp)
33 : "r" (x), "m" (*__xg(ptr))
34 : "memory");
35 break;
36 case 2:
37 __asm__ __volatile__(
38 "ldh %0, %2\n"
39 "sth %1, %2\n"
40 : "=&r" (tmp)
41 : "r" (x), "m" (*__xg(ptr))
42 : "memory");
43 break;
44 case 4:
45 __asm__ __volatile__(
46 "ldw %0, %2\n"
47 "stw %1, %2\n"
48 : "=&r" (tmp)
49 : "r" (x), "m" (*__xg(ptr))
50 : "memory");
51 break;
52 }
53
54 local_irq_restore(flags);
55 return tmp;
56}
57
58#include <asm-generic/cmpxchg.h> 12#include <asm-generic/cmpxchg.h>
59#include <asm-generic/cmpxchg-local.h>
60 13
61#endif /* _ASM_NIOS2_CMPXCHG_H */ 14#endif /* _ASM_NIOS2_CMPXCHG_H */
diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c
index b101a43d3c5a..a4ff86d58d5c 100644
--- a/arch/nios2/kernel/setup.c
+++ b/arch/nios2/kernel/setup.c
@@ -104,7 +104,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
104 unsigned r7) 104 unsigned r7)
105{ 105{
106 unsigned dtb_passed = 0; 106 unsigned dtb_passed = 0;
107 char cmdline_passed[COMMAND_LINE_SIZE] = { 0, }; 107 char cmdline_passed[COMMAND_LINE_SIZE] __maybe_unused = { 0, };
108 108
109#if defined(CONFIG_NIOS2_PASS_CMDLINE) 109#if defined(CONFIG_NIOS2_PASS_CMDLINE)
110 if (r4 == 0x534f494e) { /* r4 is magic NIOS */ 110 if (r4 == 0x534f494e) { /* r4 is magic NIOS */
diff --git a/arch/nios2/lib/memmove.c b/arch/nios2/lib/memmove.c
index c65ef517eb80..866c021f278c 100644
--- a/arch/nios2/lib/memmove.c
+++ b/arch/nios2/lib/memmove.c
@@ -10,7 +10,6 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/string.h> 11#include <linux/string.h>
12 12
13#ifdef __HAVE_ARCH_MEMMOVE
14void *memmove(void *d, const void *s, size_t count) 13void *memmove(void *d, const void *s, size_t count)
15{ 14{
16 unsigned long dst, src; 15 unsigned long dst, src;
@@ -79,4 +78,3 @@ restdown:
79 78
80 return d; 79 return d;
81} 80}
82#endif /* __HAVE_ARCH_MEMMOVE */
diff --git a/arch/nios2/lib/memset.c b/arch/nios2/lib/memset.c
index 65e97802f5cc..c2cfcb121e34 100644
--- a/arch/nios2/lib/memset.c
+++ b/arch/nios2/lib/memset.c
@@ -10,7 +10,6 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/string.h> 11#include <linux/string.h>
12 12
13#ifdef __HAVE_ARCH_MEMSET
14void *memset(void *s, int c, size_t count) 13void *memset(void *s, int c, size_t count)
15{ 14{
16 int destptr, charcnt, dwordcnt, fill8reg, wrkrega; 15 int destptr, charcnt, dwordcnt, fill8reg, wrkrega;
@@ -78,4 +77,3 @@ void *memset(void *s, int c, size_t count)
78 77
79 return s; 78 return s;
80} 79}
81#endif /* __HAVE_ARCH_MEMSET */