Commit 295bb01e authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

arm: macro whitespace fixes

While working on arch/arm/include/asm/uaccess.h, I noticed
that some macros within this header are made harder to read because they
violate a coding style rule: space is missing after comma.

Fix it up.
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 4fb9bccb
...@@ -73,7 +73,7 @@ static inline void set_fs(mm_segment_t fs) ...@@ -73,7 +73,7 @@ static inline void set_fs(mm_segment_t fs)
modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER); modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER);
} }
#define segment_eq(a,b) ((a) == (b)) #define segment_eq(a, b) ((a) == (b))
#define __addr_ok(addr) ({ \ #define __addr_ok(addr) ({ \
unsigned long flag; \ unsigned long flag; \
...@@ -84,7 +84,7 @@ static inline void set_fs(mm_segment_t fs) ...@@ -84,7 +84,7 @@ static inline void set_fs(mm_segment_t fs)
(flag == 0); }) (flag == 0); })
/* We use 33-bit arithmetic here... */ /* We use 33-bit arithmetic here... */
#define __range_ok(addr,size) ({ \ #define __range_ok(addr, size) ({ \
unsigned long flag, roksum; \ unsigned long flag, roksum; \
__chk_user_ptr(addr); \ __chk_user_ptr(addr); \
__asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \ __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
...@@ -123,7 +123,7 @@ extern int __get_user_64t_4(void *); ...@@ -123,7 +123,7 @@ extern int __get_user_64t_4(void *);
#define __GUP_CLOBBER_32t_8 "lr", "cc" #define __GUP_CLOBBER_32t_8 "lr", "cc"
#define __GUP_CLOBBER_8 "lr", "cc" #define __GUP_CLOBBER_8 "lr", "cc"
#define __get_user_x(__r2,__p,__e,__l,__s) \ #define __get_user_x(__r2, __p, __e, __l, __s) \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
__asmeq("%0", "r0") __asmeq("%1", "r2") \ __asmeq("%0", "r0") __asmeq("%1", "r2") \
__asmeq("%3", "r1") \ __asmeq("%3", "r1") \
...@@ -158,7 +158,7 @@ extern int __get_user_64t_4(void *); ...@@ -158,7 +158,7 @@ extern int __get_user_64t_4(void *);
#endif #endif
#define __get_user_check(x,p) \ #define __get_user_check(x, p) \
({ \ ({ \
unsigned long __limit = current_thread_info()->addr_limit - 1; \ unsigned long __limit = current_thread_info()->addr_limit - 1; \
register const typeof(*(p)) __user *__p asm("r0") = (p);\ register const typeof(*(p)) __user *__p asm("r0") = (p);\
...@@ -196,10 +196,10 @@ extern int __get_user_64t_4(void *); ...@@ -196,10 +196,10 @@ extern int __get_user_64t_4(void *);
__e; \ __e; \
}) })
#define get_user(x,p) \ #define get_user(x, p) \
({ \ ({ \
might_fault(); \ might_fault(); \
__get_user_check(x,p); \ __get_user_check(x, p); \
}) })
extern int __put_user_1(void *, unsigned int); extern int __put_user_1(void *, unsigned int);
...@@ -207,7 +207,7 @@ extern int __put_user_2(void *, unsigned int); ...@@ -207,7 +207,7 @@ extern int __put_user_2(void *, unsigned int);
extern int __put_user_4(void *, unsigned int); extern int __put_user_4(void *, unsigned int);
extern int __put_user_8(void *, unsigned long long); extern int __put_user_8(void *, unsigned long long);
#define __put_user_x(__r2,__p,__e,__l,__s) \ #define __put_user_x(__r2, __p, __e, __l, __s) \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
__asmeq("%0", "r0") __asmeq("%2", "r2") \ __asmeq("%0", "r0") __asmeq("%2", "r2") \
__asmeq("%3", "r1") \ __asmeq("%3", "r1") \
...@@ -216,7 +216,7 @@ extern int __put_user_8(void *, unsigned long long); ...@@ -216,7 +216,7 @@ extern int __put_user_8(void *, unsigned long long);
: "0" (__p), "r" (__r2), "r" (__l) \ : "0" (__p), "r" (__r2), "r" (__l) \
: "ip", "lr", "cc") : "ip", "lr", "cc")
#define __put_user_check(x,p) \ #define __put_user_check(x, p) \
({ \ ({ \
unsigned long __limit = current_thread_info()->addr_limit - 1; \ unsigned long __limit = current_thread_info()->addr_limit - 1; \
const typeof(*(p)) __user *__tmp_p = (p); \ const typeof(*(p)) __user *__tmp_p = (p); \
...@@ -242,10 +242,10 @@ extern int __put_user_8(void *, unsigned long long); ...@@ -242,10 +242,10 @@ extern int __put_user_8(void *, unsigned long long);
__e; \ __e; \
}) })
#define put_user(x,p) \ #define put_user(x, p) \
({ \ ({ \
might_fault(); \ might_fault(); \
__put_user_check(x,p); \ __put_user_check(x, p); \
}) })
#else /* CONFIG_MMU */ #else /* CONFIG_MMU */
...@@ -255,21 +255,21 @@ extern int __put_user_8(void *, unsigned long long); ...@@ -255,21 +255,21 @@ extern int __put_user_8(void *, unsigned long long);
*/ */
#define USER_DS KERNEL_DS #define USER_DS KERNEL_DS
#define segment_eq(a,b) (1) #define segment_eq(a, b) (1)
#define __addr_ok(addr) ((void)(addr),1) #define __addr_ok(addr) ((void)(addr), 1)
#define __range_ok(addr,size) ((void)(addr),0) #define __range_ok(addr, size) ((void)(addr), 0)
#define get_fs() (KERNEL_DS) #define get_fs() (KERNEL_DS)
static inline void set_fs(mm_segment_t fs) static inline void set_fs(mm_segment_t fs)
{ {
} }
#define get_user(x,p) __get_user(x,p) #define get_user(x, p) __get_user(x, p)
#define put_user(x,p) __put_user(x,p) #define put_user(x, p) __put_user(x, p)
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
#define access_ok(type,addr,size) (__range_ok(addr,size) == 0) #define access_ok(type, addr, size) (__range_ok(addr, size) == 0)
#define user_addr_max() \ #define user_addr_max() \
(segment_eq(get_fs(), KERNEL_DS) ? ~0UL : get_fs()) (segment_eq(get_fs(), KERNEL_DS) ? ~0UL : get_fs())
...@@ -283,35 +283,35 @@ static inline void set_fs(mm_segment_t fs) ...@@ -283,35 +283,35 @@ static inline void set_fs(mm_segment_t fs)
* error occurs, and leave it unchanged on success. Note that these * error occurs, and leave it unchanged on success. Note that these
* versions are void (ie, don't return a value as such). * versions are void (ie, don't return a value as such).
*/ */
#define __get_user(x,ptr) \ #define __get_user(x, ptr) \
({ \ ({ \
long __gu_err = 0; \ long __gu_err = 0; \
__get_user_err((x),(ptr),__gu_err); \ __get_user_err((x), (ptr), __gu_err); \
__gu_err; \ __gu_err; \
}) })
#define __get_user_error(x,ptr,err) \ #define __get_user_error(x, ptr, err) \
({ \ ({ \
__get_user_err((x),(ptr),err); \ __get_user_err((x), (ptr), err); \
(void) 0; \ (void) 0; \
}) })
#define __get_user_err(x,ptr,err) \ #define __get_user_err(x, ptr, err) \
do { \ do { \
unsigned long __gu_addr = (unsigned long)(ptr); \ unsigned long __gu_addr = (unsigned long)(ptr); \
unsigned long __gu_val; \ unsigned long __gu_val; \
__chk_user_ptr(ptr); \ __chk_user_ptr(ptr); \
might_fault(); \ might_fault(); \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \ case 1: __get_user_asm_byte(__gu_val, __gu_addr, err); break; \
case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \ case 2: __get_user_asm_half(__gu_val, __gu_addr, err); break; \
case 4: __get_user_asm_word(__gu_val,__gu_addr,err); break; \ case 4: __get_user_asm_word(__gu_val, __gu_addr, err); break; \
default: (__gu_val) = __get_user_bad(); \ default: (__gu_val) = __get_user_bad(); \
} \ } \
(x) = (__typeof__(*(ptr)))__gu_val; \ (x) = (__typeof__(*(ptr)))__gu_val; \
} while (0) } while (0)
#define __get_user_asm_byte(x,addr,err) \ #define __get_user_asm_byte(x, addr, err) \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: " TUSER(ldrb) " %1,[%2],#0\n" \ "1: " TUSER(ldrb) " %1,[%2],#0\n" \
"2:\n" \ "2:\n" \
...@@ -330,7 +330,7 @@ do { \ ...@@ -330,7 +330,7 @@ do { \
: "cc") : "cc")
#ifndef __ARMEB__ #ifndef __ARMEB__
#define __get_user_asm_half(x,__gu_addr,err) \ #define __get_user_asm_half(x, __gu_addr, err) \
({ \ ({ \
unsigned long __b1, __b2; \ unsigned long __b1, __b2; \
__get_user_asm_byte(__b1, __gu_addr, err); \ __get_user_asm_byte(__b1, __gu_addr, err); \
...@@ -338,7 +338,7 @@ do { \ ...@@ -338,7 +338,7 @@ do { \
(x) = __b1 | (__b2 << 8); \ (x) = __b1 | (__b2 << 8); \
}) })
#else #else
#define __get_user_asm_half(x,__gu_addr,err) \ #define __get_user_asm_half(x, __gu_addr, err) \
({ \ ({ \
unsigned long __b1, __b2; \ unsigned long __b1, __b2; \
__get_user_asm_byte(__b1, __gu_addr, err); \ __get_user_asm_byte(__b1, __gu_addr, err); \
...@@ -347,7 +347,7 @@ do { \ ...@@ -347,7 +347,7 @@ do { \
}) })
#endif #endif
#define __get_user_asm_word(x,addr,err) \ #define __get_user_asm_word(x, addr, err) \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: " TUSER(ldr) " %1,[%2],#0\n" \ "1: " TUSER(ldr) " %1,[%2],#0\n" \
"2:\n" \ "2:\n" \
...@@ -365,35 +365,35 @@ do { \ ...@@ -365,35 +365,35 @@ do { \
: "r" (addr), "i" (-EFAULT) \ : "r" (addr), "i" (-EFAULT) \
: "cc") : "cc")
#define __put_user(x,ptr) \ #define __put_user(x, ptr) \
({ \ ({ \
long __pu_err = 0; \ long __pu_err = 0; \
__put_user_err((x),(ptr),__pu_err); \ __put_user_err((x), (ptr), __pu_err); \
__pu_err; \ __pu_err; \
}) })
#define __put_user_error(x,ptr,err) \ #define __put_user_error(x, ptr, err) \
({ \ ({ \
__put_user_err((x),(ptr),err); \ __put_user_err((x), (ptr), err); \
(void) 0; \ (void) 0; \
}) })
#define __put_user_err(x,ptr,err) \ #define __put_user_err(x, ptr, err) \
do { \ do { \
unsigned long __pu_addr = (unsigned long)(ptr); \ unsigned long __pu_addr = (unsigned long)(ptr); \
__typeof__(*(ptr)) __pu_val = (x); \ __typeof__(*(ptr)) __pu_val = (x); \
__chk_user_ptr(ptr); \ __chk_user_ptr(ptr); \
might_fault(); \ might_fault(); \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \ case 1: __put_user_asm_byte(__pu_val, __pu_addr, err); break; \
case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \ case 2: __put_user_asm_half(__pu_val, __pu_addr, err); break; \
case 4: __put_user_asm_word(__pu_val,__pu_addr,err); break; \ case 4: __put_user_asm_word(__pu_val, __pu_addr, err); break; \
case 8: __put_user_asm_dword(__pu_val,__pu_addr,err); break; \ case 8: __put_user_asm_dword(__pu_val, __pu_addr, err); break; \
default: __put_user_bad(); \ default: __put_user_bad(); \
} \ } \
} while (0) } while (0)
#define __put_user_asm_byte(x,__pu_addr,err) \ #define __put_user_asm_byte(x, __pu_addr, err) \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: " TUSER(strb) " %1,[%2],#0\n" \ "1: " TUSER(strb) " %1,[%2],#0\n" \
"2:\n" \ "2:\n" \
...@@ -411,14 +411,14 @@ do { \ ...@@ -411,14 +411,14 @@ do { \
: "cc") : "cc")
#ifndef __ARMEB__ #ifndef __ARMEB__
#define __put_user_asm_half(x,__pu_addr,err) \ #define __put_user_asm_half(x, __pu_addr, err) \
({ \ ({ \
unsigned long __temp = (__force unsigned long)(x); \ unsigned long __temp = (__force unsigned long)(x); \
__put_user_asm_byte(__temp, __pu_addr, err); \ __put_user_asm_byte(__temp, __pu_addr, err); \
__put_user_asm_byte(__temp >> 8, __pu_addr + 1, err); \ __put_user_asm_byte(__temp >> 8, __pu_addr + 1, err); \
}) })
#else #else
#define __put_user_asm_half(x,__pu_addr,err) \ #define __put_user_asm_half(x, __pu_addr, err) \
({ \ ({ \
unsigned long __temp = (__force unsigned long)(x); \ unsigned long __temp = (__force unsigned long)(x); \
__put_user_asm_byte(__temp >> 8, __pu_addr, err); \ __put_user_asm_byte(__temp >> 8, __pu_addr, err); \
...@@ -426,7 +426,7 @@ do { \ ...@@ -426,7 +426,7 @@ do { \
}) })
#endif #endif
#define __put_user_asm_word(x,__pu_addr,err) \ #define __put_user_asm_word(x, __pu_addr, err) \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: " TUSER(str) " %1,[%2],#0\n" \ "1: " TUSER(str) " %1,[%2],#0\n" \
"2:\n" \ "2:\n" \
...@@ -451,7 +451,7 @@ do { \ ...@@ -451,7 +451,7 @@ do { \
#define __reg_oper1 "%R2" #define __reg_oper1 "%R2"
#endif #endif
#define __put_user_asm_dword(x,__pu_addr,err) \ #define __put_user_asm_dword(x, __pu_addr, err) \
__asm__ __volatile__( \ __asm__ __volatile__( \
ARM( "1: " TUSER(str) " " __reg_oper1 ", [%1], #4\n" ) \ ARM( "1: " TUSER(str) " " __reg_oper1 ", [%1], #4\n" ) \
ARM( "2: " TUSER(str) " " __reg_oper0 ", [%1]\n" ) \ ARM( "2: " TUSER(str) " " __reg_oper0 ", [%1]\n" ) \
...@@ -480,9 +480,9 @@ extern unsigned long __must_check __copy_to_user_std(void __user *to, const void ...@@ -480,9 +480,9 @@ extern unsigned long __must_check __copy_to_user_std(void __user *to, const void
extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n); extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned long n); extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned long n);
#else #else
#define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) #define __copy_from_user(to, from, n) (memcpy(to, (void __force *)from, n), 0)
#define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) #define __copy_to_user(to, from, n) (memcpy((void __force *)to, from, n), 0)
#define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0) #define __clear_user(addr, n) (memset((void __force *)addr, 0, n), 0)
#endif #endif
static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long 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