mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] iommu: use LIST_HEAD() for group_resv_regions initialization
@ 2026-01-14  5:53 Can Peng
  2026-01-14  6:52 ` Markus Elfring
  0 siblings, 1 reply; 2+ messages in thread
From: Can Peng @ 2026-01-14  5:53 UTC (permalink / raw)
  To: joro, will, robin.murphy, Markus.Elfring, vasant.hegde
  Cc: iommu, linux-kernel, Can Peng

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@kylinos.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@amd.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-14  6:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-14  5:53 [PATCH v3] iommu: use LIST_HEAD() for group_resv_regions initialization Can Peng
2026-01-14  6:52 ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®