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

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
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -78,7 +78,11 @@ static inline void set_fs(mm_segment_t fs)

#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) ({ \
	unsigned long flag, roksum; \
	__chk_user_ptr(addr);	\