Skip to content

Commit

Permalink
uml: i386: Avoid redefinition of NR_syscalls
Browse files Browse the repository at this point in the history
The i386 subarch happens to pull in original NR_syscalls. Maybe we can
make that work for all host arch, but for now just avoid the clash by
using an all-upper-case name.

  CC      arch/um/kernel/skas/syscall.o/data/linux-2.6/arch/um/kernel/skas/syscall.c:13:1: warning: "NR_syscalls" redefined
In file included from /data/linux-2.6/arch/x86/include/asm/unistd.h:3,
                 from /data/linux-2.6/arch/um/sys-i386/shared/sysdep/syscalls.h:6,
                 from /data/linux-2.6/arch/um/kernel/skas/syscall.c:10:
/data/linux-2.6/arch/x86/include/asm/unistd_32.h:349:1: warning: this is the location of the previous definition

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jan Kiszka authored and Jiri Kosina committed May 10, 2010
1 parent a8cd456 commit ce60d4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/um/kernel/skas/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "sysdep/syscalls.h"

extern int syscall_table_size;
#define NR_syscalls (syscall_table_size / sizeof(void *))
#define NR_SYSCALLS (syscall_table_size / sizeof(void *))

void handle_syscall(struct uml_pt_regs *r)
{
Expand All @@ -30,7 +30,7 @@ void handle_syscall(struct uml_pt_regs *r)
* in case it's a compiler bug.
*/
syscall = UPT_SYSCALL_NR(r);
if ((syscall >= NR_syscalls) || (syscall < 0))
if ((syscall >= NR_SYSCALLS) || (syscall < 0))
result = -ENOSYS;
else result = EXECUTE_SYSCALL(syscall, regs);

Expand Down

0 comments on commit ce60d4d

Please sign in to comment.