Received: from eggs.gnu.org ([2001:4830:134:3::10]:34683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAsv-0001UX-00 for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrAst-0008F5-0d for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:49:00 -0400 Received: from [2a03:4000:2:362::1] (port=57428 helo=v2201305906712890.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAss-0008EN-QA for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:48:58 -0400 From: Stefan Weil Date: Mon, 24 Jun 2013 19:48:47 +0200 Message-Id: <1372096130-24994-2-git-send-email-sw@weilnetz.de> In-Reply-To: <1372096130-24994-1-git-send-email-sw@weilnetz.de> References: <1372096130-24994-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH 1/3] spapr: Use named enum for function remove_hpte List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , Alexander Graf Cc: Stefan Weil , qemu-devel 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 --- 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 8f0b7e8..00f21f5 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.7.10.4