netfilter: expect: Simplify the allocation of slab caches in nf_conntrack_expect_init
authorKunwu Chan <chentao@kylinos.cn>
Wed, 24 Jan 2024 08:15:38 +0000 (16:15 +0800)
committerFlorian Westphal <fw@strlen.de>
Wed, 21 Feb 2024 10:57:11 +0000 (11:57 +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: Florian Westphal <fw@strlen.de>
net/netfilter/nf_conntrack_expect.c

index 81ca348..21fa550 100644 (file)
@@ -722,9 +722,7 @@ int nf_conntrack_expect_init(void)
                        nf_ct_expect_hsize = 1;
        }
        nf_ct_expect_max = nf_ct_expect_hsize * 4;
-       nf_ct_expect_cachep = kmem_cache_create("nf_conntrack_expect",
-                               sizeof(struct nf_conntrack_expect),
-                               0, 0, NULL);
+       nf_ct_expect_cachep = KMEM_CACHE(nf_conntrack_expect, 0);
        if (!nf_ct_expect_cachep)
                return -ENOMEM;