From: Thierry Reding <thierry.reding@gmail•com>
To: Joerg Roedel <joro@8bytes•org>
Cc: Jean-Philippe Brucker <jean-philippe@linaro•org>,
Will Deacon <will@kernel•org>,
linux-kernel@vger•kernel.org,
virtualization@lists•linux-foundation.org,
iommu@lists•linux-foundation.org,
Robin Murphy <robin.murphy@arm•com>,
David Woodhouse <dwmw2@infradead•org>,
linux-arm-kernel@lists•infradead.org
Subject: [PATCH 5/5] iommu: virt: Use iommu_put_resv_regions_simple()
Date: Thu, 29 Aug 2019 13:17:52 +0200 [thread overview]
Message-ID: <20190829111752.17513-6-thierry.reding@gmail.com> (raw)
In-Reply-To: <20190829111752.17513-1-thierry.reding@gmail.com>
From: Thierry Reding <treding@nvidia•com>
Use the new standard function instead of open-coding it.
Cc: Jean-Philippe Brucker <jean-philippe@linaro•org>
Cc: virtualization@lists•linux-foundation.org
Signed-off-by: Thierry Reding <treding@nvidia•com>
---
drivers/iommu/virtio-iommu.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
index 3ea9d7682999..bc3c7ab7f996 100644
--- a/drivers/iommu/virtio-iommu.c
+++ b/drivers/iommu/virtio-iommu.c
@@ -838,14 +838,6 @@ static void viommu_get_resv_regions(struct device *dev, struct list_head *head)
iommu_dma_get_resv_regions(dev, head);
}
-static void viommu_put_resv_regions(struct device *dev, struct list_head *head)
-{
- struct iommu_resv_region *entry, *next;
-
- list_for_each_entry_safe(entry, next, head, list)
- kfree(entry);
-}
-
static struct iommu_ops viommu_ops;
static struct virtio_driver virtio_iommu_drv;
@@ -915,7 +907,7 @@ static int viommu_add_device(struct device *dev)
err_unlink_dev:
iommu_device_unlink(&viommu->iommu, dev);
err_free_dev:
- viommu_put_resv_regions(dev, &vdev->resv_regions);
+ iommu_put_resv_regions_simple(dev, &vdev->resv_regions);
kfree(vdev);
return ret;
@@ -933,7 +925,7 @@ static void viommu_remove_device(struct device *dev)
iommu_group_remove_device(dev);
iommu_device_unlink(&vdev->viommu->iommu, dev);
- viommu_put_resv_regions(dev, &vdev->resv_regions);
+ iommu_put_resv_regions_simple(dev, &vdev->resv_regions);
kfree(vdev);
}
@@ -962,7 +954,7 @@ static struct iommu_ops viommu_ops = {
.remove_device = viommu_remove_device,
.device_group = viommu_device_group,
.get_resv_regions = viommu_get_resv_regions,
- .put_resv_regions = viommu_put_resv_regions,
+ .put_resv_regions = iommu_put_resv_regions_simple,
.of_xlate = viommu_of_xlate,
};
--
2.22.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-08-29 11:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 11:17 [PATCH 0/5] iommu: Implement iommu_put_resv_regions_simple() Thierry Reding
2019-08-29 11:17 ` [PATCH 1/5] " Thierry Reding
2019-09-18 15:37 ` Will Deacon
2019-10-16 12:46 ` Thierry Reding
2019-08-29 11:17 ` [PATCH 2/5] iommu: arm: Use iommu_put_resv_regions_simple() Thierry Reding
2019-08-29 11:17 ` [PATCH 3/5] iommu: amd: " Thierry Reding
2019-08-29 11:17 ` [PATCH 4/5] iommu: intel: " Thierry Reding
2019-08-29 11:17 ` Thierry Reding [this message]
2019-09-03 6:54 ` [PATCH 5/5] iommu: virt: " Christoph Hellwig
2019-09-16 9:14 ` [PATCH 0/5] iommu: Implement iommu_put_resv_regions_simple() Auger Eric
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190829111752.17513-6-thierry.reding@gmail.com \
--to=thierry.reding@gmail$(echo .)com \
--cc=dwmw2@infradead$(echo .)org \
--cc=iommu@lists$(echo .)linux-foundation.org \
--cc=jean-philippe@linaro$(echo .)org \
--cc=joro@8bytes$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=robin.murphy@arm$(echo .)com \
--cc=virtualization@lists$(echo .)linux-foundation.org \
--cc=will@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox