summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorKunwu Chan <chentao@kylinos.cn>2024-01-23 10:46:31 +0800
committerFlorian Westphal <fw@strlen.de>2024-01-29 15:43:20 +0100
commit2ae6e9a03dadee5b2749d391d2e6df3056c5b6dd (patch)
tree29d81a97551a2e535c3c1d787b938cee232360cf /net/netfilter
parenta128885ace60ff3da326dab7208fd7a04ce0b138 (diff)
downloadlinux-2ae6e9a03dadee5b2749d391d2e6df3056c5b6dd.tar.gz
linux-2ae6e9a03dadee5b2749d391d2e6df3056c5b6dd.tar.bz2
linux-2ae6e9a03dadee5b2749d391d2e6df3056c5b6dd.zip
netfilter: nf_conncount: Use KMEM_CACHE instead of kmem_cache_create()
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>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_conncount.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c
index 5d8ed6c90b7e..8715617b02fe 100644
--- a/net/netfilter/nf_conncount.c
+++ b/net/netfilter/nf_conncount.c
@@ -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;