Merge tag 'nios2-v4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Nov 2015 00:36:10 +0000 (16:36 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Nov 2015 00:36:10 +0000 (16:36 -0800)
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

arch/nios2/include/asm/cmpxchg.h
arch/nios2/kernel/setup.c
arch/nios2/lib/memmove.c
arch/nios2/lib/memset.c

index 85938711542d89182369105c670ca785ad3f3fb9..a7978f14d157c20bc8c33697076fad55b8e57434 100644 (file)
@@ -9,53 +9,6 @@
 #ifndef _ASM_NIOS2_CMPXCHG_H
 #define _ASM_NIOS2_CMPXCHG_H
 
-#include <linux/irqflags.h>
-
-#define xchg(ptr, x)   \
-       ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
-
-struct __xchg_dummy { unsigned long a[100]; };
-#define __xg(x)                ((volatile struct __xchg_dummy *)(x))
-
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
-                                       int size)
-{
-       unsigned long tmp, flags;
-
-       local_irq_save(flags);
-
-       switch (size) {
-       case 1:
-               __asm__ __volatile__(
-                       "ldb    %0, %2\n"
-                       "stb    %1, %2\n"
-                       : "=&r" (tmp)
-                       : "r" (x), "m" (*__xg(ptr))
-                       : "memory");
-               break;
-       case 2:
-               __asm__ __volatile__(
-                       "ldh    %0, %2\n"
-                       "sth    %1, %2\n"
-                       : "=&r" (tmp)
-                       : "r" (x), "m" (*__xg(ptr))
-                       : "memory");
-               break;
-       case 4:
-               __asm__ __volatile__(
-                       "ldw    %0, %2\n"
-                       "stw    %1, %2\n"
-                       : "=&r" (tmp)
-                       : "r" (x), "m" (*__xg(ptr))
-                       : "memory");
-               break;
-       }
-
-       local_irq_restore(flags);
-       return tmp;
-}
-
 #include <asm-generic/cmpxchg.h>
-#include <asm-generic/cmpxchg-local.h>
 
 #endif /* _ASM_NIOS2_CMPXCHG_H */
index b101a43d3c5a05ed70fa6a1bcbdb1e7aab537495..a4ff86d58d5cd74c5319e1042622dd2a58345291 100644 (file)
@@ -104,7 +104,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
                                       unsigned r7)
 {
        unsigned dtb_passed = 0;
-       char cmdline_passed[COMMAND_LINE_SIZE] = { 0, };
+       char cmdline_passed[COMMAND_LINE_SIZE] __maybe_unused = { 0, };
 
 #if defined(CONFIG_NIOS2_PASS_CMDLINE)
        if (r4 == 0x534f494e) { /* r4 is magic NIOS */
index c65ef517eb80c05e337c079ad49e709bbe847188..866c021f278c3e9407064abcbe1abf8410f73506 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/types.h>
 #include <linux/string.h>
 
-#ifdef __HAVE_ARCH_MEMMOVE
 void *memmove(void *d, const void *s, size_t count)
 {
        unsigned long dst, src;
@@ -79,4 +78,3 @@ restdown:
 
        return d;
 }
-#endif /* __HAVE_ARCH_MEMMOVE */
index 65e97802f5cc83c15703c427e61aadf28b4d5b0c..c2cfcb121e346590f0de5d805d9952ac69b42d96 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/types.h>
 #include <linux/string.h>
 
-#ifdef __HAVE_ARCH_MEMSET
 void *memset(void *s, int c, size_t count)
 {
        int destptr, charcnt, dwordcnt, fill8reg, wrkrega;
@@ -78,4 +77,3 @@ void *memset(void *s, int c, size_t count)
 
        return s;
 }
-#endif /* __HAVE_ARCH_MEMSET */