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

netfilter: expect: Simplify the allocation of slab caches in nf_conntrack_expect_init

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
aa23cfe6 b0117d13

+1 -3
+1 -3
net/netfilter/nf_conntrack_expect.c
··· 722 722 nf_ct_expect_hsize = 1; 723 723 } 724 724 nf_ct_expect_max = nf_ct_expect_hsize * 4; 725 - nf_ct_expect_cachep = kmem_cache_create("nf_conntrack_expect", 726 - sizeof(struct nf_conntrack_expect), 727 - 0, 0, NULL); 725 + nf_ct_expect_cachep = KMEM_CACHE(nf_conntrack_expect, 0); 728 726 if (!nf_ct_expect_cachep) 729 727 return -ENOMEM; 730 728