diff mbox

[1/3] iommu: exynos: constify iommu_ops

Message ID 1503922325-25905-1-git-send-email-arvind.yadav.cs@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Arvind Yadav Aug. 28, 2017, 12:12 p.m. UTC
iommu_ops are not supposed to change at runtime.
Functions 'iommu_device_set_ops' and 'bus_set_iommu' working with
const iommu_ops provided by <linux/iommu.h>. So mark the non-const
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Marek Szyprowski Aug. 28, 2017, 1:13 p.m. UTC | #1
Hi Arvind,

On 2017-08-28 14:12, Arvind Yadav wrote:
> iommu_ops are not supposed to change at runtime.
> Functions 'iommu_device_set_ops' and 'bus_set_iommu' working with
> const iommu_ops provided by <linux/iommu.h>. So mark the non-const
> structs as const.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>

I remember that in the past there were a reason for non-const iommu_ops 
in the
IOMMU API, but I hope it has been finally resolved.

> ---
>   drivers/iommu/exynos-iommu.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 2395478..a540016 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -569,7 +569,7 @@ static void sysmmu_tlb_invalidate_entry(struct sysmmu_drvdata *data,
>   	spin_unlock_irqrestore(&data->lock, flags);
>   }
>   
> -static struct iommu_ops exynos_iommu_ops;
> +static const struct iommu_ops exynos_iommu_ops;
>   
>   static int __init exynos_sysmmu_probe(struct platform_device *pdev)
>   {
> @@ -1323,7 +1323,7 @@ static int exynos_iommu_of_xlate(struct device *dev,
>   	return 0;
>   }
>   
> -static struct iommu_ops exynos_iommu_ops = {
> +static const struct iommu_ops exynos_iommu_ops = {
>   	.domain_alloc = exynos_iommu_domain_alloc,
>   	.domain_free = exynos_iommu_domain_free,
>   	.attach_dev = exynos_iommu_attach_device,

Best regards
Joerg Roedel Aug. 30, 2017, 1:14 p.m. UTC | #2
On Mon, Aug 28, 2017 at 05:42:05PM +0530, Arvind Yadav wrote:
> iommu_ops are not supposed to change at runtime.
> Functions 'iommu_device_set_ops' and 'bus_set_iommu' working with
> const iommu_ops provided by <linux/iommu.h>. So mark the non-const
> structs as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 2395478..a540016 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -569,7 +569,7 @@  static void sysmmu_tlb_invalidate_entry(struct sysmmu_drvdata *data,
 	spin_unlock_irqrestore(&data->lock, flags);
 }
 
-static struct iommu_ops exynos_iommu_ops;
+static const struct iommu_ops exynos_iommu_ops;
 
 static int __init exynos_sysmmu_probe(struct platform_device *pdev)
 {
@@ -1323,7 +1323,7 @@  static int exynos_iommu_of_xlate(struct device *dev,
 	return 0;
 }
 
-static struct iommu_ops exynos_iommu_ops = {
+static const struct iommu_ops exynos_iommu_ops = {
 	.domain_alloc = exynos_iommu_domain_alloc,
 	.domain_free = exynos_iommu_domain_free,
 	.attach_dev = exynos_iommu_attach_device,