Commit fa33b35f authored by Kunwu Chan's avatar Kunwu Chan Committed by David S. Miller
Browse files

sctp: Simplify the allocation of slab caches



commit 0a31bd5f ("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: default avatarKunwu Chan <chentao@kylinos.cn>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 49d703c8
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -1495,17 +1495,11 @@ static __init int sctp_init(void)

	/* Allocate bind_bucket and chunk caches. */
	status = -ENOBUFS;
	sctp_bucket_cachep = kmem_cache_create("sctp_bind_bucket",
					       sizeof(struct sctp_bind_bucket),
					       0, SLAB_HWCACHE_ALIGN,
					       NULL);
	sctp_bucket_cachep = KMEM_CACHE(sctp_bind_bucket, SLAB_HWCACHE_ALIGN);
	if (!sctp_bucket_cachep)
		goto out;

	sctp_chunk_cachep = kmem_cache_create("sctp_chunk",
					       sizeof(struct sctp_chunk),
					       0, SLAB_HWCACHE_ALIGN,
					       NULL);
	sctp_chunk_cachep = KMEM_CACHE(sctp_chunk, SLAB_HWCACHE_ALIGN);
	if (!sctp_chunk_cachep)
		goto err_chunk_cachep;