From nobody Sat Nov 2 14:38:13 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1486632175612200.10164700439054; Thu, 9 Feb 2017 01:22:55 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6D1CB81FAB; Thu, 9 Feb 2017 01:22:54 -0800 (PST) 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 5E6D981F81 for ; Thu, 9 Feb 2017 01:22:53 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 09 Feb 2017 01:22:53 -0800 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.22]) by fmsmga005.fm.intel.com with ESMTP; 09 Feb 2017 01:22:52 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,349,1484035200"; d="scan'208";a="63002934" From: Star Zeng To: edk2-devel@lists.01.org Date: Thu, 9 Feb 2017 17:22:49 +0800 Message-Id: <1486632169-43240-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [edk2] [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: , Cc: Ruiyu Ni , Jaben Carsey , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Current PrintBitsInfo() will always print an additional trailing " | " for the bit flags, for example, Base Board Feature Flags: Hosting board | Replaceable | Th patch is to eliminate trailing " | " in PrintBitsInfo(), then the output will be like below Base Board Feature Flags: Hosting board | Replaceable Cc: Ruiyu Ni Cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jaben Carsey --- .../UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c | 18 +++++++++++++-= ---- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTa= ble.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 --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel