Subject: Re: sys/dev/scsipi/scsipi_base.c
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: current-users
Date: 01/06/2008 23:22:56
On Sun, 6 Jan 2008 23:56:49 +0100
Manuel Bouyer <bouyer@antioche.eu.org> wrote:

> On Sun, Jan 06, 2008 at 02:36:32PM -0800, John Nemeth wrote:
> > } A "gratuitous padding" here would break anyway, as this structure
> > is } filled in by hardware (it's what's returned by a device to an
> > INQUIRY } command).
> > 
> >      The hardware returns a sequence of bytes not a struct.
> 
> Yes of course. And if padding is introduced in this structure, the
> fields will point to the wrong place in the sequence of bytes.
> 
Yes.  To quote Henry Spencer, "If you lie to the compiler, it will get
its revenge."  (see
http://www.armoredpenguin.com/quotes/Henry_Spencer.html)

More seriously -- is there any reason not to create a union, and point
the hardware at the contiguous string?

		--Steve Bellovin, http://www.cs.columbia.edu/~smb