From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8DCF9940EA0 for ; Thu, 14 Dec 2023 02:51:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dulyvCEJXTfUGrzO8fbg4DsO1opoQCzd21vJJn7Iu4k=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702522269; v=1; b=EMIqVEtP6NYCGx4Xh3Nd1CAiXBiltBd7bUoVBJAU8OsSId4Hw5McUzSc9uWf9m1EcvjNJIPL I3PG1XATosVKV+vf+2vM1ZzxaHeOyZiLphuzx6LJWVETJ/xTxVE7sC/+0nCrVtpWrq+oG0rvoOR BPR0QDyr8gU4i2Rr3EKLLfQI= X-Received: by 127.0.0.2 with SMTP id GR8RYY7687511xcRHgMb70sA; Wed, 13 Dec 2023 18:51:09 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.13529.1702522267983769962 for ; Wed, 13 Dec 2023 18:51:08 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="385476587" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="385476587" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 18:51:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="917889747" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="917889747" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 13 Dec 2023 18:51:06 -0800 X-Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 13 Dec 2023 18:51:06 -0800 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 13 Dec 2023 18:51:06 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 13 Dec 2023 18:51:06 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dq1V4l5Cr+2hQerJDJjjq0KJgXCfCgSexf05ensqKY8z1vfdB8G51eaSiWK1ilBdykn+Tx+X/fZm0jFm9cdvjdZ9qeK83Er/U7SPzdJVctSrNxCHssRht68jIv1dwPtAnO0Cmyuve7ec4qWoZ7s/E2H8TluHRgZjtMYnNcdpRkW5lBLIX05JRR2auA1zrJh95LtPasUWj8UYBO41KgTjqtO09ql8t3h9oJzXS1ozM81ZY8z8/sXIvIh9ONW7vMucymAj4/LBrdt6gbwulx1/KdLzqA7Vzx8j0TKtP6BtVpT4z3/YG/IVtXFRa/gfs14iMz/2zF4kUv8ukXfKFOSrSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Vx++KKl6hnIDpp6uxGdljpwQiy9AVIYfdJwJ0+vCHZ8=; b=ApNTqWWpctv+k6HF1fh9cBECcOWC5q+OR1XBV3ivwf4VZYVTXY0/0gXLicXXztVOF+tAeeXWDaSDEzSWzS7FsvnXe+AO5GRyzHOIfWIBc4+cOmhZX4vXFpZk2Q0tsrdxDUi8/digBdF6+H+ql+5cEeP+U0KD6E6uCMKpqqyQPFoAmNwZPxKBYnqVEsV/M97UaM5YdOF9VJQxyX2HN+Eads8Xx7NEwrqgOss4EDZ9NJSoh5lUJW68ka2lAohLHaM/i7M8nCQShLDaqqgzSKMqNkSgDpbTunvNCSOOnvVNAu8o4IWGz8YXvJMnhLr/AIHwRFbLJtFAPnOFenUT9bAwJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from PH7PR11MB6377.namprd11.prod.outlook.com (2603:10b6:510:1fb::13) by PH0PR11MB5903.namprd11.prod.outlook.com (2603:10b6:510:144::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Thu, 14 Dec 2023 02:51:02 +0000 X-Received: from PH7PR11MB6377.namprd11.prod.outlook.com ([fe80::f707:cb7a:4f81:c6db]) by PH7PR11MB6377.namprd11.prod.outlook.com ([fe80::f707:cb7a:4f81:c6db%4]) with mapi id 15.20.7091.028; Thu, 14 Dec 2023 02:51:02 +0000 From: "Gao, Zhichao" To: Tom Pilar , "devel@edk2.groups.io" , Daniel Nguyen CC: nd , "Ni, Ray" Subject: Re: [edk2-devel] [PATCH v2 1/1] ShellPkg: Tidy for code readability Thread-Topic: [edk2-devel] [PATCH v2 1/1] ShellPkg: Tidy for code readability Thread-Index: AQHaIvIIYgRBTBzDX0is+z7+cMuy+rCnLdKAgAD85pA= Date: Thu, 14 Dec 2023 02:51:01 +0000 Message-ID: References: <20231129182840.2333098-1-daniel.nguyen@arm.com> <20231129182840.2333098-2-daniel.nguyen@arm.com> <46D1DFA2-3809-489A-8EC5-5D32ED3075A3@arm.com> In-Reply-To: <46D1DFA2-3809-489A-8EC5-5D32ED3075A3@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR11MB6377:EE_|PH0PR11MB5903:EE_ x-ms-office365-filtering-correlation-id: 1ce3661b-928d-44c5-3228-08dbfc4f8213 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: vdKE8pnEZrAfja+yZX6zQ5Tz+H4fmg69eCFwBbSHgbgIt8jB6IgtJdgJuuu05zVX5pWaDTN9FG3N3NOq3sJ7vB5uMy5g6eLbpTwV+6UtIsA6zC//jx+uPqmeO0U6YkIbUDfwmC2rrbfe/hUz69DxzLgFN4H52fhaBp5LvBRQ5RVgsir+nu/mKbWNJ8rj+NJhzzL2Dv7+SQNbKgSGZMBzxGZ/UKbMVz4n01L2EvHhLbwEvOvgbm/QSDznbnEKDmoxe/wQ4KW7hMwsT05a/NbjIwGMLEBvBvym2lU8oxNqKppV7k0dNhMn9Twd5FKdpowQ9yRg3TwynNR/aIfDNLDq9MxwFi0sQvnhLK7a5XBolSFk7bzpY5CFPHCjrwLAzzf9ZIGIotGJ5Mg0J+HTIXPC6mJ2ZY7/PXU9jDJSA41xW6YALbpwMXbJ30yUobaIYZmdZ2/SGSntDtEj5DFTOZ31h0a3vTJesPKvrFYA3Mcuul6OYTQp/lVdMMOfiVIp7o+AwQjq1auyFbns+z5P0Kd1IpfUJvFMv9GQ/sKzN0rF0M8XnDj7FUKVSb3emRvSOYS0AoYB1tT8MPFxzFhgC6KiqyRLoIwYJTDr2zz2QRvzU20hBAt+xPsFpgAylCrK63XwW5rUHdpVyh1UAFU75WhXD7WZwDrRHNpcAsg8vWRLNaZHzfiXTKBhyhGgMW7bv0ab x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?VuL4V3HL2A9PRi/L8/Jt1/m/MEavBJpnLcFWd4p+yeVAA3pBBCi9hneXzjbX?= =?us-ascii?Q?zV/JHZtcuaBEJDEkOshqHgJGyAJWXyhMOuJP+BIf9EzGZMXBou+ZssEW4uOv?= =?us-ascii?Q?47m6UBU/6OQy+RnyB9gmJvxWSTe2T426woAR1eKzFRqmNKjqMYL8X2tYaSHJ?= =?us-ascii?Q?amPOMQpey0Y+gmPbVLzsMv8GmR4cvBHc7dGQ92yr8cn+wP7d5LXXLCIZdWCo?= =?us-ascii?Q?VBzsdIWDRBICc01nuxf2qJ42TaQLG2NCBRVjQicYopjlXLr+6EfVCBPIQBKy?= =?us-ascii?Q?f+WljI5jHHX35wG+GlNFNvbdpfZ2TN4FI7qWjE13jCwp33fTGgdTVUSBNaeg?= =?us-ascii?Q?sbd56zGqefwBWik00atbU68OMFlw4kCfCbQmsDdNY4eUI/QavGBKUoFaOSvQ?= =?us-ascii?Q?F1L513S9y0hT1P8CK/lBghpj2zFttL31vR3llRfoeOeDPAZvwcwhbEDFpT0u?= =?us-ascii?Q?T87166oYOMRoZxi3aPAqCK7TBgULkmxvwQ3j0Itua+v3Rfvsx2ph1+Y8OdPh?= =?us-ascii?Q?MDt40deivkUL4R+bH0wqMJaakyCTnoH1EuEsvlyjkDmASwn8CNa2VfIHbFhM?= =?us-ascii?Q?Il5GR75N1OKVDJBMuE6aw0XEJTLMFRVj7jdGoJjVAG3WKDDNIzFbdG6Ebh43?= =?us-ascii?Q?uq244S6pt7ShzANya8rJW/RdrOfhRforkm2ChGvFER2w+t3vGZswLy+sUl1n?= =?us-ascii?Q?FmKySDrmUnQNJH5KKGqfJZRRT0WLyvMvnwtbAajkAklnD5NlVn0j6YyKViwR?= =?us-ascii?Q?+QGS2LDMXjhdC+N98tcAonyIaXiFQhbNI8uS7aPm3QL/fNnKU/Smr6IoHHcn?= =?us-ascii?Q?NQfEThPxQ7OZZDE6DPzNb495tbqHeoYTeIgIAB72TJnzIqW/3aUmfxIAE+a1?= =?us-ascii?Q?JVCM/CP8p0g6ClDfx02gv5x48lZj/lw68Asf5aC3Fu2UO/X9woreygH6TJvk?= =?us-ascii?Q?PssDVt3/74KizBqC6pyqkCHYAlaZpXU1P/l/VBLVofmfuS0eLJXu1DRzH48M?= =?us-ascii?Q?wDrJhd3jQgZrOQ1Qn/grA6mR62RbS85o9fqxh4PacmBqis4Gkn/j7xTwNi0z?= =?us-ascii?Q?C8rjjt0ZDgfI4yNWEBjMmdk1pxLjkBrjNAdn/GRfDmqpZMeD2qIuwIjH5ReI?= =?us-ascii?Q?R7Jt7n20VDhdHwD3o2/BvR+fei4sSrGssmlFmCUyuL6qJ801RMy2LcN/tsBO?= =?us-ascii?Q?dIJ00+7lKBKNsKy2adxd0c52vJl9b+15X0cGyhWxlpbaivaJ9AffGkZQvNdT?= =?us-ascii?Q?HRmTBazG7EsA1vf5OUAl8CG5aEPZqjbcDMqnhauMKbbWXnHvhSBkaSci2RCx?= =?us-ascii?Q?aMTr3gbfXpeXJYC9tNZmEzWUq59VSV0XW8oRUgxrdAN6nsfHsw0vEAzG8okh?= =?us-ascii?Q?/KtYDmop52RSe7hIyHiMKDNnSr2nwV9V8TAi1DqsT/8Wyb7IMSS/KX5zyoQw?= =?us-ascii?Q?kpSjwSXHfrIIhFJKK/Lib0H7rZ6Z6PIHrUiGN4HP/DMeRgPqoskbWyQxMTSP?= =?us-ascii?Q?x6m+Q1rzoCBX/IFRi0+YsS38yFBtJtsYcxOqFpe8yjDUJIQ8VxZxj34HGoaB?= =?us-ascii?Q?EcQVa2+FY7UfCjdBsZJYbsBRWjjjk2beP/a5oWlD?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB6377.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ce3661b-928d-44c5-3228-08dbfc4f8213 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2023 02:51:01.7878 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gDcnJU2Jt3wv3N3ZIh1AsCGthwHnAgrtJCUj80Ed1ZTBFSelVW6Ug+SZJfaV32FEV5eH7SEWqGkCFLpwsrM8Rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5903 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: mdO1bwKcI6aBMGER2UZrtaMQx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=EMIqVEtP; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io The patch looks good to me. Reviewed-by: Zhichao Gao Thanks, Zhichao > -----Original Message----- > From: Tom Pilar > Sent: Wednesday, December 13, 2023 7:45 PM > To: devel@edk2.groups.io; Daniel Nguyen > Cc: nd ; Gao, Zhichao ; Ni, Ray > > Subject: Re: [edk2-devel] [PATCH v2 1/1] ShellPkg: Tidy for code readabil= ity >=20 > Hi Zhichao & Ray, >=20 > Can you have a quick review of this patch, no logic has changed, just a c= ode > tidy. >=20 > Cheers, > Tom >=20 > > On 29 Nov 2023, at 18:28, Daniel Nguyen via groups.io > wrote: > > > > Warning: EXTERNAL SENDER, use caution when opening links or > attachments. > > > > > > Use error handling instead of success handling. > > Less indented logic is easier to read. > > > > Cc: Zhichao Gao > > Cc: Ray Ni > > > > Signed-off-by: Daniel Nguyen > > --- > > ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c | 41 > > +++++++++++--------- > > 1 file changed, 23 insertions(+), 18 deletions(-) > > > > diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c > > b/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c > > index 57ba3c90f373..361c47e43059 100644 > > --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c > > +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c > > @@ -79,30 +79,35 @@ ShellCommandRunReset ( > > &DataSize, > > &OsIndications > > ); > > - if (!EFI_ERROR (Status)) { > > - if ((OsIndications & EFI_OS_INDICATIONS_BOOT_TO_FW_UI) !=3D = 0) { > > - DataSize =3D sizeof (OsIndications); > > - Status =3D gRT->GetVariable ( > > - EFI_OS_INDICATIONS_VARIABLE_NAME, > > - &gEfiGlobalVariableGuid, > > - &Attr, > > - &DataSize, > > - &OsIndications > > - ); > > - if (!EFI_ERROR (Status)) { > > - OsIndications |=3D EFI_OS_INDICATIONS_BOOT_TO_FW_UI; > > - } else { > > - OsIndications =3D EFI_OS_INDICATIONS_BOOT_TO_FW_UI; > > - } > > > > - Status =3D gRT->SetVariable ( > > + if (EFI_ERROR (Status)) { > > + ShellStatus =3D SHELL_UNSUPPORTED; > > + goto Error; > > + } > > + > > + if ((OsIndications & EFI_OS_INDICATIONS_BOOT_TO_FW_UI) !=3D 0)= { > > + DataSize =3D sizeof (OsIndications); > > + Status =3D gRT->GetVariable ( > > EFI_OS_INDICATIONS_VARIABLE_NAME, > > &gEfiGlobalVariableGuid, > > - EFI_VARIABLE_NON_VOLATILE | > EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, > > - sizeof (OsIndications), > > + &Attr, > > + &DataSize, > > &OsIndications > > ); > > + > > + if (EFI_ERROR (Status)) { > > + OsIndications =3D EFI_OS_INDICATIONS_BOOT_TO_FW_UI; > > + } else { > > + OsIndications |=3D EFI_OS_INDICATIONS_BOOT_TO_FW_UI; > > } > > + > > + Status =3D gRT->SetVariable ( > > + EFI_OS_INDICATIONS_VARIABLE_NAME, > > + &gEfiGlobalVariableGuid, > > + EFI_VARIABLE_NON_VOLATILE | > EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, > > + sizeof (OsIndications), > > + &OsIndications > > + ); > > } > > > > if (EFI_ERROR (Status)) { > > -- > > 2.25.1 > > > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D > > Groups.io Links: You receive all messages sent to this group. > > View/Reply Online (#111856): > > https://edk2.groups.io/g/devel/message/111856 > > Mute This Topic: https://groups.io/mt/102877864/7994090 > > Group Owner: devel+owner@edk2.groups.io > > Unsubscribe: https://edk2.groups.io/g/devel/unsub [tom.pilar@arm.com] > > -=3D-=3D-=3D-=3D-=3D-=3D > > > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112495): https://edk2.groups.io/g/devel/message/112495 Mute This Topic: https://groups.io/mt/102877864/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-