Skip to contentSkip to conversation

x86: uaccess: return value of __{get|put}_user() can be int

PATCH Applied Hiroshi Shimamoto 2 participants 2 messages Dec 9, 2008 – Dec 12, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: uaccess: return value of __{get|put}_user() can be int

From: Hiroshi Shimamoto <[email protected]>

Impact: cleanup

The type of return value of __{get|put}_user() can be int. There is no user to refer the return value of __{get|put}_user() as long. This reduces code size a bit on 64-bit.

$ size vmlinux.*
   text	   data	    bss	    dec	    hex	filename
4509265	 479988	 673588	5662841	 566879	vmlinux.new
4511462	 479988	 673588	5665038	 56710e	vmlinux.old
---
 arch/x86/include/asm/uaccess.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/uaccess.h +2 -2
index 99192bb..4340055 100644
@@ -352,14 +352,14 @@ do {									\
 
 #define __put_user_nocheck(x, ptr, size)			\
 ({								\
-	long __pu_err;						\
+	int __pu_err;						\
 	__put_user_size((x), (ptr), (size), __pu_err, -EFAULT);	\
 	__pu_err;						\
 })
 
 #define __get_user_nocheck(x, ptr, size)				\
 ({									\
-	long __gu_err;							\
+	int __gu_err;							\
 	unsigned long __gu_val;						\
 	__get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT);	\
 	(x) = (__force __typeof__(*(ptr)))__gu_val;			\
Signature · 1 line
1.6.0.4
Applied
#1 lore raw
Quoted 13 lines · Hiroshi Shimamoto

From: Hiroshi Shimamoto <[email protected]>

Impact: cleanup

The type of return value of __{get|put}_user() can be int. There is no user to refer the return value of __{get|put}_user() as long. This reduces code size a bit on 64-bit.

$ size vmlinux.*
   text	   data	    bss	    dec	    hex	filename
4509265	 479988	 673588	5662841	 566879	vmlinux.new
4511462	 479988	 673588	5665038	 56710e	vmlinux.old
Quoted 4 lines
---
 arch/x86/include/asm/uaccess.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

applied to tip/x86/mm, thanks!

Ingo