diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2015-01-06 08:11:13 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-01-13 08:23:49 -0500 |
commit | 4fb9bccbfbb2b95685671cc65f7ecd64e30384ff (patch) | |
tree | 3cd6ebf9b9f21b04eaa24cff9e6a0c777f8afa1d /arch/alpha/include | |
parent | 323ae3c5dd941c8257912941eb3da93aaf8d65dd (diff) |
alpha: macro whitespace fixes
While working on arch/alpha/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: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'arch/alpha/include')
-rw-r--r-- | arch/alpha/include/asm/uaccess.h | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h index a234de79157a..9b0d40093c9a 100644 --- a/arch/alpha/include/asm/uaccess.h +++ b/arch/alpha/include/asm/uaccess.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #define get_ds() (KERNEL_DS) | 27 | #define get_ds() (KERNEL_DS) |
28 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) | 28 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) |
29 | 29 | ||
30 | #define segment_eq(a,b) ((a).seg == (b).seg) | 30 | #define segment_eq(a, b) ((a).seg == (b).seg) |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * Is a address valid? This does a straightforward calculation rather | 33 | * Is a address valid? This does a straightforward calculation rather |
@@ -39,13 +39,13 @@ | |||
39 | * - AND "addr+size" doesn't have any high-bits set | 39 | * - AND "addr+size" doesn't have any high-bits set |
40 | * - OR we are in kernel mode. | 40 | * - OR we are in kernel mode. |
41 | */ | 41 | */ |
42 | #define __access_ok(addr,size,segment) \ | 42 | #define __access_ok(addr, size, segment) \ |
43 | (((segment).seg & (addr | size | (addr+size))) == 0) | 43 | (((segment).seg & (addr | size | (addr+size))) == 0) |
44 | 44 | ||
45 | #define access_ok(type,addr,size) \ | 45 | #define access_ok(type, addr, size) \ |
46 | ({ \ | 46 | ({ \ |
47 | __chk_user_ptr(addr); \ | 47 | __chk_user_ptr(addr); \ |
48 | __access_ok(((unsigned long)(addr)),(size),get_fs()); \ | 48 | __access_ok(((unsigned long)(addr)), (size), get_fs()); \ |
49 | }) | 49 | }) |
50 | 50 | ||
51 | /* | 51 | /* |
@@ -60,20 +60,20 @@ | |||
60 | * (a) re-use the arguments for side effects (sizeof/typeof is ok) | 60 | * (a) re-use the arguments for side effects (sizeof/typeof is ok) |
61 | * (b) require any knowledge of processes at this stage | 61 | * (b) require any knowledge of processes at this stage |
62 | */ | 62 | */ |
63 | #define put_user(x,ptr) \ | 63 | #define put_user(x, ptr) \ |
64 | __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)),get_fs()) | 64 | __put_user_check((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)), get_fs()) |
65 | #define get_user(x,ptr) \ | 65 | #define get_user(x, ptr) \ |
66 | __get_user_check((x),(ptr),sizeof(*(ptr)),get_fs()) | 66 | __get_user_check((x), (ptr), sizeof(*(ptr)), get_fs()) |
67 | 67 | ||
68 | /* | 68 | /* |
69 | * The "__xxx" versions do not do address space checking, useful when | 69 | * The "__xxx" versions do not do address space checking, useful when |
70 | * doing multiple accesses to the same area (the programmer has to do the | 70 | * doing multiple accesses to the same area (the programmer has to do the |
71 | * checks by hand with "access_ok()") | 71 | * checks by hand with "access_ok()") |
72 | */ | 72 | */ |
73 | #define __put_user(x,ptr) \ | 73 | #define __put_user(x, ptr) \ |
74 | __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) | 74 | __put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr))) |
75 | #define __get_user(x,ptr) \ | 75 | #define __get_user(x, ptr) \ |
76 | __get_user_nocheck((x),(ptr),sizeof(*(ptr))) | 76 | __get_user_nocheck((x), (ptr), sizeof(*(ptr))) |
77 | 77 | ||
78 | /* | 78 | /* |
79 | * The "lda %1, 2b-1b(%0)" bits are magic to get the assembler to | 79 | * The "lda %1, 2b-1b(%0)" bits are magic to get the assembler to |
@@ -84,7 +84,7 @@ | |||
84 | 84 | ||
85 | extern void __get_user_unknown(void); | 85 | extern void __get_user_unknown(void); |
86 | 86 | ||
87 | #define __get_user_nocheck(x,ptr,size) \ | 87 | #define __get_user_nocheck(x, ptr, size) \ |
88 | ({ \ | 88 | ({ \ |
89 | long __gu_err = 0; \ | 89 | long __gu_err = 0; \ |
90 | unsigned long __gu_val; \ | 90 | unsigned long __gu_val; \ |
@@ -100,12 +100,12 @@ extern void __get_user_unknown(void); | |||
100 | __gu_err; \ | 100 | __gu_err; \ |
101 | }) | 101 | }) |
102 | 102 | ||
103 | #define __get_user_check(x,ptr,size,segment) \ | 103 | #define __get_user_check(x, ptr, size, segment) \ |
104 | ({ \ | 104 | ({ \ |
105 | long __gu_err = -EFAULT; \ | 105 | long __gu_err = -EFAULT; \ |
106 | unsigned long __gu_val = 0; \ | 106 | unsigned long __gu_val = 0; \ |
107 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | 107 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ |
108 | if (__access_ok((unsigned long)__gu_addr,size,segment)) { \ | 108 | if (__access_ok((unsigned long)__gu_addr, size, segment)) { \ |
109 | __gu_err = 0; \ | 109 | __gu_err = 0; \ |
110 | switch (size) { \ | 110 | switch (size) { \ |
111 | case 1: __get_user_8(__gu_addr); break; \ | 111 | case 1: __get_user_8(__gu_addr); break; \ |
@@ -201,31 +201,31 @@ struct __large_struct { unsigned long buf[100]; }; | |||
201 | 201 | ||
202 | extern void __put_user_unknown(void); | 202 | extern void __put_user_unknown(void); |
203 | 203 | ||
204 | #define __put_user_nocheck(x,ptr,size) \ | 204 | #define __put_user_nocheck(x, ptr, size) \ |
205 | ({ \ | 205 | ({ \ |
206 | long __pu_err = 0; \ | 206 | long __pu_err = 0; \ |
207 | __chk_user_ptr(ptr); \ | 207 | __chk_user_ptr(ptr); \ |
208 | switch (size) { \ | 208 | switch (size) { \ |
209 | case 1: __put_user_8(x,ptr); break; \ | 209 | case 1: __put_user_8(x, ptr); break; \ |
210 | case 2: __put_user_16(x,ptr); break; \ | 210 | case 2: __put_user_16(x, ptr); break; \ |
211 | case 4: __put_user_32(x,ptr); break; \ | 211 | case 4: __put_user_32(x, ptr); break; \ |
212 | case 8: __put_user_64(x,ptr); break; \ | 212 | case 8: __put_user_64(x, ptr); break; \ |
213 | default: __put_user_unknown(); break; \ | 213 | default: __put_user_unknown(); break; \ |
214 | } \ | 214 | } \ |
215 | __pu_err; \ | 215 | __pu_err; \ |
216 | }) | 216 | }) |
217 | 217 | ||
218 | #define __put_user_check(x,ptr,size,segment) \ | 218 | #define __put_user_check(x, ptr, size, segment) \ |
219 | ({ \ | 219 | ({ \ |
220 | long __pu_err = -EFAULT; \ | 220 | long __pu_err = -EFAULT; \ |
221 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ | 221 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
222 | if (__access_ok((unsigned long)__pu_addr,size,segment)) { \ | 222 | if (__access_ok((unsigned long)__pu_addr, size, segment)) { \ |
223 | __pu_err = 0; \ | 223 | __pu_err = 0; \ |
224 | switch (size) { \ | 224 | switch (size) { \ |
225 | case 1: __put_user_8(x,__pu_addr); break; \ | 225 | case 1: __put_user_8(x, __pu_addr); break; \ |
226 | case 2: __put_user_16(x,__pu_addr); break; \ | 226 | case 2: __put_user_16(x, __pu_addr); break; \ |
227 | case 4: __put_user_32(x,__pu_addr); break; \ | 227 | case 4: __put_user_32(x, __pu_addr); break; \ |
228 | case 8: __put_user_64(x,__pu_addr); break; \ | 228 | case 8: __put_user_64(x, __pu_addr); break; \ |
229 | default: __put_user_unknown(); break; \ | 229 | default: __put_user_unknown(); break; \ |
230 | } \ | 230 | } \ |
231 | } \ | 231 | } \ |
@@ -237,7 +237,7 @@ extern void __put_user_unknown(void); | |||
237 | * instead of writing: this is because they do not write to | 237 | * instead of writing: this is because they do not write to |
238 | * any memory gcc knows about, so there are no aliasing issues | 238 | * any memory gcc knows about, so there are no aliasing issues |
239 | */ | 239 | */ |
240 | #define __put_user_64(x,addr) \ | 240 | #define __put_user_64(x, addr) \ |
241 | __asm__ __volatile__("1: stq %r2,%1\n" \ | 241 | __asm__ __volatile__("1: stq %r2,%1\n" \ |
242 | "2:\n" \ | 242 | "2:\n" \ |
243 | ".section __ex_table,\"a\"\n" \ | 243 | ".section __ex_table,\"a\"\n" \ |
@@ -247,7 +247,7 @@ __asm__ __volatile__("1: stq %r2,%1\n" \ | |||
247 | : "=r"(__pu_err) \ | 247 | : "=r"(__pu_err) \ |
248 | : "m" (__m(addr)), "rJ" (x), "0"(__pu_err)) | 248 | : "m" (__m(addr)), "rJ" (x), "0"(__pu_err)) |
249 | 249 | ||
250 | #define __put_user_32(x,addr) \ | 250 | #define __put_user_32(x, addr) \ |
251 | __asm__ __volatile__("1: stl %r2,%1\n" \ | 251 | __asm__ __volatile__("1: stl %r2,%1\n" \ |
252 | "2:\n" \ | 252 | "2:\n" \ |
253 | ".section __ex_table,\"a\"\n" \ | 253 | ".section __ex_table,\"a\"\n" \ |
@@ -260,7 +260,7 @@ __asm__ __volatile__("1: stl %r2,%1\n" \ | |||
260 | #ifdef __alpha_bwx__ | 260 | #ifdef __alpha_bwx__ |
261 | /* Those lucky bastards with ev56 and later CPUs can do byte/word moves. */ | 261 | /* Those lucky bastards with ev56 and later CPUs can do byte/word moves. */ |
262 | 262 | ||
263 | #define __put_user_16(x,addr) \ | 263 | #define __put_user_16(x, addr) \ |
264 | __asm__ __volatile__("1: stw %r2,%1\n" \ | 264 | __asm__ __volatile__("1: stw %r2,%1\n" \ |
265 | "2:\n" \ | 265 | "2:\n" \ |
266 | ".section __ex_table,\"a\"\n" \ | 266 | ".section __ex_table,\"a\"\n" \ |
@@ -270,7 +270,7 @@ __asm__ __volatile__("1: stw %r2,%1\n" \ | |||
270 | : "=r"(__pu_err) \ | 270 | : "=r"(__pu_err) \ |
271 | : "m"(__m(addr)), "rJ"(x), "0"(__pu_err)) | 271 | : "m"(__m(addr)), "rJ"(x), "0"(__pu_err)) |
272 | 272 | ||
273 | #define __put_user_8(x,addr) \ | 273 | #define __put_user_8(x, addr) \ |
274 | __asm__ __volatile__("1: stb %r2,%1\n" \ | 274 | __asm__ __volatile__("1: stb %r2,%1\n" \ |
275 | "2:\n" \ | 275 | "2:\n" \ |
276 | ".section __ex_table,\"a\"\n" \ | 276 | ".section __ex_table,\"a\"\n" \ |
@@ -283,7 +283,7 @@ __asm__ __volatile__("1: stb %r2,%1\n" \ | |||
283 | /* Unfortunately, we can't get an unaligned access trap for the sub-word | 283 | /* Unfortunately, we can't get an unaligned access trap for the sub-word |
284 | write, so we have to do a general unaligned operation. */ | 284 | write, so we have to do a general unaligned operation. */ |
285 | 285 | ||
286 | #define __put_user_16(x,addr) \ | 286 | #define __put_user_16(x, addr) \ |
287 | { \ | 287 | { \ |
288 | long __pu_tmp1, __pu_tmp2, __pu_tmp3, __pu_tmp4; \ | 288 | long __pu_tmp1, __pu_tmp2, __pu_tmp3, __pu_tmp4; \ |
289 | __asm__ __volatile__( \ | 289 | __asm__ __volatile__( \ |
@@ -308,13 +308,13 @@ __asm__ __volatile__("1: stb %r2,%1\n" \ | |||
308 | " .long 4b - .\n" \ | 308 | " .long 4b - .\n" \ |
309 | " lda $31, 5b-4b(%0)\n" \ | 309 | " lda $31, 5b-4b(%0)\n" \ |
310 | ".previous" \ | 310 | ".previous" \ |
311 | : "=r"(__pu_err), "=&r"(__pu_tmp1), \ | 311 | : "=r"(__pu_err), "=&r"(__pu_tmp1), \ |
312 | "=&r"(__pu_tmp2), "=&r"(__pu_tmp3), \ | 312 | "=&r"(__pu_tmp2), "=&r"(__pu_tmp3), \ |
313 | "=&r"(__pu_tmp4) \ | 313 | "=&r"(__pu_tmp4) \ |
314 | : "r"(addr), "r"((unsigned long)(x)), "0"(__pu_err)); \ | 314 | : "r"(addr), "r"((unsigned long)(x)), "0"(__pu_err)); \ |
315 | } | 315 | } |
316 | 316 | ||
317 | #define __put_user_8(x,addr) \ | 317 | #define __put_user_8(x, addr) \ |
318 | { \ | 318 | { \ |
319 | long __pu_tmp1, __pu_tmp2; \ | 319 | long __pu_tmp1, __pu_tmp2; \ |
320 | __asm__ __volatile__( \ | 320 | __asm__ __volatile__( \ |
@@ -330,7 +330,7 @@ __asm__ __volatile__("1: stb %r2,%1\n" \ | |||
330 | " .long 2b - .\n" \ | 330 | " .long 2b - .\n" \ |
331 | " lda $31, 3b-2b(%0)\n" \ | 331 | " lda $31, 3b-2b(%0)\n" \ |
332 | ".previous" \ | 332 | ".previous" \ |
333 | : "=r"(__pu_err), \ | 333 | : "=r"(__pu_err), \ |
334 | "=&r"(__pu_tmp1), "=&r"(__pu_tmp2) \ | 334 | "=&r"(__pu_tmp1), "=&r"(__pu_tmp2) \ |
335 | : "r"((unsigned long)(x)), "r"(addr), "0"(__pu_err)); \ | 335 | : "r"((unsigned long)(x)), "r"(addr), "0"(__pu_err)); \ |
336 | } | 336 | } |
@@ -366,7 +366,7 @@ __copy_tofrom_user_nocheck(void *to, const void *from, long len) | |||
366 | : "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to) | 366 | : "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to) |
367 | : __module_address(__copy_user) | 367 | : __module_address(__copy_user) |
368 | "0" (__cu_len), "1" (__cu_from), "2" (__cu_to) | 368 | "0" (__cu_len), "1" (__cu_from), "2" (__cu_to) |
369 | : "$1","$2","$3","$4","$5","$28","memory"); | 369 | : "$1", "$2", "$3", "$4", "$5", "$28", "memory"); |
370 | 370 | ||
371 | return __cu_len; | 371 | return __cu_len; |
372 | } | 372 | } |
@@ -379,15 +379,15 @@ __copy_tofrom_user(void *to, const void *from, long len, const void __user *vali | |||
379 | return len; | 379 | return len; |
380 | } | 380 | } |
381 | 381 | ||
382 | #define __copy_to_user(to,from,n) \ | 382 | #define __copy_to_user(to, from, n) \ |
383 | ({ \ | 383 | ({ \ |
384 | __chk_user_ptr(to); \ | 384 | __chk_user_ptr(to); \ |
385 | __copy_tofrom_user_nocheck((__force void *)(to),(from),(n)); \ | 385 | __copy_tofrom_user_nocheck((__force void *)(to), (from), (n)); \ |
386 | }) | 386 | }) |
387 | #define __copy_from_user(to,from,n) \ | 387 | #define __copy_from_user(to, from, n) \ |
388 | ({ \ | 388 | ({ \ |
389 | __chk_user_ptr(from); \ | 389 | __chk_user_ptr(from); \ |
390 | __copy_tofrom_user_nocheck((to),(__force void *)(from),(n)); \ | 390 | __copy_tofrom_user_nocheck((to), (__force void *)(from), (n)); \ |
391 | }) | 391 | }) |
392 | 392 | ||
393 | #define __copy_to_user_inatomic __copy_to_user | 393 | #define __copy_to_user_inatomic __copy_to_user |
@@ -418,7 +418,7 @@ __clear_user(void __user *to, long len) | |||
418 | : "=r"(__cl_len), "=r"(__cl_to) | 418 | : "=r"(__cl_len), "=r"(__cl_to) |
419 | : __module_address(__do_clear_user) | 419 | : __module_address(__do_clear_user) |
420 | "0"(__cl_len), "1"(__cl_to) | 420 | "0"(__cl_len), "1"(__cl_to) |
421 | : "$1","$2","$3","$4","$5","$28","memory"); | 421 | : "$1", "$2", "$3", "$4", "$5", "$28", "memory"); |
422 | return __cl_len; | 422 | return __cl_len; |
423 | } | 423 | } |
424 | 424 | ||