mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 01:31:44 +00:00
Blackfin: Add missing __user annotations to put_user
typeof() will not inherit the __user annotation so we have to explicitly specify this for '_p'. This fixes the following and quite a few similar warnings from spatch: kernel/sys.c:884:26: warning: incorrect type in initializer (different address spaces) kernel/sys.c:884:26: expected unsigned int *_p kernel/sys.c:884:26: got unsigned int [noderef] [usertype] <asn:1>*ruidp kernel/sys.c:885:26: warning: incorrect type in initializer (different address spaces) kernel/sys.c:885:26: expected unsigned int *_p kernel/sys.c:885:26: got unsigned int [noderef] [usertype] <asn:1>*euidp kernel/sys.c:886:26: warning: incorrect type in initializer (different address spaces) kernel/sys.c:886:26: expected unsigned int *_p kernel/sys.c:886:26: got unsigned int [noderef] [usertype] <asn:1>*suidp Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Bob Liu <lliubbo@gmail.com>
This commit is contained in:
parent
d95dcaa06b
commit
aff06631da
@ -89,7 +89,7 @@ struct exception_table_entry {
|
|||||||
({ \
|
({ \
|
||||||
int _err = 0; \
|
int _err = 0; \
|
||||||
typeof(*(p)) _x = (x); \
|
typeof(*(p)) _x = (x); \
|
||||||
typeof(*(p)) *_p = (p); \
|
typeof(*(p)) __user *_p = (p); \
|
||||||
if (!access_ok(VERIFY_WRITE, _p, sizeof(*(_p)))) {\
|
if (!access_ok(VERIFY_WRITE, _p, sizeof(*(_p)))) {\
|
||||||
_err = -EFAULT; \
|
_err = -EFAULT; \
|
||||||
} \
|
} \
|
||||||
@ -108,8 +108,8 @@ struct exception_table_entry {
|
|||||||
long _xl, _xh; \
|
long _xl, _xh; \
|
||||||
_xl = ((long *)&_x)[0]; \
|
_xl = ((long *)&_x)[0]; \
|
||||||
_xh = ((long *)&_x)[1]; \
|
_xh = ((long *)&_x)[1]; \
|
||||||
__put_user_asm(_xl, ((long *)_p)+0, ); \
|
__put_user_asm(_xl, ((long __user *)_p)+0, ); \
|
||||||
__put_user_asm(_xh, ((long *)_p)+1, ); \
|
__put_user_asm(_xh, ((long __user *)_p)+1, ); \
|
||||||
} break; \
|
} break; \
|
||||||
default: \
|
default: \
|
||||||
_err = __put_user_bad(); \
|
_err = __put_user_bad(); \
|
||||||
@ -136,7 +136,7 @@ static inline int bad_user_access_length(void)
|
|||||||
* aliasing issues.
|
* aliasing issues.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define __ptr(x) ((unsigned long *)(x))
|
#define __ptr(x) ((unsigned long __force *)(x))
|
||||||
|
|
||||||
#define __put_user_asm(x,p,bhw) \
|
#define __put_user_asm(x,p,bhw) \
|
||||||
__asm__ (#bhw"[%1] = %0;\n\t" \
|
__asm__ (#bhw"[%1] = %0;\n\t" \
|
||||||
|
Loading…
Reference in New Issue
Block a user