Skip to contentSkip to conversation

scsi-disk: add 'fall through' comment to switch VERIFY cases

PATCH Applied Peter Maydell 2 participants 2 messages Jan 16, 2017 – Jan 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi-disk: add 'fall through' comment to switch VERIFY cases

Commit 166dbda7e131 added some extra cases to a switch() such that the existing code is intended to fall through the new case statements. It's clear from the commit that this is intentional, but less clear to subsequent readers of the code, and not clear at all to static analysis tools like Coverity. Add a /* fall through */ comment to indicate the intent. (Fixes CID 1368287.)

---
 hw/scsi/scsi-disk.c | 1 +
 1 file changed, 1 insertion(+)
hw/scsi/scsi-disk.c +1 -0
index bdd1e5f..25e1081 100644
@@ -2157,6 +2157,7 @@ static int32_t scsi_disk_dma_command(SCSIRequest *req, uint8_t *buf)
         DPRINTF("Write %s(sector %" PRId64 ", count %u)\n",
                 (command & 0xe) == 0xe ? "And Verify " : "",
                 r->req.cmd.lba, len);
+        /* fall through */
     case VERIFY_10:
     case VERIFY_12:
     case VERIFY_16:
Signature · 1 line
2.7.4