aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2015-10-25 15:28:14 -0400
committerRichard Weinberger <richard@nod.at>2015-11-06 16:49:10 -0500
commitf10e6d652bc2dad67b5e7b6e6d890c76f739ed77 (patch)
tree335e7780479d92f77a28c5cc552046074bdc7377 /arch/um/kernel
parent1d80f0cda10118d7505bd0a09a5c1c72f3a5f6c8 (diff)
um: Get rid of open coded NR_SYSCALLS
We can use __NR_syscall_max. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/kernel')
-rw-r--r--arch/um/kernel/skas/syscall.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c
index 64a8fe589d6f..1683b8efdfda 100644
--- a/arch/um/kernel/skas/syscall.c
+++ b/arch/um/kernel/skas/syscall.c
@@ -10,9 +10,6 @@
10#include <sysdep/syscalls.h> 10#include <sysdep/syscalls.h>
11#include <os.h> 11#include <os.h>
12 12
13extern int syscall_table_size;
14#define NR_SYSCALLS (syscall_table_size / sizeof(void *))
15
16void handle_syscall(struct uml_pt_regs *r) 13void handle_syscall(struct uml_pt_regs *r)
17{ 14{
18 struct pt_regs *regs = container_of(r, struct pt_regs, regs); 15 struct pt_regs *regs = container_of(r, struct pt_regs, regs);
@@ -26,9 +23,10 @@ void handle_syscall(struct uml_pt_regs *r)
26 23
27 syscall = get_syscall(r); 24 syscall = get_syscall(r);
28 25
29 if ((syscall >= NR_SYSCALLS) || (syscall < 0)) 26 if ((syscall > __NR_syscall_max) || syscall < 0)
30 result = -ENOSYS; 27 result = -ENOSYS;
31 else result = EXECUTE_SYSCALL(syscall, regs); 28 else
29 result = EXECUTE_SYSCALL(syscall, regs);
32 30
33out: 31out:
34 PT_REGS_SET_SYSCALL_RETURN(regs, result); 32 PT_REGS_SET_SYSCALL_RETURN(regs, result);