summaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/avtab.c
diff options
context:
space:
mode:
authorEric Suen <ericsu@linux.microsoft.com>2024-08-27 19:40:03 +0200
committerPaul Moore <paul@paul-moore.com>2024-08-28 00:42:27 +0200
commit4ad858bd6fbe21c563f177d499da5f99b4b2480e (patch)
tree437609c3b30f4212a01b050a54aee393bbb270f5 /security/selinux/ss/avtab.c
parentselinux: annotate false positive data race to avoid KCSAN warnings (diff)
downloadlinux-4ad858bd6fbe21c563f177d499da5f99b4b2480e.tar.xz
linux-4ad858bd6fbe21c563f177d499da5f99b4b2480e.zip
selinux: replace kmem_cache_create() with KMEM_CACHE()
Based on guidance in include/linux/slab.h, replace kmem_cache_create() with KMEM_CACHE() for sources under security/selinux to simplify creation of SLAB caches. Signed-off-by: Eric Suen <ericsu@linux.microsoft.com> [PM: minor grammar nits in the description] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/ss/avtab.c')
-rw-r--r--security/selinux/ss/avtab.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/security/selinux/ss/avtab.c b/security/selinux/ss/avtab.c
index 2ad98732d052..8e400dd736b7 100644
--- a/security/selinux/ss/avtab.c
+++ b/security/selinux/ss/avtab.c
@@ -604,9 +604,6 @@ int avtab_write(struct policydb *p, struct avtab *a, void *fp)
void __init avtab_cache_init(void)
{
- avtab_node_cachep = kmem_cache_create(
- "avtab_node", sizeof(struct avtab_node), 0, SLAB_PANIC, NULL);
- avtab_xperms_cachep = kmem_cache_create(
- "avtab_extended_perms", sizeof(struct avtab_extended_perms), 0,
- SLAB_PANIC, NULL);
+ avtab_node_cachep = KMEM_CACHE(avtab_node, SLAB_PANIC);
+ avtab_xperms_cachep = KMEM_CACHE(avtab_extended_perms, SLAB_PANIC);
}