[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/22] spapr: Use named enum for function remove_hpt
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 03/22] spapr: Use named enum for function remove_hpte |
Date: |
Thu, 11 Jul 2013 19:01:06 +0200 |
From: Stefan Weil <address@hidden>
The function returned a target_ulong which was made from unnamed enum
values. The target_ulong was then assigned to an int variable which
was used in a switch statement.
Using a named enum in both cases makes reviews easier.
Signed-off-by: Stefan Weil <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc/spapr_hcall.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 8bad27f..ed32dec 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -121,14 +121,14 @@ static target_ulong h_enter(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
return H_SUCCESS;
}
-enum {
+typedef enum {
REMOVE_SUCCESS = 0,
REMOVE_NOT_FOUND = 1,
REMOVE_PARM = 2,
REMOVE_HW = 3,
-};
+} RemoveResult;
-static target_ulong remove_hpte(CPUPPCState *env, target_ulong ptex,
+static RemoveResult remove_hpte(CPUPPCState *env, target_ulong ptex,
target_ulong avpn,
target_ulong flags,
target_ulong *vp, target_ulong *rp)
@@ -165,7 +165,7 @@ static target_ulong h_remove(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
target_ulong flags = args[0];
target_ulong pte_index = args[1];
target_ulong avpn = args[2];
- int ret;
+ RemoveResult ret;
ret = remove_hpte(env, pte_index, avpn, flags,
&args[0], &args[1]);
--
1.8.1.4
- [Qemu-devel] [PULL 00/22] ppc patch queue 2013-07-11, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 04/22] spapr: Respect -bios command line option for SLOF, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 05/22] pseries: move interrupt controllers to hw/intc/, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 02/22] spapr: Fix compiler warnings for some versions of gcc, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 09/22] PPC: Macio: Replace tabs with spaces, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 03/22] spapr: Use named enum for function remove_hpte,
Alexander Graf <=
- [Qemu-devel] [PATCH 01/22] e600 core for MPC86xx processors, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 12/22] PPC: dbdma: Fix debug print, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 15/22] PPC: dbdma: Introduce kick function, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 22/22] PPC: dbdma: Support more multi-issue DMA requests, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 21/22] PPC: Add timer handler for newworld mac-io, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 17/22] PPC: dbdma: macio: Add DMA callback, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 11/22] PPC: Mac: Add debug prints in macio and dbdma code, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 18/22] PPC: dbdma: Move processing to io, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 10/22] PPC: dbdma: Replace tabs with spaces, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 13/22] PPC: dbdma: Allow new commands in RUN state, Alexander Graf, 2013/07/11