Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Dec 2002 01:49:16 +0100
From:      Stefan Farfeleder <stefan@fafoe.dyndns.org>
To:        Nate Lawson <nate@root.org>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, freebsd-current@FreeBSD.ORG
Subject:   Re: UMASS USB bug? (getting the Sony disk-on-key device working)
Message-ID:  <20021220004916.GC669@frog.fafoe>
In-Reply-To: <Pine.BSF.4.21.0212191442450.60085-100000@root.org>
References:  <200212191848.gBJImgOq099846@apollo.backplane.com> <Pine.BSF.4.21.0212191442450.60085-100000@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 19, 2002 at 04:25:40PM -0800, Nate Lawson wrote:

>                 if (csio->ccb_h.flags & CAM_CDB_POINTER) {
>                         cmd = (unsigned char *) csio->cdb_io.cdb_ptr;
>                 } else {
>                         cmd = (unsigned char *) &csio->cdb_io.cdb_bytes;
>                 }
> 
> The & is extraneous.  Not sure why this doesn't bomb horribly later.

Because cdb_bytes is an array not a pointer.  The expression
&csio->cdb_io.cdb_bytes points to the whole array and has the type
u_int8_t (*)[IOCDBLEN], when cast to unsigned char *, the value will be
the same as just csio->cdb_io.cdb_bytes.

Regards,
Stefan Farfeleder

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021220004916.GC669>