From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 DBCCA81F03 for ; Thu, 9 Feb 2017 09:00:16 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP; 09 Feb 2017 09:00:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,137,1484035200"; d="scan'208";a="63153618" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 09 Feb 2017 09:00:16 -0800 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 9 Feb 2017 09:00:16 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.47]) by fmsmsx116.amr.corp.intel.com ([169.254.2.162]) with mapi id 14.03.0248.002; Thu, 9 Feb 2017 09:00:16 -0800 From: "Carsey, Jaben" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Zeng, Star" , "Carsey, Jaben" Thread-Topic: [edk2] [PATCH] ShellPkg SmbiosView: Eliminate trailing " | " in PrintBitsInfo() Thread-Index: AQHSgrYbhko33ETIP0iyaF7WzF4RbKFg5oRg Date: Thu, 9 Feb 2017 17:00:15 +0000 Message-ID: References: <1486632169-43240-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1486632169-43240-1-git-send-email-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjU2Y2Q4MjYtMmI1NC00MTZhLWFkMDktZjc4NzdmZTZiM2I2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjFFa3VIWUNTWnBHa0RvMG9jUkVFT2FUbUdLRmd0UVBCWHlHbDJRcTBkK2M9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.106] MIME-Version: 1.0 Subject: Re: [PATCH] ShellPkg SmbiosView: Eliminate trailing " | " in PrintBitsInfo() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2017 17:00:17 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Star Zeng > Sent: Thursday, February 09, 2017 1:23 AM > To: edk2-devel@lists.01.org > Cc: Ni, Ruiyu ; Carsey, Jaben > ; Zeng, Star > Subject: [edk2] [PATCH] ShellPkg SmbiosView: Eliminate trailing " | " in > PrintBitsInfo() > Importance: High >=20 > Current PrintBitsInfo() will always print an additional trailing > " | " for the bit flags, for example, >=20 > Base Board Feature Flags: Hosting board | Replaceable | >=20 > Th patch is to eliminate trailing " | " in PrintBitsInfo(), then > the output will be like below >=20 > Base Board Feature Flags: Hosting board | Replaceable >=20 > Cc: Ruiyu Ni > Cc: Jaben Carsey > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Star Zeng > --- > .../UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c | 18 > +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) >=20 > diff --git > a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable. > c > b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable. > c > index 282ba584c8c9..02d9ab1f57b3 100644 > --- > a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable. > c > +++ > b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable. > c > @@ -3449,19 +3449,24 @@ PrintBitsInfo ( >=20 > UINTN Index; > UINT32 Value; > - BOOLEAN NoInfo; > + BOOLEAN FirstInfo; >=20 > - NoInfo =3D TRUE; > + FirstInfo =3D TRUE; > Value =3D Bits; > // > // query the table and print information > // > for (Index =3D 0; Index < Number; Index++) { > if (BIT (Value, Table[Index].Key) !=3D 0) { > + if (!FirstInfo) { > + // > + // If it is not first info, print the separator first. > + // > + Print (L" | "); > + } > Print (Table[Index].Info); > - Print (L" | "); >=20 > - NoInfo =3D FALSE; > + FirstInfo =3D FALSE; > // > // clear the bit, for reserved bits test > // > @@ -3469,7 +3474,10 @@ PrintBitsInfo ( > } > } >=20 > - if (NoInfo) { > + // > + // There is no any info if FirstInfo is still TRUE. > + // > + if (FirstInfo) { > ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN > (STR_SMBIOSVIEW_QUERYTABLE_NO_INFO), gShellDebug1HiiHandle); > } >=20 > -- > 2.7.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel