Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: bridge: Use KMEM_CACHE instead of kmem_cache_create

commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation")
introduces a new macro.
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>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20240130092536.73623-1-chentao@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kunwu Chan and committed by
Jakub Kicinski
2dc23b6f 57f2c635

+1 -4
+1 -4
net/bridge/br_fdb.c
··· 35 35 36 36 int __init br_fdb_init(void) 37 37 { 38 - br_fdb_cache = kmem_cache_create("bridge_fdb_cache", 39 - sizeof(struct net_bridge_fdb_entry), 40 - 0, 41 - SLAB_HWCACHE_ALIGN, NULL); 38 + br_fdb_cache = KMEM_CACHE(net_bridge_fdb_entry, SLAB_HWCACHE_ALIGN); 42 39 if (!br_fdb_cache) 43 40 return -ENOMEM; 44 41