diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-05-14 06:07:07 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-05-14 06:07:07 +0000 |
commit | ea7cb08c0afc7ad5dd9ed7176cd062385df8fa8b (patch) | |
tree | febbcc3c37da1e44b5405f5c5085e93be96f8b48 /MdeModulePkg/Universal/Disk | |
parent | d29270810c282aa3b7938b42a3e6efbc08014a91 (diff) | |
download | edk2-platforms-ea7cb08c0afc7ad5dd9ed7176cd062385df8fa8b.tar.xz |
Minor coding style adjustment for DiskIo, Partition, English and Ebc modules.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5200 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Disk')
7 files changed, 83 insertions, 94 deletions
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h index 5223ae7b90..f4a378133b 100644 --- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h +++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h @@ -13,8 +13,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
-#ifndef _DISK_IO_H
-#define _DISK_IO_H
+#ifndef _DISK_IO_H_
+#define _DISK_IO_H_
#include <Uefi.h>
#include <Protocol/BlockIo.h>
@@ -69,9 +69,9 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gDiskIoComponentName2; EFI_STATUS
EFIAPI
DiskIoDriverBindingSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
);
/**
@@ -91,9 +91,9 @@ DiskIoDriverBindingSupported ( EFI_STATUS
EFIAPI
DiskIoDriverBindingStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
);
/**
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c b/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c index f208194eac..ce3305039d 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c @@ -166,7 +166,7 @@ PartitionInstallElToritoChildHandles ( Check += CheckBuffer[Index];
}
- if (Check & 0xFFFF) {
+ if ((Check & 0xFFFF) != 0) {
DEBUG ((EFI_D_ERROR, "EltCheckBootCatalog: El Torito boot catalog header checksum failed\n"));
continue;
}
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c index ef3c766e53..6d3abae843 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c @@ -79,7 +79,7 @@ PartitionRestoreGptTable ( /**
- Restore Partition Table to its alternate place
+ Restore Partition Table to its alternate place.
(Primary -> Backup or Backup -> Primary)
@param[in] PartHeader Partition table header structure
@@ -97,7 +97,7 @@ PartitionCheckGptEntry ( /**
- Checks the CRC32 value in the table header
+ Checks the CRC32 value in the table header.
@param MaxSize Max Size limit
@param Size The size of the table
@@ -116,7 +116,7 @@ PartitionCheckCrcAltSize ( /**
- Checks the CRC32 value in the table header
+ Checks the CRC32 value in the table header.
@param MaxSize Max Size limit
@param Hdr Table to check
@@ -133,7 +133,7 @@ PartitionCheckCrc ( /**
- Updates the CRC32 value in the table header
+ Updates the CRC32 value in the table header.
@param Size The size of the table
@param Hdr Table to update
@@ -147,7 +147,7 @@ PartitionSetCrcAltSize ( /**
- Updates the CRC32 value in the table header
+ Updates the CRC32 value in the table header.
@param Hdr Table to update
@@ -619,7 +619,7 @@ Done: /**
- Restore Partition Table to its alternate place
+ Restore Partition Table to its alternate place.
(Primary -> Backup or Backup -> Primary)
@param[in] PartHeader Partition table header structure
@@ -681,7 +681,7 @@ PartitionCheckGptEntry ( /**
- Updates the CRC32 value in the table header
+ Updates the CRC32 value in the table header.
@param Hdr Table to update
@@ -696,7 +696,7 @@ PartitionSetCrc ( /**
- Updates the CRC32 value in the table header
+ Updates the CRC32 value in the table header.
@param Size The size of the table
@param Hdr Table to update
@@ -707,7 +707,6 @@ PartitionSetCrcAltSize ( IN UINTN Size,
IN OUT EFI_TABLE_HEADER *Hdr
)
-
{
UINT32 Crc;
@@ -718,7 +717,7 @@ PartitionSetCrcAltSize ( /**
- Checks the CRC32 value in the table header
+ Checks the CRC32 value in the table header.
@param MaxSize Max Size limit
@param Hdr Table to check
@@ -738,7 +737,7 @@ PartitionCheckCrc ( /**
- Checks the CRC32 value in the table header
+ Checks the CRC32 value in the table header.
@param MaxSize Max Size limit
@param Size The size of the table
@@ -768,7 +767,7 @@ PartitionCheckCrcAltSize ( return FALSE;
}
- if (MaxSize && Size > MaxSize) {
+ if ((MaxSize != 0) && (Size > MaxSize)) {
DEBUG ((EFI_D_ERROR, "CheckCrc32: Size > MaxSize\n"));
return FALSE;
}
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c index c95a866e75..68b389ae91 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c @@ -93,7 +93,7 @@ PartitionValidMbr ( }
}
//
- // Non of the regions overlapped so MBR is O.K.
+ // None of the regions overlapped so MBR is O.K.
//
return MbrValid;
}
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h index 9d6477cc3a..6dcbd9b139 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h @@ -15,8 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
-#ifndef _PARTITION_H
-#define _PARTITION_H
+#ifndef _PARTITION_H_
+#define _PARTITION_H_
#include <Uefi.h>
#include <Protocol/BlockIo.h>
@@ -150,10 +150,10 @@ PartitionDriverBindingStart ( EFI_STATUS
EFIAPI
PartitionDriverBindingStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE *ChildHandleBuffer
);
//
@@ -313,12 +313,11 @@ PartitionInstallChildHandle ( IN EFI_BLOCK_IO_PROTOCOL *ParentBlockIo,
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN UINT64 Start,
- IN UINT64 End,
+ IN EFI_LBA Start,
+ IN EFI_LBA End,
IN UINT32 BlockSize,
IN BOOLEAN InstallEspGuid
- )
-;
+ );
/**
Install child handles if the Handle supports GPT partition structure.
@@ -341,8 +340,7 @@ PartitionInstallGptChildHandles ( IN EFI_DISK_IO_PROTOCOL *DiskIo,
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-;
+ );
/**
Install child handles if the Handle supports El Torito format.
@@ -366,8 +364,7 @@ PartitionInstallElToritoChildHandles ( IN EFI_DISK_IO_PROTOCOL *DiskIo,
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-;
+ );
/**
Install child handles if the Handle supports MBR format.
@@ -390,8 +387,7 @@ PartitionInstallMbrChildHandles ( IN EFI_DISK_IO_PROTOCOL *DiskIo,
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-;
+ );
typedef
EFI_STATUS
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c index 07bb2f446d..67f1db1c6c 100644 --- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c +++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c @@ -122,7 +122,7 @@ InitializeUnicodeCollationEng ( }
}
- for (Index = 0; mOtherChars[Index]; Index++) {
+ for (Index = 0; mOtherChars[Index] != 0; Index++) {
Index2 = mOtherChars[Index];
mEngInfoMap[Index2] |= CHAR_FAT_VALID;
}
@@ -191,8 +191,8 @@ EngStriColl ( IN CHAR16 *Str2
)
{
- while (*Str1) {
- if (ToUpper (*Str1) != ToUpper (*Str2)) {
+ while (*Str1 != 0) {
+ if (TO_UPPER (*Str1) != TO_UPPER (*Str2)) {
break;
}
@@ -200,7 +200,7 @@ EngStriColl ( Str2 += 1;
}
- return ToUpper (*Str1) - ToUpper (*Str2);
+ return TO_UPPER (*Str1) - TO_UPPER (*Str2);
}
@@ -219,8 +219,8 @@ EngStrLwr ( IN OUT CHAR16 *Str
)
{
- while (*Str) {
- *Str = ToLower (*Str);
+ while (*Str != 0) {
+ *Str = TO_LOWER (*Str);
Str += 1;
}
}
@@ -241,8 +241,8 @@ EngStrUpr ( IN OUT CHAR16 *Str
)
{
- while (*Str) {
- *Str = ToUpper (*Str);
+ while (*Str != 0) {
+ *Str = TO_UPPER (*Str);
Str += 1;
}
}
@@ -280,7 +280,7 @@ EngMetaiMatch ( //
// End of pattern. If end of string, TRUE match
//
- if (*String) {
+ if (*String != 0) {
return FALSE;
} else {
return TRUE;
@@ -290,7 +290,7 @@ EngMetaiMatch ( //
// Match zero or more chars
//
- while (*String) {
+ while (*String != 0) {
if (EngMetaiMatch (This, String, Pattern)) {
return TRUE;
}
@@ -304,7 +304,7 @@ EngMetaiMatch ( //
// Match any one char
//
- if (!*String) {
+ if (*String == 0) {
return FALSE;
}
@@ -316,7 +316,7 @@ EngMetaiMatch ( // Match char set
//
CharC = *String;
- if (!CharC) {
+ if (CharC == 0) {
//
// syntax problem
//
@@ -325,7 +325,7 @@ EngMetaiMatch ( Index3 = 0;
CharP = *Pattern++;
- while (CharP) {
+ while (CharP != 0) {
if (CharP == ']') {
return FALSE;
}
@@ -342,7 +342,7 @@ EngMetaiMatch ( return FALSE;
}
- if (ToUpper (CharC) >= ToUpper (Index3) && ToUpper (CharC) <= ToUpper (CharP)) {
+ if (TO_UPPER (CharC) >= TO_UPPER (Index3) && TO_UPPER (CharC) <= TO_UPPER (CharP)) {
//
// if in range, it's a match
//
@@ -351,7 +351,7 @@ EngMetaiMatch ( }
Index3 = CharP;
- if (ToUpper (CharC) == ToUpper (CharP)) {
+ if (TO_UPPER (CharC) == TO_UPPER (CharP)) {
//
// if char matches
//
@@ -363,7 +363,7 @@ EngMetaiMatch ( //
// skip to end of match char set
//
- while (CharP && CharP != ']') {
+ while ((CharP != 0) && (CharP != ']')) {
CharP = *Pattern;
Pattern += 1;
}
@@ -373,7 +373,7 @@ EngMetaiMatch ( default:
CharC = *String;
- if (ToUpper (CharC) != ToUpper (CharP)) {
+ if (TO_UPPER (CharC) != TO_UPPER (CharP)) {
return FALSE;
}
@@ -408,7 +408,7 @@ EngFatToStr ( //
// No DBCS issues, just expand and add null terminate to end of string
//
- while (*Fat && FatSize) {
+ while ((*Fat != 0) && (FatSize != 0)) {
*String = *Fat;
String += 1;
Fat += 1;
@@ -446,7 +446,7 @@ EngStrToFat ( BOOLEAN SpecialCharExist;
SpecialCharExist = FALSE;
- while (*String && FatSize) {
+ while ((*String != 0) && (FatSize != 0)) {
//
// Skip '.' or ' ' when making a fat name
//
@@ -455,7 +455,7 @@ EngStrToFat ( // If this is a valid fat char, move it.
// Otherwise, move a '_' and flag the fact that the name needs an Lfn
//
- if (*String < 0x100 && (mEngInfoMap[*String] & CHAR_FAT_VALID)) {
+ if (*String < 0x100 && ((mEngInfoMap[*String] & CHAR_FAT_VALID) != 0)) {
*Fat = mEngUpperMap[*String];
} else {
*Fat = '_';
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h index 7cab7088cf..85dc593789 100644 --- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h +++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
-#ifndef _UNICODE_COLLATION_ENG_H
-#define _UNICODE_COLLATION_ENG_H
+#ifndef _UNICODE_COLLATION_ENG_H_
+#define _UNICODE_COLLATION_ENG_H_
@@ -32,8 +32,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. //
#define CHAR_FAT_VALID 0x01
-#define ToUpper(a) (CHAR16) (a <= 0xFF ? mEngUpperMap[a] : a)
-#define ToLower(a) (CHAR16) (a <= 0xFF ? mEngLowerMap[a] : a)
+#define TO_UPPER(a) (CHAR16) (a <= 0xFF ? mEngUpperMap[a] : a)
+#define TO_LOWER(a) (CHAR16) (a <= 0xFF ? mEngLowerMap[a] : a)
//
// Prototypes
@@ -54,11 +54,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. INTN
EFIAPI
EngStriColl (
- IN EFI_UNICODE_COLLATION_PROTOCOL *This,
- IN CHAR16 *Str1,
- IN CHAR16 *Str2
- )
-;
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN CHAR16 *Str1,
+ IN CHAR16 *Str2
+ );
/**
Performs a case-insensitive comparison of a Null-terminated Unicode
@@ -75,11 +74,10 @@ EngStriColl ( BOOLEAN
EFIAPI
EngMetaiMatch (
- IN EFI_UNICODE_COLLATION_PROTOCOL *This,
- IN CHAR16 *String,
- IN CHAR16 *Pattern
- )
-;
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN CHAR16 *String,
+ IN CHAR16 *Pattern
+ );
/**
Converts all the Unicode characters in a Null-terminated Unicode string to
@@ -92,10 +90,9 @@ EngMetaiMatch ( VOID
EFIAPI
EngStrLwr (
- IN EFI_UNICODE_COLLATION_PROTOCOL *This,
- IN OUT CHAR16 *Str
- )
-;
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN OUT CHAR16 *Str
+ );
/**
Converts all the Unicode characters in a Null-terminated Unicode string to upper
@@ -108,10 +105,9 @@ EngStrLwr ( VOID
EFIAPI
EngStrUpr (
- IN EFI_UNICODE_COLLATION_PROTOCOL *This,
- IN OUT CHAR16 *Str
- )
-;
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN OUT CHAR16 *Str
+ );
/**
Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
@@ -128,12 +124,11 @@ EngStrUpr ( VOID
EFIAPI
EngFatToStr (
- IN EFI_UNICODE_COLLATION_PROTOCOL *This,
- IN UINTN FatSize,
- IN CHAR8 *Fat,
- OUT CHAR16 *String
- )
-;
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN UINTN FatSize,
+ IN CHAR8 *Fat,
+ OUT CHAR16 *String
+ );
/**
Converts a Null-terminated Unicode string to legal characters in a FAT
@@ -153,12 +148,11 @@ EngFatToStr ( BOOLEAN
EFIAPI
EngStrToFat (
- IN EFI_UNICODE_COLLATION_PROTOCOL *This,
- IN CHAR16 *String,
- IN UINTN FatSize,
- OUT CHAR8 *Fat
- )
-;
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN CHAR16 *String,
+ IN UINTN FatSize,
+ OUT CHAR8 *Fat
+ );
/**
The user Entry Point for English module.
@@ -178,7 +172,7 @@ EFIAPI InitializeUnicodeCollationEng (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
- )
-;
+ );
#endif
+
|