* [PATCH net-next] net: dccp: Simplify the allocation of slab caches in dccp_ackvec_init
@ 2024-01-31 9:08 Kunwu Chan
2024-01-31 9:29 ` Jiri Pirko
2024-02-02 12:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Kunwu Chan @ 2024-01-31 9:08 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni; +Cc: dccp, netdev, linux-kernel, Kunwu Chan
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>
---
net/dccp/ackvec.c | 8 ++------
1 file 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;
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: dccp: Simplify the allocation of slab caches in dccp_ackvec_init
2024-01-31 9:08 [PATCH net-next] net: dccp: Simplify the allocation of slab caches in dccp_ackvec_init Kunwu Chan
@ 2024-01-31 9:29 ` Jiri Pirko
2024-02-02 12:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2024-01-31 9:29 UTC (permalink / raw)
To: Kunwu Chan; +Cc: davem, edumazet, kuba, pabeni, dccp, netdev, linux-kernel
Wed, Jan 31, 2024 at 10:08:51AM CET, chentao@kylinos.cn wrote:
>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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: dccp: Simplify the allocation of slab caches in dccp_ackvec_init
2024-01-31 9:08 [PATCH net-next] net: dccp: Simplify the allocation of slab caches in dccp_ackvec_init Kunwu Chan
2024-01-31 9:29 ` Jiri Pirko
@ 2024-02-02 12:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-02 12:20 UTC (permalink / raw)
To: Kunwu Chan; +Cc: davem, edumazet, kuba, pabeni, dccp, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Wed, 31 Jan 2024 17:08:51 +0800 you wrote:
> 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>
> ---
> net/dccp/ackvec.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
Here is the summary with links:
- [net-next] net: dccp: Simplify the allocation of slab caches in dccp_ackvec_init
https://git.kernel.org/netdev/net-next/c/20ea9327c2fd
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-02 12:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31 9:08 [PATCH net-next] net: dccp: Simplify the allocation of slab caches in dccp_ackvec_init Kunwu Chan
2024-01-31 9:29 ` Jiri Pirko
2024-02-02 12:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).