Skip to content

Commit 1497eea

Browse files
committed
powerpc/syscalls: Use the number when building SPU syscall table
Currently the macro that inserts entries into the SPU syscall table doesn't actually use the "nr" (syscall number) parameter. This does work, but it relies on the exact right number of syscall entries being emitted in order for the syscal numbers to line up with the array entries. If for example we had two entries with the same syscall number we wouldn't get an error, it would just cause all subsequent syscalls to be off by one in the spu_syscall_table. So instead change the macro to assign to the specific entry of the array, meaning any numbering overlap will be caught by the compiler. Signed-off-by: Michael Ellerman <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 687993c commit 1497eea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/platforms/cell/spu_callbacks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636

3737
static void *spu_syscall_table[] = {
38-
#define __SYSCALL(nr, entry) entry,
38+
#define __SYSCALL(nr, entry) [nr] = entry,
3939
#include <asm/syscall_table_spu.h>
4040
#undef __SYSCALL
4141
};

0 commit comments

Comments
 (0)