diff mbox series

[43/43] target/ppc/mmu-hash32.c: Change parameter type of ppc_hash32_direct_store

Message ID 89743dc082d33b8bed06d5574b8916005c0b47a8.1716763435.git.balaton@eik.bme.hu (mailing list archive)
State New, archived
Headers show
Series Remaining MMU clean up patches | expand

Commit Message

BALATON Zoltan May 26, 2024, 11:13 p.m. UTC
This function needs CPUState and env but takes PowerPCCPU and cast
that. We already have the right types in the caller so pass them to
this function to avoid casting.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 target/ppc/mmu-hash32.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/target/ppc/mmu-hash32.c b/target/ppc/mmu-hash32.c
index 0f9c61bf89..3588f8f8de 100644
--- a/target/ppc/mmu-hash32.c
+++ b/target/ppc/mmu-hash32.c
@@ -109,15 +109,12 @@  static hwaddr ppc_hash32_bat_lookup(CPUPPCState *env, target_ulong ea,
     return -1;
 }
 
-static bool ppc_hash32_direct_store(PowerPCCPU *cpu, target_ulong sr,
-                                    target_ulong eaddr,
+static bool ppc_hash32_direct_store(CPUState *cs, CPUPPCState *env,
+                                    target_ulong sr, target_ulong eaddr,
                                     MMUAccessType access_type,
                                     hwaddr *raddr, int *prot, int mmu_idx,
                                     bool guest_visible)
 {
-    CPUState *cs = CPU(cpu);
-    CPUPPCState *env = &cpu->env;
-
     qemu_log_mask(CPU_LOG_MMU, "direct store...\n");
 
     if (access_type == MMU_INST_FETCH) {
@@ -336,7 +333,7 @@  bool ppc_hash32_xlate(CPUState *cs, vaddr eaddr, MMUAccessType access_type,
 
     /* 4. Handle direct store segments */
     if (sr & SR32_T) {
-        return ppc_hash32_direct_store(cpu, sr, eaddr, access_type,
+        return ppc_hash32_direct_store(cs, env, sr, eaddr, access_type,
                                        raddrp, protp, mmu_idx, guest_visible);
     }