diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:53:58 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | bcdcc4160d7460c46c08c9395aae81be44ef23a9 (patch) | |
tree | 8e8607b86b86a1cebeaf6f614c43731a486b61a5 /FatPkg/EnhancedFatDxe/Hash.c | |
parent | a550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97 (diff) | |
download | edk2-bcdcc4160d7460c46c08c9395aae81be44ef23a9.tar.gz edk2-bcdcc4160d7460c46c08c9395aae81be44ef23a9.tar.bz2 edk2-bcdcc4160d7460c46c08c9395aae81be44ef23a9.zip |
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>
Diffstat (limited to 'FatPkg/EnhancedFatDxe/Hash.c')
-rw-r--r-- | FatPkg/EnhancedFatDxe/Hash.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/FatPkg/EnhancedFatDxe/Hash.c b/FatPkg/EnhancedFatDxe/Hash.c index 3413cd6ffe..142dafe349 100644 --- a/FatPkg/EnhancedFatDxe/Hash.c +++ b/FatPkg/EnhancedFatDxe/Hash.c @@ -20,11 +20,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent STATIC
UINT32
FatHashLongName (
- IN CHAR16 *LongNameString
+ IN CHAR16 *LongNameString
)
{
UINT32 HashValue;
CHAR16 UpCasedLongFileName[EFI_PATH_STRING_LENGTH];
+
StrnCpyS (
UpCasedLongFileName,
ARRAY_SIZE (UpCasedLongFileName),
@@ -48,10 +49,11 @@ FatHashLongName ( STATIC
UINT32
FatHashShortName (
- IN CHAR8 *ShortNameString
+ IN CHAR8 *ShortNameString
)
{
UINT32 HashValue;
+
gBS->CalculateCrc32 (ShortNameString, FAT_NAME_LEN, &HashValue);
return (HashValue & HASH_TABLE_MASK);
}
@@ -68,15 +70,17 @@ FatHashShortName ( **/
FAT_DIRENT **
FatLongNameHashSearch (
- IN FAT_ODIR *ODir,
- IN CHAR16 *LongNameString
+ IN FAT_ODIR *ODir,
+ IN CHAR16 *LongNameString
)
{
FAT_DIRENT **PreviousHashNode;
+
for (PreviousHashNode = &ODir->LongNameHashTable[FatHashLongName (LongNameString)];
*PreviousHashNode != NULL;
PreviousHashNode = &(*PreviousHashNode)->LongNameForwardLink
- ) {
+ )
+ {
if (FatStriCmp (LongNameString, (*PreviousHashNode)->FileString) == 0) {
break;
}
@@ -97,15 +101,17 @@ FatLongNameHashSearch ( **/
FAT_DIRENT **
FatShortNameHashSearch (
- IN FAT_ODIR *ODir,
- IN CHAR8 *ShortNameString
+ IN FAT_ODIR *ODir,
+ IN CHAR8 *ShortNameString
)
{
FAT_DIRENT **PreviousHashNode;
+
for (PreviousHashNode = &ODir->ShortNameHashTable[FatHashShortName (ShortNameString)];
*PreviousHashNode != NULL;
PreviousHashNode = &(*PreviousHashNode)->ShortNameForwardLink
- ) {
+ )
+ {
if (CompareMem (ShortNameString, (*PreviousHashNode)->Entry.FileName, FAT_NAME_LEN) == 0) {
break;
}
@@ -124,8 +130,8 @@ FatShortNameHashSearch ( **/
VOID
FatInsertToHashTable (
- IN FAT_ODIR *ODir,
- IN FAT_DIRENT *DirEnt
+ IN FAT_ODIR *ODir,
+ IN FAT_DIRENT *DirEnt
)
{
FAT_DIRENT **HashTable;
@@ -134,17 +140,17 @@ FatInsertToHashTable ( //
// Insert hash table index for short name
//
- HashTableIndex = FatHashShortName (DirEnt->Entry.FileName);
- HashTable = ODir->ShortNameHashTable;
- DirEnt->ShortNameForwardLink = HashTable[HashTableIndex];
- HashTable[HashTableIndex] = DirEnt;
+ HashTableIndex = FatHashShortName (DirEnt->Entry.FileName);
+ HashTable = ODir->ShortNameHashTable;
+ DirEnt->ShortNameForwardLink = HashTable[HashTableIndex];
+ HashTable[HashTableIndex] = DirEnt;
//
// Insert hash table index for long name
//
- HashTableIndex = FatHashLongName (DirEnt->FileString);
- HashTable = ODir->LongNameHashTable;
- DirEnt->LongNameForwardLink = HashTable[HashTableIndex];
- HashTable[HashTableIndex] = DirEnt;
+ HashTableIndex = FatHashLongName (DirEnt->FileString);
+ HashTable = ODir->LongNameHashTable;
+ DirEnt->LongNameForwardLink = HashTable[HashTableIndex];
+ HashTable[HashTableIndex] = DirEnt;
}
/**
@@ -157,8 +163,8 @@ FatInsertToHashTable ( **/
VOID
FatDeleteFromHashTable (
- IN FAT_ODIR *ODir,
- IN FAT_DIRENT *DirEnt
+ IN FAT_ODIR *ODir,
+ IN FAT_DIRENT *DirEnt
)
{
*FatShortNameHashSearch (ODir, DirEnt->Entry.FileName) = DirEnt->ShortNameForwardLink;
|