FatPkg: Apply uncrustify changes

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

Apply uncrustify changes to .c/.h files in the FatPkg 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: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:53:58 -08:00
committed by mergify[bot]
parent a550d468a6
commit bcdcc4160d
30 changed files with 2153 additions and 2047 deletions

View File

@@ -23,26 +23,27 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
BOOLEAN
PartitionValidMbr (
IN MASTER_BOOT_RECORD *Mbr,
IN EFI_PEI_LBA LastLba
IN MASTER_BOOT_RECORD *Mbr,
IN EFI_PEI_LBA LastLba
)
{
UINT32 StartingLBA;
UINT32 EndingLBA;
UINT32 NewEndingLBA;
INTN Index1;
INTN Index2;
BOOLEAN MbrValid;
UINT32 StartingLBA;
UINT32 EndingLBA;
UINT32 NewEndingLBA;
INTN Index1;
INTN Index2;
BOOLEAN MbrValid;
if (Mbr->Signature != MBR_SIGNATURE) {
return FALSE;
}
//
// The BPB also has this signature, so it can not be used alone.
//
MbrValid = FALSE;
for (Index1 = 0; Index1 < MAX_MBR_PARTITIONS; Index1++) {
if (Mbr->Partition[Index1].OSIndicator == 0x00 || UNPACK_UINT32 (Mbr->Partition[Index1].SizeInLBA) == 0) {
if ((Mbr->Partition[Index1].OSIndicator == 0x00) || (UNPACK_UINT32 (Mbr->Partition[Index1].SizeInLBA) == 0)) {
continue;
}
@@ -65,12 +66,12 @@ PartitionValidMbr (
}
for (Index2 = Index1 + 1; Index2 < MAX_MBR_PARTITIONS; Index2++) {
if (Mbr->Partition[Index2].OSIndicator == 0x00 || UNPACK_INT32 (Mbr->Partition[Index2].SizeInLBA) == 0) {
if ((Mbr->Partition[Index2].OSIndicator == 0x00) || (UNPACK_INT32 (Mbr->Partition[Index2].SizeInLBA) == 0)) {
continue;
}
NewEndingLBA = UNPACK_UINT32 (Mbr->Partition[Index2].StartingLBA) + UNPACK_UINT32 (Mbr->Partition[Index2].SizeInLBA) - 1;
if (NewEndingLBA >= StartingLBA && UNPACK_UINT32 (Mbr->Partition[Index2].StartingLBA) <= EndingLBA) {
if ((NewEndingLBA >= StartingLBA) && (UNPACK_UINT32 (Mbr->Partition[Index2].StartingLBA) <= EndingLBA)) {
//
// This region overlaps with the Index1'th region
//
@@ -78,6 +79,7 @@ PartitionValidMbr (
}
}
}
//
// Non of the regions overlapped so MBR is O.K.
//
@@ -98,8 +100,8 @@ PartitionValidMbr (
**/
BOOLEAN
FatFindMbrPartitions (
IN PEI_FAT_PRIVATE_DATA *PrivateData,
IN UINTN ParentBlockDevNo
IN PEI_FAT_PRIVATE_DATA *PrivateData,
IN UINTN ParentBlockDevNo
)
{
EFI_STATUS Status;
@@ -113,55 +115,56 @@ FatFindMbrPartitions (
return FALSE;
}
ParentBlockDev = &(PrivateData->BlockDevice[ParentBlockDevNo]);
ParentBlockDev = &(PrivateData->BlockDevice[ParentBlockDevNo]);
if (ParentBlockDev->BlockSize > PEI_FAT_MAX_BLOCK_SIZE) {
DEBUG((DEBUG_ERROR, "Device BlockSize %x exceeds FAT_MAX_BLOCK_SIZE\n", ParentBlockDev->BlockSize));
DEBUG ((DEBUG_ERROR, "Device BlockSize %x exceeds FAT_MAX_BLOCK_SIZE\n", ParentBlockDev->BlockSize));
return FALSE;
}
Found = FALSE;
Mbr = (MASTER_BOOT_RECORD *) PrivateData->BlockData;
Found = FALSE;
Mbr = (MASTER_BOOT_RECORD *)PrivateData->BlockData;
Status = FatReadBlock (
PrivateData,
ParentBlockDevNo,
0,
ParentBlockDev->BlockSize,
Mbr
);
PrivateData,
ParentBlockDevNo,
0,
ParentBlockDev->BlockSize,
Mbr
);
if (EFI_ERROR (Status) || !PartitionValidMbr (Mbr, ParentBlockDev->LastBlock)) {
goto Done;
}
//
// We have a valid mbr - add each partition
//
for (Index = 0; Index < MAX_MBR_PARTITIONS; Index++) {
if (Mbr->Partition[Index].OSIndicator == 0x00 || UNPACK_INT32 (Mbr->Partition[Index].SizeInLBA) == 0) {
if ((Mbr->Partition[Index].OSIndicator == 0x00) || (UNPACK_INT32 (Mbr->Partition[Index].SizeInLBA) == 0)) {
//
// Don't use null MBR entries
//
continue;
}
//
// Register this partition
//
if (PrivateData->BlockDeviceCount < PEI_FAT_MAX_BLOCK_DEVICE) {
Found = TRUE;
Found = TRUE;
BlockDev = &(PrivateData->BlockDevice[PrivateData->BlockDeviceCount]);
BlockDev = &(PrivateData->BlockDevice[PrivateData->BlockDeviceCount]);
BlockDev->BlockSize = MBR_SIZE;
BlockDev->LastBlock = UNPACK_INT32 (Mbr->Partition[Index].SizeInLBA) - 1;
BlockDev->IoAlign = ParentBlockDev->IoAlign;
BlockDev->Logical = TRUE;
BlockDev->PartitionChecked = FALSE;
BlockDev->StartingPos = MultU64x32 (
UNPACK_INT32 (Mbr->Partition[Index].StartingLBA),
ParentBlockDev->BlockSize
);
BlockDev->BlockSize = MBR_SIZE;
BlockDev->LastBlock = UNPACK_INT32 (Mbr->Partition[Index].SizeInLBA) - 1;
BlockDev->IoAlign = ParentBlockDev->IoAlign;
BlockDev->Logical = TRUE;
BlockDev->PartitionChecked = FALSE;
BlockDev->StartingPos = MultU64x32 (
UNPACK_INT32 (Mbr->Partition[Index].StartingLBA),
ParentBlockDev->BlockSize
);
BlockDev->ParentDevNo = ParentBlockDevNo;
PrivateData->BlockDeviceCount++;