drm/i915: Move u64-to-ptr helpers to general header
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/21 drm/i915: Move u64-to-ptr helpers to general header
From: Leon Romanovsky <[email protected]>
The macro u64_to_ptr() and function ptr_to_u64() are useful enough to be part of general header, so move them there and allow RDMA subsystem reuse them.
--- drivers/gpu/drm/i915/i915_utils.h | 12 ++---------- include/linux/kernel.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_utils.h +2 -10
@@ -25,6 +25,8 @@#ifndef __I915_UTILS_H#define __I915_UTILS_H +#include <linux/kernel.h> +#undef WARN_ON/* Many gcc seem to no see through this and fall over :( */ #if 0
@@ -102,16 +104,6 @@ __T; \ }) -static inline u64 ptr_to_u64 (const void *ptr) -{ -return (uintptr_t )ptr; -} - -#define u64_to_ptr (T , x) ({ \ - typecheck(u64, x); \ - (T *)(uintptr_t)(x); \ -}) -#define __mask_next_bit (mask) ({ \ int __idx = ffs(mask) - 1; \ mask &= ~BIT(__idx); \
include/linux/kernel.h +12 -0
@@ -70,6 +70,18 @@*/ #define ARRAY_SIZE (arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) +static inline u64 ptr_to_u64 (const void *ptr) +{ +return (uintptr_t )ptr; +} + +#define u64_to_ptr (T , x) ( \ +{ \ + typecheck(u64, x); \ + (T *)(uintptr_t)(x); \ +} \ +) +#define u64_to_user_ptr (x) ( \ { \ typecheck(u64, x); \
--
2.14.3
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoting Leon Romanovsky (2018-05-03 16:36:55)
Quoted 7 lines
From: Leon Romanovsky <[email protected]>
The macro
u64_to_ptr()and functionptr_to_u64()are useful enough to be part of general header, so move them there and allow RDMA subsystem reuse them.Signed-off-by Leon Romanovsky <[email protected]>
Feel free to merge this through an appropriate tree, I guess you could get some acks from LKML.
Regards, Joonas
Quoted 59 lines
--- drivers/gpu/drm/i915/i915_utils.h | 12 ++---------- include/linux/kernel.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/i915_utils.h +2
-10@@ -25,6 +25,8 @@#ifndef __I915_UTILS_H#define __I915_UTILS_H +#include <linux/kernel.h> +#undef WARN_ON/* Many gcc seem to no see through this and fall over :( */ #if 0 @@ -102,16 +104,6 @@ __T; \ }) -static inline u64 ptr_to_u64 (const void *ptr) -{ -return (uintptr_t )ptr; -} - -#define u64_to_ptr (T , x) ({ \ - typecheck(u64, x); \ - (T *)(uintptr_t)(x); \ -}) -#define __mask_next_bit (mask) ({ \ int __idx = ffs(mask) - 1; \ mask &= ~BIT(__idx); \include/linux/kernel.h +12
-1@@ -70,6 +70,18 @@*/ #define ARRAY_SIZE (arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) +static inline u64 ptr_to_u64 (const void *ptr) +{ +return (uintptr_t )ptr; +} + +#define u64_to_ptr (T , x) ( \ +{ \ + typecheck(u64, x); \ + (T *)(uintptr_t)(x); \ +} \ +) +#define u64_to_user_ptr (x) ( \ { \ typecheck(u64, x); \ --
Quoted 2 lines
2.14.3
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 11 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
The macro
u64_to_ptr()and functionptr_to_u64()are useful enough to be part of general header, so move them there and allow RDMA subsystem reuse them.Signed-off-by Leon Romanovsky <[email protected]>--- drivers/gpu/drm/i915/i915_utils.h | 12 ++---------- include/linux/kernel.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 10 deletions(-)
This patch and the next one to kernel.h will need to be Ack'd be someone.. But I am not sure who.. AndrewM perhaps?
Jason
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines · Jason Gunthorpe
Quoted 6 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
The macro
u64_to_ptr()and functionptr_to_u64()are useful enough to be part of general header, so move them there and allow RDMA subsystem reuse them.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Leon Romanovsky <[email protected]>--- drivers/gpu/drm/i915/i915_utils.h | 12 ++---------- include/linux/kernel.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 10 deletions(-)This patch and the next one to
kernel.hwill need to be Ack'd be someone.. But I am not sure who.. AndrewM perhaps?
Why is that?
The kernel.h doesn't have explicit maintainer and is managed by community effort.
Thanks
Quoted 2 lines
Jason
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel