RE: [PATCH 2/3] iommu: mtk: constify iommu_ops
Hi Arvind, This patch looks lost. Could you help resend it after changing the title to "iommu/mediatek:xxx"? Thanks. On Fri, 2018-09-07 at 14:21 +0800, Yong Wu (吴勇) wrote: > From: Linux-mediatek [mailto:linux-mediatek-boun...@lists.infradead.org] On > Behalf Of Arvind Yadav > Sent: Monday, August 28, 2017 8:12 PM > To: m.szyprow...@samsung.com; j...@8bytes.org; kg...@kernel.org; > k...@kernel.org; matthias@gmail.com; gerald.schae...@de.ibm.com > Cc: iommu@lists.linux-foundation.org; linux-media...@lists.infradead.org; > linux-ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org > Subject: [PATCH 2/3] iommu: mtk: constify iommu_ops > > 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 . So mark the non-const structs as const. > > Signed-off-by: Arvind Yadav > --- > drivers/iommu/mtk_iommu.c| 4 ++-- > drivers/iommu/mtk_iommu_v1.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index > 91c6d36..eac99a3 100644 > --- a/drivers/iommu/mtk_iommu.c > +++ b/drivers/iommu/mtk_iommu.c > @@ -102,7 +102,7 @@ struct mtk_iommu_domain { > struct iommu_domain domain; > }; > > -static struct iommu_ops mtk_iommu_ops; > +static const struct iommu_ops mtk_iommu_ops; > > static struct mtk_iommu_domain *to_mtk_domain(struct iommu_domain *dom) { > @@ -437,7 +437,7 @@ static int mtk_iommu_of_xlate(struct device *dev, struct > of_phandle_args *args) > return iommu_fwspec_add_ids(dev, args->args, 1); } > > -static struct iommu_ops mtk_iommu_ops = { > +static const struct iommu_ops mtk_iommu_ops = { > .domain_alloc = mtk_iommu_domain_alloc, > .domain_free= mtk_iommu_domain_free, > .attach_dev = mtk_iommu_attach_device, > diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c > index bc1efbf..40b231f 100644 > --- a/drivers/iommu/mtk_iommu_v1.c > +++ b/drivers/iommu/mtk_iommu_v1.c > @@ -363,7 +363,7 @@ static phys_addr_t mtk_iommu_iova_to_phys(struct > iommu_domain *domain, > return pa; > } > > -static struct iommu_ops mtk_iommu_ops; > +static const struct iommu_ops mtk_iommu_ops; > > /* > * MTK generation one iommu HW only support one iommu domain, and all the > client @@ -536,7 +536,7 @@ static int mtk_iommu_hw_init(const struct > mtk_iommu_data *data) > return 0; > } > > -static struct iommu_ops mtk_iommu_ops = { > +static const struct iommu_ops mtk_iommu_ops = { > .domain_alloc = mtk_iommu_domain_alloc, > .domain_free= mtk_iommu_domain_free, > .attach_dev = mtk_iommu_attach_device, > -- > 1.9.1 > > > ___ > Linux-mediatek mailing list > linux-media...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH 2/3] iommu: mtk: constify iommu_ops
On Mon, Aug 28, 2017 at 05:42:26PM +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 . So mark the non-const > structs as const. > > Signed-off-by: Arvind Yadav > --- > drivers/iommu/mtk_iommu.c| 4 ++-- > drivers/iommu/mtk_iommu_v1.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) This doesn't apply cleanly to the arm/mediatek branch in the iommu-tree. Please rebase it against that branch and update the subject to: iommu/mediatek: Constify iommu_ops to match the convention used in the iommu-tree and send it again. Thanks, Joerg ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: FW: [PATCH 2/3] iommu: mtk: constify iommu_ops
> From: Linux-mediatek [mailto:linux-mediatek-boun...@lists.infradead.org] On > Behalf Of Arvind Yadav > Sent: Monday, August 28, 2017 8:12 PM > To: m.szyprow...@samsung.com; j...@8bytes.org; kg...@kernel.org; > k...@kernel.org; matthias@gmail.com; gerald.schae...@de.ibm.com > Cc: iommu@lists.linux-foundation.org; linux-media...@lists.infradead.org; > linux-ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org > Subject: [PATCH 2/3] iommu: mtk: constify iommu_ops > > 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 . So mark the non-const > structs as const. > > Signed-off-by: Arvind Yadav Thanks. Reviewed-by: Yong Wu nit, the title should be: iommu/mediatek:xxx Also, the file mtk_iommu.c may need rebase on[1]. [1]https://lists.linuxfoundation.org/pipermail/iommu/2017-August/023847.html ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[PATCH 2/3] iommu: mtk: constify iommu_ops
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 . So mark the non-const structs as const. Signed-off-by: Arvind Yadav --- drivers/iommu/mtk_iommu.c| 4 ++-- drivers/iommu/mtk_iommu_v1.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 91c6d36..eac99a3 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -102,7 +102,7 @@ struct mtk_iommu_domain { struct iommu_domain domain; }; -static struct iommu_ops mtk_iommu_ops; +static const struct iommu_ops mtk_iommu_ops; static struct mtk_iommu_domain *to_mtk_domain(struct iommu_domain *dom) { @@ -437,7 +437,7 @@ static int mtk_iommu_of_xlate(struct device *dev, struct of_phandle_args *args) return iommu_fwspec_add_ids(dev, args->args, 1); } -static struct iommu_ops mtk_iommu_ops = { +static const struct iommu_ops mtk_iommu_ops = { .domain_alloc = mtk_iommu_domain_alloc, .domain_free= mtk_iommu_domain_free, .attach_dev = mtk_iommu_attach_device, diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index bc1efbf..40b231f 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -363,7 +363,7 @@ static phys_addr_t mtk_iommu_iova_to_phys(struct iommu_domain *domain, return pa; } -static struct iommu_ops mtk_iommu_ops; +static const struct iommu_ops mtk_iommu_ops; /* * MTK generation one iommu HW only support one iommu domain, and all the client @@ -536,7 +536,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data) return 0; } -static struct iommu_ops mtk_iommu_ops = { +static const struct iommu_ops mtk_iommu_ops = { .domain_alloc = mtk_iommu_domain_alloc, .domain_free= mtk_iommu_domain_free, .attach_dev = mtk_iommu_attach_device, -- 1.9.1 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu