Skip to content

Commit

Permalink
scsi/esp-pci: add g_assert() for fix clang analyzer warning in esp_pc…
Browse files Browse the repository at this point in the history
…i_io_write()

Clang static code analyzer show warning:
  hw/scsi/esp-pci.c:198:9: warning: Value stored to 'size' is never read
        size = 4;
        ^      ~

Reported-by: Euler Robot <[email protected]>
Signed-off-by: Chen Qun <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
  • Loading branch information
Kuhn-Chen authored and vivier committed May 4, 2020
1 parent 2ef486e commit d58f886
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/scsi/esp-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ static void esp_pci_io_write(void *opaque, hwaddr addr,
addr &= ~3;
size = 4;
}
g_assert(size >= 4);

if (addr < 0x40) {
/* SCSI core reg */
Expand Down

0 comments on commit d58f886

Please sign in to comment.