Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2321144rbb; Tue, 27 Feb 2024 19:41:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVuM7/DKHLLT31HkWfaJV/9cliWwQlPHJ48jjRcn3jmKaQSItFuUsB/07FHW8hy8jkt+NzF7OPJd+EDUoSRxjvGrjNyrYysRgXM53OqhA== X-Google-Smtp-Source: AGHT+IEw78730f3oHRQQD3C7PlCda6B416nnNzovyX7hQPPWdSgeRnfo6g6HQTlFVfItpT2JaKeg X-Received: by 2002:a81:e249:0:b0:607:8196:9d69 with SMTP id z9-20020a81e249000000b0060781969d69mr4156549ywl.30.1709091669086; Tue, 27 Feb 2024 19:41:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709091669; cv=pass; d=google.com; s=arc-20160816; b=Z06N1cRaLmHMftzD23gyAv6CqyKET/zo8y1Bs8C7TsNH0h8CpZLqbuQ31B/Cd3tizP LWOr1dyPjTCmBUnxICPwdaHgGKsUhnI3ElEzGnDlq81vfIh3cc//lDDOaN+dVZO+TbWN yAa6vZ2dlpdE5C16YESc5gp45xvrq5rJD4aOgX4s04UEmrNE5NSZFiU5f1wLNju2SrAe 974CZwLNxzdxI/XgENYiACcy5/fKG18lXAhh8H2W0VN4X1UATYqpv5C/42yDW9gpBLGq jJ72U9+sc04rUD/ls1mEuYF3/S49YeHbtvMGId/wSAEcWU0+IDTTi2pRHw+1wkizX8X1 PV7g== 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=VAvEIHJSg7JYdUqj4C55rzhtG4/daQXG27/aEQN0JLI=; fh=2P730UAIZMlxOMAjCvSmhjnnYdMNOTkMrSxhk21Sjp0=; b=rXaW4mWP2mIRo9fPVWAsI/OP1L5ewYcF4Y8hMhUWP6KQP/KLVnlF//zdwdnGZxnJj1 LMzr3M1s7kSM1obDi3LbN5c79ocTiE8QnNtmrSTj5ce5iEo8wIEzP15ZKGlprUznlwmC DbERzV7jzb5XTgbWPw32zTAKNxaZ6ZRwVPGY6rpRzlyBit2Aa9Cvu46qKjzDsC65LfqE vz85x+eTmBuavI5EF2Q3xBI+UB+rtUeAi5meOf46mDnDAoTXkIIgXFIgV79y0atSDMS2 PN8lD+s9ZtUh8kBccL+Ezxj/fS9mwF+TerBNfu7+vymsNXv+yKEEkn2x2e4t8s2xMxlD FfFQ==; 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-84457-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84457-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h191-20020a636cc8000000b005d8b7c3a00csi6580150pgc.145.2024.02.27.19.41.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 19:41:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84457-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-84457-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84457-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B18DEB287FD for ; Wed, 28 Feb 2024 03:01:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB5EB200B8; Wed, 28 Feb 2024 03:01:06 +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 03ACB1F945; Wed, 28 Feb 2024 03:01:02 +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=1709089266; cv=none; b=oakrje9af5z35a74/0ML18fz03mMHS83Sfnc1CD7XAgGNROTDcUZPFhqMgwLpyG2CX1+TMWvDB95M0scVcIJ2cVTIr3FQpqmX4XpuUMDhmpPU6S8g9yWF1pwQjZz1JzGSFU7sTaAc7E5502tDL8dHZz17wgRTJuuTxvUwcb2Jvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709089266; c=relaxed/simple; bh=LYAx6i2cOnkhf1XESQN7LgtJo9zHj/YnHlJ+pCyQkWU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=AcGpeQKRuH8H+uyHUBOeji8NwGgVzt6WsJCPk7HAyHbZV7Gf3YG1foeldnYv8t2MBV4HvVHHrK3dJ3f7PEklTPrA1p6RvTGtat4BruNFj/D4Pfdnceqr/CN38A3c55Euqavg6cVwaQdk8vFNvSr9Uck2YsN1DOTtW19wjGr6BPg= 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: 61f36a06ab6c4d4088c73fea239f1afd-20240228 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:2eea6bf1-5c20-4404-b771-0ed2897f1d65,IP:10, URL:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:20 X-CID-INFO: VERSION:1.1.37,REQID:2eea6bf1-5c20-4404-b771-0ed2897f1d65,IP:10,UR L:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:20 X-CID-META: VersionHash:6f543d0,CLOUDID:3fdae480-4f93-4875-95e7-8c66ea833d57,B ulkID:2402281101007PHTMKEX,BulkQuantity:0,Recheck:0,SF:66|24|17|19|44|102, TC:nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,RT: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 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_FSI,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD X-UUID: 61f36a06ab6c4d4088c73fea239f1afd-20240228 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 275689174; Wed, 28 Feb 2024 11:00:59 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 2E6EAE000EBD; Wed, 28 Feb 2024 11:00:59 +0800 (CST) X-ns-mid: postfix-65DEA1EA-976147471 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 254A8E000EBC; Wed, 28 Feb 2024 11:00:57 +0800 (CST) From: Kunwu Chan To: manivannan.sadhasivam@linaro.org Cc: mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH v2] bus: mhi: ep: Simplify the allocation of slab caches in mhi_ep_register_controller Date: Wed, 28 Feb 2024 11:00:56 +0800 Message-Id: <20240228030056.509994-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 Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan --- v2: - Simplify the allocations of mhi_ring_element slab caches --- drivers/bus/mhi/ep/main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c index 65fc1d738bec..795611482f16 100644 --- a/drivers/bus/mhi/ep/main.c +++ b/drivers/bus/mhi/ep/main.c @@ -1478,9 +1478,7 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl = *mhi_cntrl, goto err_free_ch; } =20 - mhi_cntrl->ev_ring_el_cache =3D kmem_cache_create("mhi_ep_event_ring_el= ", - sizeof(struct mhi_ring_element), 0, - SLAB_CACHE_DMA, NULL); + mhi_cntrl->ev_ring_el_cache =3D KMEM_CACHE(mhi_ring_element, SLAB_CACHE= _DMA); if (!mhi_cntrl->ev_ring_el_cache) { ret =3D -ENOMEM; goto err_free_cmd; @@ -1493,9 +1491,7 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl = *mhi_cntrl, goto err_destroy_ev_ring_el_cache; } =20 - mhi_cntrl->ring_item_cache =3D kmem_cache_create("mhi_ep_ring_item", - sizeof(struct mhi_ep_ring_item), 0, - 0, NULL); + mhi_cntrl->ring_item_cache =3D KMEM_CACHE(mhi_ep_ring_item, 0); if (!mhi_cntrl->ev_ring_el_cache) { ret =3D -ENOMEM; goto err_destroy_tre_buf_cache; --=20 2.39.2