drm/amdgpu: Simplify the allocation of fence slab caches
authorKunwu Chan <chentao@kylinos.cn>
Wed, 21 Feb 2024 09:59:05 +0000 (17:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Feb 2024 15:28:19 +0000 (10:28 -0500)
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

index 70bff8cecfda7e20fd8fcb93ef1637894fcd3e02..10832b4704484b9d308beb47375240942dd93a0f 100644 (file)
@@ -61,9 +61,7 @@ static struct kmem_cache *amdgpu_fence_slab;
 
 int amdgpu_fence_slab_init(void)
 {
-       amdgpu_fence_slab = kmem_cache_create(
-               "amdgpu_fence", sizeof(struct amdgpu_fence), 0,
-               SLAB_HWCACHE_ALIGN, NULL);
+       amdgpu_fence_slab = KMEM_CACHE(amdgpu_fence, SLAB_HWCACHE_ALIGN);
        if (!amdgpu_fence_slab)
                return -ENOMEM;
        return 0;