drivers: iommu: declare iommu_gather_ops structures as const
Subsystems (2)
cover drivers: iommu: declare iommu_gather_ops structures as const
Constify iommu_gather_ops structures and replace __initdata with __initconst where needed.
Bhumika Goyal (3):
drivers: iommu: arm-smmu: constify iommu_gather_ops structures
drivers: iommu: arm-smmu-v3: constify iommu_gather_ops structures
drivers: iommu: io-pgtable-arm: use const and __initconst for
iommu_gather_ops structures
drivers/iommu/arm-smmu-v3.c | 2 +- drivers/iommu/arm-smmu.c | 2 +- drivers/iommu/io-pgtable-arm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/3 drivers: iommu: arm-smmu: constify iommu_gather_ops structures
Check for iommu_gather_ops structures that are only stored in the tlb field of an io_pgtable_cfg structure. The tlb field is of type const struct iommu_gather_ops *, so iommu_gather_ops structures having this property can be declared as const.
--- drivers/iommu/arm-smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/arm-smmu.c +1 -1
@@ -640,7 +640,7 @@ static void arm_smmu_tlb_inv_range_nosync(unsigned long iova, size_t size, } } -static struct iommu_gather_ops arm_smmu_gather_ops = { +static const struct iommu_gather_ops arm_smmu_gather_ops = { .tlb_flush_all = arm_smmu_tlb_inv_context, .tlb_add_flush = arm_smmu_tlb_inv_range_nosync, .tlb_sync = arm_smmu_tlb_sync,
Signature · 1 line
1.9.1
PATCH 2/3 drivers: iommu: arm-smmu-v3: constify iommu_gather_ops structures
In reply to Bhumika GoyalCheck for iommu_gather_ops structures that are only stored in the tlb field of an io_pgtable_cfg structure. The tlb field is of type const struct iommu_gather_ops *, so iommu_gather_ops structures having this property can be declared as const.
--- drivers/iommu/arm-smmu-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/arm-smmu-v3.c +1 -1
@@ -1358,7 +1358,7 @@ static void arm_smmu_tlb_inv_range_nosync(unsigned long iova, size_t size, }while (size -= granule); } -static struct iommu_gather_ops arm_smmu_gather_ops = { +static const struct iommu_gather_ops arm_smmu_gather_ops = { .tlb_flush_all = arm_smmu_tlb_inv_context, .tlb_add_flush = arm_smmu_tlb_inv_range_nosync, .tlb_sync = arm_smmu_tlb_sync,
Signature · 1 line
1.9.1
PATCH 3/3 drivers: iommu: io-pgtable-arm: use const and __initconst for iommu_gather_ops structures
In reply to Bhumika GoyalCheck for iommu_gather_ops structures that are only stored in the tlb field of an io_pgtable_cfg structure. The tlb field is of type const struct iommu_gather_ops *, so iommu_gather_ops structures having this property can be declared as const. Also, replace __initdata with __initconst.
--- drivers/iommu/io-pgtable-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm.c +1 -1
@@ -916,7 +916,7 @@ static void dummy_tlb_sync(void *cookie)WARN_ON (cookie != cfg_cookie); } -static struct iommu_gather_ops dummy_tlb_ops__initdata = { +static const struct iommu_gather_ops dummy_tlb_ops__initconst = { .tlb_flush_all = dummy_tlb_flush_all, .tlb_add_flush = dummy_tlb_add_flush, .tlb_sync = dummy_tlb_sync,
Signature · 1 line
1.9.1
Re: [PATCH 3/3] drivers: iommu: io-pgtable-arm: use const and __initconst for iommu_gather_ops structures
Quoted 7 lines · Bhumika Goyal
Check for
iommu_gather_opsstructures that are only stored in the tlb field of anio_pgtable_cfgstructure. The tlb field is of type const structiommu_gather_ops*, soiommu_gather_opsstructures having this property can be declared as const. Also, replace__initdatawith__initconst.Signed-off-by Bhumika Goyal <[email protected]>
Quoted 21 lines
--- drivers/iommu/io-pgtable-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/io-pgtable-arm.c +1
-2@@ -916,7 +916,7 @@ static void dummy_tlb_sync(void *cookie)WARN_ON (cookie != cfg_cookie); } -static struct iommu_gather_ops dummy_tlb_ops__initdata = { +static const struct iommu_gather_ops dummy_tlb_ops__initconst = { .tlb_flush_all = dummy_tlb_flush_all, .tlb_add_flush = dummy_tlb_add_flush, .tlb_sync = dummy_tlb_sync, --1.9.1
Re: [PATCH 2/3] drivers: iommu: arm-smmu-v3: constify iommu_gather_ops structures
In reply to Bhumika GoyalQuoted 6 lines · Bhumika Goyal
Check for
iommu_gather_opsstructures that are only stored in the tlb field of anio_pgtable_cfgstructure. The tlb field is of type const structiommu_gather_ops*, soiommu_gather_opsstructures having this property can be declared as const.Signed-off-by Bhumika Goyal <[email protected]>
Quoted 21 lines
--- drivers/iommu/arm-smmu-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/arm-smmu-v3.c +1
-2@@ -1358,7 +1358,7 @@ static void arm_smmu_tlb_inv_range_nosync(unsigned long iova, size_t size, }while (size -= granule); } -static struct iommu_gather_ops arm_smmu_gather_ops = { +static const struct iommu_gather_ops arm_smmu_gather_ops = { .tlb_flush_all = arm_smmu_tlb_inv_context, .tlb_add_flush = arm_smmu_tlb_inv_range_nosync, .tlb_sync = arm_smmu_tlb_sync, --1.9.1
Re: [PATCH 1/3] drivers: iommu: arm-smmu: constify iommu_gather_ops structures
In reply to Bhumika GoyalQuoted 6 lines · Bhumika Goyal
Check for
iommu_gather_opsstructures that are only stored in the tlb field of anio_pgtable_cfgstructure. The tlb field is of type const structiommu_gather_ops*, soiommu_gather_opsstructures having this property can be declared as const.Signed-off-by Bhumika Goyal <[email protected]>
Quoted 21 lines
--- drivers/iommu/arm-smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/arm-smmu.c +1
-2@@ -640,7 +640,7 @@ static void arm_smmu_tlb_inv_range_nosync(unsigned long iova, size_t size, } } -static struct iommu_gather_ops arm_smmu_gather_ops = { +static const struct iommu_gather_ops arm_smmu_gather_ops = { .tlb_flush_all = arm_smmu_tlb_inv_context, .tlb_add_flush = arm_smmu_tlb_inv_range_nosync, .tlb_sync = arm_smmu_tlb_sync, --1.9.1