From nobody Thu Dec 26 13:42:29 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.zohomail.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 1505451495551370.20455510890577; Thu, 14 Sep 2017 21:58:15 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5CAB621EA35AF; Thu, 14 Sep 2017 21:55:07 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 4ADA921EA35AF for ; Thu, 14 Sep 2017 21:55:06 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2017 21:58:05 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 21:58:04 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,396,1500966000"; d="scan'208";a="152114498" From: Hao Wu To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 12:57:52 +0800 Message-Id: <20170915045753.588-7-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170915045753.588-1-hao.a.wu@intel.com> References: <20170915045753.588-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 6/7] MdeModulePkg/Udf: Avoid declaring and initializing local GUID variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Eric Dong , Hao Wu , Dandan Bi , 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" The local GUID variable 'UdfDevPathGuid', it has been initialized during its declaration. For better coding style, this commit uses a global variable instead. Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu --- MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c | 8 ++++++-- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/= Universal/Disk/PartitionDxe/Udf.c index c566bfc594..609f56cef6 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c @@ -28,6 +28,11 @@ typedef struct { } UDF_DEVICE_PATH; =20 // +// Vendor-Defined Device Path GUID for UDF file system +// +EFI_GUID gUdfDevPathGuid =3D EFI_UDF_DEVICE_PATH_GUID; + +// // Vendor-Defined Media Device Path for UDF file system // UDF_DEVICE_PATH gUdfDevicePath =3D { @@ -260,7 +265,6 @@ PartitionInstallUdfChildHandles ( EFI_BLOCK_IO_MEDIA *Media; EFI_DEVICE_PATH_PROTOCOL *DevicePathNode; EFI_GUID *VendorDefinedGuid; - EFI_GUID UdfDevPathGuid =3D EFI_UDF_DEVICE_PATH_GUID; EFI_PARTITION_INFO_PROTOCOL PartitionInfo; =20 Media =3D BlockIo->Media; @@ -291,7 +295,7 @@ PartitionInstallUdfChildHandles ( if (DevicePathSubType (DevicePathNode) =3D=3D MEDIA_VENDOR_DP) { VendorDefinedGuid =3D (EFI_GUID *)((UINTN)DevicePathNode + OFFSET_OF (VENDOR_DEVICE_PATH, Gu= id)); - if (CompareGuid (VendorDefinedGuid, &UdfDevPathGuid)) { + if (CompareGuid (VendorDefinedGuid, &gUdfDevPathGuid)) { return EFI_NOT_FOUND; } } diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 90862932fd..dfbf6b3f95 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -14,6 +14,11 @@ =20 #include "Udf.h" =20 +// +// Vendor-Defined Device Path GUID for UDF file system +// +EFI_GUID gUdfDevPathGuid =3D EFI_UDF_DEVICE_PATH_GUID; + /** Find the anchor volume descriptor pointer. =20 @@ -2650,7 +2655,6 @@ SupportUdfFileSystem ( EFI_DEVICE_PATH_PROTOCOL *DevicePathNode; EFI_DEVICE_PATH_PROTOCOL *LastDevicePathNode; EFI_GUID *VendorDefinedGuid; - EFI_GUID UdfDevPathGuid =3D EFI_UDF_DEVICE_PATH_GUID; =20 // // Open Device Path protocol on ControllerHandle @@ -2687,7 +2691,7 @@ SupportUdfFileSystem ( DevicePathSubType (LastDevicePathNode) =3D=3D MEDIA_VENDOR_DP) { VendorDefinedGuid =3D (EFI_GUID *)((UINTN)LastDevicePathNode + OFFSET_OF (VENDOR_DEVICE_PATH, Guid)); - if (CompareGuid (VendorDefinedGuid, &UdfDevPathGuid)) { + if (CompareGuid (VendorDefinedGuid, &gUdfDevPathGuid)) { Status =3D EFI_SUCCESS; } } --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel