diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2008-07-28 20:16:33 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 20:16:33 -0400 |
commit | 6de9c6481d47c6da5f8b81f75a5c24c69c366f37 (patch) | |
tree | b0f9643afdb5a470978ded04a3c5ce492a35a5da /arch/sh/include | |
parent | d27e0854d5773fffe1a1d475032b715d124325ae (diff) |
sh: Proper __put_user_asm() size mismatch fix.
This fixes up the workaround in 2b4b2bb42137c779ef0084de5df66ff21b4cd86e
and cleans up __put_user_asm() to get the sizing right from the onset.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include')
-rw-r--r-- | arch/sh/include/asm/uaccess.h | 6 | ||||
-rw-r--r-- | arch/sh/include/asm/uaccess_32.h | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/arch/sh/include/asm/uaccess.h b/arch/sh/include/asm/uaccess.h index 45c2c9b2993d..075848f43b6a 100644 --- a/arch/sh/include/asm/uaccess.h +++ b/arch/sh/include/asm/uaccess.h | |||
@@ -77,8 +77,9 @@ struct __large_struct { unsigned long buf[100]; }; | |||
77 | ({ \ | 77 | ({ \ |
78 | long __pu_err; \ | 78 | long __pu_err; \ |
79 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ | 79 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
80 | __typeof__(*(ptr)) __pu_val = x; \ | ||
80 | __chk_user_ptr(ptr); \ | 81 | __chk_user_ptr(ptr); \ |
81 | __put_user_size((x), __pu_addr, (size), __pu_err); \ | 82 | __put_user_size(__pu_val, __pu_addr, (size), __pu_err); \ |
82 | __pu_err; \ | 83 | __pu_err; \ |
83 | }) | 84 | }) |
84 | 85 | ||
@@ -86,8 +87,9 @@ struct __large_struct { unsigned long buf[100]; }; | |||
86 | ({ \ | 87 | ({ \ |
87 | long __pu_err = -EFAULT; \ | 88 | long __pu_err = -EFAULT; \ |
88 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ | 89 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
90 | __typeof__(*(ptr)) __pu_val = x; \ | ||
89 | if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) \ | 91 | if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) \ |
90 | __put_user_size((x), __pu_addr, (size), \ | 92 | __put_user_size(__pu_val, __pu_addr, (size), \ |
91 | __pu_err); \ | 93 | __pu_err); \ |
92 | __pu_err; \ | 94 | __pu_err; \ |
93 | }) | 95 | }) |
diff --git a/arch/sh/include/asm/uaccess_32.h b/arch/sh/include/asm/uaccess_32.h index 892fd6dea9db..ae0d24f6653f 100644 --- a/arch/sh/include/asm/uaccess_32.h +++ b/arch/sh/include/asm/uaccess_32.h | |||
@@ -76,8 +76,7 @@ do { \ | |||
76 | __put_user_asm(x, ptr, retval, "w"); \ | 76 | __put_user_asm(x, ptr, retval, "w"); \ |
77 | break; \ | 77 | break; \ |
78 | case 4: \ | 78 | case 4: \ |
79 | __put_user_asm((u32)x, ptr, \ | 79 | __put_user_asm(x, ptr, retval, "l"); \ |
80 | retval, "l"); \ | ||
81 | break; \ | 80 | break; \ |
82 | case 8: \ | 81 | case 8: \ |
83 | __put_user_u64(x, ptr, retval); \ | 82 | __put_user_u64(x, ptr, retval); \ |