Skip to content

Commit 2ae6e9a

Browse files
KunWuChanFlorian Westphal
authored andcommitted
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 <[email protected]> Signed-off-by: Florian Westphal <[email protected]>
1 parent a128885 commit 2ae6e9a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

net/netfilter/nf_conncount.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -605,15 +605,11 @@ static int __init nf_conncount_modinit(void)
605605
for (i = 0; i < CONNCOUNT_SLOTS; ++i)
606606
spin_lock_init(&nf_conncount_locks[i]);
607607

608-
conncount_conn_cachep = kmem_cache_create("nf_conncount_tuple",
609-
sizeof(struct nf_conncount_tuple),
610-
0, 0, NULL);
608+
conncount_conn_cachep = KMEM_CACHE(nf_conncount_tuple, 0);
611609
if (!conncount_conn_cachep)
612610
return -ENOMEM;
613611

614-
conncount_rb_cachep = kmem_cache_create("nf_conncount_rb",
615-
sizeof(struct nf_conncount_rb),
616-
0, 0, NULL);
612+
conncount_rb_cachep = KMEM_CACHE(nf_conncount_rb, 0);
617613
if (!conncount_rb_cachep) {
618614
kmem_cache_destroy(conncount_conn_cachep);
619615
return -ENOMEM;

0 commit comments

Comments
 (0)