Commit 0795cb1b authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

sparc32: nocheck uaccess coding style tweaks

Sam Ravnborg suggested packing single-lines cases in switch statements
in nocheck uaccess macros makes for easier to read code.
Suggested-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 4b636ba2
...@@ -145,21 +145,11 @@ struct __large_struct { unsigned long buf[100]; }; ...@@ -145,21 +145,11 @@ struct __large_struct { unsigned long buf[100]; };
#define __put_user_nocheck(x, addr, size) ({ \ #define __put_user_nocheck(x, addr, size) ({ \
register int __pu_ret; \ register int __pu_ret; \
switch (size) { \ switch (size) { \
case 1: \ case 1: __put_user_asm(x, b, addr, __pu_ret); break; \
__put_user_asm(x, b, addr, __pu_ret); \ case 2: __put_user_asm(x, h, addr, __pu_ret); break; \
break; \ case 4: __put_user_asm(x, , addr, __pu_ret); break; \
case 2: \ case 8: __put_user_asm(x, d, addr, __pu_ret); break; \
__put_user_asm(x, h, addr, __pu_ret); \ default: __pu_ret = __put_user_bad(); break; \
break; \
case 4: \
__put_user_asm(x, , addr, __pu_ret); \
break; \
case 8: \
__put_user_asm(x, d, addr, __pu_ret); \
break; \
default: \
__pu_ret = __put_user_bad(); \
break; \
} \ } \
__pu_ret; \ __pu_ret; \
}) })
...@@ -244,18 +234,10 @@ int __put_user_bad(void); ...@@ -244,18 +234,10 @@ int __put_user_bad(void);
register int __gu_ret; \ register int __gu_ret; \
register unsigned long __gu_val; \ register unsigned long __gu_val; \
switch (size) { \ switch (size) { \
case 1: \ case 1: __get_user_asm(__gu_val, ub, addr, __gu_ret); break; \
__get_user_asm(__gu_val, ub, addr, __gu_ret); \ case 2: __get_user_asm(__gu_val, uh, addr, __gu_ret); break; \
break; \ case 4: __get_user_asm(__gu_val, , addr, __gu_ret); break; \
case 2: \ case 8: __get_user_asm(__gu_val, d, addr, __gu_ret); break; \
__get_user_asm(__gu_val, uh, addr, __gu_ret); \
break; \
case 4: \
__get_user_asm(__gu_val, , addr, __gu_ret); \
break; \
case 8: \
__get_user_asm(__gu_val, d, addr, __gu_ret); \
break; \
default: \ default: \
__gu_val = 0; \ __gu_val = 0; \
__gu_ret = __get_user_bad(); \ __gu_ret = __get_user_bad(); \
...@@ -268,18 +250,10 @@ int __put_user_bad(void); ...@@ -268,18 +250,10 @@ int __put_user_bad(void);
#define __get_user_nocheck_ret(x, addr, size, type, retval) ({ \ #define __get_user_nocheck_ret(x, addr, size, type, retval) ({ \
register unsigned long __gu_val __asm__ ("l1"); \ register unsigned long __gu_val __asm__ ("l1"); \
switch (size) { \ switch (size) { \
case 1: \ case 1: __get_user_asm_ret(__gu_val, ub, addr, retval); break; \
__get_user_asm_ret(__gu_val, ub, addr, retval); \ case 2: __get_user_asm_ret(__gu_val, uh, addr, retval); break; \
break; \ case 4: __get_user_asm_ret(__gu_val, , addr, retval); break; \
case 2: \ case 8: __get_user_asm_ret(__gu_val, d, addr, retval); break; \
__get_user_asm_ret(__gu_val, uh, addr, retval); \
break; \
case 4: \
__get_user_asm_ret(__gu_val, , addr, retval); \
break; \
case 8: \
__get_user_asm_ret(__gu_val, d, addr, retval); \
break; \
default: \ default: \
if (__get_user_bad()) \ if (__get_user_bad()) \
return retval; \ return retval; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment