From owner-freebsd-current Wed Mar 15 10:15:30 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA06389 for current-outgoing; Wed, 15 Mar 1995 10:15:30 -0800 Received: from hda.com (hda.com [199.232.40.182]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id KAA06379 for ; Wed, 15 Mar 1995 10:15:26 -0800 Received: (dufault@localhost) by hda.com (8.6.9/8.3) id NAA00750; Wed, 15 Mar 1995 13:12:14 -0500 From: Peter Dufault Message-Id: <199503151812.NAA00750@hda.com> Subject: Re: scsi_sense To: charnier@lirmm.fr (Philippe Charnier) Date: Wed, 15 Mar 1995 13:12:14 -0500 (EST) Cc: current@FreeBSD.org In-Reply-To: <199503151634.RAA08046@lirmm.lirmm.fr> from "Philippe Charnier" at Mar 15, 95 05:22:15 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 825 Sender: current-owner@FreeBSD.org Precedence: bulk Philippe Charnier writes: > > Hello, > > > from scsi_sence.c (in src/sys/scsi) > > {0x26, 0x03, "Threshold parameters not supported" }, > {0x46, 0x00, "Unsuccessful soft reset" }, > #endif /* NO_SCSI_SENSE */ > {0xff, 0xff, 0 }, > }; > > char *scsi_sense_desc(int asc, int ascq) > { > int i; > for (i = 0; i < sizeof(tab) / sizeof(tab[0]); i++) > if (tab[i].asc == asc && tab[i].ascq == ascq) > return tab[i].desc; > > return "no available sense description"; > } > > Why this code don't use {0xff, 0xff, 0 } as a end of list? Because we know the table size. -- Peter Dufault Real Time Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936 dufault@hda.com Fax: 508 433 5267