diff options
| author | Gustavo Padovan <[email protected]> | 2016-04-26 12:32:27 -0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2016-04-29 17:03:49 -0700 |
| commit | 3ed605bc8a0a688d8750a1e2eff39c854418c5cf (patch) | |
| tree | 323bdbf5c34309d04b56ba3222dff5b1ed286598 /include/linux | |
| parent | b5b7fe86668b4606ccd878a6c8a57f96247c5705 (diff) | |
kernel.h: add u64_to_user_ptr()
This function had copies in 3 different files. Unify them in kernel.h.
Cc: Joe Perches <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Rob Clark <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Acked-by: Daniel Vetter <[email protected]> [drm/i915/]
Acked-by: Rob Clark <[email protected]> [drm/msm/]
Acked-by: Lucas Stach <[email protected]> [drm/etinav/]
Acked-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kernel.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 2f7775e229b0..f3e45cb0b6a2 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -53,6 +53,13 @@ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) +#define u64_to_user_ptr(x) ( \ +{ \ + typecheck(u64, x); \ + (void __user *)(uintptr_t)x; \ +} \ +) + /* * This looks more complex than it should be. But we need to * get the type for the ~ right in round_down (it needs to be |