From owner-svn-src-all@FreeBSD.ORG Mon May 6 16:16:09 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABB7586A; Mon, 6 May 2013 16:16:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) by mx1.freebsd.org (Postfix) with ESMTP id 859C1F04; Mon, 6 May 2013 16:16:09 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1UZO5A-000PKY-Dk; Mon, 06 May 2013 16:16:08 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r46GG6Cn014664; Mon, 6 May 2013 10:16:06 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18PIUuUiykk4SiHY6Dwf9aG Subject: Re: svn commit: r250298 - head/sys/cam/ata From: Ian Lepore To: Alexander Motin In-Reply-To: <201305061558.r46Fws6i056327@svn.freebsd.org> References: <201305061558.r46Fws6i056327@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 06 May 2013 10:16:06 -0600 Message-ID: <1367856966.1180.168.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 16:16:09 -0000 On Mon, 2013-05-06 at 15:58 +0000, Alexander Motin wrote: > Author: mav > Date: Mon May 6 15:58:53 2013 > New Revision: 250298 > URL: http://svnweb.freebsd.org/changeset/base/250298 > > Log: > Fix byte order of ATA WWN when converting it to SCSI LUN ID. > > Modified: > head/sys/cam/ata/ata_xpt.c > > Modified: head/sys/cam/ata/ata_xpt.c > ============================================================================== > --- head/sys/cam/ata/ata_xpt.c Mon May 6 15:30:34 2013 (r250297) > +++ head/sys/cam/ata/ata_xpt.c Mon May 6 15:58:53 2013 (r250298) > @@ -834,6 +834,7 @@ noerror: > { > struct ccb_pathinq cpi; > int16_t *ptr; > + int i; > > ident_buf = &softc->ident_data; > for (ptr = (int16_t *)ident_buf; > @@ -913,8 +914,10 @@ noerror: > path->device->device_id_len = 16; > bcopy(&fake_device_id_hdr, > path->device->device_id, 8); > - bcopy(ident_buf->wwn, > - path->device->device_id + 8, 8); > + for (i = 0; i < 4; i++) { > + ptr = (int16_t *)(path->device->device_id + 8); > + ptr[i] = bswap16(ident_buf->wwn[i]); > + } > } > } > Shouldn't this use ata_bswap()? If not that, then shouldn't it be one of the conditional swap routines (be16dec() or similar)? -- Ian