2017-08-28 12:13:19

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/3] iommu: s390: constify iommu_ops

iommu_ops are not supposed to change at runtime.
Functions '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 <[email protected]>
---
drivers/iommu/s390-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c
index 8788640..400d75f 100644
--- a/drivers/iommu/s390-iommu.c
+++ b/drivers/iommu/s390-iommu.c
@@ -327,7 +327,7 @@ static size_t s390_iommu_unmap(struct iommu_domain *domain,
return size;
}

-static struct iommu_ops s390_iommu_ops = {
+static const struct iommu_ops s390_iommu_ops = {
.capable = s390_iommu_capable,
.domain_alloc = s390_domain_alloc,
.domain_free = s390_domain_free,
--
1.9.1


2017-08-28 15:55:04

by Gerald Schaefer

[permalink] [raw]
Subject: Re: [PATCH 3/3] iommu: s390: constify iommu_ops

On Mon, 28 Aug 2017 17:42:50 +0530
Arvind Yadav <[email protected]> wrote:

> iommu_ops are not supposed to change at runtime.
> Functions '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 <[email protected]>
> ---
> drivers/iommu/s390-iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Gerald Schaefer <[email protected]>

>
> diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c
> index 8788640..400d75f 100644
> --- a/drivers/iommu/s390-iommu.c
> +++ b/drivers/iommu/s390-iommu.c
> @@ -327,7 +327,7 @@ static size_t s390_iommu_unmap(struct iommu_domain *domain,
> return size;
> }
>
> -static struct iommu_ops s390_iommu_ops = {
> +static const struct iommu_ops s390_iommu_ops = {
> .capable = s390_iommu_capable,
> .domain_alloc = s390_domain_alloc,
> .domain_free = s390_domain_free,

2017-08-30 13:21:51

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH 3/3] iommu: s390: constify iommu_ops

On Mon, Aug 28, 2017 at 05:42:50PM +0530, Arvind Yadav wrote:
> iommu_ops are not supposed to change at runtime.
> Functions '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 <[email protected]>
> ---
> drivers/iommu/s390-iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.