netfilter: nf_conncount: Use KMEM_CACHE instead of kmem_cache_create()
authorKunwu Chan <chentao@kylinos.cn>
Tue, 23 Jan 2024 02:46:31 +0000 (10:46 +0800)
committerFlorian Westphal <fw@strlen.de>
Mon, 29 Jan 2024 14:43:20 +0000 (15:43 +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_conncount.c

index 5d8ed6c90b7ef4c1cad1555e86c600302b77bcec..8715617b02fe674ea11fc284f83409ae77bac164 100644 (file)
@@ -605,15 +605,11 @@ static int __init nf_conncount_modinit(void)
        for (i = 0; i < CONNCOUNT_SLOTS; ++i)
                spin_lock_init(&nf_conncount_locks[i]);
 
-       conncount_conn_cachep = kmem_cache_create("nf_conncount_tuple",
-                                          sizeof(struct nf_conncount_tuple),
-                                          0, 0, NULL);
+       conncount_conn_cachep = KMEM_CACHE(nf_conncount_tuple, 0);
        if (!conncount_conn_cachep)
                return -ENOMEM;
 
-       conncount_rb_cachep = kmem_cache_create("nf_conncount_rb",
-                                          sizeof(struct nf_conncount_rb),
-                                          0, 0, NULL);
+       conncount_rb_cachep = KMEM_CACHE(nf_conncount_rb, 0);
        if (!conncount_rb_cachep) {
                kmem_cache_destroy(conncount_conn_cachep);
                return -ENOMEM;