[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1198951625.4861.25.camel@localhost>
Date: Sat, 29 Dec 2007 10:07:05 -0800
From: Joe Perches <joe@...ches.com>
To: Adrian McMenamin <adrian@...golddream.dyndns.info>
Cc: LKML <linux-kernel@...r.kernel.org>,
linux-sh <linux-sh@...r.kernel.org>,
Paul Mundt <lethal@...ux-sh.org>
Subject: Re: [PATCH] SH/Dreamcast - add support for GD-Rom device
On Sat, 2007-12-29 at 12:03 +0000, Adrian McMenamin wrote:
> This won't work see include/scsi/scsi.h
> /*
> * SENSE KEYS
> */
>
> #define NO_SENSE 0x00
> #define RECOVERED_ERROR 0x01
> #define NOT_READY 0x02
> #define MEDIUM_ERROR 0x03
> #define HARDWARE_ERROR 0x04
> #define ILLEGAL_REQUEST 0x05
> #define UNIT_ATTENTION 0x06
> #define DATA_PROTECT 0x07
> #define BLANK_CHECK 0x08
> #define COPY_ABORTED 0x0a
> #define ABORTED_COMMAND 0x0b
> #define VOLUME_OVERFLOW 0x0d
> #define MISCOMPARE 0x0e
>
> (The GD device specs says it supports 0, 1, 2, 3,4, 5, 6, 7 and 0xB)
>
> ie we could get a sense key of 0x0B which would be greater than the
> array size. I think you'd have to hard code the limit.
Then shouldn't this test be:
for (i = 0; i < ARRAY_SIZE(sense_texts); i++) {
if (sense_key == sense_texts[i].sense_key)
printk(KERN_INFO "GDROM: %s\n", sense_texts[i].text);
}
if (i >= ARRAY_SIZE(sense_texts))
printk(KERN_ERR "GDROM: Unknown sense key: %d\n", sense_key);
cheers, Joe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists