[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 33/46] scsi: replace hex constants with #defines
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 33/46] scsi: replace hex constants with #defines |
Date: |
Wed, 20 Dec 2017 18:14:45 +0100 |
Sense keys have nice #defines in scsi/constants.h, use them.
Reported-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
scsi/utils.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/scsi/utils.c b/scsi/utils.c
index 61bc1a8..ddae650 100644
--- a/scsi/utils.c
+++ b/scsi/utils.c
@@ -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:
--
1.8.3.1
- [Qemu-devel] [PULL 20/46] tests/boot-serial-test: Add support for the mcf5208evb board, (continued)
- [Qemu-devel] [PULL 20/46] tests/boot-serial-test: Add support for the mcf5208evb board, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 24/46] tests/boot-serial-test: Add support for the raspi2 machine, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 23/46] tests/boot-serial-test: Add a test for the moxiesim machine, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 26/46] cpu: suffix cpu address spaces with cpu index, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 25/46] cpu: refactor cpu_address_space_init(), Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 29/46] exec: Don't reuse unassigned_mem_ops for io_mem_rom, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 27/46] block/iscsi: dont leave allocmap in an invalid state on UNMAP failure, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 28/46] block/iscsi: only report an iSCSI Failure if we don't handle it gracefully, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 30/46] hw/mips/boston: Remove workaround for writes to ROM aborting, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 31/46] hw/i386/vmport: replace fprintf() by trace events or LOG_UNIMP, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 33/46] scsi: replace hex constants with #defines,
Paolo Bonzini <=
- [Qemu-devel] [PULL 32/46] scsi: provide general-purpose functions to manage sense data, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 37/46] i8259: generalize statistics into common code, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 35/46] i8259: convert DPRINTFs into trace, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 38/46] kvm-i8259: support "info pic" and "info irq", Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 36/46] i8259: use DEBUG_IRQ_COUNT always, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 34/46] Remove legacy -no-kvm-pit option, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 39/46] i8259: move TYPE_INTERRUPT_STATS_PROVIDER upper, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 40/46] checkpatch: volatile with a comment or sig_atomic_t is okay, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 43/46] test: add some chardev mux event tests, Paolo Bonzini, 2017/12/20