Commit 2350ebe2 authored by Russell King's avatar Russell King

ARM: uaccess: add further explanation of __range_ok()

Detail the success return condition, and that we rely on KERNEL_DS
being zero for this to operate correctly.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 6da5238f
...@@ -78,7 +78,11 @@ static inline void set_fs(mm_segment_t fs) ...@@ -78,7 +78,11 @@ static inline void set_fs(mm_segment_t fs)
#define segment_eq(a, b) ((a) == (b)) #define segment_eq(a, b) ((a) == (b))
/* We use 33-bit arithmetic here... */ /*
* We use 33-bit arithmetic here. Success returns zero, failure returns
* addr_limit. We take advantage that addr_limit will be zero for KERNEL_DS,
* so this will always return success in that case.
*/
#define __range_ok(addr, size) ({ \ #define __range_ok(addr, size) ({ \
unsigned long flag, roksum; \ unsigned long flag, roksum; \
__chk_user_ptr(addr); \ __chk_user_ptr(addr); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment