Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kunwu Chan and committed by
Florian Westphal
2ae6e9a0 a128885a

+2 -6
+2 -6
net/netfilter/nf_conncount.c
··· 605 605 for (i = 0; i < CONNCOUNT_SLOTS; ++i) 606 606 spin_lock_init(&nf_conncount_locks[i]); 607 607 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); 611 609 if (!conncount_conn_cachep) 612 610 return -ENOMEM; 613 611 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); 617 613 if (!conncount_rb_cachep) { 618 614 kmem_cache_destroy(conncount_conn_cachep); 619 615 return -ENOMEM;