]> git.proxmox.com Git - mirror_qemu.git/commitdiff
scsi: replace hex constants with #defines
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Nov 2017 12:45:59 +0000 (13:45 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Dec 2017 08:30:32 +0000 (09:30 +0100)
Sense keys have nice #defines in scsi/constants.h, use them.

Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi/utils.c

index 61bc1a8e2b44bc924391e754ecabcb8acdcc8b60..ddae650a999e3bfc73a8fcc12bdaa192c8306763 100644 (file)
@@ -339,16 +339,16 @@ int scsi_convert_sense(uint8_t *in_buf, int in_len,
 int scsi_sense_to_errno(int key, int asc, int ascq)
 {
     switch (key) {
-    case 0x00: /* NO SENSE */
-    case 0x01: /* RECOVERED ERROR */
-    case 0x06: /* UNIT ATTENTION */
+    case NO_SENSE:
+    case RECOVERED_ERROR:
+    case UNIT_ATTENTION:
         /* These sense keys are not errors */
         return 0;
-    case 0x0b: /* COMMAND ABORTED */
+    case ABORTED_COMMAND: /* COMMAND ABORTED */
         return ECANCELED;
-    case 0x02: /* NOT READY */
-    case 0x05: /* ILLEGAL REQUEST */
-    case 0x07: /* DATA PROTECTION */
+    case NOT_READY:
+    case ILLEGAL_REQUEST:
+    case DATA_PROTECT:
         /* Parse ASCQ */
         break;
     default: