Commit 0e8a2eb0 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

parisc: macro whitespace fixes

While working on arch/parisc/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 e9e6d918
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#define KERNEL_DS ((mm_segment_t){0}) #define KERNEL_DS ((mm_segment_t){0})
#define USER_DS ((mm_segment_t){1}) #define USER_DS ((mm_segment_t){1})
#define segment_eq(a,b) ((a).seg == (b).seg) #define segment_eq(a, b) ((a).seg == (b).seg)
#define get_ds() (KERNEL_DS) #define get_ds() (KERNEL_DS)
#define get_fs() (current_thread_info()->addr_limit) #define get_fs() (current_thread_info()->addr_limit)
...@@ -42,14 +42,14 @@ static inline long access_ok(int type, const void __user * addr, ...@@ -42,14 +42,14 @@ static inline long access_ok(int type, const void __user * addr,
#if !defined(CONFIG_64BIT) #if !defined(CONFIG_64BIT)
#define LDD_KERNEL(ptr) BUILD_BUG() #define LDD_KERNEL(ptr) BUILD_BUG()
#define LDD_USER(ptr) BUILD_BUG() #define LDD_USER(ptr) BUILD_BUG()
#define STD_KERNEL(x, ptr) __put_kernel_asm64(x,ptr) #define STD_KERNEL(x, ptr) __put_kernel_asm64(x, ptr)
#define STD_USER(x, ptr) __put_user_asm64(x,ptr) #define STD_USER(x, ptr) __put_user_asm64(x, ptr)
#define ASM_WORD_INSN ".word\t" #define ASM_WORD_INSN ".word\t"
#else #else
#define LDD_KERNEL(ptr) __get_kernel_asm("ldd",ptr) #define LDD_KERNEL(ptr) __get_kernel_asm("ldd", ptr)
#define LDD_USER(ptr) __get_user_asm("ldd",ptr) #define LDD_USER(ptr) __get_user_asm("ldd", ptr)
#define STD_KERNEL(x, ptr) __put_kernel_asm("std",x,ptr) #define STD_KERNEL(x, ptr) __put_kernel_asm("std", x, ptr)
#define STD_USER(x, ptr) __put_user_asm("std",x,ptr) #define STD_USER(x, ptr) __put_user_asm("std", x, ptr)
#define ASM_WORD_INSN ".dword\t" #define ASM_WORD_INSN ".dword\t"
#endif #endif
...@@ -80,25 +80,25 @@ struct exception_data { ...@@ -80,25 +80,25 @@ struct exception_data {
unsigned long fault_addr; unsigned long fault_addr;
}; };
#define __get_user(x,ptr) \ #define __get_user(x, ptr) \
({ \ ({ \
register long __gu_err __asm__ ("r8") = 0; \ register long __gu_err __asm__ ("r8") = 0; \
register long __gu_val __asm__ ("r9") = 0; \ register long __gu_val __asm__ ("r9") = 0; \
\ \
if (segment_eq(get_fs(),KERNEL_DS)) { \ if (segment_eq(get_fs(), KERNEL_DS)) { \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: __get_kernel_asm("ldb",ptr); break; \ case 1: __get_kernel_asm("ldb", ptr); break; \
case 2: __get_kernel_asm("ldh",ptr); break; \ case 2: __get_kernel_asm("ldh", ptr); break; \
case 4: __get_kernel_asm("ldw",ptr); break; \ case 4: __get_kernel_asm("ldw", ptr); break; \
case 8: LDD_KERNEL(ptr); break; \ case 8: LDD_KERNEL(ptr); break; \
default: BUILD_BUG(); break; \ default: BUILD_BUG(); break; \
} \ } \
} \ } \
else { \ else { \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: __get_user_asm("ldb",ptr); break; \ case 1: __get_user_asm("ldb", ptr); break; \
case 2: __get_user_asm("ldh",ptr); break; \ case 2: __get_user_asm("ldh", ptr); break; \
case 4: __get_user_asm("ldw",ptr); break; \ case 4: __get_user_asm("ldw", ptr); break; \
case 8: LDD_USER(ptr); break; \ case 8: LDD_USER(ptr); break; \
default: BUILD_BUG(); break; \ default: BUILD_BUG(); break; \
} \ } \
...@@ -108,40 +108,40 @@ struct exception_data { ...@@ -108,40 +108,40 @@ struct exception_data {
__gu_err; \ __gu_err; \
}) })
#define __get_kernel_asm(ldx,ptr) \ #define __get_kernel_asm(ldx, ptr) \
__asm__("\n1:\t" ldx "\t0(%2),%0\n\t" \ __asm__("\n1:\t" ldx "\t0(%2),%0\n\t" \
ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_get_user_skip_1)\ ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_get_user_skip_1)\
: "=r"(__gu_val), "=r"(__gu_err) \ : "=r"(__gu_val), "=r"(__gu_err) \
: "r"(ptr), "1"(__gu_err) \ : "r"(ptr), "1"(__gu_err) \
: "r1"); : "r1");
#define __get_user_asm(ldx,ptr) \ #define __get_user_asm(ldx, ptr) \
__asm__("\n1:\t" ldx "\t0(%%sr3,%2),%0\n\t" \ __asm__("\n1:\t" ldx "\t0(%%sr3,%2),%0\n\t" \
ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_get_user_skip_1)\ ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_get_user_skip_1)\
: "=r"(__gu_val), "=r"(__gu_err) \ : "=r"(__gu_val), "=r"(__gu_err) \
: "r"(ptr), "1"(__gu_err) \ : "r"(ptr), "1"(__gu_err) \
: "r1"); : "r1");
#define __put_user(x,ptr) \ #define __put_user(x, ptr) \
({ \ ({ \
register long __pu_err __asm__ ("r8") = 0; \ register long __pu_err __asm__ ("r8") = 0; \
__typeof__(*(ptr)) __x = (__typeof__(*(ptr)))(x); \ __typeof__(*(ptr)) __x = (__typeof__(*(ptr)))(x); \
\ \
if (segment_eq(get_fs(),KERNEL_DS)) { \ if (segment_eq(get_fs(), KERNEL_DS)) { \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: __put_kernel_asm("stb",__x,ptr); break; \ case 1: __put_kernel_asm("stb", __x, ptr); break; \
case 2: __put_kernel_asm("sth",__x,ptr); break; \ case 2: __put_kernel_asm("sth", __x, ptr); break; \
case 4: __put_kernel_asm("stw",__x,ptr); break; \ case 4: __put_kernel_asm("stw", __x, ptr); break; \
case 8: STD_KERNEL(__x,ptr); break; \ case 8: STD_KERNEL(__x, ptr); break; \
default: BUILD_BUG(); break; \ default: BUILD_BUG(); break; \
} \ } \
} \ } \
else { \ else { \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: __put_user_asm("stb",__x,ptr); break; \ case 1: __put_user_asm("stb", __x, ptr); break; \
case 2: __put_user_asm("sth",__x,ptr); break; \ case 2: __put_user_asm("sth", __x, ptr); break; \
case 4: __put_user_asm("stw",__x,ptr); break; \ case 4: __put_user_asm("stw", __x, ptr); break; \
case 8: STD_USER(__x,ptr); break; \ case 8: STD_USER(__x, ptr); break; \
default: BUILD_BUG(); break; \ default: BUILD_BUG(); break; \
} \ } \
} \ } \
...@@ -159,18 +159,18 @@ struct exception_data { ...@@ -159,18 +159,18 @@ struct exception_data {
* r8/r9 are already listed as err/val. * r8/r9 are already listed as err/val.
*/ */
#define __put_kernel_asm(stx,x,ptr) \ #define __put_kernel_asm(stx, x, ptr) \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"\n1:\t" stx "\t%2,0(%1)\n\t" \ "\n1:\t" stx "\t%2,0(%1)\n\t" \
ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_1)\ ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_put_user_skip_1)\
: "=r"(__pu_err) \ : "=r"(__pu_err) \
: "r"(ptr), "r"(x), "0"(__pu_err) \ : "r"(ptr), "r"(x), "0"(__pu_err) \
: "r1") : "r1")
#define __put_user_asm(stx,x,ptr) \ #define __put_user_asm(stx, x, ptr) \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"\n1:\t" stx "\t%2,0(%%sr3,%1)\n\t" \ "\n1:\t" stx "\t%2,0(%%sr3,%1)\n\t" \
ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_1)\ ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_put_user_skip_1)\
: "=r"(__pu_err) \ : "=r"(__pu_err) \
: "r"(ptr), "r"(x), "0"(__pu_err) \ : "r"(ptr), "r"(x), "0"(__pu_err) \
: "r1") : "r1")
...@@ -178,23 +178,23 @@ struct exception_data { ...@@ -178,23 +178,23 @@ struct exception_data {
#if !defined(CONFIG_64BIT) #if !defined(CONFIG_64BIT)
#define __put_kernel_asm64(__val,ptr) do { \ #define __put_kernel_asm64(__val, ptr) do { \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"\n1:\tstw %2,0(%1)" \ "\n1:\tstw %2,0(%1)" \
"\n2:\tstw %R2,4(%1)\n\t" \ "\n2:\tstw %R2,4(%1)\n\t" \
ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_2)\ ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_put_user_skip_2)\
ASM_EXCEPTIONTABLE_ENTRY(2b,fixup_put_user_skip_1)\ ASM_EXCEPTIONTABLE_ENTRY(2b, fixup_put_user_skip_1)\
: "=r"(__pu_err) \ : "=r"(__pu_err) \
: "r"(ptr), "r"(__val), "0"(__pu_err) \ : "r"(ptr), "r"(__val), "0"(__pu_err) \
: "r1"); \ : "r1"); \
} while (0) } while (0)
#define __put_user_asm64(__val,ptr) do { \ #define __put_user_asm64(__val, ptr) do { \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"\n1:\tstw %2,0(%%sr3,%1)" \ "\n1:\tstw %2,0(%%sr3,%1)" \
"\n2:\tstw %R2,4(%%sr3,%1)\n\t" \ "\n2:\tstw %R2,4(%%sr3,%1)\n\t" \
ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_2)\ ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_put_user_skip_2)\
ASM_EXCEPTIONTABLE_ENTRY(2b,fixup_put_user_skip_1)\ ASM_EXCEPTIONTABLE_ENTRY(2b, fixup_put_user_skip_1)\
: "=r"(__pu_err) \ : "=r"(__pu_err) \
: "r"(ptr), "r"(__val), "0"(__pu_err) \ : "r"(ptr), "r"(__val), "0"(__pu_err) \
: "r1"); \ : "r1"); \
...@@ -211,8 +211,8 @@ extern unsigned long lcopy_to_user(void __user *, const void *, unsigned long); ...@@ -211,8 +211,8 @@ extern unsigned long lcopy_to_user(void __user *, const void *, unsigned long);
extern unsigned long lcopy_from_user(void *, const void __user *, unsigned long); extern unsigned long lcopy_from_user(void *, const void __user *, unsigned long);
extern unsigned long lcopy_in_user(void __user *, const void __user *, unsigned long); extern unsigned long lcopy_in_user(void __user *, const void __user *, unsigned long);
extern long strncpy_from_user(char *, const char __user *, long); extern long strncpy_from_user(char *, const char __user *, long);
extern unsigned lclear_user(void __user *,unsigned long); extern unsigned lclear_user(void __user *, unsigned long);
extern long lstrnlen_user(const char __user *,long); extern long lstrnlen_user(const char __user *, long);
/* /*
* Complex access routines -- macros * Complex access routines -- macros
*/ */
......
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