Skip to content

Commit 455dae7

Browse files
arndbThomas Hellström
authored andcommitted
drm/xe: avoid function cast warnings
clang-16 warns about a cast between incompatible function types: drivers/gpu/drm/xe/xe_range_fence.c:155:10: error: cast from 'void (*)(const void *)' to 'void (*)(struct xe_range_fence *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 155 | .free = (void (*)(struct xe_range_fence *rfence)) kfree, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Avoid this with a trivial helper function that calls kfree() here. v2: - s/* rfence/*rfence/ (Thomas) Fixes: 845f64b ("drm/xe: Introduce a range-fence utility") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240213095719.454865-1-arnd@kernel.org (cherry picked from commit f2c9364) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 8cb92dc commit 455dae7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/gpu/drm/xe/xe_range_fence.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ xe_range_fence_tree_next(struct xe_range_fence *rfence, u64 start, u64 last)
151151
return xe_range_fence_tree_iter_next(rfence, start, last);
152152
}
153153

154+
static void xe_range_fence_free(struct xe_range_fence *rfence)
155+
{
156+
kfree(rfence);
157+
}
158+
154159
const struct xe_range_fence_ops xe_range_fence_kfree_ops = {
155-
.free = (void (*)(struct xe_range_fence *rfence)) kfree,
160+
.free = xe_range_fence_free,
156161
};

0 commit comments

Comments
 (0)