The symbol "smmu" is declared and defined only in this compilation unit. It makes either no sense to pass it as a parameter to functions only used here (Wshadow was complaining), or it can be properly passed as parameter to preserve the generality of the accessor funcitons.
As there, fix sign-compare warnings. Signed-off-by: Andrea Bastoni <[email protected]> --- hypervisor/arch/arm64/smmu-v3.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/hypervisor/arch/arm64/smmu-v3.c b/hypervisor/arch/arm64/smmu-v3.c index 2f57868d..45b7186c 100644 --- a/hypervisor/arch/arm64/smmu-v3.c +++ b/hypervisor/arch/arm64/smmu-v3.c @@ -360,7 +360,9 @@ struct arm_smmu_device { struct arm_smmu_evtq evtq; unsigned int sid_bits; struct arm_smmu_strtab_cfg strtab_cfg; -} smmu[JAILHOUSE_MAX_IOMMU_UNITS]; +}; + +static struct arm_smmu_device the_smmu[JAILHOUSE_MAX_IOMMU_UNITS]; /* Low-level queue manipulation functions */ static bool queue_full(struct arm_smmu_queue *q) @@ -403,7 +405,7 @@ static void queue_inc_prod(struct arm_smmu_queue *q) static void queue_write(u64 *dst, u64 *src, u32 n_dwords) { - int i; + u32 i; for (i = 0; i < n_dwords; ++i) *dst++ = *src++; @@ -574,6 +576,7 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid, { struct paging_structures *pg_structs = &this_cell()->arch.mm; u64 val, vttbr; + (void)guest_ste; val = 0; @@ -1042,7 +1045,9 @@ static int arm_smmuv3_cell_init(struct cell *cell) { struct jailhouse_iommu *iommu; struct arm_smmu_cmdq_ent cmd; - int ret, i, j, sid; + int ret, sid; + unsigned int i,j; + struct arm_smmu_device *smmu = the_smmu; if (!iommu_count_units()) return 0; @@ -1071,7 +1076,9 @@ static void arm_smmuv3_cell_exit(struct cell *cell) { struct jailhouse_iommu *iommu; struct arm_smmu_cmdq_ent cmd; - int i, j, sid; + int sid; + unsigned int i,j; + struct arm_smmu_device *smmu = the_smmu; if (!iommu_count_units()) return; @@ -1095,7 +1102,9 @@ static void arm_smmuv3_cell_exit(struct cell *cell) static int arm_smmuv3_init(void) { struct jailhouse_iommu *iommu; - int ret, i; + int ret; + unsigned int i; + struct arm_smmu_device *smmu = the_smmu; iommu = &system_config->platform_info.iommu_units[0]; for (i = 0; i < iommu_count_units(); iommu++, i++) { -- 2.28.0 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/20201021145404.100463-8-andrea.bastoni%40tum.de.
