Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1525159rdb; Wed, 31 Jan 2024 00:54:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIs52XUth4tzSeV9BWL/hpV+IU46edIG/Va4HKXNG9E8E2FVDtDj+vaKX5cQJqNvB80QV2 X-Received: by 2002:a05:6102:5cd:b0:46b:2f5d:c4d with SMTP id v13-20020a05610205cd00b0046b2f5d0c4dmr669636vsf.37.1706691292835; Wed, 31 Jan 2024 00:54:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706691292; cv=pass; d=google.com; s=arc-20160816; b=vWA0XBPqdh4TTCWoIvgZ0soYGfuoQLP0JXr3I7uNs+ZtcSB2RxOBDEAfF/0YedkaIz kcXgt91/+lO/EzBi6wXZwjl53yCVpULirc8UmQWF/YGTPxZiNasuIHWFmnqxGKj0hdJS yAOkCsaxvVPiwvmLpAhvRqFQk0ss3vHzp32It1q4yXCUsfUDCcWSn/D8UMNRqFcsMIVh dQSFyB+Hovpk3iK6y9OkWBe+U7uiYmigjGXhr5gFPSrUcR5qVlWgfFf6pzBBcsocwhHl ogjV2UKfGqpmwHOGN4KFyGXTUPsI/ZDgVgDm/vzEC9vmZnQK1tRf5BPbBA+YuOzkCMpP 9Fgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=Ya382KAe9UraDRrATFl8k2RBdzOTZVwid2Pi7mvM/1M=; fh=RDPXzIk4uAgMNmHw4MnHstJnjjNJZKVMfQRqlZITnZg=; b=TCsmEQBnTBiBBrHbFeeZLHVzWOpicuR4OoAZvPlJsga0/4SlMwm+ddomMvzd3g8j3f zNsPWzp5UVceqchXnPiTRY66oh3sI1jRWqwTAazlKPrQoEqk2ZXUGJXYNvquftmOv5um RiCoi0NaJTJxsh/LVE7Fs/WdnoqLuBBIFCsBwWeyOMV+LC5YVsC7oHBIiWLDsXA4HxHB mkyCCCPUJ9NFxClneVEu86Ge3uzu05UClgoYrinnD/9wBugt0eaAB8ZhuaoDrExCoSoh 5QnM+HYPX93MIJ5lTIMNiHhrOn4YwM8/dyXqM+cSSCjfz+qZ5qVOPy49WWFIcWrzna3C W1rg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-46056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46056-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCURTNjghYXkGnSJzeETHPKcBYsg+VvuZ8ehhL6L/LnExXxTzJIejUX8ZPHjxYm7RV2cuAd9VCPCMgsGrJMbSUxz7r93M5B3vt9DEVE+wA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p6-20020ad45f46000000b006816d1e04b2si11803368qvg.129.2024.01.31.00.54.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 00:54:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-46056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46056-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8F2931C27B19 for ; Wed, 31 Jan 2024 08:54:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4595B6994D; Wed, 31 Jan 2024 08:46:11 +0000 (UTC) Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09A3C69968; Wed, 31 Jan 2024 08:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706690770; cv=none; b=udLkXsKhcRsuw1ngQIaX9ufaqOz5vSc1JAosGAo/3R32VxXvbj6/PdD2+obQ4f2BOg/wY4W8hG9AG8EUBp/PR19lePrOWDIBKKhTmG62QMNGjINXq0tFKQLiB7sk3X4pPL09KFHu1mrkkw6QtUm5agaAXBEUPRp6WRAmFPjyiw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706690770; c=relaxed/simple; bh=C9y3ndyXZaoRbRNXMuMZ3OsYWUjmAu76jF09AJo+whE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YUHv2FL7qHPFTzrT5o0hA2UKVValyUZDXQA1sypjR6fc3iQR7FU6YDlVGIfMoGXw5Zj9vI5nBgO7eSo2h9iGhikHO0eHVG3/e2hGnFc7/s0b59H2G1MEL17AxvR/K7SCEKL3j94AMNDBcTTG+Tm38c5N8zlhEAl3nwLlJ8B57mk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: cae85ecc1fd4424483f295ce66f8324a-20240131 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:95ae698e-1567-481c-90aa-ee649a018903,IP:20, URL:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:30 X-CID-INFO: VERSION:1.1.35,REQID:95ae698e-1567-481c-90aa-ee649a018903,IP:20,UR L:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:30 X-CID-META: VersionHash:5d391d7,CLOUDID:baf7f47f-4f93-4875-95e7-8c66ea833d57,B ulkID:2401311645553AHGQ76V,BulkQuantity:0,Recheck:0,SF:66|38|24|17|19|44|1 02,TC:nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL :0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: cae85ecc1fd4424483f295ce66f8324a-20240131 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1902976999; Wed, 31 Jan 2024 16:45:52 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 1775FE000EB9; Wed, 31 Jan 2024 16:45:52 +0800 (CST) X-ns-mid: postfix-65BA08BF-893949752 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 4AA0BE000EB9; Wed, 31 Jan 2024 16:45:51 +0800 (CST) From: Kunwu Chan To: marcelo.leitner@gmail.com, lucien.xin@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH net-next] sctp: Simplify the allocation of slab caches Date: Wed, 31 Jan 2024 16:45:49 +0800 Message-Id: <20240131084549.142595-1-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 --- net/sctp/protocol.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 94c6dd53cd62..e849f368ed91 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -1495,17 +1495,11 @@ static __init int sctp_init(void) =20 /* Allocate bind_bucket and chunk caches. */ status =3D -ENOBUFS; - sctp_bucket_cachep =3D kmem_cache_create("sctp_bind_bucket", - sizeof(struct sctp_bind_bucket), - 0, SLAB_HWCACHE_ALIGN, - NULL); + sctp_bucket_cachep =3D KMEM_CACHE(sctp_bind_bucket, SLAB_HWCACHE_ALIGN)= ; if (!sctp_bucket_cachep) goto out; =20 - sctp_chunk_cachep =3D kmem_cache_create("sctp_chunk", - sizeof(struct sctp_chunk), - 0, SLAB_HWCACHE_ALIGN, - NULL); + sctp_chunk_cachep =3D KMEM_CACHE(sctp_chunk, SLAB_HWCACHE_ALIGN); if (!sctp_chunk_cachep) goto err_chunk_cachep; =20 --=20 2.39.2