All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] iommu: exynos: constify iommu_ops
@ 2017-08-28 12:12   ` Arvind Yadav
  0 siblings, 0 replies; 8+ messages in thread
From: Arvind Yadav @ 2017-08-28 12:12 UTC (permalink / raw)
  To: m.szyprowski, joro, kgene, krzk, matthias.bgg, gerald.schaefer
  Cc: linux-kernel, iommu, linux-arm-kernel, linux-samsung-soc

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(-)

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,
-- 
1.9.1

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

* [PATCH 1/3] iommu: exynos: constify iommu_ops
@ 2017-08-28 12:12   ` Arvind Yadav
  0 siblings, 0 replies; 8+ messages in thread
From: Arvind Yadav @ 2017-08-28 12:12 UTC (permalink / raw)
  To: m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ, joro-zLv9SwRftAIdnm+yROfE0A,
	kgene-DgEjT+Ai2ygdnm+yROfE0A, krzk-DgEjT+Ai2ygdnm+yROfE0A,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	gerald.schaefer-tA70FqPdS9bQT0dZR+AlfA
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 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,
-- 
1.9.1

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

* [PATCH 1/3] iommu: exynos: constify iommu_ops
@ 2017-08-28 12:12   ` Arvind Yadav
  0 siblings, 0 replies; 8+ messages in thread
From: Arvind Yadav @ 2017-08-28 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

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(-)

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,
-- 
1.9.1

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

* Re: [PATCH 1/3] iommu: exynos: constify iommu_ops
  2017-08-28 12:12   ` Arvind Yadav
@ 2017-08-28 13:13     ` Marek Szyprowski
  -1 siblings, 0 replies; 8+ messages in thread
From: Marek Szyprowski @ 2017-08-28 13:13 UTC (permalink / raw)
  To: Arvind Yadav, joro, kgene, krzk, matthias.bgg, gerald.schaefer
  Cc: linux-kernel, iommu, linux-arm-kernel, linux-samsung-soc

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
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* [PATCH 1/3] iommu: exynos: constify iommu_ops
@ 2017-08-28 13:13     ` Marek Szyprowski
  0 siblings, 0 replies; 8+ messages in thread
From: Marek Szyprowski @ 2017-08-28 13:13 UTC (permalink / raw)
  To: linux-arm-kernel

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
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* Re: [PATCH 1/3] iommu: exynos: constify iommu_ops
@ 2017-08-30 13:14     ` Joerg Roedel
  0 siblings, 0 replies; 8+ messages in thread
From: Joerg Roedel @ 2017-08-30 13:14 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: m.szyprowski, kgene, krzk, matthias.bgg, gerald.schaefer,
	linux-kernel, iommu, linux-arm-kernel, linux-samsung-soc

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.

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

* Re: [PATCH 1/3] iommu: exynos: constify iommu_ops
@ 2017-08-30 13:14     ` Joerg Roedel
  0 siblings, 0 replies; 8+ messages in thread
From: Joerg Roedel @ 2017-08-30 13:14 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, krzk-DgEjT+Ai2ygdnm+yROfE0A,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kgene-DgEjT+Ai2ygdnm+yROfE0A,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	gerald.schaefer-tA70FqPdS9bQT0dZR+AlfA

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

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

* [PATCH 1/3] iommu: exynos: constify iommu_ops
@ 2017-08-30 13:14     ` Joerg Roedel
  0 siblings, 0 replies; 8+ messages in thread
From: Joerg Roedel @ 2017-08-30 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

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.

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

end of thread, other threads:[~2017-08-30 13:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170828121232epcas2p49f8a17002f18d19b613b43ba38f71df9@epcas2p4.samsung.com>
2017-08-28 12:12 ` [PATCH 1/3] iommu: exynos: constify iommu_ops Arvind Yadav
2017-08-28 12:12   ` Arvind Yadav
2017-08-28 12:12   ` Arvind Yadav
2017-08-28 13:13   ` Marek Szyprowski
2017-08-28 13:13     ` Marek Szyprowski
2017-08-30 13:14   ` Joerg Roedel
2017-08-30 13:14     ` Joerg Roedel
2017-08-30 13:14     ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.