Skip to content

Commit d6e9c96

Browse files
mwajdeczdanvet
authored andcommitted
drm/i915: Promote ptrdiff() to i915_utils.h
Generic helpers should be placed in i915_utils.h. Signed-off-by: Michal Wajdeczko <[email protected]> Signed-off-by: Matthew Brost <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 882be6e commit d6e9c96

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/gpu/drm/i915/i915_utils.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ __check_struct_size(size_t base, size_t arr, size_t count, size_t *size)
201201
__T; \
202202
})
203203

204+
static __always_inline ptrdiff_t ptrdiff(const void *a, const void *b)
205+
{
206+
return a - b;
207+
}
208+
204209
/*
205210
* container_of_user: Extract the superclass from a pointer to a member.
206211
*

drivers/gpu/drm/i915/i915_vma.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ static inline void i915_vma_put(struct i915_vma *vma)
146146
i915_gem_object_put(vma->obj);
147147
}
148148

149-
static __always_inline ptrdiff_t ptrdiff(const void *a, const void *b)
150-
{
151-
return a - b;
152-
}
153-
154149
static inline long
155150
i915_vma_compare(struct i915_vma *vma,
156151
struct i915_address_space *vm,

0 commit comments

Comments
 (0)