From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=songpeng.li@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1EC4021159927 for ; Thu, 27 Sep 2018 01:09:09 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2018 01:09:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,309,1534834800"; d="scan'208";a="93680147" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 27 Sep 2018 01:09:08 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Sep 2018 01:09:08 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Sep 2018 01:09:08 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.140]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.37]) with mapi id 14.03.0319.002; Thu, 27 Sep 2018 16:09:07 +0800 From: "Li, Songpeng" To: "Fu, Siyuan" , "edk2-devel@lists.01.org" CC: "Wu, Jiaxin" , "Gao, Liming" Thread-Topic: [PATCH] MdePkg/UefiDevicePathLib: Fix print logic in DevPathToTextiSCSI Thread-Index: AQHUVjUOGqUY222fJU+G/Nz6Zh4UIqUDwJXggAAECcA= Date: Thu, 27 Sep 2018 08:09:06 +0000 Message-ID: References: <20180927073704.15152-1-songpeng.li@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdePkg/UefiDevicePathLib: Fix print logic in DevPathToTextiSCSI X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 08:09:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The variable in memory is stored as little endian, so the byte 0 is actuall= y stored in the last byte in memory. Best, Songpeng > -----Original Message----- > From: Fu, Siyuan > Sent: Thursday, September 27, 2018 3:51 PM > To: Li, Songpeng ; edk2-devel@lists.01.org > Cc: Wu, Jiaxin ; Gao, Liming > Subject: RE: [PATCH] MdePkg/UefiDevicePathLib: Fix print logic in > DevPathToTextiSCSI >=20 > Hi, Songpeng >=20 > According to the iSCSI text device note in UEFI spec, the byte 0 of LUN s= hould > come first, seems there is no problem in original code logic. Could you p= lease > double confirm that? > "The LUN is an 8 byte array that is displayed in hexadecimal format > with byte 0 first (i.e., on the left) and byte 7 last (i.e, on the right)= , and is > required." >=20 >=20 > BestRegards > Fu Siyuan >=20 > > -----Original Message----- > > From: Li, Songpeng > > Sent: Thursday, September 27, 2018 3:37 PM > > To: edk2-devel@lists.01.org > > Cc: Fu, Siyuan ; Wu, Jiaxin ; > > Gao, Liming > > Subject: [PATCH] MdePkg/UefiDevicePathLib: Fix print logic in > > DevPathToTextiSCSI > > > > In DevPathToTextiSCSI(), ISCSIDevPath->Lun is printed in reversed order= s. > > > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1216 > > Cc: Fu Siyuan > > Cc: Wu Jiaxin > > Cc: Liming Gao > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Songpeng Li > > --- > > MdePkg/Library/UefiDevicePathLib/DevicePathToText.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > > b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > > index 7d8d304f6f..3f6478e43c 100644 > > --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > > +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > > @@ -1548,7 +1548,7 @@ DevPathToTextiSCSI ( > > ISCSIDevPath->TargetName, > > ISCSIDevPath->TargetPortalGroupTag > > ); > > - for (Index =3D 0; Index < sizeof (ISCSIDevPath->Lun) / sizeof (UINT8= ); > > Index++) { > > + for (Index =3D sizeof (ISCSIDevPath->Lun) / sizeof (UINT8) - 1; Inde= x >=3D > > 0; Index--) { > > UefiDevicePathLibCatPrint (Str, L"%02x", ((UINT8 *)&ISCSIDevPath- > > >Lun)[Index]); > > } > > Options =3D ISCSIDevPath->LoginOption; > > -- > > 2.18.0.windows.1