From: Jens Axboe <axboe@suse.de>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
Marcelo Tosatti <marcelo@conectiva.com.br>,
linux-kernel@vger.kernel.org,
Erik Andersen <andersen@codepoet.org>
Subject: Re: [PATCH] cdrom sane fallback vs 2.4.20-pre1
Date: Tue, 13 Aug 2002 18:14:06 +0200 [thread overview]
Message-ID: <20020813161406.GC32470@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.33L2.0208130847380.5175-100000@dragon.pdx.osdl.net>
On Tue, Aug 13 2002, Randy.Dunlap wrote:
> On Tue, 13 Aug 2002, James Bottomley wrote:
>
> | > > - if (ret) {
> | > > + if (ret && sense.sense_key==0x05 && sense.asc==0x20 && sense.ascq==0x00) {
> | >
> | > Do you really need to hardcode this values ?
> |
> | We have no #defines for the asc and ascq codes (they are interpreted in
> | constants.c but the values are hardcoded in there too). There is a #define
> | for sense_key 0x05 as ILLEGAL_REQUEST in scsi/scsi.h, but these #defines have
> | annoyed a lot of people by being rather namespace polluting.
>
> and that's precisely the wrong attitude IMO.
>
> I was glad to see that Marcelo asked about the hardcoded values.
> They hurt.
I usually find it a hell of a lot easier remembering that 5/20/00 is
illegal opcode, 5/24/00 is illegal field, etc. There are just too many
of these to be named sanely. sense_key can be done, agreed, but asc and
ascq just gets silly imo, and it makes it harder to read for those that
know the codes. Encouraging others to look up the values (it's not hard,
you can see it's asc and ascq and it relates to sense info) does
definitely not hurt, they might pick up something else along the way.
--
Jens Axboe
next prev parent reply other threads:[~2002-08-13 16:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-13 14:13 [PATCH] cdrom sane fallback vs 2.4.20-pre1 James Bottomley
2002-08-13 15:48 ` Randy.Dunlap
2002-08-13 16:14 ` Jens Axboe [this message]
2002-08-13 16:21 ` James Bottomley
2002-08-13 16:25 ` Randy.Dunlap
2002-08-13 16:37 ` Jens Axboe
2002-08-13 17:10 ` James Bottomley
-- strict thread matches above, loose matches on Subject: below --
2002-08-11 21:59 Erik Andersen
2002-08-13 2:58 ` Marcelo Tosatti
2002-08-13 4:12 ` Erik Andersen
2002-08-16 3:12 ` Oliver Xymoron
2002-08-13 8:42 ` Jens Axboe
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=20020813161406.GC32470@suse.de \
--to=axboe@suse.de \
--cc=James.Bottomley@SteelEye.com \
--cc=andersen@codepoet.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=rddunlap@osdl.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