aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2019-07-11 14:52:46 +0200
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2019-07-16 17:54:06 +0200
commit2658594ff64828bf4230d9224b394034dae14028 (patch)
tree1b4f116d4a5ca39a879ad204c8de6ac45b560579 /hw
parent697f59243f5a28b8a243ff5ad59e34bbecffcae1 (diff)
hw/block/pflash_cfi02: Explicit switch fallthrough for ERASE commands
Previous to commit ddb6f2254, the DQ2 bit was incorrectly set during PROGRAM command (0xA0). The commit reordered the switch cases to only set the DQ2 bit for the ERASE commands using a fallthrough, but did not explicit the fallthrough is intentional. Mark the switch fallthrough with a comment interpretable by C preprocessors and static analysis tools. Reported-by: Coverity (CID 1403012) Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20190711130759.27720-1-philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/block/pflash_cfi02.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index 83084b9d72..f68837a449 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -367,6 +367,7 @@ static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width)
case 0x30: /* Sector Erase */
/* Toggle bit 2 during erase, but not program. */
toggle_dq2(pfl);
+ /* fall through */
case 0xA0: /* Program */
/* Toggle bit 6 */
toggle_dq6(pfl);