diff options
author | Kunwu Chan <chentao@kylinos.cn> | 2024-01-31 17:08:51 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-02-02 12:19:26 +0000 |
commit | 20ea9327c2fd545d6b96e998727bcd724290694d (patch) | |
tree | 61e5f59c86414127d7c944df7bc320ff2931ad09 | |
parent | 84f90efd5076525a581e3f923f6c86579f41e713 (diff) | |
download | linux-stable-20ea9327c2fd545d6b96e998727bcd724290694d.tar.gz linux-stable-20ea9327c2fd545d6b96e998727bcd724290694d.tar.bz2 linux-stable-20ea9327c2fd545d6b96e998727bcd724290694d.zip |
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>
-rw-r--r-- | net/dccp/ackvec.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c index c4bbac99740d..1cba001bb4c8 100644 --- a/net/dccp/ackvec.c +++ b/net/dccp/ackvec.c @@ -376,15 +376,11 @@ EXPORT_SYMBOL_GPL(dccp_ackvec_parsed_cleanup); int __init dccp_ackvec_init(void) { - dccp_ackvec_slab = kmem_cache_create("dccp_ackvec", - sizeof(struct dccp_ackvec), 0, - SLAB_HWCACHE_ALIGN, NULL); + dccp_ackvec_slab = KMEM_CACHE(dccp_ackvec, SLAB_HWCACHE_ALIGN); if (dccp_ackvec_slab == NULL) goto out_err; - dccp_ackvec_record_slab = kmem_cache_create("dccp_ackvec_record", - sizeof(struct dccp_ackvec_record), - 0, SLAB_HWCACHE_ALIGN, NULL); + dccp_ackvec_record_slab = KMEM_CACHE(dccp_ackvec_record, SLAB_HWCACHE_ALIGN); if (dccp_ackvec_record_slab == NULL) goto out_destroy_slab; |