public inbox for audit@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] audit: Use KMEM_CACHE instead of kmem_cache_create
@ 2024-01-24  6:02 Kunwu Chan
  2024-01-25 15:13 ` Paul Moore
  0 siblings, 1 reply; 2+ messages in thread
From: Kunwu Chan @ 2024-01-24  6:02 UTC (permalink / raw)
  To: paul, eparis; +Cc: audit, 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>
---
 kernel/audit.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index 9c8e5f732c4c..e7a62ebbf4d1 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1693,9 +1693,7 @@ static int __init audit_init(void)
 	if (audit_initialized == AUDIT_DISABLED)
 		return 0;
 
-	audit_buffer_cache = kmem_cache_create("audit_buffer",
-					       sizeof(struct audit_buffer),
-					       0, SLAB_PANIC, NULL);
+	audit_buffer_cache = KMEM_CACHE(audit_buffer, SLAB_PANIC);
 
 	skb_queue_head_init(&audit_queue);
 	skb_queue_head_init(&audit_retry_queue);
-- 
2.39.2


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

* Re: [PATCH] audit: Use KMEM_CACHE instead of kmem_cache_create
  2024-01-24  6:02 [PATCH] audit: Use KMEM_CACHE instead of kmem_cache_create Kunwu Chan
@ 2024-01-25 15:13 ` Paul Moore
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Moore @ 2024-01-25 15:13 UTC (permalink / raw)
  To: Kunwu Chan, eparis; +Cc: audit, linux-kernel, Kunwu Chan

On Jan 24, 2024 Kunwu Chan <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>
> ---
>  kernel/audit.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Merged into audit/dev, thanks.

--
paul-moore.com

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

end of thread, other threads:[~2024-01-25 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24  6:02 [PATCH] audit: Use KMEM_CACHE instead of kmem_cache_create Kunwu Chan
2024-01-25 15:13 ` Paul Moore

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