Skip to content

Commit 065c8ec

Browse files
KunWuChanRadxaStephen
authored andcommitted
drm/scheduler: Simplify the allocation of slab caches in drm_sched_fence_slab_init
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20240221085558.166774-1-chentao@kylinos.cn
1 parent f7848d6 commit 065c8ec

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/gpu/drm/scheduler/sched_fence.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ static struct kmem_cache *sched_fence_slab;
3333

3434
static int __init drm_sched_fence_slab_init(void)
3535
{
36-
sched_fence_slab = kmem_cache_create(
37-
"drm_sched_fence", sizeof(struct drm_sched_fence), 0,
38-
SLAB_HWCACHE_ALIGN, NULL);
36+
sched_fence_slab = KMEM_CACHE(drm_sched_fence, SLAB_HWCACHE_ALIGN);
3937
if (!sched_fence_slab)
4038
return -ENOMEM;
4139

0 commit comments

Comments
 (0)