drm/amdgpu: Simplify the allocation of sync slab caches
authorKunwu Chan <chentao@kylinos.cn>
Wed, 21 Feb 2024 09:59:07 +0000 (17:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Feb 2024 17:05:16 +0000 (12:05 -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_sync.c

index 1b013a44ca99af7a51bee203b7f91c738b3500df..bdf1ef825d89631262d49f857c20a470669a2352 100644 (file)
@@ -441,9 +441,7 @@ void amdgpu_sync_free(struct amdgpu_sync *sync)
  */
 int amdgpu_sync_init(void)
 {
-       amdgpu_sync_slab = kmem_cache_create(
-               "amdgpu_sync", sizeof(struct amdgpu_sync_entry), 0,
-               SLAB_HWCACHE_ALIGN, NULL);
+       amdgpu_sync_slab = KMEM_CACHE(amdgpu_sync_entry, SLAB_HWCACHE_ALIGN);
        if (!amdgpu_sync_slab)
                return -ENOMEM;