From b9e122c80cd2e10fe18678c63db4717871ed31cf Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Fri, 23 Jun 2006 02:05:04 -0700 Subject: [PATCH] xtensa: remove verify_area macros verify_area() is still alive on xtensa in 2.6.17-rc3-git13 It would be nice to finally be rid of that function across the board. Signed-off-by: Chris Zankel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-xtensa/checksum.h | 3 +-- include/asm-xtensa/rwsem.h | 7 ++++++- include/asm-xtensa/uaccess.h | 34 ---------------------------------- 3 files changed, 7 insertions(+), 37 deletions(-) (limited to 'include/asm-xtensa') diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h index bdc00ae9be4..03114f8d1e1 100644 --- a/include/asm-xtensa/checksum.h +++ b/include/asm-xtensa/checksum.h @@ -43,8 +43,7 @@ asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, i * Note: when you get a NULL pointer exception here this means someone * passed in an incorrect kernel address to one of these functions. * - * If you use these functions directly please don't forget the - * verify_area(). + * If you use these functions directly please don't forget the access_ok(). */ static inline unsigned int csum_partial_copy_nocheck ( const char *src, char *dst, diff --git a/include/asm-xtensa/rwsem.h b/include/asm-xtensa/rwsem.h index 3c02b0e033f..abcd86dc5ab 100644 --- a/include/asm-xtensa/rwsem.h +++ b/include/asm-xtensa/rwsem.h @@ -172,4 +172,9 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) return atomic_add_return(delta, (atomic_t *)(&sem->count)); } -#endif /* _XTENSA_RWSEM_XADD_H */ +static inline int rwsem_is_locked(struct rw_semaphore *sem) +{ + return (sem->count != 0); +} + +#endif /* _XTENSA_RWSEM_H */ diff --git a/include/asm-xtensa/uaccess.h b/include/asm-xtensa/uaccess.h index 06a22b83ba1..88a64e1144d 100644 --- a/include/asm-xtensa/uaccess.h +++ b/include/asm-xtensa/uaccess.h @@ -154,35 +154,6 @@ .Laccess_ok_\@: .endm -/* - * verify_area determines whether a memory access is allowed. It's - * mostly an unnecessary wrapper for access_ok, but we provide it as a - * duplicate of the verify_area() C inline function below. See the - * equivalent C version below for clarity. - * - * On error, verify_area branches to a label indicated by parameter - * . This implies that the macro falls through to the next - * instruction on success. - * - * Note that we assume success is the common case, and we optimize the - * branch fall-through case on success. - * - * On Entry: - * register containing memory address - * register containing memory size - * temp register - * label to branch to on error; implies fall-through - * macro on success - * On Exit: - * preserved - * preserved - * destroyed - */ - .macro verify_area aa, as, at, sp, error - access_ok \at, \aa, \as, \sp, \error - .endm - - #else /* __ASSEMBLY__ not defined */ #include @@ -211,11 +182,6 @@ #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) -static inline int verify_area(int type, const void * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - /* * These are the main single-value transfer routines. They * automatically use the right size if we just have the right pointer -- cgit v1.2.3