audit: use KMEM_CACHE() instead of kmem_cache_create()
authorKunwu Chan <chentao@kylinos.cn>
Wed, 24 Jan 2024 06:02:24 +0000 (14:02 +0800)
committerPaul Moore <paul@paul-moore.com>
Thu, 25 Jan 2024 15:12:22 +0000 (10:12 -0500)
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>
[PM: subject line tweaks]
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/audit.c

index 9c8e5f732c4c79472883e1094e22ca469e43cdb4..e7a62ebbf4d1a96e5bf6f2b05bb5cb0fad180f62 100644 (file)
@@ -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);