Skip to content

Commit

Permalink
powerpc/syscalls: Use the number when building SPU syscall table
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
mpe committed Jun 17, 2020
1 parent 687993c commit 1497eea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/spu_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/

static void *spu_syscall_table[] = {
#define __SYSCALL(nr, entry) entry,
#define __SYSCALL(nr, entry) [nr] = entry,
#include <asm/syscall_table_spu.h>
#undef __SYSCALL
};
Expand Down

0 comments on commit 1497eea

Please sign in to comment.