]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/EnhancedFatDxe/Hash.c
FatPkg: Refine casting expression result to bigger size
[mirror_edk2.git] / FatPkg / EnhancedFatDxe / Hash.c
index f827368ef5ebfe8bc4e3cd2d91f4ea8930c14515..5a9bbda754319644858ed8eb12afee98da94ad08 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  Hash table operations.\r
 \r
 Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available\r
@@ -9,41 +10,24 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
+**/\r
 \r
-Module Name:\r
-\r
-  Hash.c\r
-\r
-Abstract:\r
+#include "Fat.h"\r
 \r
-  Hash table operations\r
+/**\r
 \r
-Revision History\r
+  Get hash value for long name.\r
 \r
---*/\r
+  @param  LongNameString        - The long name string to be hashed.\r
 \r
-#include "Fat.h"\r
+  @return HashValue.\r
 \r
+**/\r
 STATIC\r
 UINT32\r
 FatHashLongName (\r
   IN CHAR16   *LongNameString\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get hash value for long name.\r
-\r
-Arguments:\r
-\r
-  LongNameString        - The long name string to be hashed.\r
-\r
-Returns:\r
-\r
-  HashValue.\r
-\r
---*/\r
 {\r
   UINT32  HashValue;\r
   CHAR16  UpCasedLongFileName[EFI_PATH_STRING_LENGTH];\r
@@ -58,53 +42,41 @@ Returns:
   return (HashValue & HASH_TABLE_MASK);\r
 }\r
 \r
-STATIC\r
-UINT32\r
-FatHashShortName (\r
-  IN CHAR8   *ShortNameString\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Get hash value for short name.\r
 \r
-Arguments:\r
+  @param  ShortNameString       - The short name string to be hashed.\r
 \r
-  ShortNameString       - The short name string to be hashed.\r
+  @return HashValue\r
 \r
-Returns:\r
-\r
-  HashValue\r
-\r
---*/\r
+**/\r
+STATIC\r
+UINT32\r
+FatHashShortName (\r
+  IN CHAR8   *ShortNameString\r
+  )\r
 {\r
   UINT32  HashValue;\r
   gBS->CalculateCrc32 (ShortNameString, FAT_NAME_LEN, &HashValue);\r
   return (HashValue & HASH_TABLE_MASK);\r
 }\r
 \r
-FAT_DIRENT **\r
-FatLongNameHashSearch (\r
-  IN FAT_ODIR       *ODir,\r
-  IN CHAR16         *LongNameString\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Search the long name hash table for the directory entry.\r
 \r
-Arguments:\r
-\r
-  ODir                  - The directory to be searched.\r
-  LongNameString        - The long name string to search.\r
-\r
-Returns:\r
+  @param  ODir                  - The directory to be searched.\r
+  @param  LongNameString        - The long name string to search.\r
 \r
-  The previous long name hash node of the directory entry.\r
+  @return The previous long name hash node of the directory entry.\r
 \r
---*/\r
+**/\r
+FAT_DIRENT **\r
+FatLongNameHashSearch (\r
+  IN FAT_ODIR       *ODir,\r
+  IN CHAR16         *LongNameString\r
+  )\r
 {\r
   FAT_DIRENT  **PreviousHashNode;\r
   for (PreviousHashNode   = &ODir->LongNameHashTable[FatHashLongName (LongNameString)];\r
@@ -119,27 +91,21 @@ Returns:
   return PreviousHashNode;\r
 }\r
 \r
-FAT_DIRENT **\r
-FatShortNameHashSearch (\r
-  IN FAT_ODIR      *ODir,\r
-  IN CHAR8         *ShortNameString\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Search the short name hash table for the directory entry.\r
 \r
-Arguments:\r
-\r
-  ODir                  - The directory to be searched.\r
-  ShortNameString       - The short name string to search.\r
+  @param  ODir                  - The directory to be searched.\r
+  @param  ShortNameString       - The short name string to search.\r
 \r
-Returns:\r
+  @return The previous short name hash node of the directory entry.\r
 \r
-  The previous short name hash node of the directory entry.\r
-\r
---*/\r
+**/\r
+FAT_DIRENT **\r
+FatShortNameHashSearch (\r
+  IN FAT_ODIR      *ODir,\r
+  IN CHAR8         *ShortNameString\r
+  )\r
 {\r
   FAT_DIRENT  **PreviousHashNode;\r
   for (PreviousHashNode   = &ODir->ShortNameHashTable[FatHashShortName (ShortNameString)];\r
@@ -154,27 +120,19 @@ Returns:
   return PreviousHashNode;\r
 }\r
 \r
+/**\r
+\r
+  Insert directory entry to hash table.\r
+\r
+  @param  ODir                  - The parent directory.\r
+  @param  DirEnt                - The directory entry node.\r
+\r
+**/\r
 VOID\r
 FatInsertToHashTable (\r
   IN FAT_ODIR     *ODir,\r
   IN FAT_DIRENT   *DirEnt\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Insert directory entry to hash table.\r
-\r
-Arguments:\r
-\r
-  ODir                  - The parent directory.\r
-  DirEnt                - The directory entry node.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   FAT_DIRENT  **HashTable;\r
   UINT32      HashTableIndex;\r
@@ -195,27 +153,19 @@ Returns:
   HashTable[HashTableIndex]     = DirEnt;\r
 }\r
 \r
+/**\r
+\r
+  Delete directory entry from hash table.\r
+\r
+  @param  ODir                  - The parent directory.\r
+  @param  DirEnt                - The directory entry node.\r
+\r
+**/\r
 VOID\r
 FatDeleteFromHashTable (\r
   IN FAT_ODIR     *ODir,\r
   IN FAT_DIRENT   *DirEnt\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Delete directory entry from hash table.\r
-\r
-Arguments:\r
-\r
-  ODir                  - The parent directory.\r
-  DirEnt                - The directory entry node.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   *FatShortNameHashSearch (ODir, DirEnt->Entry.FileName) = DirEnt->ShortNameForwardLink;\r
   *FatLongNameHashSearch (ODir, DirEnt->FileString)      = DirEnt->LongNameForwardLink;\r