提交 bc179f08 编写于 作者: B Bhumika Goyal 提交者: Lucas Stach

drm/etnaviv: constify etnaviv_iommu_ops structures

Declare etnaviv_iommu_ops structure as const as it is only used when
the reference of one of its field is stored in the ops field of a
iommu_domain structure. This ops field is of type const, so
etnaviv_iommu_ops structures having similar properties can be declared
const too.

Done using Coccinelle.
Before and after size details of .o file remains the same after
cross compiling for arm architecture.

lst: Trimmed commit message, apply the same change to iommu_v2.
Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
上级 e17a0ded
...@@ -184,7 +184,7 @@ static void etnaviv_iommuv1_dump(struct iommu_domain *domain, void *buf) ...@@ -184,7 +184,7 @@ static void etnaviv_iommuv1_dump(struct iommu_domain *domain, void *buf)
memcpy(buf, etnaviv_domain->pgtable.pgtable, PT_SIZE); memcpy(buf, etnaviv_domain->pgtable.pgtable, PT_SIZE);
} }
static struct etnaviv_iommu_ops etnaviv_iommu_ops = { static const struct etnaviv_iommu_ops etnaviv_iommu_ops = {
.ops = { .ops = {
.domain_free = etnaviv_domain_free, .domain_free = etnaviv_domain_free,
.map = etnaviv_iommuv1_map, .map = etnaviv_iommuv1_map,
......
...@@ -229,7 +229,7 @@ static void etnaviv_iommuv2_dump(struct iommu_domain *domain, void *buf) ...@@ -229,7 +229,7 @@ static void etnaviv_iommuv2_dump(struct iommu_domain *domain, void *buf)
memcpy(buf, etnaviv_domain->stlb_cpu[i], SZ_4K); memcpy(buf, etnaviv_domain->stlb_cpu[i], SZ_4K);
} }
static struct etnaviv_iommu_ops etnaviv_iommu_ops = { static const struct etnaviv_iommu_ops etnaviv_iommu_ops = {
.ops = { .ops = {
.domain_free = etnaviv_iommuv2_domain_free, .domain_free = etnaviv_iommuv2_domain_free,
.map = etnaviv_iommuv2_map, .map = etnaviv_iommuv2_map,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册