From: Stefan Weil <sw@weilnetz.de>
To: David Gibson <david@gibson.dropbear.id.au>,
Alexander Graf <agraf@suse.de>
Cc: Stefan Weil <sw@weilnetz.de>, qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 1/3] spapr: Use named enum for function remove_hpte
Date: Mon, 24 Jun 2013 19:48:47 +0200 [thread overview]
Message-ID: <1372096130-24994-2-git-send-email-sw@weilnetz.de> (raw)
In-Reply-To: <1372096130-24994-1-git-send-email-sw@weilnetz.de>
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 <sw@weilnetz.de>
---
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
next prev parent reply other threads:[~2013-06-24 17:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 17:48 [Qemu-devel] [PATCH 0/3] spapr: Fix remaining compiler warnings Stefan Weil
2013-06-24 17:48 ` Stefan Weil [this message]
2013-07-02 12:45 ` [Qemu-devel] [PATCH 1/3] spapr: Use named enum for function remove_hpte Alexander Graf
2013-06-24 17:48 ` [Qemu-devel] [PATCH 2/3] spapr: Fix compiler warning for some versions of gcc (h_remove) Stefan Weil
2013-06-24 20:27 ` Paolo Bonzini
2013-06-24 20:35 ` Stefan Weil
2013-06-24 21:07 ` Paolo Bonzini
2013-06-24 17:48 ` [Qemu-devel] [PATCH 3/3] spapr: Fix compiler warning for some versions of gcc (spapr_io_read) Stefan Weil
2013-07-02 12:45 ` Alexander Graf
2013-07-02 20:22 ` Stefan Weil
2013-07-02 20:25 ` Alexander Graf
2013-06-26 8:14 ` [Qemu-devel] [PATCH 0/3] spapr: Fix remaining compiler warnings Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372096130-24994-2-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=agraf@suse.de \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).