All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>,
	joro@8bytes.org, kgene@kernel.org, krzk@kernel.org,
	matthias.bgg@gmail.com, gerald.schaefer@de.ibm.com
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH 1/3] iommu: exynos: constify iommu_ops
Date: Mon, 28 Aug 2017 15:13:43 +0200	[thread overview]
Message-ID: <18f05dd3-4305-e607-57bb-dea086481bb8@samsung.com> (raw)
In-Reply-To: <1503922325-25905-1-git-send-email-arvind.yadav.cs@gmail.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] iommu: exynos: constify iommu_ops
Date: Mon, 28 Aug 2017 15:13:43 +0200	[thread overview]
Message-ID: <18f05dd3-4305-e607-57bb-dea086481bb8@samsung.com> (raw)
In-Reply-To: <1503922325-25905-1-git-send-email-arvind.yadav.cs@gmail.com>

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

  reply	other threads:[~2017-08-28 13:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
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

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=18f05dd3-4305-e607-57bb-dea086481bb8@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.