From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: dgilbert@redhat.com
Subject: Re: [Qemu-devel] [PATCH] scsi: replace hex constants with #defines
Date: Sun, 17 Dec 2017 12:11:17 -0300 [thread overview]
Message-ID: <b9491b5d-452c-d26f-a2c7-992ab2852591@amsat.org> (raw)
In-Reply-To: <20171217052945.12782-2-pbonzini@redhat.com>
On 12/17/2017 02:29 AM, Paolo Bonzini wrote:
> Sense keys have nice #defines in scsi/constants.h, use them.
>
> Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> scsi/utils.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/scsi/utils.c b/scsi/utils.c
> index 61bc1a8e2b..ddae650a99 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:
>
prev parent reply other threads:[~2017-12-17 15:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-17 5:29 [Qemu-devel] [PATCH] scsi: replace hex constants with #defines Paolo Bonzini
2017-12-17 15:11 ` Philippe Mathieu-Daudé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b9491b5d-452c-d26f-a2c7-992ab2852591@amsat.org \
--to=f4bug@amsat.org \
--cc=dgilbert@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).