Commit 2479bfc9 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc: Fix build by disabling attribute-alias warning for SYSCALL_DEFINEx

GCC 8.1 emits warnings such as the following. As arch/powerpc code is
built with -Werror, this breaks the build with GCC 8.1.

  In file included from arch/powerpc/kernel/pci_64.c:23:
  ./include/linux/syscalls.h:233:18: error: 'sys_pciconfig_iobase' alias
  between functions of incompatible types 'long int(long int, long
  unsigned int, long unsigned int)' and 'long int(long int, long int,
  long int)' [-Werror=attribute-alias]
    asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
                    ^~~
  ./include/linux/syscalls.h:222:2: note: in expansion of macro '__SYSCALL_DEFINEx'
    __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)

This patch inhibits those warnings.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
[mpe: Trim change log]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent c9599881
...@@ -203,6 +203,9 @@ void pcibios_setup_phb_io_space(struct pci_controller *hose) ...@@ -203,6 +203,9 @@ void pcibios_setup_phb_io_space(struct pci_controller *hose)
#define IOBASE_ISA_IO 3 #define IOBASE_ISA_IO 3
#define IOBASE_ISA_MEM 4 #define IOBASE_ISA_MEM 4
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wattribute-alias"
SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus,
unsigned long, in_devfn) unsigned long, in_devfn)
{ {
...@@ -256,6 +259,7 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, ...@@ -256,6 +259,7 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
#pragma GCC diagnostic pop
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
int pcibus_to_node(struct pci_bus *bus) int pcibus_to_node(struct pci_bus *bus)
......
...@@ -1051,6 +1051,9 @@ struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log, ...@@ -1051,6 +1051,9 @@ struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log,
} }
/* We assume to be passed big endian arguments */ /* We assume to be passed big endian arguments */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wattribute-alias"
SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs)
{ {
struct rtas_args args; struct rtas_args args;
...@@ -1137,6 +1140,7 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) ...@@ -1137,6 +1140,7 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs)
return 0; return 0;
} }
#pragma GCC diagnostic pop
/* /*
* Call early during boot, before mem init, to retrieve the RTAS * Call early during boot, before mem init, to retrieve the RTAS
......
...@@ -1037,6 +1037,9 @@ static int do_setcontext_tm(struct ucontext __user *ucp, ...@@ -1037,6 +1037,9 @@ static int do_setcontext_tm(struct ucontext __user *ucp,
} }
#endif #endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wattribute-alias"
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
COMPAT_SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, COMPAT_SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
struct ucontext __user *, new_ctx, int, ctx_size) struct ucontext __user *, new_ctx, int, ctx_size)
...@@ -1132,6 +1135,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, ...@@ -1132,6 +1135,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
set_thread_flag(TIF_RESTOREALL); set_thread_flag(TIF_RESTOREALL);
return 0; return 0;
} }
#pragma GCC diagnostic pop
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
COMPAT_SYSCALL_DEFINE0(rt_sigreturn) COMPAT_SYSCALL_DEFINE0(rt_sigreturn)
...@@ -1228,6 +1232,9 @@ SYSCALL_DEFINE0(rt_sigreturn) ...@@ -1228,6 +1232,9 @@ SYSCALL_DEFINE0(rt_sigreturn)
return 0; return 0;
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wattribute-alias"
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx,
int, ndbg, struct sig_dbg_op __user *, dbg) int, ndbg, struct sig_dbg_op __user *, dbg)
...@@ -1333,6 +1340,7 @@ SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, ...@@ -1333,6 +1340,7 @@ SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx,
return 0; return 0;
} }
#endif #endif
#pragma GCC diagnostic pop
/* /*
* OK, we're invoking a handler * OK, we're invoking a handler
......
...@@ -625,6 +625,9 @@ static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp) ...@@ -625,6 +625,9 @@ static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp)
/* /*
* Handle {get,set,swap}_context operations * Handle {get,set,swap}_context operations
*/ */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wattribute-alias"
SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
struct ucontext __user *, new_ctx, long, ctx_size) struct ucontext __user *, new_ctx, long, ctx_size)
{ {
...@@ -690,6 +693,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, ...@@ -690,6 +693,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
set_thread_flag(TIF_RESTOREALL); set_thread_flag(TIF_RESTOREALL);
return 0; return 0;
} }
#pragma GCC diagnostic pop
/* /*
......
...@@ -62,6 +62,9 @@ static inline long do_mmap2(unsigned long addr, size_t len, ...@@ -62,6 +62,9 @@ static inline long do_mmap2(unsigned long addr, size_t len,
return ret; return ret;
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wattribute-alias"
SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len, SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len,
unsigned long, prot, unsigned long, flags, unsigned long, prot, unsigned long, flags,
unsigned long, fd, unsigned long, pgoff) unsigned long, fd, unsigned long, pgoff)
...@@ -75,6 +78,7 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, size_t, len, ...@@ -75,6 +78,7 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, size_t, len,
{ {
return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT); return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT);
} }
#pragma GCC diagnostic pop
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
/* /*
......
...@@ -186,6 +186,9 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, ...@@ -186,6 +186,9 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr,
* in a 2-bit field won't allow writes to a page that is otherwise * in a 2-bit field won't allow writes to a page that is otherwise
* write-protected. * write-protected.
*/ */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wattribute-alias"
SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, SYSCALL_DEFINE3(subpage_prot, unsigned long, addr,
unsigned long, len, u32 __user *, map) unsigned long, len, u32 __user *, map)
{ {
...@@ -269,3 +272,4 @@ SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, ...@@ -269,3 +272,4 @@ SYSCALL_DEFINE3(subpage_prot, unsigned long, addr,
up_write(&mm->mmap_sem); up_write(&mm->mmap_sem);
return err; return err;
} }
#pragma GCC diagnostic pop
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment