Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] Remove the __arch_* layer from uaccess.h

Back in the days when we had armo (26-bit) and armv (32-bit) combined,
we had an additional layer to the uaccess macros to ensure correct
typing. Since we no longer have 26-bit in this tree, we no longer
need this layer, so eliminate it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Russell King and committed by
Russell King
02fcb974 a39727f2

+31 -50
+5 -5
arch/arm/kernel/armksyms.c
··· 109 109 EXPORT_SYMBOL(__memzero); 110 110 111 111 /* user mem (segment) */ 112 - EXPORT_SYMBOL(__arch_copy_from_user); 113 - EXPORT_SYMBOL(__arch_copy_to_user); 114 - EXPORT_SYMBOL(__arch_clear_user); 115 - EXPORT_SYMBOL(__arch_strnlen_user); 116 - EXPORT_SYMBOL(__arch_strncpy_from_user); 112 + EXPORT_SYMBOL(__copy_from_user); 113 + EXPORT_SYMBOL(__copy_to_user); 114 + EXPORT_SYMBOL(__clear_user); 115 + EXPORT_SYMBOL(__strnlen_user); 116 + EXPORT_SYMBOL(__strncpy_from_user); 117 117 118 118 EXPORT_SYMBOL(__get_user_1); 119 119 EXPORT_SYMBOL(__get_user_2);
+2 -2
arch/arm/lib/clear_user.S
··· 12 12 13 13 .text 14 14 15 - /* Prototype: int __arch_clear_user(void *addr, size_t sz) 15 + /* Prototype: int __clear_user(void *addr, size_t sz) 16 16 * Purpose : clear some user memory 17 17 * Params : addr - user memory address to clear 18 18 * : sz - number of bytes to clear 19 19 * Returns : number of bytes NOT cleared 20 20 */ 21 - ENTRY(__arch_clear_user) 21 + ENTRY(__clear_user) 22 22 stmfd sp!, {r1, lr} 23 23 mov r2, #0 24 24 cmp r1, #4
+2 -2
arch/arm/lib/copy_from_user.S
··· 16 16 /* 17 17 * Prototype: 18 18 * 19 - * size_t __arch_copy_from_user(void *to, const void *from, size_t n) 19 + * size_t __copy_from_user(void *to, const void *from, size_t n) 20 20 * 21 21 * Purpose: 22 22 * ··· 83 83 84 84 .text 85 85 86 - ENTRY(__arch_copy_from_user) 86 + ENTRY(__copy_from_user) 87 87 88 88 #include "copy_template.S" 89 89
+2 -2
arch/arm/lib/copy_to_user.S
··· 16 16 /* 17 17 * Prototype: 18 18 * 19 - * size_t __arch_copy_to_user(void *to, const void *from, size_t n) 19 + * size_t __copy_to_user(void *to, const void *from, size_t n) 20 20 * 21 21 * Purpose: 22 22 * ··· 86 86 87 87 .text 88 88 89 - ENTRY(__arch_copy_to_user) 89 + ENTRY(__copy_to_user) 90 90 91 91 #include "copy_template.S" 92 92
+1 -1
arch/arm/lib/strncpy_from_user.S
··· 20 20 * returns the number of characters copied (strlen of copied string), 21 21 * -EFAULT on exception, or "len" if we fill the whole buffer 22 22 */ 23 - ENTRY(__arch_strncpy_from_user) 23 + ENTRY(__strncpy_from_user) 24 24 mov ip, r1 25 25 1: subs r2, r2, #1 26 26 USER( ldrplbt r3, [r1], #1)
+2 -2
arch/arm/lib/strnlen_user.S
··· 14 14 .text 15 15 .align 5 16 16 17 - /* Prototype: unsigned long __arch_strnlen_user(const char *str, long n) 17 + /* Prototype: unsigned long __strnlen_user(const char *str, long n) 18 18 * Purpose : get length of a string in user memory 19 19 * Params : str - address of string in user memory 20 20 * Returns : length of string *including terminator* 21 21 * or zero on exception, or n + 1 if too long 22 22 */ 23 - ENTRY(__arch_strnlen_user) 23 + ENTRY(__strnlen_user) 24 24 mov r2, r0 25 25 1: 26 26 USER( ldrbt r3, [r0], #1)
+4 -4
arch/arm/lib/uaccess.S
··· 19 19 20 20 #define PAGE_SHIFT 12 21 21 22 - /* Prototype: int __arch_copy_to_user(void *to, const char *from, size_t n) 22 + /* Prototype: int __copy_to_user(void *to, const char *from, size_t n) 23 23 * Purpose : copy a block to user memory from kernel memory 24 24 * Params : to - user memory 25 25 * : from - kernel memory ··· 39 39 sub r2, r2, ip 40 40 b .Lc2u_dest_aligned 41 41 42 - ENTRY(__arch_copy_to_user) 42 + ENTRY(__copy_to_user) 43 43 stmfd sp!, {r2, r4 - r7, lr} 44 44 cmp r2, #4 45 45 blt .Lc2u_not_enough ··· 283 283 9001: ldmfd sp!, {r0, r4 - r7, pc} 284 284 .previous 285 285 286 - /* Prototype: unsigned long __arch_copy_from_user(void *to,const void *from,unsigned long n); 286 + /* Prototype: unsigned long __copy_from_user(void *to,const void *from,unsigned long n); 287 287 * Purpose : copy a block from user memory to kernel memory 288 288 * Params : to - kernel memory 289 289 * : from - user memory ··· 302 302 sub r2, r2, ip 303 303 b .Lcfu_dest_aligned 304 304 305 - ENTRY(__arch_copy_from_user) 305 + ENTRY(__copy_from_user) 306 306 stmfd sp!, {r0, r2, r4 - r7, lr} 307 307 cmp r2, #4 308 308 blt .Lcfu_not_enough
+13 -32
include/asm-arm/uaccess.h
··· 353 353 : "r" (x), "i" (-EFAULT) \ 354 354 : "cc") 355 355 356 - extern unsigned long __arch_copy_from_user(void *to, const void __user *from, unsigned long n); 357 - extern unsigned long __arch_copy_to_user(void __user *to, const void *from, unsigned long n); 358 - extern unsigned long __arch_clear_user(void __user *addr, unsigned long n); 359 - extern unsigned long __arch_strncpy_from_user(char *to, const char __user *from, unsigned long count); 360 - extern unsigned long __arch_strnlen_user(const char __user *s, long n); 356 + 357 + extern unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n); 358 + extern unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n); 359 + extern unsigned long __clear_user(void __user *addr, unsigned long n); 360 + extern unsigned long __strncpy_from_user(char *to, const char __user *from, unsigned long count); 361 + extern unsigned long __strnlen_user(const char __user *s, long n); 361 362 362 363 static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) 363 364 { 364 365 if (access_ok(VERIFY_READ, from, n)) 365 - n = __arch_copy_from_user(to, from, n); 366 + n = __copy_from_user(to, from, n); 366 367 else /* security hole - plug it */ 367 368 memzero(to, n); 368 369 return n; 369 370 } 370 371 371 - static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) 372 - { 373 - return __arch_copy_from_user(to, from, n); 374 - } 375 - 376 372 static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) 377 373 { 378 374 if (access_ok(VERIFY_WRITE, to, n)) 379 - n = __arch_copy_to_user(to, from, n); 375 + n = __copy_to_user(to, from, n); 380 376 return n; 381 - } 382 - 383 - static inline unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n) 384 - { 385 - return __arch_copy_to_user(to, from, n); 386 377 } 387 378 388 379 #define __copy_to_user_inatomic __copy_to_user 389 380 #define __copy_from_user_inatomic __copy_from_user 390 381 391 - static inline unsigned long clear_user (void __user *to, unsigned long n) 382 + static inline unsigned long clear_user(void __user *to, unsigned long n) 392 383 { 393 384 if (access_ok(VERIFY_WRITE, to, n)) 394 - n = __arch_clear_user(to, n); 385 + n = __clear_user(to, n); 395 386 return n; 396 387 } 397 388 398 - static inline unsigned long __clear_user (void __user *to, unsigned long n) 399 - { 400 - return __arch_clear_user(to, n); 401 - } 402 - 403 - static inline long strncpy_from_user (char *dst, const char __user *src, long count) 389 + static inline long strncpy_from_user(char *dst, const char __user *src, long count) 404 390 { 405 391 long res = -EFAULT; 406 392 if (access_ok(VERIFY_READ, src, 1)) 407 - res = __arch_strncpy_from_user(dst, src, count); 393 + res = __strncpy_from_user(dst, src, count); 408 394 return res; 409 - } 410 - 411 - static inline long __strncpy_from_user (char *dst, const char __user *src, long count) 412 - { 413 - return __arch_strncpy_from_user(dst, src, count); 414 395 } 415 396 416 397 #define strlen_user(s) strnlen_user(s, ~0UL >> 1) ··· 401 420 unsigned long res = 0; 402 421 403 422 if (__addr_ok(s)) 404 - res = __arch_strnlen_user(s, n); 423 + res = __strnlen_user(s, n); 405 424 406 425 return res; 407 426 }