public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Kunwu Chan <chentao@kylinos.cn>
To: dhowells@redhat.com, marc.dionne@auristor.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com
Cc: linux-afs@lists.infradead.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Kunwu Chan <chentao@kylinos.cn>
Subject: [PATCH net-next] rxrpc: Simplify the allocation of slab caches
Date: Thu,  1 Feb 2024 18:09:24 +0800	[thread overview]
Message-ID: <20240201100924.210298-1-chentao@kylinos.cn> (raw)

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/rxrpc/af_rxrpc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index 465bfe5eb061..1326a1bff2d7 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -1026,9 +1026,7 @@ static int __init af_rxrpc_init(void)
 
 	ret = -ENOMEM;
 	rxrpc_gen_version_string();
-	rxrpc_call_jar = kmem_cache_create(
-		"rxrpc_call_jar", sizeof(struct rxrpc_call), 0,
-		SLAB_HWCACHE_ALIGN, NULL);
+	rxrpc_call_jar = KMEM_CACHE(rxrpc_call,	SLAB_HWCACHE_ALIGN);
 	if (!rxrpc_call_jar) {
 		pr_notice("Failed to allocate call jar\n");
 		goto error_call_jar;
-- 
2.39.2


             reply	other threads:[~2024-02-01 10:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 10:09 Kunwu Chan [this message]
2024-02-01 12:47 ` [PATCH net-next] rxrpc: Simplify the allocation of slab caches Jiri Pirko
2024-02-01 15:38 ` [net-next] " Markus Elfring
     [not found] ` <1706866812511330.14.seg@mailgw>
2024-02-02  9:46   ` [PATCH net-next] " Kunwu Chan
2024-02-02 10:28     ` Jiri Pirko
2024-02-04  3:00       ` Kunwu Chan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240201100924.210298-1-chentao@kylinos.cn \
    --to=chentao@kylinos.cn \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox