Skip to contentSkip to conversation

x86: merge strncpy_from_user() between 32 and 64 bits

PATCH New Akinobu Mita 1 participant 1 message Sep 1, 2010 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: merge strncpy_from_user() between 32 and 64 bits

Merge __strncpy_from_user() and strncpy_from_user() in usercopy_32.c and usercopy_64.c

The register operand constraint for the local variable res is changed from "=&d" to "=&r" on 32-bit.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/include/asm/asm.h |    1 +
 arch/x86/lib/Makefile      |    2 +-
 arch/x86/lib/usercopy.c    |   89 ++++++++++++++++++++++++++++++++++++++++++++
 arch/x86/lib/usercopy_32.c |   87 -------------------------------------------
 arch/x86/lib/usercopy_64.c |   49 ------------------------
 5 files changed, 91 insertions(+), 137 deletions(-)
 create mode 100644 arch/x86/lib/usercopy.c
arch/x86/include/asm/asm.h +1 -0
index b3ed1e1..c07d510 100644
@@ -27,6 +27,7 @@
 #define _ASM_ADD	__ASM_SIZE(add)
 #define _ASM_SUB	__ASM_SIZE(sub)
 #define _ASM_XADD	__ASM_SIZE(xadd)
+#define _ASM_TEST	__ASM_SIZE(test)
 
 #define _ASM_AX		__ASM_REG(ax)
 #define _ASM_BX		__ASM_REG(bx)
arch/x86/lib/Makefile +1 -1
index e10cf07..b40b473 100644
@@ -18,7 +18,7 @@ obj-$(CONFIG_SMP) += msr-smp.o cache-smp.o
 
 lib-y := delay.o
 lib-y += thunk_$(BITS).o
-lib-y += usercopy_$(BITS).o getuser.o putuser.o
+lib-y += usercopy.o usercopy_$(BITS).o getuser.o putuser.o
 lib-y += memcpy_$(BITS).o
 lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o
 
arch/x86/lib/usercopy.c new file +89 -0

89 lines not on this page · raw message

arch/x86/lib/usercopy_32.c +0 -87

93 lines not on this page · raw message

arch/x86/lib/usercopy_64.c +0 -49

55 lines not on this page · raw message

Signature · 1 line
1.6.0.6