[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/14] pflash_cfi01: Fix warning caused by unreachab
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 07/14] pflash_cfi01: Fix warning caused by unreachable code |
Date: |
Sun, 23 Sep 2012 11:00:13 +0100 |
From: Stefan Weil <address@hidden>
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 <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/pflash_cfi01.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index 9c42d31..855890d 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -321,7 +321,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 */
@@ -376,7 +376,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 */
@@ -407,7 +407,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 */
@@ -423,7 +423,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__);
--
1.7.10.4
- [Qemu-devel] [PULL 00/14] Trivial patches for 15 to 23 September 2012, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 01/14] target-i386: Allow tsc-frequency to be larger then 2.147G, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 03/14] qemu-sockets: Fix potential memory leak, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 02/14] qemu-ga: Remove unreachable code after g_error, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 04/14] cadence_uart: Fix buffer overflow, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 05/14] lm4549: Fix buffer overflow, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 07/14] pflash_cfi01: Fix warning caused by unreachable code,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 06/14] ioh3420: Remove unreachable code, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 08/14] dtrace backend: add function to reserved words, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 09/14] curses: don't initialize curses when qemu is daemonized, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 10/14] TextConsole: saturate escape parameter in TTY_STATE_CSI, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 11/14] qemu-timer: simplify qemu_run_timers, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 13/14] net/socket: Fix compiler warning (regression for MinGW), Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 12/14] linux-user: Remove redundant null check and replace free by g_free, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 14/14] w32: Always use standard instead of native format strings, Stefan Hajnoczi, 2012/09/23
- Re: [Qemu-devel] [PULL 00/14] Trivial patches for 15 to 23 September 2012, Anthony Liguori, 2012/09/25