Commit 9987c19e authored by Jesper Nilsson's avatar Jesper Nilsson

CRIS: Whitespace cleanup

No functional change, just clean up the most obvious.
Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
parent 83f1588e
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
#define __user_ok(addr, size) \ #define __user_ok(addr, size) \
(((size) <= TASK_SIZE)&&((addr) <= TASK_SIZE-(size))) (((size) <= TASK_SIZE) && ((addr) <= TASK_SIZE-(size)))
#define __access_ok(addr, size) (__kernel_ok || __user_ok((addr), (size))) #define __access_ok(addr, size) (__kernel_ok || __user_ok((addr), (size)))
#define access_ok(type, addr, size) __access_ok((unsigned long)(addr), (size)) #define access_ok(type, addr, size) __access_ok((unsigned long)(addr), (size))
...@@ -70,8 +70,7 @@ ...@@ -70,8 +70,7 @@
* on our cache or tlb entries. * on our cache or tlb entries.
*/ */
struct exception_table_entry struct exception_table_entry {
{
unsigned long insn, fixup; unsigned long insn, fixup;
}; };
...@@ -109,11 +108,20 @@ extern long __put_user_bad(void); ...@@ -109,11 +108,20 @@ extern long __put_user_bad(void);
do { \ do { \
retval = 0; \ retval = 0; \
switch (size) { \ switch (size) { \
case 1: __put_user_asm(x, ptr, retval, "move.b"); break; \ case 1: \
case 2: __put_user_asm(x, ptr, retval, "move.w"); break; \ __put_user_asm(x, ptr, retval, "move.b"); \
case 4: __put_user_asm(x, ptr, retval, "move.d"); break; \ break; \
case 8: __put_user_asm_64(x, ptr, retval); break; \ case 2: \
default: __put_user_bad(); \ __put_user_asm(x, ptr, retval, "move.w"); \
break; \
case 4: \
__put_user_asm(x, ptr, retval, "move.d"); \
break; \
case 8: \
__put_user_asm_64(x, ptr, retval); \
break; \
default: \
__put_user_bad(); \
} \ } \
} while (0) } while (0)
...@@ -121,11 +129,20 @@ do { \ ...@@ -121,11 +129,20 @@ do { \
do { \ do { \
retval = 0; \ retval = 0; \
switch (size) { \ switch (size) { \
case 1: __get_user_asm(x, ptr, retval, "move.b"); break; \ case 1: \
case 2: __get_user_asm(x, ptr, retval, "move.w"); break; \ __get_user_asm(x, ptr, retval, "move.b"); \
case 4: __get_user_asm(x, ptr, retval, "move.d"); break; \ break; \
case 8: __get_user_asm_64(x, ptr, retval); break; \ case 2: \
default: (x) = __get_user_bad(); \ __get_user_asm(x, ptr, retval, "move.w"); \
break; \
case 4: \
__get_user_asm(x, ptr, retval, "move.d"); \
break; \
case 8: \
__get_user_asm_64(x, ptr, retval); \
break; \
default: \
(x) = __get_user_bad(); \
} \ } \
} while (0) } while (0)
...@@ -211,6 +228,7 @@ static inline long ...@@ -211,6 +228,7 @@ static inline long
strncpy_from_user(char *dst, const char __user *src, long count) strncpy_from_user(char *dst, const char __user *src, long count)
{ {
long res = -EFAULT; long res = -EFAULT;
if (access_ok(VERIFY_READ, src, 1)) if (access_ok(VERIFY_READ, src, 1))
res = __do_strncpy_from_user(dst, src, count); res = __do_strncpy_from_user(dst, src, count);
return res; return res;
...@@ -224,6 +242,7 @@ static inline unsigned long ...@@ -224,6 +242,7 @@ static inline unsigned long
__constant_copy_from_user(void *to, const void __user *from, unsigned long n) __constant_copy_from_user(void *to, const void __user *from, unsigned long n)
{ {
unsigned long ret = 0; unsigned long ret = 0;
if (n == 0) if (n == 0)
; ;
else if (n == 1) else if (n == 1)
...@@ -274,6 +293,7 @@ static inline unsigned long ...@@ -274,6 +293,7 @@ static inline unsigned long
__constant_copy_to_user(void __user *to, const void *from, unsigned long n) __constant_copy_to_user(void __user *to, const void *from, unsigned long n)
{ {
unsigned long ret = 0; unsigned long ret = 0;
if (n == 0) if (n == 0)
; ;
else if (n == 1) else if (n == 1)
...@@ -324,6 +344,7 @@ static inline unsigned long ...@@ -324,6 +344,7 @@ static inline unsigned long
__constant_clear_user(void __user *to, unsigned long n) __constant_clear_user(void __user *to, unsigned long n)
{ {
unsigned long ret = 0; unsigned long ret = 0;
if (n == 0) if (n == 0)
; ;
else if (n == 1) else if (n == 1)
...@@ -352,17 +373,17 @@ __constant_clear_user(void __user *to, unsigned long n) ...@@ -352,17 +373,17 @@ __constant_clear_user(void __user *to, unsigned long n)
#define clear_user(to, n) \ #define clear_user(to, n) \
(__builtin_constant_p(n) ? \ (__builtin_constant_p(n) ? \
__constant_clear_user(to, n) : \ __constant_clear_user(to, n) : \
__generic_clear_user(to, n)) __generic_clear_user(to, n))
#define copy_from_user(to, from, n) \ #define copy_from_user(to, from, n) \
(__builtin_constant_p(n) ? \ (__builtin_constant_p(n) ? \
__constant_copy_from_user(to, from, n) : \ __constant_copy_from_user(to, from, n) : \
__generic_copy_from_user(to, from, n)) __generic_copy_from_user(to, from, n))
#define copy_to_user(to, from, n) \ #define copy_to_user(to, from, n) \
(__builtin_constant_p(n) ? \ (__builtin_constant_p(n) ? \
__constant_copy_to_user(to, from, n) : \ __constant_copy_to_user(to, from, n) : \
__generic_copy_to_user(to, from, n)) __generic_copy_to_user(to, from, n))
......
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