Skip to content

Commit 20ea932

Browse files
KunWuChandavem330
authored andcommitted
net: dccp: Simplify the allocation of slab caches in dccp_ackvec_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> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 84f90ef commit 20ea932

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

net/dccp/ackvec.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,11 @@ EXPORT_SYMBOL_GPL(dccp_ackvec_parsed_cleanup);
376376

377377
int __init dccp_ackvec_init(void)
378378
{
379-
dccp_ackvec_slab = kmem_cache_create("dccp_ackvec",
380-
sizeof(struct dccp_ackvec), 0,
381-
SLAB_HWCACHE_ALIGN, NULL);
379+
dccp_ackvec_slab = KMEM_CACHE(dccp_ackvec, SLAB_HWCACHE_ALIGN);
382380
if (dccp_ackvec_slab == NULL)
383381
goto out_err;
384382

385-
dccp_ackvec_record_slab = kmem_cache_create("dccp_ackvec_record",
386-
sizeof(struct dccp_ackvec_record),
387-
0, SLAB_HWCACHE_ALIGN, NULL);
383+
dccp_ackvec_record_slab = KMEM_CACHE(dccp_ackvec_record, SLAB_HWCACHE_ALIGN);
388384
if (dccp_ackvec_record_slab == NULL)
389385
goto out_destroy_slab;
390386

0 commit comments

Comments
 (0)