diff options
author | Andrzej Hajda <andrzej.hajda@intel.com> | 2022-12-09 13:14:59 +0100 |
---|---|---|
committer | Andi Shyti <andi.shyti@linux.intel.com> | 2022-12-13 16:16:23 +0100 |
commit | 89270d002b7440ec5c6e92f7cac524ab7954a016 (patch) | |
tree | 58481af809991c4f8e8c2bcc1dc3aa175b2d5119 /drivers/gpu/drm/i915/i915_utils.h | |
parent | drm/i915/selftests: exercise emit_pte() with nearly full ring (diff) | |
download | linux-89270d002b7440ec5c6e92f7cac524ab7954a016.tar.xz linux-89270d002b7440ec5c6e92f7cac524ab7954a016.zip |
drm/i915: remove struct_member macro
Since it is used only to get type of member it can be replaced
with typeof_member.
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221209121459.3496148-1-andrzej.hajda@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_utils.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_utils.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h index 6c14d13364bf..b64192d9c7da 100644 --- a/drivers/gpu/drm/i915/i915_utils.h +++ b/drivers/gpu/drm/i915/i915_utils.h @@ -149,8 +149,6 @@ bool i915_error_injected(void); #define page_pack_bits(ptr, bits) ptr_pack_bits(ptr, bits, PAGE_SHIFT) #define page_unpack_bits(ptr, bits) ptr_unpack_bits(ptr, bits, PAGE_SHIFT) -#define struct_member(T, member) (((T *)0)->member) - #define fetch_and_zero(ptr) ({ \ typeof(*ptr) __T = *(ptr); \ *(ptr) = (typeof(*ptr))0; \ @@ -170,7 +168,7 @@ static __always_inline ptrdiff_t ptrdiff(const void *a, const void *b) */ #define container_of_user(ptr, type, member) ({ \ void __user *__mptr = (void __user *)(ptr); \ - BUILD_BUG_ON_MSG(!__same_type(*(ptr), struct_member(type, member)) && \ + BUILD_BUG_ON_MSG(!__same_type(*(ptr), typeof_member(type, member)) && \ !__same_type(*(ptr), void), \ "pointer type mismatch in container_of()"); \ ((type __user *)(__mptr - offsetof(type, member))); }) |