diff options
Diffstat (limited to 'ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c')
-rw-r--r-- | ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c index 017b410..386b880 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c @@ -32,14 +32,14 @@ VOID
EFIAPI
GetNextLanguage (
- IN OUT CHAR8 **LangCode,
- OUT CHAR8 *Lang
+ IN OUT CHAR8 **LangCode,
+ OUT CHAR8 *Lang
)
{
UINTN Index;
CHAR8 *StringPtr;
- if (LangCode == NULL || *LangCode == NULL || Lang == NULL) {
+ if ((LangCode == NULL) || (*LangCode == NULL) || (Lang == NULL)) {
return;
}
@@ -55,6 +55,7 @@ GetNextLanguage ( if (StringPtr[Index] == ';') {
Index++;
}
+
*LangCode = StringPtr + Index;
}
@@ -69,7 +70,7 @@ GetNextLanguage ( UINT16
EFIAPI
GetSupportedLanguageNumber (
- IN EFI_HII_HANDLE HiiHandle
+ IN EFI_HII_HANDLE HiiHandle
)
{
CHAR8 *Lang;
@@ -83,20 +84,21 @@ GetSupportedLanguageNumber ( }
LangNumber = 0;
- Lang = AllocatePool (AsciiStrSize (Languages));
+ Lang = AllocatePool (AsciiStrSize (Languages));
if (Lang != NULL) {
LanguageString = Languages;
while (*LanguageString != 0) {
GetNextLanguage (&LanguageString, Lang);
LangNumber++;
}
+
FreePool (Lang);
}
+
FreePool (Languages);
return LangNumber;
}
-
/**
This function makes boot time changes to the contents of the
MiscNumberOfInstallableLanguages (Type 13) record.
@@ -109,14 +111,13 @@ GetSupportedLanguageNumber ( @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory.
**/
-SMBIOS_MISC_TABLE_FUNCTION(MiscNumberOfInstallableLanguages)
-{
- UINTN LangStrLen;
- CHAR8 CurrentLang[SMBIOS_STRING_MAX_LENGTH + 1];
- CHAR8 *OptionalStrStart;
- EFI_STATUS Status;
- SMBIOS_TABLE_TYPE13 *SmbiosRecord;
- SMBIOS_TABLE_TYPE13 *InputData;
+SMBIOS_MISC_TABLE_FUNCTION (MiscNumberOfInstallableLanguages) {
+ UINTN LangStrLen;
+ CHAR8 CurrentLang[SMBIOS_STRING_MAX_LENGTH + 1];
+ CHAR8 *OptionalStrStart;
+ EFI_STATUS Status;
+ SMBIOS_TABLE_TYPE13 *SmbiosRecord;
+ SMBIOS_TABLE_TYPE13 *InputData;
InputData = NULL;
@@ -155,10 +156,15 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscNumberOfInstallableLanguages) //
// Now we have got the full smbios record, call smbios protocol to add this record.
//
- Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
+ Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
- __FUNCTION__, DEBUG_LINE_NUMBER, Status));
+ DEBUG ((
+ DEBUG_ERROR,
+ "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
+ __FUNCTION__,
+ DEBUG_LINE_NUMBER,
+ Status
+ ));
}
FreePool (SmbiosRecord);
|