aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-09-01 13:00:48 +0200
committerDoug Goldstein <cardoe@cardoe.com>2012-11-13 22:50:03 -0600
commit73a55843e9f1cb42e7e88cece507dd6a20a7d47e (patch)
tree579eae1c79d93d25f7e520cc1a9e1da392c9f646
parentioh3420: Remove unreachable code (diff)
downloadqemu-kvm-73a55843e9f1cb42e7e88cece507dd6a20a7d47e.tar.gz
qemu-kvm-73a55843e9f1cb42e7e88cece507dd6a20a7d47e.tar.bz2
qemu-kvm-73a55843e9f1cb42e7e88cece507dd6a20a7d47e.zip
pflash_cfi01: Fix warning caused by unreachable code
Report from smatch: hw/pflash_cfi01.c:431 pflash_write(180) info: ignoring unreachable code. Instead of removing the return statement after the switch statement, the patch replaces the return statements in the switch statement by break statements. Other switch statements in the same code do it also like that. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> (cherry picked from commit 12dabc79f976d66755025272f7e2e8e4da31715a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> (cherry picked from commit f3e98930787bc1cf21d962dc121448dea713b891)
-rw-r--r--hw/pflash_cfi01.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index d56b51abe..ac503cfa0 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -320,7 +320,7 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
}
pfl->wcycle++;
pfl->cmd = cmd;
- return;
+ break;
case 1:
switch (pfl->cmd) {
case 0x10: /* Single Byte Program */
@@ -375,7 +375,7 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
default:
goto error_flash;
}
- return;
+ break;
case 2:
switch (pfl->cmd) {
case 0xe8: /* Block write */
@@ -406,7 +406,7 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
default:
goto error_flash;
}
- return;
+ break;
case 3: /* Confirm mode */
switch (pfl->cmd) {
case 0xe8: /* Block write */
@@ -422,7 +422,7 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
default:
goto error_flash;
}
- return;
+ break;
default:
/* Should never happen */
DPRINTF("%s: invalid write state\n", __func__);