nios2 update for v4.4-rc1

- nios2: Remove unnecessary #ifdef guards
 - nios2: Switch to generic __xchg()
 - nios2: Fix unused variable warning
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWQDMOAAoJEFWoEK+e3syCIV0QAKrFlUxEeaQbitwc33S1FNS2
 iqVlWsZ8Br5Jf5Hjix2BJFzgOHUpUxYze/P2I1mbQfd/4oxkmY6U4ztJZFyfee3M
 S7qvtqa9RfxsxAb+QfcpYDmA2DYvRa5ewRXsrfRol6GWzCC00iVqDkxhb9ME8k9R
 DsIbO54MTDIy7MdhM5gHm7g5KeVJWqd/jQjvjLSv/AW7E5GtW6UMaCyuzfxCywnm
 mRzafIXuq+0J0X4w9Cznd8oH+qyKOZMJvoTLQYG8HIVwurHJmxbk3Vh/Opilpob7
 Bv6G+X+uDlz81HZ8vloKKlCK/f5r6Zyg1C4XQX5BF3uH/l+IAb5QxC2mzp2b8gCZ
 60cT2Xoy3deuyh9onRMCiHqX6BAdx+LXpFusEC8ksmKfZFZ1/3fMKZWNW+uQLTfC
 FYCoulQbXlCQQdJ/z8FOlDzbZCYWONtRieNFjYk61tiyjiNTVdGIqIEIMUhPdf2Y
 qQwhnjVvoAJaKgs6SkIjDVcEbTzBA6d4Ejj9QRbo/qT2wnnWASsEC7ZzHl+4cU3l
 siWKIYyJM2uxb5rDVAGoG37cXKX9II9jrVwuIRdPvtF7QjiZKEZOBJY+mlGMUhtZ
 rmMIaz44O8FAo17JfDzj5J1sHZ9hLsEoi7mWjloxBjVnFHLh9sr75iYtQznD7u1v
 uGNRdTOCDJ6X01t0IIu/
 =+cHI
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2015-11-09 16:36:10 -08:00
commit f4d68930a8
4 changed files with 1 additions and 52 deletions

View 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 */

View 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 */

View 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 */

View 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 */