]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
microblaze: Fix put_user macro for 64bits arguments
authorMichal Simek <monstr@monstr.eu>
Mon, 13 Jul 2009 14:46:54 +0000 (16:46 +0200)
committerMichal Simek <monstr@monstr.eu>
Mon, 27 Jul 2009 05:39:54 +0000 (07:39 +0200)
For 64bits arguments gcc caused that put_user macro
works with wrong value because of optimalization.
Adding volatile caused that gcc not optimized it.

It is possible to use (as Blackfin do) two put_user
macros with 32bits arguments but there is one more
instruction which is due to duplication zero return
value which is called put_user_asm macro.

Signed-off-by: Michal Simek <monstr@monstr.eu>
arch/microblaze/include/asm/uaccess.h

index 65adad61e7e90b4bbf05cc161caaf4a6a6757290..5431b4631a7ad479bc23baf72de4563c68b8efb8 100644 (file)
@@ -189,7 +189,7 @@ extern long strnlen_user(const char *src, long count);
 
 #define __put_user(x, ptr)                                             \
 ({                                                                     \
-       __typeof__(*(ptr)) __gu_val = x;                                \
+       __typeof__(*(ptr)) volatile __gu_val = (x);                     \
        long __gu_err = 0;                                              \
        switch (sizeof(__gu_val)) {                                     \
        case 1:                                                         \