* [PATCH 1/3] iommu: exynos: constify iommu_ops @ 2017-08-28 12:12 ` Arvind Yadav 2017-08-28 13:13 ` Marek Szyprowski 2017-08-30 13:14 ` Joerg Roedel 0 siblings, 2 replies; 3+ 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] 3+ messages in thread
* [PATCH 1/3] iommu: exynos: constify iommu_ops 2017-08-28 12:12 ` [PATCH 1/3] iommu: exynos: constify iommu_ops Arvind Yadav @ 2017-08-28 13:13 ` Marek Szyprowski 2017-08-30 13:14 ` Joerg Roedel 1 sibling, 0 replies; 3+ 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] 3+ messages in thread
* [PATCH 1/3] iommu: exynos: constify iommu_ops 2017-08-28 12:12 ` [PATCH 1/3] iommu: exynos: constify iommu_ops Arvind Yadav 2017-08-28 13:13 ` Marek Szyprowski @ 2017-08-30 13:14 ` Joerg Roedel 1 sibling, 0 replies; 3+ 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] 3+ messages in thread
end of thread, other threads:[~2017-08-30 13:14 UTC | newest]
Thread overview: 3+ 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 13:13 ` Marek Szyprowski
2017-08-30 13:14 ` Joerg Roedel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).