Skip to content

Commit d5f9142

Browse files
KunWuChanFlorian Westphal
authored andcommitted
ipvs: Simplify the allocation of ip_vs_conn slab caches
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan <[email protected]> Acked-by: Simon Horman <[email protected]> Signed-off-by: Florian Westphal <[email protected]>
1 parent 2ae6e9a commit d5f9142

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/netfilter/ipvs/ip_vs_conn.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,9 +1511,7 @@ int __init ip_vs_conn_init(void)
15111511
return -ENOMEM;
15121512

15131513
/* Allocate ip_vs_conn slab cache */
1514-
ip_vs_conn_cachep = kmem_cache_create("ip_vs_conn",
1515-
sizeof(struct ip_vs_conn), 0,
1516-
SLAB_HWCACHE_ALIGN, NULL);
1514+
ip_vs_conn_cachep = KMEM_CACHE(ip_vs_conn, SLAB_HWCACHE_ALIGN);
15171515
if (!ip_vs_conn_cachep) {
15181516
kvfree(ip_vs_conn_tab);
15191517
return -ENOMEM;

0 commit comments

Comments
 (0)