]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/scheduler: Simplify the allocation of slab caches in drm_sched_fence_slab_init
authorKunwu Chan <chentao@kylinos.cn>
Wed, 21 Feb 2024 08:55:58 +0000 (16:55 +0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 28 Feb 2024 14:55:13 +0000 (15:55 +0100)
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
drivers/gpu/drm/scheduler/sched_fence.c

index 06cedfe4b4867a7c2d42622f7a143512e665d812..0f35f009b9d373491b20288da5f79c97f697b3f4 100644 (file)
@@ -33,9 +33,7 @@ static struct kmem_cache *sched_fence_slab;
 
 static int __init drm_sched_fence_slab_init(void)
 {
-       sched_fence_slab = kmem_cache_create(
-               "drm_sched_fence", sizeof(struct drm_sched_fence), 0,
-               SLAB_HWCACHE_ALIGN, NULL);
+       sched_fence_slab = KMEM_CACHE(drm_sched_fence, SLAB_HWCACHE_ALIGN);
        if (!sched_fence_slab)
                return -ENOMEM;