lkml.org 
[lkml]   [2015]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3] asm-generic: {get,put}_user ptr argument evaluate only 1 time
Date
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


\
 
 \ /
  Last update: 2015-07-21 16:21    [W:0.102 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site