]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: uaccess: Formalise types for access_ok()
authorRobin Murphy <robin.murphy@arm.com>
Mon, 19 Feb 2018 13:38:00 +0000 (13:38 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 19 Feb 2018 13:59:58 +0000 (13:59 +0000)
commitdf842f346471878907996922f1774829d1784abf
tree1c93d515a8c65e8ce5f8a2afd46c8adc5832a226
parented7f6f759b6bec10c0119f651a0618d57dba3c3d
arm64: uaccess: Formalise types for access_ok()

In converting __range_ok() into a static inline, I inadvertently made
it more type-safe, but without considering the ordering of the relevant
conversions. This leads to quite a lot of Sparse noise about the fact
that we use __chk_user_ptr() after addr has already been converted from
a user pointer to an unsigned long.

Rather than just adding another cast for the sake of shutting Sparse up,
it seems reasonable to rework the types to make logical sense (although
the resulting codegen for __range_ok() remains identical). The only
callers this affects directly are our compat traps where the inferred
"user-pointer-ness" of a register value now warrants explicit casting.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/uaccess.h
arch/arm64/kernel/armv8_deprecated.c
arch/arm64/kernel/sys_compat.c