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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260114055320.399056-1-pengcan@kylinos.cn>
Date: Wed, 14 Jan 2026 13:53:20 +0800
From: Can Peng <pengcan@...inos.cn>
To: joro@...tes.org,
	will@...nel.org,
	robin.murphy@....com,
	Markus.Elfring@....de,
	vasant.hegde@....com
Cc: iommu@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Can Peng <pengcan@...inos.cn>
Subject: [PATCH v3] iommu: use LIST_HEAD() for group_resv_regions initialization

Replace the manual declaration and INIT_LIST_HEAD() call with the
LIST_HEAD() macro when initializing group_resv_regions in
iommu_group_show_resv_regions(). This simplifies the code and makes
the list initialization more concise.

No functional change intended.

Signed-off-by: Can Peng <pengcan@...inos.cn>
---
### Changes since v2:
- Rebased on top of iommu/next as requested by Vasant Hegde.
- Adjusted commit message to be shorter and clearer, following Markus Elfring's
  suggestion.
- Retained the LIST_HEAD() cleanup pattern consistently across the file.

### Notes on v2 discussion:
- V2 was reviewed positively:
  - Reviewed-by: Vasant Hegde <vasant.hegde@....com>
  Link: https://lore.kernel.org/all/4526ca31-71a4-4b3f-b378-32546eb8133d@amd.com/
- Markus Elfring suggested a shorter summary phrase and pointed out that
  Jörg Rödel had already applied the patch ("Applied, thanks." on 2026-01-10).
  Link: https://lore.kernel.org/lkml/stpavkxy3sbevk7zmt4kxyecqy5gc6phubvcfutbtnuk7vphlh@a7aimtvk423i/

Thanks everyone for the review and suggestions.

Best regards,
Can Peng

 drivers/iommu/iommu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 4926a43118e6..2f31527b3c62 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -957,10 +957,9 @@ static ssize_t iommu_group_show_resv_regions(struct iommu_group *group,
 					     char *buf)
 {
 	struct iommu_resv_region *region, *next;
-	struct list_head group_resv_regions;
+	LIST_HEAD(group_resv_regions);
 	int offset = 0;
 
-	INIT_LIST_HEAD(&group_resv_regions);
 	iommu_get_group_resv_regions(group, &group_resv_regions);
 
 	list_for_each_entry_safe(region, next, &group_resv_regions, list) {
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ