Skip to contentSkip to conversation

x86: Fix sys_call_table type in asm/syscall.h

PATCH In review Andi Kleen 2 participants 4 messages Jun 7, 2011 – Jun 8, 2011 x86

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 x86: Fix sys_call_table type in asm/syscall.h

From: Andi Kleen <[email protected]>

Make the sys_call_table type defined in asm/syscall.h match the definition in syscall_64.c

---
 arch/x86/include/asm/syscall.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/include/asm/syscall.h +2 -1
index c4a348f..32295b7 100644
@@ -16,7 +16,8 @@
 #include <linux/sched.h>
 #include <linux/err.h>
 
-extern const unsigned long sys_call_table[];
+typedef void (*sys_call_ptr_t)(void);
+extern const sys_call_ptr_t sys_call_table[];
 
 /*
  * Only the low 32 bits of orig_ax are meaningful, so we return int.
Signature · 1 line
1.7.4.4
#1 lore raw
Quoted 16 lines · Andi Kleen

From: Andi Kleen <[email protected]>

Make the sys_call_table type defined in asm/syscall.h match the definition in syscall_64.c

---
 arch/x86/include/asm/syscall.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/include/asm/syscall.h +0 -0
index c4a348f..32295b7 100644

arch/x86/include/asm/syscall.h line 23

Quoted 9 lines
arch/x86/include/asm/syscall.h +2 -1
@@ -16,7 +16,8 @@
 #include <linux/sched.h>
 #include <linux/err.h>
 
-extern const unsigned long sys_call_table[];
+typedef void (*sys_call_ptr_t)(void);
+extern const sys_call_ptr_t sys_call_table[];
 
 /*
  * Only the low 32 bits of orig_ax are meaningful, so we return int.

There's an obvious problem with this patch, please fix it and resend.

Thanks,

Ingo

author
#2 lore raw
Quoted 1 line

There's an obvious problem with this patch, please fix it and resend.

Nothing obvious to me. Can you be more specific?

-Andi

#3 lore raw
Quoted 3 lines · Andi Kleen
Quoted 1 line

There's an obvious problem with this patch, please fix it and resend.

Nothing obvious to me. Can you be more specific?

Sure, a trivial git grep of the sys_call_ptr_t typedef you added to syscall.h shows:

~/tip> git grep sys_call_ptr_t arch/um/sys-x86_64/syscall_table.c:typedef void (*sys_call_ptr_t)(void); arch/x86/include/asm/syscall.h:typedef void (*sys_call_ptr_t)(void); arch/x86/kernel/syscall_64.c:typedef void (*sys_call_ptr_t)(void);

So you've now added a third typedef in addition to the two existing ones. We obivously only want one in the kernel - the one you added to the header file.

Thanks,

Ingo