Commit 533ab223 authored by Linus Torvalds's avatar Linus Torvalds

x86: make the masked_user_access_begin() macro use its argument only once

This doesn't actually matter for any of the current users, but before
merging it mainline, make sure we don't have any surprising semantics.

We don't actually want to use an inline function here, because we want
to allow - but not require - const pointer arguments, and return them as
such.  But we already had a local auto-type variable, so let's just use
it to avoid any possible double evaluation.
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 05f42162
......@@ -60,7 +60,8 @@ static inline unsigned long __untagged_addr_remote(struct mm_struct *mm,
*/
#define mask_user_address(x) ((typeof(x))((long)(x)|((long)(x)>>63)))
#define masked_user_access_begin(x) ({ \
__auto_type __masked_ptr = mask_user_address(x); \
__auto_type __masked_ptr = (x); \
__masked_ptr = mask_user_address(__masked_ptr); \
__uaccess_begin(); __masked_ptr; })
/*
......
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