From 45f6c85bb18a658d68d7b39db81a651014593273 Mon Sep 17 00:00:00 2001 From: eric_tian Date: Fri, 12 Dec 2008 09:48:24 +0000 Subject: code scrub on VariableRuntime Dxe driver git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7017 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/Variable/RuntimeDxe/Variable.c | 16 +++++++++++----- .../Universal/Variable/RuntimeDxe/Variable.h | 20 -------------------- 2 files changed, 11 insertions(+), 25 deletions(-) (limited to 'MdeModulePkg/Universal') diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 2d6d428..f09ed23 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -36,8 +36,14 @@ VARIABLE_CACHE_ENTRY mVariableCache[] = { } }; -GLOBAL_REMOVE_IF_UNREFERENCED VARIABLE_INFO_ENTRY *gVariableInfo = NULL; +VARIABLE_INFO_ENTRY *gVariableInfo = NULL; +EFI_STATUS +FtwVariableSpace ( + IN EFI_PHYSICAL_ADDRESS VariableBaseAddress, + IN UINT8 *Buffer, + IN UINTN BufferSize + ); /** @@ -747,7 +753,7 @@ Reclaim ( @param[in] VariableName Name of variable @param[in] VendorGuid Guid of variable - @param[in] Attribute Attribue of the variable + @param[in] Attributes Attribues of the variable @param[in] DataSize Size of data. 0 means delete @param[in] Data Variable data @@ -1364,7 +1370,7 @@ RuntimeServiceSetVariable ( // Only variable have NV|RT attribute can be created in Runtime // if (EfiAtRuntime () && - (!(Attributes & EFI_VARIABLE_RUNTIME_ACCESS) || !(Attributes & EFI_VARIABLE_NON_VOLATILE))) { + (((Attributes & EFI_VARIABLE_RUNTIME_ACCESS) == 0) || ((Attributes & EFI_VARIABLE_NON_VOLATILE) == 0))) { Status = EFI_INVALID_PARAMETER; goto Done; } @@ -1420,7 +1426,7 @@ RuntimeServiceSetVariable ( // include pad size. // VarSize = VarDataOffset + DataSize + GET_PAD_SIZE (DataSize); - if (Attributes & EFI_VARIABLE_NON_VOLATILE) { + if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) { // // Create a nonvolatile variable // @@ -1655,7 +1661,7 @@ RuntimeServiceQueryVariableInfo ( // Make sure if runtime bit is set, boot service bit is set also. // return EFI_INVALID_PARAMETER; - } else if (EfiAtRuntime () && !(Attributes & EFI_VARIABLE_RUNTIME_ACCESS)) { + } else if (EfiAtRuntime () && ((Attributes & EFI_VARIABLE_RUNTIME_ACCESS) == 0)) { // // Make sure RT Attribute is set if we are in Runtime phase. // diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h index c03dece..320d1ec 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h @@ -85,24 +85,4 @@ typedef struct { VOID *Data; } VARIABLE_CACHE_ENTRY; - -// -// Functions -// - -EFI_STATUS -EFIAPI -VariableServiceInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ); - - -EFI_STATUS -FtwVariableSpace ( - IN EFI_PHYSICAL_ADDRESS VariableBaseAddress, - IN UINT8 *Buffer, - IN UINTN BufferSize - ); - #endif -- cgit v1.1