From: Jan Kiszka <[email protected]>

Simplifies the code. Also removes the test of the return value which was
always true.

Signed-off-by: Jan Kiszka <[email protected]>
---
 hypervisor/arch/arm64/smmu.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/hypervisor/arch/arm64/smmu.c b/hypervisor/arch/arm64/smmu.c
index 9b3d59fb..94f65313 100644
--- a/hypervisor/arch/arm64/smmu.c
+++ b/hypervisor/arch/arm64/smmu.c
@@ -799,18 +799,6 @@ static int arm_smmu_find_sme(u16 id, struct 
arm_smmu_device *smmu)
        return free_idx;
 }
 
-static bool arm_smmu_free_sme(struct arm_smmu_device *smmu, int idx)
-{
-       smmu->s2crs[idx] = s2cr_init_val;
-       if (smmu->smrs) {
-               smmu->smrs[idx].id = 0;
-               smmu->smrs[idx].mask = 0;
-               smmu->smrs[idx].valid = false;
-       }
-
-       return true;
-}
-
 #define for_each_smmu_sid(sid, config, counter)                                
\
        for ((sid) = jailhouse_cell_stream_ids(config), (counter) = 0;  \
             (counter) < (config)->num_stream_ids;                      \
@@ -908,8 +896,13 @@ static void arm_smmu_cell_exit(struct cell *cell)
                        if (idx < 0)
                                continue;
 
-                       if (arm_smmu_free_sme(smmu, idx))
-                               arm_smmu_write_sme(smmu, idx);
+                       smmu->s2crs[idx] = s2cr_init_val;
+                       if (smmu->smrs) {
+                               smmu->smrs[idx].id = 0;
+                               smmu->smrs[idx].mask = 0;
+                               smmu->smrs[idx].valid = false;
+                       }
+                       arm_smmu_write_sme(smmu, idx);
 
                        smmu->cbs[cbndx].cfg = NULL;
                        arm_smmu_write_context_bank(smmu, cbndx);
-- 
2.26.2

-- 
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/51e75bc48215dad8e70f59c6b221eadfe4b7246e.1601838005.git.jan.kiszka%40siemens.com.

Reply via email to