summaryrefslogtreecommitdiff
path: root/net/xfrm
diff options
context:
space:
mode:
authorKunwu Chan <chentao@kylinos.cn>2024-01-30 16:14:11 +0800
committerSteffen Klassert <steffen.klassert@secunet.com>2024-02-09 06:48:04 +0100
commit1476de6d2b578673e20fb4cf654ff61cf2782873 (patch)
tree8f33ad8763c32b9940493fc5eab342f1a9615fc4 /net/xfrm
parentab1e1a38de240057ed108075abd1309c02e2a2a4 (diff)
xfrm: Simplify the allocation of slab caches in xfrm_policy_init
commit 0a31bd5f2bbb ("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: Kunwu Chan <chentao@kylinos.cn> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_policy.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index b4850a8f14ad..53b7ce4a4db0 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -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);