]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: Simplify the allocation of mux_chunk slab caches
authorKunwu Chan <chentao@kylinos.cn>
Wed, 21 Feb 2024 09:59:06 +0000 (17:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Feb 2024 15:28:24 +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_ring_mux.c

index e1ee1c7117fb93024ddb17628a3f30824daba417..d234b7ccfaafcd5df30bae8c173f24e10d4fff6c 100644 (file)
@@ -159,9 +159,7 @@ int amdgpu_ring_mux_init(struct amdgpu_ring_mux *mux, struct amdgpu_ring *ring,
        mux->ring_entry_size = entry_size;
        mux->s_resubmit = false;
 
-       amdgpu_mux_chunk_slab = kmem_cache_create("amdgpu_mux_chunk",
-                                                 sizeof(struct amdgpu_mux_chunk), 0,
-                                                 SLAB_HWCACHE_ALIGN, NULL);
+       amdgpu_mux_chunk_slab = KMEM_CACHE(amdgpu_mux_chunk, SLAB_HWCACHE_ALIGN);
        if (!amdgpu_mux_chunk_slab) {
                DRM_ERROR("create amdgpu_mux_chunk cache failed\n");
                return -ENOMEM;