Skip to contentSkip to conversation

trivial, uninline do_trap(), remove get_cr2()

PATCH In review Oleg Nesterov 2 participants 2 messages Nov 17, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trivial, uninline do_trap(), remove get_cr2()

Uninlining do_trap() saves 544 bytes in traps.o.
get_cr2() seems to be unused, remove it.

arch/i386/kernel/traps.c renamed from arch/i386/kernel/traps.c~ +1 -10
@@ -358,16 +358,7 @@ static inline void die_if_kernel(const c
 		die(str, regs, err);
 }
 
-static inline unsigned long get_cr2(void)
-{
-	unsigned long address;
-
-	/* get the address */
-	__asm__("movl %%cr2,%0":"=r" (address));
-	return address;
-}
-
-static inline void do_trap(int trapnr, int signr, char *str, int vm86,
+static void do_trap(int trapnr, int signr, char *str, int vm86,
 			   struct pt_regs * regs, long error_code, siginfo_t *info)
 {
 	if (regs->eflags & VM_MASK) {
#1 lore raw
Quoted 9 lines · Oleg Nesterov

Uninlining do_trap() saves 544 bytes in traps.o.
get_cr2() seems to be unused, remove it.

arch/i386/kernel/traps.c renamed from arch/i386/kernel/traps.c~ +0 -0
@@ -358,16 +358,7 @@ static inline void die_if_kernel(const c
 		die(str, regs, err);

arch/i386/kernel/traps.c static inline void die_if_kernel(const c · line 368

Quoted 10 lines
arch/i386/kernel/traps.c renamed from arch/i386/kernel/traps.c~ +0 -8
 }
 
-static inline unsigned long get_cr2(void)
-{
-	unsigned long address;
-
-	/* get the address */
-	__asm__("movl %%cr2,%0":"=r" (address));
-	return address;
-}

Looks like it can be removed from arch/x86_64/kernel/traps.c also.

Signature · 1 line
~Randy