Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: Trim change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Christophe Leroy and committed by
Michael Ellerman
2479bfc9 c9599881

+28
+4
arch/powerpc/kernel/pci_64.c
··· 203 203 #define IOBASE_ISA_IO 3 204 204 #define IOBASE_ISA_MEM 4 205 205 206 + #pragma GCC diagnostic push 207 + #pragma GCC diagnostic ignored "-Wpragmas" 208 + #pragma GCC diagnostic ignored "-Wattribute-alias" 206 209 SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, 207 210 unsigned long, in_devfn) 208 211 { ··· 259 256 260 257 return -EOPNOTSUPP; 261 258 } 259 + #pragma GCC diagnostic pop 262 260 263 261 #ifdef CONFIG_NUMA 264 262 int pcibus_to_node(struct pci_bus *bus)
+4
arch/powerpc/kernel/rtas.c
··· 1051 1051 } 1052 1052 1053 1053 /* We assume to be passed big endian arguments */ 1054 + #pragma GCC diagnostic push 1055 + #pragma GCC diagnostic ignored "-Wpragmas" 1056 + #pragma GCC diagnostic ignored "-Wattribute-alias" 1054 1057 SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) 1055 1058 { 1056 1059 struct rtas_args args; ··· 1140 1137 1141 1138 return 0; 1142 1139 } 1140 + #pragma GCC diagnostic pop 1143 1141 1144 1142 /* 1145 1143 * Call early during boot, before mem init, to retrieve the RTAS
+8
arch/powerpc/kernel/signal_32.c
··· 1037 1037 } 1038 1038 #endif 1039 1039 1040 + #pragma GCC diagnostic push 1041 + #pragma GCC diagnostic ignored "-Wpragmas" 1042 + #pragma GCC diagnostic ignored "-Wattribute-alias" 1040 1043 #ifdef CONFIG_PPC64 1041 1044 COMPAT_SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, 1042 1045 struct ucontext __user *, new_ctx, int, ctx_size) ··· 1135 1132 set_thread_flag(TIF_RESTOREALL); 1136 1133 return 0; 1137 1134 } 1135 + #pragma GCC diagnostic pop 1138 1136 1139 1137 #ifdef CONFIG_PPC64 1140 1138 COMPAT_SYSCALL_DEFINE0(rt_sigreturn) ··· 1232 1228 return 0; 1233 1229 } 1234 1230 1231 + #pragma GCC diagnostic push 1232 + #pragma GCC diagnostic ignored "-Wpragmas" 1233 + #pragma GCC diagnostic ignored "-Wattribute-alias" 1235 1234 #ifdef CONFIG_PPC32 1236 1235 SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, 1237 1236 int, ndbg, struct sig_dbg_op __user *, dbg) ··· 1340 1333 return 0; 1341 1334 } 1342 1335 #endif 1336 + #pragma GCC diagnostic pop 1343 1337 1344 1338 /* 1345 1339 * OK, we're invoking a handler
+4
arch/powerpc/kernel/signal_64.c
··· 625 625 /* 626 626 * Handle {get,set,swap}_context operations 627 627 */ 628 + #pragma GCC diagnostic push 629 + #pragma GCC diagnostic ignored "-Wpragmas" 630 + #pragma GCC diagnostic ignored "-Wattribute-alias" 628 631 SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, 629 632 struct ucontext __user *, new_ctx, long, ctx_size) 630 633 { ··· 693 690 set_thread_flag(TIF_RESTOREALL); 694 691 return 0; 695 692 } 693 + #pragma GCC diagnostic pop 696 694 697 695 698 696 /*
+4
arch/powerpc/kernel/syscalls.c
··· 62 62 return ret; 63 63 } 64 64 65 + #pragma GCC diagnostic push 66 + #pragma GCC diagnostic ignored "-Wpragmas" 67 + #pragma GCC diagnostic ignored "-Wattribute-alias" 65 68 SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len, 66 69 unsigned long, prot, unsigned long, flags, 67 70 unsigned long, fd, unsigned long, pgoff) ··· 78 75 { 79 76 return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT); 80 77 } 78 + #pragma GCC diagnostic pop 81 79 82 80 #ifdef CONFIG_PPC32 83 81 /*
+4
arch/powerpc/mm/subpage-prot.c
··· 186 186 * in a 2-bit field won't allow writes to a page that is otherwise 187 187 * write-protected. 188 188 */ 189 + #pragma GCC diagnostic push 190 + #pragma GCC diagnostic ignored "-Wpragmas" 191 + #pragma GCC diagnostic ignored "-Wattribute-alias" 189 192 SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, 190 193 unsigned long, len, u32 __user *, map) 191 194 { ··· 272 269 up_write(&mm->mmap_sem); 273 270 return err; 274 271 } 272 + #pragma GCC diagnostic pop