mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] block: use KMEM_CACHE instead of kmem_cache_create
@ 2025-09-02  3:32 Longlong Xia
  2025-09-02  5:37 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Longlong Xia @ 2025-09-02  3:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, Longlong Xia

Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code.

Signed-off-by: Longlong Xia <xialonglong@kylinos.cn>
---
 block/bio-integrity-auto.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/block/bio-integrity-auto.c b/block/bio-integrity-auto.c
index 687952f63bbb..167cdc6f5920 100644
--- a/block/bio-integrity-auto.c
+++ b/block/bio-integrity-auto.c
@@ -203,9 +203,7 @@ void blk_flush_integrity(void)
 
 static int __init blk_integrity_auto_init(void)
 {
-	bid_slab = kmem_cache_create("bio_integrity_data",
-			sizeof(struct bio_integrity_data), 0,
-			SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL);
+	bid_slab = KMEM_CACHE(bio_integrity_data, SLAB_HWCACHE_ALIGN | SLAB_PANIC);
 
 	if (mempool_init_slab_pool(&bid_pool, BIO_POOL_SIZE, bid_slab))
 		panic("bio: can't create integrity pool\n");
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] block: use KMEM_CACHE instead of kmem_cache_create
  2025-09-02  3:32 [PATCH 1/1] block: use KMEM_CACHE instead of kmem_cache_create Longlong Xia
@ 2025-09-02  5:37 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2025-09-02  5:37 UTC (permalink / raw)
  To: Longlong Xia; +Cc: axboe, linux-block, linux-kernel

On Tue, Sep 02, 2025 at 11:32:41AM +0800, Longlong Xia wrote:
> Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code.

I don't see that this simplifies anything.  The only thing it does
is to add yet another magic macros that needs to be followed and it
adds and overly long line.

What problem are you trying to solve with this patch?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-02  5:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-02  3:32 [PATCH 1/1] block: use KMEM_CACHE instead of kmem_cache_create Longlong Xia
2025-09-02  5:37 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®