Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH v3] asm-generic: {get,put}_user ptr argument evaluate only 1 time | Date | Tue, 21 Jul 2015 15:06:13 +0100 |
| |
Yoshinori Sato <ysato@users.sourceforge.jp> wrote:
> #define get_user(x, ptr) \ > ({ \ > + uintptr_t __uip = (uintptr_t)(ptr); \
const?
> might_fault(); \ > - access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ > - __get_user(x, ptr) : \ > + access_ok(VERIFY_READ, __uip, sizeof(*ptr)) ? \ > + __get_user((x), (__typeof__(*ptr) *)__uip) : \ > -EFAULT; \ > })
Would it be better to use void* instead of uintptr_t?
David
| |