Commit 1476de6d authored by Kunwu Chan's avatar Kunwu Chan Committed by Steffen Klassert
Browse files

xfrm: Simplify the allocation of slab caches in xfrm_policy_init



commit 0a31bd5f ("KMEM_CACHE(): simplify slab cache creation")
introduces a new macro.
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Signed-off-by: default avatarKunwu Chan <chentao@kylinos.cn>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent ab1e1a38
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -4163,10 +4163,7 @@ static int __net_init xfrm_policy_init(struct net *net)
	int dir, err;

	if (net_eq(net, &init_net)) {
		xfrm_dst_cache = kmem_cache_create("xfrm_dst_cache",
					   sizeof(struct xfrm_dst),
					   0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
					   NULL);
		xfrm_dst_cache = KMEM_CACHE(xfrm_dst, SLAB_HWCACHE_ALIGN | SLAB_PANIC);
		err = rhashtable_init(&xfrm_policy_inexact_table,
				      &xfrm_pol_inexact_params);
		BUG_ON(err);