lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date: Tue, 27 Feb 2024 17:08:25 +0800
From: Cong Liu <liucong2@...inos.cn>
To: Joerg Roedel <joro@...tes.org>,
	Will Deacon <will@...nel.org>,
	Robin Murphy <robin.murphy@....com>
Cc: Cong Liu <liucong2@...inos.cn>,
	iommu@...ts.linux.dev,
	linux-kernel@...r.kernel.org
Subject: [PATCH] iommu/fsl_pamu: Simplify IOVA cache allocation with KMEM_CACHE() in fsl_pamu_domain.c

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Signed-off-by: Cong Liu <liucong2@...inos.cn>
---
 drivers/iommu/fsl_pamu_domain.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index e9d2bff4659b..61c47ecfe6b0 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -31,21 +31,13 @@ static struct fsl_dma_domain *to_fsl_dma_domain(struct iommu_domain *dom)
 
 static int __init iommu_init_mempool(void)
 {
-	fsl_pamu_domain_cache = kmem_cache_create("fsl_pamu_domain",
-						  sizeof(struct fsl_dma_domain),
-						  0,
-						  SLAB_HWCACHE_ALIGN,
-						  NULL);
+	fsl_pamu_domain_cache = KMEM_CACHE(fsl_dma_domain, SLAB_HWCACHE_ALIGN);
 	if (!fsl_pamu_domain_cache) {
 		pr_debug("Couldn't create fsl iommu_domain cache\n");
 		return -ENOMEM;
 	}
 
-	iommu_devinfo_cache = kmem_cache_create("iommu_devinfo",
-						sizeof(struct device_domain_info),
-						0,
-						SLAB_HWCACHE_ALIGN,
-						NULL);
+	iommu_devinfo_cache = KMEM_CACHE(device_domain_info, SLAB_HWCACHE_ALIGN);
 	if (!iommu_devinfo_cache) {
 		pr_debug("Couldn't create devinfo cache\n");
 		kmem_cache_destroy(fsl_pamu_domain_cache);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ