qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/9] scsi-bus: remove duplicate table entries


From: Blue Swirl
Subject: [Qemu-devel] [PATCH 3/9] scsi-bus: remove duplicate table entries
Date: Sun, 4 Sep 2011 15:48:28 +0000

Remove duplicate entries from SCSI command table, spotted by
clang analyzer:
/src/qemu/hw/scsi-bus.c:979:40: warning: initializer overrides prior
initialization of this subobject
        [ ERASE_16                 ] = "ERASE_16",
/src/qemu/hw/scsi-bus.c:978:40: note: previous initialization is here
        [ WRITE_SAME_16            ] = "WRITE_SAME_16",
/src/qemu/hw/scsi-bus.c:984:40: warning: initializer overrides prior
initialization of this subobject
        [ MAINTENANCE_IN           ] = "MAINTENANCE_IN",
/src/qemu/hw/scsi-bus.c:917:40: note: previous initialization is here
        [ MAINTENANCE_IN           ] = "MAINTENANCE_IN",
/src/qemu/hw/scsi-bus.c:985:40: warning: initializer overrides prior
initialization of this subobject
        [ MAINTENANCE_OUT          ] = "MAINTENANCE_OUT",
/src/qemu/hw/scsi-bus.c:918:40: note: previous initialization is here
        [ MAINTENANCE_OUT          ] = "MAINTENANCE_OUT",

Signed-off-by: Blue Swirl <address@hidden>
---
 hw/scsi-bus.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 6f0d039..2703309 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -976,13 +976,11 @@ static const char *scsi_command_name(uint8_t cmd)
         [ SYNCHRONIZE_CACHE_16     ] = "SYNCHRONIZE_CACHE_16",
         [ LOCATE_16                ] = "LOCATE_16",
         [ WRITE_SAME_16            ] = "WRITE_SAME_16",
-        [ ERASE_16                 ] = "ERASE_16",
+        /* ERASE_16 and WRITE_SAME_16 use the same operation code */
         [ SERVICE_ACTION_IN        ] = "SERVICE_ACTION_IN",
         [ WRITE_LONG_16            ] = "WRITE_LONG_16",
         [ REPORT_LUNS              ] = "REPORT_LUNS",
         [ BLANK                    ] = "BLANK",
-        [ MAINTENANCE_IN           ] = "MAINTENANCE_IN",
-        [ MAINTENANCE_OUT          ] = "MAINTENANCE_OUT",
         [ MOVE_MEDIUM              ] = "MOVE_MEDIUM",
         [ LOAD_UNLOAD              ] = "LOAD_UNLOAD",
         [ READ_12                  ] = "READ_12",
-- 
1.6.2.4

Attachment: 0003-scsi-bus-remove-duplicate-table-entries.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]