MdeModulePkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the MdeModulePkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:02 -08:00
committed by mergify[bot]
parent 7c7184e201
commit 1436aea4d5
994 changed files with 107608 additions and 101311 deletions

View File

@@ -7,10 +7,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "Partition.h"
/**
Install child handles if the Handle supports El Torito format.
@@ -57,10 +55,10 @@ PartitionInstallElToritoChildHandles (
UINT32 VolSpaceSize;
EFI_PARTITION_INFO_PROTOCOL PartitionInfo;
Found = EFI_NOT_FOUND;
Media = BlockIo->Media;
Found = EFI_NOT_FOUND;
Media = BlockIo->Media;
VolSpaceSize = 0;
VolSpaceSize = 0;
//
// CD_ROM has the fixed block size as 2048 bytes (SIZE_2KB)
@@ -79,7 +77,7 @@ PartitionInstallElToritoChildHandles (
return EFI_NOT_FOUND;
}
Catalog = (ELTORITO_CATALOG *) VolDescriptor;
Catalog = (ELTORITO_CATALOG *)VolDescriptor;
//
// Loop: handle one volume descriptor per time
@@ -87,7 +85,8 @@ PartitionInstallElToritoChildHandles (
//
for (VolDescriptorOffset = SIZE_32KB;
VolDescriptorOffset <= MultU64x32 (Media->LastBlock, Media->BlockSize);
VolDescriptorOffset += SIZE_2KB) {
VolDescriptorOffset += SIZE_2KB)
{
Status = DiskIo->ReadDisk (
DiskIo,
Media->MediaId,
@@ -99,17 +98,20 @@ PartitionInstallElToritoChildHandles (
Found = Status;
break;
}
//
// Check for valid volume descriptor signature
//
if (VolDescriptor->Unknown.Type == CDVOL_TYPE_END ||
CompareMem (VolDescriptor->Unknown.Id, CDVOL_ID, sizeof (VolDescriptor->Unknown.Id)) != 0
) {
if ((VolDescriptor->Unknown.Type == CDVOL_TYPE_END) ||
(CompareMem (VolDescriptor->Unknown.Id, CDVOL_ID, sizeof (VolDescriptor->Unknown.Id)) != 0)
)
{
//
// end of Volume descriptor list
//
break;
}
//
// Read the Volume Space Size from Primary Volume Descriptor 81-88 byte,
// the 32-bit numerical values is stored in Both-byte orders
@@ -117,12 +119,14 @@ PartitionInstallElToritoChildHandles (
if (VolDescriptor->PrimaryVolume.Type == CDVOL_TYPE_CODED) {
VolSpaceSize = VolDescriptor->PrimaryVolume.VolSpaceSize[0];
}
//
// Is it an El Torito volume descriptor?
//
if (CompareMem (VolDescriptor->BootRecordVolume.SystemId, CDVOL_ELTORITO_ID, sizeof (CDVOL_ELTORITO_ID) - 1) != 0) {
continue;
}
//
// Read in the boot El Torito boot catalog
// The LBA unit used by El Torito boot catalog is 2KB unit
@@ -144,17 +148,18 @@ PartitionInstallElToritoChildHandles (
DEBUG ((DEBUG_ERROR, "EltCheckDevice: error reading catalog %r\n", Status));
continue;
}
//
// We don't care too much about the Catalog header's contents, but we do want
// to make sure it looks like a Catalog header
//
if (Catalog->Catalog.Indicator != ELTORITO_ID_CATALOG || Catalog->Catalog.Id55AA != 0xAA55) {
if ((Catalog->Catalog.Indicator != ELTORITO_ID_CATALOG) || (Catalog->Catalog.Id55AA != 0xAA55)) {
DEBUG ((DEBUG_ERROR, "EltCheckBootCatalog: El Torito boot catalog header IDs not correct\n"));
continue;
}
Check = 0;
CheckBuffer = (UINT16 *) Catalog;
CheckBuffer = (UINT16 *)Catalog;
for (Index = 0; Index < sizeof (ELTORITO_CATALOG) / sizeof (UINT16); Index += 1) {
Check += CheckBuffer[Index];
}
@@ -174,45 +179,45 @@ PartitionInstallElToritoChildHandles (
//
// Check this entry
//
if (Catalog->Boot.Indicator != ELTORITO_ID_SECTION_BOOTABLE || Catalog->Boot.Lba == 0) {
if ((Catalog->Boot.Indicator != ELTORITO_ID_SECTION_BOOTABLE) || (Catalog->Boot.Lba == 0)) {
continue;
}
SubBlockSize = 512;
SectorCount = Catalog->Boot.SectorCount;
SubBlockSize = 512;
SectorCount = Catalog->Boot.SectorCount;
switch (Catalog->Boot.MediaType) {
case ELTORITO_NO_EMULATION:
SubBlockSize = Media->BlockSize;
break;
case ELTORITO_NO_EMULATION:
SubBlockSize = Media->BlockSize;
break;
case ELTORITO_HARD_DISK:
break;
case ELTORITO_HARD_DISK:
break;
case ELTORITO_12_DISKETTE:
SectorCount = 0x50 * 0x02 * 0x0F;
break;
case ELTORITO_12_DISKETTE:
SectorCount = 0x50 * 0x02 * 0x0F;
break;
case ELTORITO_14_DISKETTE:
SectorCount = 0x50 * 0x02 * 0x12;
break;
case ELTORITO_14_DISKETTE:
SectorCount = 0x50 * 0x02 * 0x12;
break;
case ELTORITO_28_DISKETTE:
SectorCount = 0x50 * 0x02 * 0x24;
break;
case ELTORITO_28_DISKETTE:
SectorCount = 0x50 * 0x02 * 0x24;
break;
default:
DEBUG ((DEBUG_INIT, "EltCheckDevice: unsupported El Torito boot media type %x\n", Catalog->Boot.MediaType));
SectorCount = 0;
SubBlockSize = Media->BlockSize;
break;
default:
DEBUG ((DEBUG_INIT, "EltCheckDevice: unsupported El Torito boot media type %x\n", Catalog->Boot.MediaType));
SectorCount = 0;
SubBlockSize = Media->BlockSize;
break;
}
//
// Create child device handle
//
CdDev.Header.Type = MEDIA_DEVICE_PATH;
CdDev.Header.SubType = MEDIA_CDROM_DP;
CdDev.Header.Type = MEDIA_DEVICE_PATH;
CdDev.Header.SubType = MEDIA_CDROM_DP;
SetDevicePathNodeLength (&CdDev.Header, sizeof (CdDev));
if (Index == 1) {
@@ -222,7 +227,7 @@ PartitionInstallElToritoChildHandles (
BootEntry = 0;
}
CdDev.BootEntry = (UINT32) BootEntry;
CdDev.BootEntry = (UINT32)BootEntry;
BootEntry++;
CdDev.PartitionStart = Catalog->Boot.Lba * (SIZE_2KB / Media->BlockSize);
if (SectorCount < 2) {
@@ -249,20 +254,20 @@ PartitionInstallElToritoChildHandles (
PartitionInfo.Type = PARTITION_TYPE_OTHER;
Status = PartitionInstallChildHandle (
This,
Handle,
DiskIo,
DiskIo2,
BlockIo,
BlockIo2,
DevicePath,
(EFI_DEVICE_PATH_PROTOCOL *) &CdDev,
&PartitionInfo,
Catalog->Boot.Lba * (SIZE_2KB / Media->BlockSize),
Catalog->Boot.Lba * (SIZE_2KB / Media->BlockSize) + CdDev.PartitionSize - 1,
SubBlockSize,
NULL
);
This,
Handle,
DiskIo,
DiskIo2,
BlockIo,
BlockIo2,
DevicePath,
(EFI_DEVICE_PATH_PROTOCOL *)&CdDev,
&PartitionInfo,
Catalog->Boot.Lba * (SIZE_2KB / Media->BlockSize),
Catalog->Boot.Lba * (SIZE_2KB / Media->BlockSize) + CdDev.PartitionSize - 1,
SubBlockSize,
NULL
);
if (!EFI_ERROR (Status)) {
Found = EFI_SUCCESS;
}