ip6mr: Simplify the allocation of slab caches in ip6_mr_init
authorKunwu Chan <chentao@kylinos.cn>
Tue, 20 Feb 2024 07:36:43 +0000 (15:36 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Feb 2024 11:28:57 +0000 (11:28 +0000)
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
And change cache name from 'ip6_mrt_cache' to 'mfc6_cache'.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6mr.c

index 9782c180fee646ab0fad7f0f911254b4b3a592c4..1f19743f254064852139809143b60c1d397fe1d8 100644 (file)
@@ -1373,10 +1373,7 @@ int __init ip6_mr_init(void)
 {
        int err;
 
-       mrt_cachep = kmem_cache_create("ip6_mrt_cache",
-                                      sizeof(struct mfc6_cache),
-                                      0, SLAB_HWCACHE_ALIGN,
-                                      NULL);
+       mrt_cachep = KMEM_CACHE(mfc6_cache, SLAB_HWCACHE_ALIGN);
        if (!mrt_cachep)
                return -ENOMEM;