From owner-freebsd-current Thu Dec 19 16:49:31 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 07F9337B401 for ; Thu, 19 Dec 2002 16:49:30 -0800 (PST) Received: from fafoe.dyndns.org (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 652B843EE5 for ; Thu, 19 Dec 2002 16:49:29 -0800 (PST) (envelope-from stefan@fafoe.dyndns.org) Received: from frog.fafoe (frog.fafoe [192.168.2.101]) by fafoe.dyndns.org (Postfix) with ESMTP id BE3323FC6; Fri, 20 Dec 2002 01:49:17 +0100 (CET) Received: by frog.fafoe (Postfix, from userid 1001) id CDCD383D; Fri, 20 Dec 2002 01:49:16 +0100 (CET) Date: Fri, 20 Dec 2002 01:49:16 +0100 From: Stefan Farfeleder To: Nate Lawson Cc: Matthew Dillon , freebsd-current@FreeBSD.ORG Subject: Re: UMASS USB bug? (getting the Sony disk-on-key device working) Message-ID: <20021220004916.GC669@frog.fafoe> References: <200212191848.gBJImgOq099846@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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