diff options
author | Hao Wu <hao.a.wu@intel.com> | 2017-09-15 08:43:22 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2017-09-19 12:44:03 +0800 |
commit | 3f92b104930ba582924da578a12ee0062881ab7b (patch) | |
tree | b22d3e6edc204f3ddc7c198bd84221e03eedb2fe /MdeModulePkg/Universal | |
parent | 32492fee2d7e7116b5970266915285d043e0c0e1 (diff) | |
download | edk2-3f92b104930ba582924da578a12ee0062881ab7b.tar.gz edk2-3f92b104930ba582924da578a12ee0062881ab7b.tar.bz2 edk2-3f92b104930ba582924da578a12ee0062881ab7b.zip |
MdeModulePkg/Udf: Avoid declaring and initializing local GUID variable
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 <pcacjr@zytor.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <pcacjr@zytor.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c | 8 | ||||
-rw-r--r-- | 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;
//
+// Vendor-Defined Device Path GUID for UDF file system
+//
+EFI_GUID gUdfDevPathGuid = EFI_UDF_DEVICE_PATH_GUID;
+
+//
// Vendor-Defined Media Device Path for UDF file system
//
UDF_DEVICE_PATH gUdfDevicePath = {
@@ -260,7 +265,6 @@ PartitionInstallUdfChildHandles ( EFI_BLOCK_IO_MEDIA *Media;
EFI_DEVICE_PATH_PROTOCOL *DevicePathNode;
EFI_GUID *VendorDefinedGuid;
- EFI_GUID UdfDevPathGuid = EFI_UDF_DEVICE_PATH_GUID;
EFI_PARTITION_INFO_PROTOCOL PartitionInfo;
Media = BlockIo->Media;
@@ -291,7 +295,7 @@ PartitionInstallUdfChildHandles ( if (DevicePathSubType (DevicePathNode) == MEDIA_VENDOR_DP) {
VendorDefinedGuid = (EFI_GUID *)((UINTN)DevicePathNode +
OFFSET_OF (VENDOR_DEVICE_PATH, Guid));
- if (CompareGuid (VendorDefinedGuid, &UdfDevPathGuid)) {
+ if (CompareGuid (VendorDefinedGuid, &gUdfDevPathGuid)) {
return EFI_NOT_FOUND;
}
}
diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/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 @@ #include "Udf.h"
+//
+// Vendor-Defined Device Path GUID for UDF file system
+//
+EFI_GUID gUdfDevPathGuid = EFI_UDF_DEVICE_PATH_GUID;
+
/**
Find the anchor volume descriptor pointer.
@@ -2650,7 +2655,6 @@ SupportUdfFileSystem ( EFI_DEVICE_PATH_PROTOCOL *DevicePathNode;
EFI_DEVICE_PATH_PROTOCOL *LastDevicePathNode;
EFI_GUID *VendorDefinedGuid;
- EFI_GUID UdfDevPathGuid = EFI_UDF_DEVICE_PATH_GUID;
//
// Open Device Path protocol on ControllerHandle
@@ -2687,7 +2691,7 @@ SupportUdfFileSystem ( DevicePathSubType (LastDevicePathNode) == MEDIA_VENDOR_DP) {
VendorDefinedGuid = (EFI_GUID *)((UINTN)LastDevicePathNode +
OFFSET_OF (VENDOR_DEVICE_PATH, Guid));
- if (CompareGuid (VendorDefinedGuid, &UdfDevPathGuid)) {
+ if (CompareGuid (VendorDefinedGuid, &gUdfDevPathGuid)) {
Status = EFI_SUCCESS;
}
}
|