diff --git a/CloverEFI/AcpiReset/Reset.c b/CloverEFI/AcpiReset/Reset.c index 26eb9c946..9761f26dc 100644 --- a/CloverEFI/AcpiReset/Reset.c +++ b/CloverEFI/AcpiReset/Reset.c @@ -212,7 +212,7 @@ InitializeReset ( &gEfiResetArchProtocolGuid, NULL, NULL ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } diff --git a/CloverEFI/BiosKeyboard/AppleKey.c b/CloverEFI/BiosKeyboard/AppleKey.c index 8245c67e5..b3e263ff3 100644 --- a/CloverEFI/BiosKeyboard/AppleKey.c +++ b/CloverEFI/BiosKeyboard/AppleKey.c @@ -43,7 +43,7 @@ BiosKbSetAppleKeyMapDb ( &BiosKeyboardDevice->KeyMapDbIndex ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosKeyboardDevice->KeyMapDb = AppleKeyMapDb; } return Status; @@ -74,7 +74,7 @@ BiosKbAppleKeyMapDbInstallNotify ( mAppleKeyMapDbRegistration, (VOID **)&mAppleKeyMapDb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosKbSetAppleKeyMapDb ((BIOS_KEYBOARD_DEV *)Context, mAppleKeyMapDb); gBS->CloseEvent (Event); } @@ -98,7 +98,7 @@ BiosKbLocateAppleKeyMapDb ( NULL, (VOID **)&mAppleKeyMapDb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosKbSetAppleKeyMapDb (BiosKeyboardDevice, mAppleKeyMapDb); } else { diff --git a/CloverEFI/BiosKeyboard/BiosKeyboard.c b/CloverEFI/BiosKeyboard/BiosKeyboard.c index 2977476fb..1cf080615 100644 --- a/CloverEFI/BiosKeyboard/BiosKeyboard.c +++ b/CloverEFI/BiosKeyboard/BiosKeyboard.c @@ -166,14 +166,14 @@ BiosKeyboardDriverBindingSupported ( (VOID **) &LegacyBios ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; }*/ // // See if the Legacy 8259 Protocol is available // Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &Legacy8259); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG(" Legacy 8259 Protocol NOT available\n"); return Status; } @@ -190,7 +190,7 @@ DBG(" Legacy 8259 Protocol NOT available\n"); EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { //DBG("OpenProtocol gEfiIsaIoProtocolGuid failed, status=%x\n", Status); return Status; } @@ -271,7 +271,7 @@ BiosKeyboardDriverBindingStart ( (VOID **) &LegacyBios ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; }*/ // @@ -279,7 +279,7 @@ BiosKeyboardDriverBindingStart ( // if (mLegacy8259 == NULL) { Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &mLegacy8259); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -295,7 +295,7 @@ BiosKeyboardDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -310,7 +310,7 @@ BiosKeyboardDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -381,7 +381,7 @@ BiosKeyboardDriverBindingStart ( &(BiosKeyboardPrivate->SimpleTextIn), &((BiosKeyboardPrivate->SimpleTextIn).WaitForKey) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { (BiosKeyboardPrivate->SimpleTextIn).WaitForKey = NULL; goto Done; } @@ -392,7 +392,7 @@ BiosKeyboardDriverBindingStart ( &(BiosKeyboardPrivate->SimpleTextInputEx), &(BiosKeyboardPrivate->SimpleTextInputEx.WaitForKeyEx) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BiosKeyboardPrivate->SimpleTextInputEx.WaitForKeyEx = NULL; goto Done; } @@ -407,7 +407,7 @@ BiosKeyboardDriverBindingStart ( BiosKeyboardPrivate, &BiosKeyboardPrivate->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto Done; @@ -418,7 +418,7 @@ BiosKeyboardDriverBindingStart ( TimerPeriodic, KEYBOARD_TIMER_INTERVAL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto Done; @@ -441,7 +441,7 @@ BiosKeyboardDriverBindingStart ( &BiosKeyboardPrivate->SimpleTextInputEx, extVerif ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "[KBD]Reset Failed. Status - %r\n", Status)); StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED; goto Done; @@ -559,7 +559,7 @@ Done: ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosKeyboardPrivate != NULL) { if ((BiosKeyboardPrivate->SimpleTextIn).WaitForKey != NULL) { @@ -575,7 +575,7 @@ Done: gBS->CloseEvent (BiosKeyboardPrivate->TimerEvent); } - FreePool (BiosKeyboardPrivate); + FreePool(BiosKeyboardPrivate); } gBS->CloseProtocol ( Controller, @@ -634,7 +634,7 @@ BiosKeyboardDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -646,7 +646,7 @@ BiosKeyboardDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -662,7 +662,7 @@ BiosKeyboardDriverBindingStop ( &BiosKeyboardPrivate->SimpleTextInputEx, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -691,7 +691,7 @@ BiosKeyboardDriverBindingStop ( gBS->CloseEvent (BiosKeyboardPrivate->SimpleTextInputEx.WaitForKeyEx); BiosKeyboardFreeNotifyList (&BiosKeyboardPrivate->NotifyList); - FreePool (BiosKeyboardPrivate); + FreePool(BiosKeyboardPrivate); return EFI_SUCCESS; } @@ -1079,7 +1079,7 @@ KeyboardReadKeyStrokeWorker ( // If there's no key, just return // Status = CheckQueue (&BiosKeyboardPrivate->Queue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->RestoreTPL (OldTpl); return EFI_NOT_READY; } @@ -1153,7 +1153,7 @@ BiosKeyboardReset ( This, &Key ); - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); // // 3 // check for KBC itself firstly for setted-up already or not by reading SYSF (bit2) of status register via 64H @@ -1173,7 +1173,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_CMDBYTE_R ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1183,7 +1183,7 @@ BiosKeyboardReset ( &CommandByte ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1204,7 +1204,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_AUX_DISABLE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1214,7 +1214,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_KB_DISABLE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1236,7 +1236,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_CMDREG_VIA64_KBC_SLFTEST ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1246,7 +1246,7 @@ BiosKeyboardReset ( KBC_CMDECHO_KBCSLFTEST_OK, KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1262,7 +1262,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_CMDBYTE_W ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1313,7 +1313,7 @@ BiosKeyboardReset ( KBC_INPBUF_VIA60_KBRESET ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1324,7 +1324,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1338,7 +1338,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1350,7 +1350,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_INPBUF_VIA60_KBSCODE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1361,7 +1361,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1370,7 +1370,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_INPBUF_VIA60_SCODESET2 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1381,7 +1381,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1393,7 +1393,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_INPBUF_VIA60_KBEN ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1404,7 +1404,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1423,7 +1423,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_CMDREG_VIA64_KB_CKECK ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1434,7 +1434,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1449,7 +1449,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_KB_ENABLE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1464,7 +1464,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_AUX_ENABLE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -1506,7 +1506,7 @@ BiosKeyboardReadKeyStroke ( BiosKeyboardPrivate = BIOS_KEYBOARD_DEV_FROM_THIS (This); Status = KeyboardReadKeyStrokeWorker (BiosKeyboardPrivate, &KeyData); - if (EFI_ERROR (Status)) { //EFI_NOT_READY mean the queue is empty + if (EFI_ERROR(Status)) { //EFI_NOT_READY mean the queue is empty return Status; } @@ -1556,7 +1556,7 @@ BiosKeyboardWaitForKey ( // BiosKeyboardTimerHandler (NULL, BIOS_KEYBOARD_DEV_FROM_THIS (Context)); - if (!EFI_ERROR (BiosKeyboardCheckForKey (Context))) { + if (!EFI_ERROR(BiosKeyboardCheckForKey (Context))) { gBS->SignalEvent (Event); } } @@ -1802,7 +1802,7 @@ CheckKeyboardConnect ( BiosKeyboardPrivate, KBC_INPBUF_VIA60_KBEN ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Keyboard enable failed!\n")); REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -1817,7 +1817,7 @@ CheckKeyboardConnect ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Timeout!\n")); REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -2384,7 +2384,7 @@ BiosKeyboardFreeNotifyList ( BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE ); RemoveEntryList (ListHead->ForwardLink); - gBS->FreePool (NotifyNode); + gBS->FreePool(NotifyNode); } return EFI_SUCCESS; @@ -2484,7 +2484,7 @@ DBG("BiosKeyboardResetEx -> Enter\n"); &BiosKeyboardPrivate->SimpleTextIn, ExtendedVerification ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("BiosKeyboardResetEx -> Leave EFI_DEVICE_ERROR\n"); return EFI_DEVICE_ERROR; } @@ -2581,7 +2581,7 @@ BiosKeyboardSetState ( (VOID **) &LegacyBios ); - ASSERT_EFI_ERROR (Status); */ + ASSERT_EFI_ERROR(Status); */ // // Enter critical section // @@ -2599,17 +2599,17 @@ BiosKeyboardSetState ( } Status = KeyboardWrite (BiosKeyboardPrivate, 0xed); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } Status = KeyboardWaitForValue (BiosKeyboardPrivate, 0xfa, KEYBOARD_WAITFORVALUE_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } Status = KeyboardWrite (BiosKeyboardPrivate, Command); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -2824,7 +2824,7 @@ InitializeBiosKeyboard( &gBiosKeyboardComponentName, &gBiosKeyboardComponentName2 ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } diff --git a/CloverEFI/BiosKeyboard/ComponentName.c b/CloverEFI/BiosKeyboard/ComponentName.c index e46c1ae7b..a815f8562 100644 --- a/CloverEFI/BiosKeyboard/ComponentName.c +++ b/CloverEFI/BiosKeyboard/ComponentName.c @@ -202,7 +202,7 @@ BiosKeyboardComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiIsaIoProtocolGuid, @@ -227,7 +227,7 @@ BiosKeyboardComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/CloverEFI/BiosKeyboard/LegacyBiosThunk.c b/CloverEFI/BiosKeyboard/LegacyBiosThunk.c index 15d0566c0..b78019628 100644 --- a/CloverEFI/BiosKeyboard/LegacyBiosThunk.c +++ b/CloverEFI/BiosKeyboard/LegacyBiosThunk.c @@ -43,8 +43,8 @@ InitializeBiosIntCaller ( EFI_SIZE_TO_PAGES(LegacyRegionSize), &LegacyRegionBase ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -99,8 +99,8 @@ InitializeInterruptRedirection ( EFI_SIZE_TO_PAGES(LegacyRegionLength), &LegacyRegionBase ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -113,8 +113,8 @@ InitializeInterruptRedirection ( // Get VectorBase, it should be 0x68 // Status = Legacy8259->GetVector (Legacy8259, Efi8259Irq0, &ProtectedModeBaseVector); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -189,7 +189,7 @@ LegacyBiosInt86 ( // Set Legacy16 state. 0x08, 0x70 is legacy 8259 vector bases. // Status = BiosDev->Legacy8259->SetMode (BiosDev->Legacy8259, Efi8259LegacyMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); Stack16 = (UINT16 *)((UINT8 *) BiosDev->ThunkContext->RealModeBuffer + BiosDev->ThunkContext->RealModeBufferSize - sizeof (UINT16)); @@ -205,7 +205,7 @@ LegacyBiosInt86 ( // Restore protected mode interrupt state // Status = BiosDev->Legacy8259->SetMode (BiosDev->Legacy8259, Efi8259ProtectedMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // End critical section diff --git a/CloverEFI/BiosVideo/BiosVideo.c b/CloverEFI/BiosVideo/BiosVideo.c index 6928c20ad..1e0a4890f 100644 --- a/CloverEFI/BiosVideo/BiosVideo.c +++ b/CloverEFI/BiosVideo/BiosVideo.c @@ -207,7 +207,7 @@ BiosVideoDriverBindingSupported ( // See if the Legacy 8259 Protocol is available // Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -222,7 +222,7 @@ BiosVideoDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -271,7 +271,7 @@ BiosVideoDriverBindingStart ( &gEfiDevicePathProtocolGuid, (VOID **) &ParentDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -286,7 +286,7 @@ BiosVideoDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -295,7 +295,7 @@ BiosVideoDriverBindingStart ( // if (mLegacy8259 == NULL) { Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &mLegacy8259); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -317,7 +317,7 @@ BiosVideoDriverBindingStart ( ); Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (PciIo != NULL) { // // Release PCI I/O Protocols on the controller handle. @@ -378,7 +378,7 @@ BiosVideoDriverBindingStop ( for (Index = 0; Index < NumberOfChildren; Index++) { Status = BiosVideoChildHandleUninstall (This, Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -428,7 +428,7 @@ BiosVideoChildHandleInstall ( sizeof (BIOS_VIDEO_DEV), (VOID**) &BiosVideoPrivate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -487,7 +487,7 @@ BiosVideoChildHandleInstall ( // Check for VESA BIOS Extensions for modes that are compatible with Graphics Output // Status = BiosVideoCheckForVbe (BiosVideoPrivate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The VESA BIOS Extensions are not compatible with Graphics Output, so check for support // for the standard 640x480 16 color VGA mode @@ -496,7 +496,7 @@ BiosVideoChildHandleInstall ( Status = BiosVideoCheckForVga (BiosVideoPrivate); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Neither VBE nor the standard 640x480 16 color VGA mode are supported, so do // not produce the Graphics Output protocol. Instead, produce the VGA MiniPort Protocol. @@ -542,7 +542,7 @@ BiosVideoChildHandleInstall ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Open the Parent Handle for the child // @@ -554,7 +554,7 @@ BiosVideoChildHandleInstall ( BiosVideoPrivate->Handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -571,7 +571,7 @@ BiosVideoChildHandleInstall ( } Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free private data structure // @@ -615,7 +615,7 @@ BiosVideoChildHandleUninstall ( Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (GraphicsOutput); } @@ -627,7 +627,7 @@ BiosVideoChildHandleUninstall ( Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_VGA_MINI_PORT_THIS (VgaMiniPort); } @@ -669,7 +669,7 @@ BiosVideoChildHandleUninstall ( NULL ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiPciIoProtocolGuid, @@ -730,25 +730,25 @@ BiosVideoDeviceReleaseResource ( // Free VGA Frame Buffer // if (BiosVideoPrivate->VgaFrameBuffer != NULL) { - gBS->FreePool (BiosVideoPrivate->VgaFrameBuffer); + gBS->FreePool(BiosVideoPrivate->VgaFrameBuffer); } // // Free VBE Frame Buffer // if (BiosVideoPrivate->VbeFrameBuffer != NULL) { - gBS->FreePool (BiosVideoPrivate->VbeFrameBuffer); + gBS->FreePool(BiosVideoPrivate->VbeFrameBuffer); } // // Free line buffer // if (BiosVideoPrivate->LineBuffer != NULL) { - gBS->FreePool (BiosVideoPrivate->LineBuffer); + gBS->FreePool(BiosVideoPrivate->LineBuffer); } // // Free mode data // if (BiosVideoPrivate->ModeData != NULL) { - gBS->FreePool (BiosVideoPrivate->ModeData); + gBS->FreePool(BiosVideoPrivate->ModeData); } // // Free memory allocated below 1MB @@ -765,28 +765,28 @@ BiosVideoDeviceReleaseResource ( // if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); } - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode); } // // Free EDID discovered protocol occupied resource // if (BiosVideoPrivate->EdidDiscovered.Edid != NULL) { - gBS->FreePool (BiosVideoPrivate->EdidDiscovered.Edid); + gBS->FreePool(BiosVideoPrivate->EdidDiscovered.Edid); } // // Free EDID active protocol occupied resource // if (BiosVideoPrivate->EdidActive.Edid != NULL) { - gBS->FreePool (BiosVideoPrivate->EdidActive.Edid); + gBS->FreePool(BiosVideoPrivate->EdidActive.Edid); } if (BiosVideoPrivate->DevicePath!= NULL) { - gBS->FreePool (BiosVideoPrivate->DevicePath); + gBS->FreePool(BiosVideoPrivate->DevicePath); } - gBS->FreePool (BiosVideoPrivate); + gBS->FreePool(BiosVideoPrivate); return ; } @@ -1055,7 +1055,7 @@ BiosVideoIsVga ( sizeof (Pci) / sizeof (UINT32), &Pci ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return VgaCompatible; } @@ -1127,7 +1127,7 @@ BiosVideoCheckForVbe ( BiosVideoPrivate->NumberOfPagesBelow1MB, &BiosVideoPrivate->PagesBelow1MB ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1242,7 +1242,7 @@ BiosVideoCheckForVbe ( VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE, (VOID**) &BiosVideoPrivate->EdidDiscovered.Edid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } CopyMem ( @@ -1257,7 +1257,7 @@ BiosVideoCheckForVbe ( VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE, (VOID**)&BiosVideoPrivate->EdidActive.Edid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } CopyMem ( @@ -1416,7 +1416,7 @@ BiosVideoCheckForVbe ( ModeNumber * sizeof (BIOS_VIDEO_MODE_DATA), (VOID **) &ModeBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1429,7 +1429,7 @@ BiosVideoCheckForVbe ( } if (BiosVideoPrivate->ModeData != NULL) { - gBS->FreePool (BiosVideoPrivate->ModeData); + gBS->FreePool(BiosVideoPrivate->ModeData); } CurrentModeData = &ModeBuffer[ModeNumber - 1]; @@ -1494,7 +1494,7 @@ BiosVideoCheckForVbe ( sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE), (VOID **) &BiosVideoPrivate->GraphicsOutput.Mode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } GraphicsOutputMode = BiosVideoPrivate->GraphicsOutput.Mode; @@ -1503,7 +1503,7 @@ BiosVideoCheckForVbe ( sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), (VOID **) &GraphicsOutputMode->Info ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1517,13 +1517,13 @@ BiosVideoCheckForVbe ( // Find the best mode to initialize // Status = BiosVideoGraphicsOutputSetMode (&BiosVideoPrivate->GraphicsOutput, (UINT32) PreferMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { for (PreferMode = 0; PreferMode < ModeNumber; PreferMode ++) { Status = BiosVideoGraphicsOutputSetMode ( &BiosVideoPrivate->GraphicsOutput, (UINT32) PreferMode ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } } @@ -1539,15 +1539,15 @@ Done: // // If there was an error, then free the mode structure // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosVideoPrivate->ModeData != NULL) { - gBS->FreePool (BiosVideoPrivate->ModeData); + gBS->FreePool(BiosVideoPrivate->ModeData); } if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); } - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode); } } @@ -1585,7 +1585,7 @@ BiosVideoCheckForVga ( sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE), (VOID **) &BiosVideoPrivate->GraphicsOutput.Mode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = gBS->AllocatePool ( @@ -1593,7 +1593,7 @@ BiosVideoCheckForVga ( sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), (VOID **) &BiosVideoPrivate->GraphicsOutput.Mode->Info ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1607,7 +1607,7 @@ BiosVideoCheckForVga ( sizeof (BIOS_VIDEO_MODE_DATA), (VOID **) &ModeBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1632,15 +1632,15 @@ Done: // // If there was an error, then free the mode structure // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosVideoPrivate->ModeData != NULL) { - gBS->FreePool (BiosVideoPrivate->ModeData); + gBS->FreePool(BiosVideoPrivate->ModeData); } if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); } - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode); } } return Status; @@ -1692,7 +1692,7 @@ BiosVideoGraphicsOutputQueryMode ( sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), (VOID**) Info ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1748,15 +1748,15 @@ BiosVideoGraphicsOutputSetMode ( ModeData = &BiosVideoPrivate->ModeData[ModeNumber]; if (BiosVideoPrivate->LineBuffer) { - gBS->FreePool (BiosVideoPrivate->LineBuffer); + gBS->FreePool(BiosVideoPrivate->LineBuffer); } if (BiosVideoPrivate->VgaFrameBuffer) { - gBS->FreePool (BiosVideoPrivate->VgaFrameBuffer); + gBS->FreePool(BiosVideoPrivate->VgaFrameBuffer); } if (BiosVideoPrivate->VbeFrameBuffer) { - gBS->FreePool (BiosVideoPrivate->VbeFrameBuffer); + gBS->FreePool(BiosVideoPrivate->VbeFrameBuffer); } BiosVideoPrivate->LineBuffer = NULL; @@ -1765,7 +1765,7 @@ BiosVideoGraphicsOutputSetMode ( ModeData->BytesPerScanLine, (VOID**) &BiosVideoPrivate->LineBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1783,7 +1783,7 @@ BiosVideoGraphicsOutputSetMode ( 4 * 480 * 80, (VOID**) &BiosVideoPrivate->VgaFrameBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1802,7 +1802,7 @@ BiosVideoGraphicsOutputSetMode ( ModeData->BytesPerScanLine * ModeData->VerticalResolution, (VOID**) &BiosVideoPrivate->VbeFrameBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1833,7 +1833,7 @@ BiosVideoGraphicsOutputSetMode ( (ModeData->BytesPerScanLine * ModeData->VerticalResolution) >> 2, BiosVideoPrivate->VbeFrameBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1907,7 +1907,7 @@ CopyVideoBuffer ( TotalBytes, VbeBuffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return; } @@ -1925,7 +1925,7 @@ CopyVideoBuffer ( UnalignedBytes, VbeBuffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); FrameBufferAddr += UnalignedBytes; VbeBuffer += UnalignedBytes; } @@ -1948,7 +1948,7 @@ CopyVideoBuffer ( CopyBlockNum, VbeBuffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (RemainingBytes != 0) { @@ -1962,7 +1962,7 @@ CopyVideoBuffer ( RemainingBytes, VbeBuffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } diff --git a/CloverEFI/BiosVideo/BiosVideoNew.c b/CloverEFI/BiosVideo/BiosVideoNew.c index 46f0cfdc5..457048e73 100644 --- a/CloverEFI/BiosVideo/BiosVideoNew.c +++ b/CloverEFI/BiosVideo/BiosVideoNew.c @@ -227,7 +227,7 @@ BiosVideoDriverBindingSupported ( // See if the Legacy 8259 Protocol is available // Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG("no Legacy8259 %r\n", Status); return Status; } @@ -243,7 +243,7 @@ BiosVideoDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG("no PciIoProtocol %r\n", Status); return Status; } @@ -296,7 +296,7 @@ BiosVideoDriverBindingStart ( &gEfiDevicePathProtocolGuid, (VOID **) &ParentDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -311,7 +311,7 @@ BiosVideoDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -320,7 +320,7 @@ BiosVideoDriverBindingStart ( // if (mLegacy8259 == NULL) { Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &mLegacy8259); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -342,7 +342,7 @@ BiosVideoDriverBindingStart ( ); Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (PciIo != NULL) { // // Release PCI I/O Protocols on the controller handle. @@ -413,7 +413,7 @@ BiosVideoDriverBindingStop ( for (Index = 0; Index < NumberOfChildren; Index++) { Status = BiosVideoChildHandleUninstall (This, Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -464,7 +464,7 @@ BiosVideoChildHandleInstall ( sizeof (BIOS_VIDEO_DEV), (VOID**) &BiosVideoPrivate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -544,7 +544,7 @@ BiosVideoChildHandleInstall ( // Check for VESA BIOS Extensions for modes that are compatible with Graphics Output // Status = BiosVideoCheckForVbe (BiosVideoPrivate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The VESA BIOS Extensions are not compatible with Graphics Output, so check for support // for the standard 640x480 16 color VGA mode @@ -553,7 +553,7 @@ BiosVideoChildHandleInstall ( Status = BiosVideoCheckForVga (BiosVideoPrivate); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Neither VBE nor the standard 640x480 16 color VGA mode are supported, so do // not produce the Graphics Output protocol. Instead, produce the VGA MiniPort Protocol. @@ -599,7 +599,7 @@ BiosVideoChildHandleInstall ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Open the Parent Handle for the child // @@ -611,7 +611,7 @@ BiosVideoChildHandleInstall ( BiosVideoPrivate->Handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -633,7 +633,7 @@ BiosVideoChildHandleInstall ( } Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free private data structure // @@ -680,7 +680,7 @@ BiosVideoChildHandleUninstall ( Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (GraphicsOutput); } @@ -692,7 +692,7 @@ BiosVideoChildHandleUninstall ( Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_VGA_MINI_PORT_THIS (VgaMiniPort); } @@ -734,7 +734,7 @@ BiosVideoChildHandleUninstall ( NULL ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiPciIoProtocolGuid, @@ -795,25 +795,25 @@ BiosVideoDeviceReleaseResource ( // Free VGA Frame Buffer // if (BiosVideoPrivate->VgaFrameBuffer != NULL) { - gBS->FreePool (BiosVideoPrivate->VgaFrameBuffer); + gBS->FreePool(BiosVideoPrivate->VgaFrameBuffer); } // // Free VBE Frame Buffer // if (BiosVideoPrivate->VbeFrameBuffer != NULL) { - gBS->FreePool (BiosVideoPrivate->VbeFrameBuffer); + gBS->FreePool(BiosVideoPrivate->VbeFrameBuffer); } // // Free line buffer // if (BiosVideoPrivate->LineBuffer != NULL) { - gBS->FreePool (BiosVideoPrivate->LineBuffer); + gBS->FreePool(BiosVideoPrivate->LineBuffer); } // // Free mode data // if (BiosVideoPrivate->ModeData != NULL) { - gBS->FreePool (BiosVideoPrivate->ModeData); + gBS->FreePool(BiosVideoPrivate->ModeData); } // // Free memory allocated below 1MB @@ -830,28 +830,28 @@ BiosVideoDeviceReleaseResource ( // if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); } - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode); } // // Free EDID discovered protocol occupied resource // if (BiosVideoPrivate->EdidDiscovered.Edid != NULL) { - gBS->FreePool (BiosVideoPrivate->EdidDiscovered.Edid); + gBS->FreePool(BiosVideoPrivate->EdidDiscovered.Edid); } // // Free EDID active protocol occupied resource // if (BiosVideoPrivate->EdidActive.Edid != NULL) { - gBS->FreePool (BiosVideoPrivate->EdidActive.Edid); + gBS->FreePool(BiosVideoPrivate->EdidActive.Edid); } if (BiosVideoPrivate->DevicePath!= NULL) { - gBS->FreePool (BiosVideoPrivate->DevicePath); + gBS->FreePool(BiosVideoPrivate->DevicePath); } - gBS->FreePool (BiosVideoPrivate); + gBS->FreePool(BiosVideoPrivate); return ; } @@ -1135,7 +1135,7 @@ BiosVideoIsVga ( sizeof (Pci) / sizeof (UINT32), &Pci ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return VgaCompatible; } @@ -1239,7 +1239,7 @@ BiosVideoCheckForVbe ( BiosVideoPrivate->NumberOfPagesBelow1MB, &BiosVideoPrivate->PagesBelow1MB ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1275,7 +1275,7 @@ BiosVideoCheckForVbe ( NULL, (VOID **) &EdidOverride ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Allocate double size of VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE to avoid overflow // @@ -1293,7 +1293,7 @@ BiosVideoCheckForVbe ( &EdidOverrideDataSize, (UINT8 **) &EdidOverrideDataBlock ); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && EdidAttributes == 0 && EdidOverrideDataSize != 0) { // @@ -1429,7 +1429,7 @@ BiosVideoCheckForVbe ( EdidActiveDataSize, (VOID**) &BiosVideoPrivate->EdidDiscovered.Edid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } CopyMem ( @@ -1444,7 +1444,7 @@ BiosVideoCheckForVbe ( EdidActiveDataSize, (VOID**)&BiosVideoPrivate->EdidActive.Edid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } CopyMem ( @@ -1710,7 +1710,7 @@ BiosVideoCheckForVbe ( ModeNumber * sizeof (BIOS_VIDEO_MODE_DATA), (VOID **) &ModeBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1723,7 +1723,7 @@ BiosVideoCheckForVbe ( } if (BiosVideoPrivate->ModeData != NULL) { - gBS->FreePool (BiosVideoPrivate->ModeData); + gBS->FreePool(BiosVideoPrivate->ModeData); } CurrentModeData = &ModeBuffer[ModeNumber - 1]; @@ -1791,7 +1791,7 @@ BiosVideoCheckForVbe ( sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE), (VOID **) &BiosVideoPrivate->GraphicsOutput.Mode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } GraphicsOutputMode = BiosVideoPrivate->GraphicsOutput.Mode; @@ -1800,7 +1800,7 @@ BiosVideoCheckForVbe ( sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), (VOID **) &GraphicsOutputMode->Info ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1816,7 +1816,7 @@ BiosVideoCheckForVbe ( Status = BiosVideoGraphicsOutputSetMode (&BiosVideoPrivate->GraphicsOutput, (UINT32) PreferMode); DBG(" SetMode pref %d (%d) = %r\n", PreferMode, (UINT32) PreferMode, Status); // MsgLog("setPreferMode %d status=%r\n", PreferMode, Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { for (PreferMode = 0; PreferMode < ModeNumber; PreferMode ++) { // DBG("try to set %d...", PreferMode); Status = BiosVideoGraphicsOutputSetMode ( @@ -1824,7 +1824,7 @@ BiosVideoCheckForVbe ( (UINT32) PreferMode ); DBG(" SetMode pref %d (%d) = %r\n", PreferMode, (UINT32) PreferMode, Status); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // DBG("success\n"); break; } @@ -1841,15 +1841,15 @@ Done: // // If there was an error, then free the mode structure // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosVideoPrivate->ModeData != NULL) { - gBS->FreePool (BiosVideoPrivate->ModeData); + gBS->FreePool(BiosVideoPrivate->ModeData); } if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); } - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode); } } @@ -1887,7 +1887,7 @@ BiosVideoCheckForVga ( sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE), (VOID **) &BiosVideoPrivate->GraphicsOutput.Mode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = gBS->AllocatePool ( @@ -1895,7 +1895,7 @@ BiosVideoCheckForVga ( sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), (VOID **) &BiosVideoPrivate->GraphicsOutput.Mode->Info ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1909,7 +1909,7 @@ BiosVideoCheckForVga ( sizeof (BIOS_VIDEO_MODE_DATA), (VOID **) &ModeBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1936,15 +1936,15 @@ Done: // // If there was an error, then free the mode structure // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosVideoPrivate->ModeData != NULL) { - gBS->FreePool (BiosVideoPrivate->ModeData); + gBS->FreePool(BiosVideoPrivate->ModeData); } if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); } - gBS->FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + gBS->FreePool(BiosVideoPrivate->GraphicsOutput.Mode); } } return Status; @@ -1996,7 +1996,7 @@ BiosVideoGraphicsOutputQueryMode ( sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), (VOID**) Info ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2070,15 +2070,15 @@ BiosVideoGraphicsOutputSetMode ( if (BiosVideoPrivate->LineBuffer) { - FreePool (BiosVideoPrivate->LineBuffer); + FreePool(BiosVideoPrivate->LineBuffer); } if (BiosVideoPrivate->VgaFrameBuffer) { - FreePool (BiosVideoPrivate->VgaFrameBuffer); + FreePool(BiosVideoPrivate->VgaFrameBuffer); } if (BiosVideoPrivate->VbeFrameBuffer) { - FreePool (BiosVideoPrivate->VbeFrameBuffer); + FreePool(BiosVideoPrivate->VbeFrameBuffer); } BiosVideoPrivate->LineBuffer = (UINT8 *) AllocatePool (ModeData->BytesPerScanLine); @@ -2142,7 +2142,7 @@ BiosVideoGraphicsOutputSetMode ( (ModeData->BytesPerScanLine * ModeData->VerticalResolution) >> 2, BiosVideoPrivate->VbeFrameBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -2192,15 +2192,15 @@ BiosVideoSetModeWorker ( IA32_REGISTER_SET Regs; if (BiosVideoPrivate->LineBuffer != NULL) { - FreePool (BiosVideoPrivate->LineBuffer); + FreePool(BiosVideoPrivate->LineBuffer); } if (BiosVideoPrivate->VgaFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VgaFrameBuffer); + FreePool(BiosVideoPrivate->VgaFrameBuffer); } if (BiosVideoPrivate->VbeFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VbeFrameBuffer); + FreePool(BiosVideoPrivate->VbeFrameBuffer); } BiosVideoPrivate->LineBuffer = (UINT8 *) AllocatePool (ModeData->BytesPerScanLine); @@ -2264,7 +2264,7 @@ BiosVideoSetModeWorker ( (ModeData->BytesPerScanLine * ModeData->VerticalResolution) >> 2, BiosVideoPrivate->VbeFrameBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } */ } @@ -2346,7 +2346,7 @@ BiosVideoGraphicsOutputSetMode ( } Status = BiosVideoSetModeWorker (BiosVideoPrivate, ModeData, BiosVideoPrivate->DevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("BV - ERROR %r\n", Status); return Status; } @@ -2421,7 +2421,7 @@ CopyVideoBuffer ( TotalBytes, VbeBuffer ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return; } @@ -2439,8 +2439,8 @@ CopyVideoBuffer ( UnalignedBytes, VbeBuffer ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } FrameBufferAddr += UnalignedBytes; @@ -2465,8 +2465,8 @@ CopyVideoBuffer ( CopyBlockNum, VbeBuffer ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } @@ -2482,8 +2482,8 @@ CopyVideoBuffer ( RemainingBytes, VbeBuffer ); - // ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + // ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } diff --git a/CloverEFI/BiosVideo/LegacyBiosThunk.c b/CloverEFI/BiosVideo/LegacyBiosThunk.c index ff92eed19..40dc1e83f 100644 --- a/CloverEFI/BiosVideo/LegacyBiosThunk.c +++ b/CloverEFI/BiosVideo/LegacyBiosThunk.c @@ -43,8 +43,8 @@ InitializeBiosIntCaller ( EFI_SIZE_TO_PAGES(LegacyRegionSize), &LegacyRegionBase ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -99,8 +99,8 @@ InitializeInterruptRedirection ( EFI_SIZE_TO_PAGES(LegacyRegionLength), &LegacyRegionBase ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -113,8 +113,8 @@ InitializeInterruptRedirection ( // Get VectorBase, it should be 0x68 // Status = Legacy8259->GetVector (Legacy8259, Efi8259Irq0, &ProtectedModeBaseVector); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -189,7 +189,7 @@ LegacyBiosInt86 ( // Set Legacy16 state. 0x08, 0x70 is legacy 8259 vector bases. // Status = BiosDev->Legacy8259->SetMode (BiosDev->Legacy8259, Efi8259LegacyMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); Stack16 = (UINT16 *)((UINT8 *) BiosDev->ThunkContext->RealModeBuffer + BiosDev->ThunkContext->RealModeBufferSize - sizeof (UINT16)); @@ -205,7 +205,7 @@ LegacyBiosInt86 ( // Restore protected mode interrupt state // Status = BiosDev->Legacy8259->SetMode (BiosDev->Legacy8259, Efi8259ProtectedMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // End critical section diff --git a/CloverEFI/CpuDxe/Cpu.c b/CloverEFI/CpuDxe/Cpu.c index 657c8a28b..1723a6a4f 100644 --- a/CloverEFI/CpuDxe/Cpu.c +++ b/CloverEFI/CpuDxe/Cpu.c @@ -1137,8 +1137,8 @@ Returns: // Find the Legacy8259 protocol. // Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &gLegacy8259); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -1146,8 +1146,8 @@ Returns: // Get the interrupt vector number corresponding to IRQ0 from the 8259 driver // Status = gLegacy8259->GetVector (gLegacy8259, Efi8259Irq0, (UINT8 *) &mTimerVector); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -1187,8 +1187,8 @@ Returns: for (Irq = Efi8259Irq1; Irq <= Efi8259Irq15; Irq++) { InterruptVector = 0; Status = gLegacy8259->GetVector (gLegacy8259, Irq, (UINT8 *) &InterruptVector); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } InstallInterruptHandler (InterruptVector, SystemTimerHandler); @@ -1206,7 +1206,7 @@ Returns: &mCpu, NULL ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } @@ -1233,8 +1233,8 @@ InitializeBiosIntCaller ( EFI_SIZE_TO_PAGES(LegacyRegionSize), &LegacyRegionBase ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { mThunkContext.RealModeBuffer = 0; return; } @@ -1297,8 +1297,8 @@ LegacyBiosInt86 ( // Set Legacy16 state. 0x08, 0x70 is legacy 8259 vector bases. // Status = gLegacy8259->SetMode (gLegacy8259, Efi8259LegacyMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { if ((Eflags & EFI_CPU_EFLAGS_IF) != 0) { EnableInterrupts (); } @@ -1323,8 +1323,8 @@ LegacyBiosInt86 ( // Restore protected mode interrupt state // Status = gLegacy8259->SetMode (gLegacy8259, Efi8259ProtectedMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); -// if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); +// if (EFI_ERROR(Status)) { // return FALSE; // } diff --git a/CloverEFI/GraphicsConsoleDxe/GraphicsConsole.c b/CloverEFI/GraphicsConsoleDxe/GraphicsConsole.c index e0b307d54..1528dc353 100644 --- a/CloverEFI/GraphicsConsoleDxe/GraphicsConsole.c +++ b/CloverEFI/GraphicsConsoleDxe/GraphicsConsole.c @@ -145,7 +145,7 @@ GraphicsConsoleControllerDriverSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { + if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { // // Open Graphics Output Protocol failed, try to open UGA Draw Protocol // @@ -158,7 +158,7 @@ GraphicsConsoleControllerDriverSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -175,7 +175,7 @@ GraphicsConsoleControllerDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -429,7 +429,7 @@ GraphicsConsoleControllerDriverStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -463,14 +463,14 @@ GraphicsConsoleControllerDriverStart ( &SizeOfInfo, &Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Info->HorizontalResolution >= HorizontalResolution) && (Info->VerticalResolution >= VerticalResolution)) { HorizontalResolution = Info->HorizontalResolution; VerticalResolution = Info->VerticalResolution; ModeNumber = ModeIndex; } - FreePool (Info); + FreePool(Info); } } if ((HorizontalResolution == 0x0) || (VerticalResolution == 0x0)) { @@ -488,7 +488,7 @@ GraphicsConsoleControllerDriverStart ( VerticalResolution, &ModeNumber ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // if not supporting current mode, try 800x600 which is required by UEFI/EFI spec // @@ -499,7 +499,7 @@ GraphicsConsoleControllerDriverStart ( &ModeNumber ); Mode = Private->GraphicsOutput->Mode; - if (EFI_ERROR (Status) && Mode->MaxMode != 0) { + if (EFI_ERROR(Status) && Mode->MaxMode != 0) { // // Set default mode failed or device don't support default mode, then get the current mode information // @@ -522,7 +522,7 @@ GraphicsConsoleControllerDriverStart ( ColorDepth, RefreshRate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Try to set 800*600 which is required by UEFI/EFI spec // @@ -533,7 +533,7 @@ GraphicsConsoleControllerDriverStart ( ColorDepth, RefreshRate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = Private->UgaDraw->GetMode ( Private->UgaDraw, &HorizontalResolution, @@ -541,7 +541,7 @@ GraphicsConsoleControllerDriverStart ( &ColorDepth, &RefreshRate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } @@ -559,7 +559,7 @@ GraphicsConsoleControllerDriverStart ( &Private->ModeData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -570,11 +570,11 @@ GraphicsConsoleControllerDriverStart ( /* DEBUG_CODE_BEGIN (); Status = GraphicsConsoleConOutSetMode (&Private->SimpleTextOutput, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } Status = GraphicsConsoleConOutOutputString (&Private->SimpleTextOutput, (CHAR16 *)L"Graphics Console Started\n\r"); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } DEBUG_CODE_END (); @@ -590,7 +590,7 @@ GraphicsConsoleControllerDriverStart ( ); Error: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Close the GOP and UGA Draw Protocol // @@ -611,17 +611,17 @@ Error: } if (Private->LineBuffer != NULL) { - FreePool (Private->LineBuffer); + FreePool(Private->LineBuffer); } if (Private->ModeData != NULL) { - FreePool (Private->ModeData); + FreePool(Private->ModeData); } // // Free private data // - FreePool (Private); + FreePool(Private); } return Status; @@ -666,7 +666,7 @@ GraphicsConsoleControllerDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_STARTED; } @@ -678,7 +678,7 @@ GraphicsConsoleControllerDriverStop ( &Private->SimpleTextOutput ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Close the GOP or UGA IO Protocol // @@ -699,17 +699,17 @@ GraphicsConsoleControllerDriverStop ( } if (Private->LineBuffer != NULL) { - FreePool (Private->LineBuffer); + FreePool(Private->LineBuffer); } if (Private->ModeData != NULL) { - FreePool (Private->ModeData); + FreePool(Private->ModeData); } // // Free our instance data // - FreePool (Private); + FreePool(Private); } return Status; @@ -758,7 +758,7 @@ CheckModeSupported ( &SizeOfInfo, &Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution == VerticalResolution)) { if ((GraphicsOutput->Mode->Info->HorizontalResolution == HorizontalResolution) && @@ -766,17 +766,17 @@ CheckModeSupported ( // // If video device has been set to this mode, we do not need to SetMode again // - FreePool (Info); + FreePool(Info); break; } else { Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber); - if (!EFI_ERROR (Status)) { - FreePool (Info); + if (!EFI_ERROR(Status)) { + FreePool(Info); break; } } } - FreePool (Info); + FreePool(Info); } } @@ -820,7 +820,7 @@ EfiLocateHiiProtocol ( (VOID **) &Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -830,7 +830,7 @@ EfiLocateHiiProtocol ( (VOID **) &mHiiDatabase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -873,7 +873,7 @@ GraphicsConsoleConOutReset ( { EFI_STATUS Status; Status = This->SetMode (This, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK)); @@ -1136,7 +1136,7 @@ GraphicsConsoleConOutOutputString ( } Status = DrawUnicodeWeightAtCursorN (This, WString, Count); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Warning = TRUE; } // @@ -1213,12 +1213,12 @@ GraphicsConsoleConOutTestString ( NULL ); if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); Blt = NULL; } Count++; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } } @@ -1357,7 +1357,7 @@ GraphicsConsoleConOutSetMode ( // FlushCursor (This); - FreePool (Private->LineBuffer); + FreePool(Private->LineBuffer); } // @@ -1385,7 +1385,7 @@ GraphicsConsoleConOutSetMode ( // Either no graphics mode is currently set, or it is set to the wrong resolution, so set the new graphics mode // Status = GraphicsOutput->SetMode (GraphicsOutput, ModeData->GopModeNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The mode set operation failed // @@ -1419,7 +1419,7 @@ GraphicsConsoleConOutSetMode ( &ColorDepth, &RefreshRate ); - if (EFI_ERROR (Status) || HorizontalResolution != ModeData->GopWidth || VerticalResolution != ModeData->GopHeight) { + if (EFI_ERROR(Status) || HorizontalResolution != ModeData->GopWidth || VerticalResolution != ModeData->GopHeight) { // // Either no graphics mode is currently set, or it is set to the wrong resolution, so set the new graphics mode // @@ -1430,7 +1430,7 @@ GraphicsConsoleConOutSetMode ( 32, 60 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The mode set operation failed // @@ -1793,7 +1793,7 @@ DrawUnicodeWeightAtCursorN ( String = AllocateCopyPool ((Count + 1) * sizeof (CHAR16), UnicodeWeight); if (String == NULL) { - FreePool (Blt); + FreePool(Blt); return EFI_OUT_OF_RESOURCES; } // @@ -1803,8 +1803,8 @@ DrawUnicodeWeightAtCursorN ( FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO)); if (FontInfo == NULL) { - FreePool (Blt); - FreePool (String); + FreePool(Blt); + FreePool(String); return EFI_OUT_OF_RESOURCES; } // @@ -1842,8 +1842,8 @@ DrawUnicodeWeightAtCursorN ( Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (Blt->Image.Bitmap == NULL) { - FreePool (Blt); - FreePool (String); + FreePool(Blt); + FreePool(String); return EFI_OUT_OF_RESOURCES; } @@ -1865,7 +1865,7 @@ DrawUnicodeWeightAtCursorN ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Line breaks are handled by caller of DrawUnicodeWeightAtCursorN, so the updated parameter RowInfoArraySize by StringToImage will // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure. @@ -1886,20 +1886,20 @@ DrawUnicodeWeightAtCursorN ( ); } - FreePool (RowInfoArray); - FreePool (Blt->Image.Bitmap); + FreePool(RowInfoArray); + FreePool(Blt->Image.Bitmap); } else { Status = EFI_UNSUPPORTED; } if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); } if (String != NULL) { - FreePool (String); + FreePool(String); } if (FontInfo != NULL) { - FreePool (FontInfo); + FreePool(FontInfo); } return Status; } @@ -2054,7 +2054,7 @@ RegisterFontPackage ( NULL, (VOID **) &HiiDatabase ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Add 4 bytes to the header for entire length for HiiAddPackages use only. @@ -2098,7 +2098,7 @@ RegisterFontPackage ( Package, NULL ); - FreePool (Package); + FreePool(Package); } /** @@ -2142,7 +2142,7 @@ InitializeGraphicsConsole ( &gGraphicsConsoleComponentName, &gGraphicsConsoleComponentName2 ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } diff --git a/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatform.c b/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatform.c index ce2c6dbb7..b781ea1f0 100644 --- a/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatform.c +++ b/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatform.c @@ -409,7 +409,7 @@ AcpiPlatformEntryPoint ( // Find the AcpiTable protocol // Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID**)&AcpiTable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } #if DEBUG_ACPI @@ -479,7 +479,7 @@ AcpiPlatformEntryPoint ( &gEfiLoadedImageProtocolGuid, (VOID*)&LoadedImage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } Status = gBS->HandleProtocol ( @@ -487,7 +487,7 @@ AcpiPlatformEntryPoint ( &gEfiSimpleFileSystemProtocolGuid, (VOID *) &Volume ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -495,7 +495,7 @@ AcpiPlatformEntryPoint ( // // Open the root directory of the volume // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Volume->OpenVolume (Volume, &Root); } #else //Multiple FS protocols @@ -513,9 +513,9 @@ AcpiPlatformEntryPoint ( // Loop through all the file system structures and cache the file system info data for (Index =0; Index < mFsCount; Index++) { Status = gBS->HandleProtocol (mFs[Index], &gEfiSimpleFileSystemProtocolGuid, (VOID **)&Volume); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Volume->OpenVolume (Volume, &Root); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // Get information about the volume /* Size = 0; Status = Root->GetInfo (Root, &gEfiFileSystemInfoGuid, &Size, mFsInfo[Index]); @@ -540,7 +540,7 @@ AcpiPlatformEntryPoint ( StrCpyS(FileName, 32, ACPInames[Index]); // DBG(L"File probe %s\n", FileName); Status = Root->Open (Root, &ThisFile, FileName, EFI_FILE_MODE_READ, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } /* Get right size we need to allocate */ @@ -556,7 +556,7 @@ AcpiPlatformEntryPoint ( DBG(L"Buffer size %d\n", BufferSize); // DBG(L"GetInfo success!\n"); Status = gBS->AllocatePool (EfiBootServicesData, BufferSize, (VOID **) &Info); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG(L"No pool!\n"); continue; } @@ -568,11 +568,11 @@ AcpiPlatformEntryPoint ( ); FileSize = Info->FileSize; // DBG(L"FileSize = %d!\n", FileSize); - gBS->FreePool (Info); + gBS->FreePool(Info); //Slice - this is the problem. // FileBuffer = AllocatePool(FileSize); Status = gBS->AllocatePool (EfiBootServicesData, FileSize, (VOID **) &FileBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG(L"No pool for FileBuffer size %d!\n", FileSize); continue; } @@ -582,7 +582,7 @@ AcpiPlatformEntryPoint ( EFI_SIZE_TO_PAGES(FileSize), FileBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG(L"No pool for FileBuffer size %d!\n", FileSize); continue; } diff --git a/CloverEFI/OsxAcpiTableDxe/AcpiSdt.c b/CloverEFI/OsxAcpiTableDxe/AcpiSdt.c index abd331a45..d177cff68 100644 --- a/CloverEFI/OsxAcpiTableDxe/AcpiSdt.c +++ b/CloverEFI/OsxAcpiTableDxe/AcpiSdt.c @@ -172,7 +172,7 @@ SdtNotifyAcpiList ( &AcpiTableInstance->TableList, &Table ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Find the notify @@ -354,7 +354,7 @@ SdtUnregisterNotify ( // Remove it from list and free the node. // RemoveEntryList (&(CurrentNotifyList->Link)); - FreePool (CurrentNotifyList); + FreePool(CurrentNotifyList); return EFI_SUCCESS; } @@ -442,7 +442,7 @@ SdtOpenSdtTable ( &AcpiTableInstance->TableList, &Table ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -532,7 +532,7 @@ SdtOpenEx ( AmlHandle->Size = AmlGetObjectSize (AmlByteEncoding, Buffer, BufferSize); if (AmlHandle->Size == 0) { - FreePool (AmlHandle); + FreePool(AmlHandle); return EFI_INVALID_PARAMETER; } @@ -572,7 +572,7 @@ Open ( } Status = SdtGetMaxAmlBufferSize (Buffer, &MaxSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -614,12 +614,12 @@ Close ( // if (AmlHandle->Modified) { Status = SdtUpdateAmlChecksum (AmlHandle->Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } } - FreePool (AmlHandle); + FreePool(AmlHandle); return EFI_SUCCESS; } @@ -681,7 +681,7 @@ GetOption ( // Parse option // Status = AmlParseOptionHandleCommon (AmlHandle, (AML_OP_PARSE_INDEX)Index, DataType, (VOID **)Data, DataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -745,7 +745,7 @@ SetOption ( // Parse option // Status = AmlParseOptionHandleCommon (AmlHandle, (AML_OP_PARSE_INDEX)Index, &DataType, &OrgData, &OrgDataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (DataType == EFI_ACPI_DATA_TYPE_NONE) { @@ -820,7 +820,7 @@ GetChild ( return EFI_INVALID_PARAMETER; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (Buffer == NULL) { @@ -858,7 +858,7 @@ SdtFindPathFromNonRoot ( // For non-root handle, we need search from THIS node instead of ROOT. // Status = AmlFindPath (AmlHandle, AmlPath, &Buffer, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (Buffer == NULL) { @@ -931,7 +931,7 @@ SdtFindPathFromRoot ( ChildHandle = NULL; while (TRUE) { Status = GetChild (HandleIn, &ChildHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -948,7 +948,7 @@ SdtFindPathFromRoot ( // AmlHandle = (EFI_AML_HANDLE *)ChildHandle; Status = AmlFindPath (AmlHandle, AmlPath, &Buffer, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -957,7 +957,7 @@ SdtFindPathFromRoot ( // Great! Find it, open // Status = SdtOpenEx (Buffer, (UINTN)AmlHandle->Buffer + AmlHandle->Size - (UINTN)Buffer, HandleOut); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } // @@ -1031,7 +1031,7 @@ FindPath ( Status = EFI_INVALID_PARAMETER; } - FreePool (AmlPath); + FreePool(AmlPath); return Status; } @@ -1062,7 +1062,7 @@ ExitPmAuthNotification ( NULL, &DxeSmmReadyToLock ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -1074,8 +1074,8 @@ ExitPmAuthNotification ( &gEfiAcpiSdtProtocolGuid, &mPrivateData->AcpiSdtProtocol ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return ; } diff --git a/CloverEFI/OsxAcpiTableDxe/AcpiTable.c b/CloverEFI/OsxAcpiTableDxe/AcpiTable.c index 4590b1b7c..3eef42ebf 100644 --- a/CloverEFI/OsxAcpiTableDxe/AcpiTable.c +++ b/CloverEFI/OsxAcpiTableDxe/AcpiTable.c @@ -60,8 +60,8 @@ InitializeAcpiTableDxe ( // Call all constructors per produced protocols // Status = AcpiTableAcpiTableConstructor (PrivateData); - if (EFI_ERROR (Status)) { - gBS->FreePool (PrivateData); + if (EFI_ERROR(Status)) { + gBS->FreePool(PrivateData); return EFI_LOAD_ERROR; } @@ -87,7 +87,7 @@ InitializeAcpiTableDxe ( NULL ); // } -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // Register the event to install ACPI Table into EFI System Table diff --git a/CloverEFI/OsxAcpiTableDxe/AcpiTableProtocol.c b/CloverEFI/OsxAcpiTableDxe/AcpiTableProtocol.c index 9b1c445ba..f5fc8888a 100644 --- a/CloverEFI/OsxAcpiTableDxe/AcpiTableProtocol.c +++ b/CloverEFI/OsxAcpiTableDxe/AcpiTableProtocol.c @@ -164,7 +164,7 @@ SetAcpiTable ( // Delete the table list entry // Status = RemoveTableFromList (AcpiTableInstance, Version, *Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Should not get an error here ever, but abort if we do. // @@ -193,7 +193,7 @@ SetAcpiTable ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Should not get an error here ever, but abort if we do. // @@ -270,7 +270,7 @@ PublishTables ( if (((Version & EFI_ACPI_TABLE_VERSION_1_0B) != 0) && !AcpiTableInstance->TablesInstalled1) { Status = gBS->InstallConfigurationTable (&gEfiAcpi10TableGuid, AcpiTableInstance->Rsdp1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -281,7 +281,7 @@ PublishTables ( (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) && !AcpiTableInstance->TablesInstalled3) { Status = gBS->InstallConfigurationTable (&gEfiAcpiTableGuid, AcpiTableInstance->Rsdp3); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -360,20 +360,20 @@ InstallAcpiTable ( EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0, TableKey ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PublishTables ( AcpiTableInstance, EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0 ); } - FreePool (AcpiTableBufferConst); + FreePool(AcpiTableBufferConst); // // Add a new table successfully, notify registed callback // /* if (FeaturePcdGet (PcdInstallAcpiSdtProtocol)) { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SdtNotifyAcpiList ( AcpiTableInstance, EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0, @@ -421,14 +421,14 @@ UninstallAcpiTable ( EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0, &TableKey ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PublishTables ( AcpiTableInstance, EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0 ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } else { return EFI_SUCCESS; @@ -491,7 +491,7 @@ ReallocateAcpiTableBuffer ( &PageAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -656,8 +656,8 @@ AddTableToList ( // // Check return value from memory alloc. // - if (EFI_ERROR (Status)) { - gBS->FreePool (CurrentTableList); + if (EFI_ERROR(Status)) { + gBS->FreePool(CurrentTableList); return EFI_OUT_OF_RESOURCES; } // @@ -698,7 +698,7 @@ AddTableToList ( ((Version & EFI_ACPI_TABLE_VERSION_3_0) != 0 && AcpiTableInstance->Fadt3 != NULL) ) { gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages); - gBS->FreePool (CurrentTableList); + gBS->FreePool(CurrentTableList); return EFI_ABORTED; } // @@ -828,7 +828,7 @@ AddTableToList ( ((Version & EFI_ACPI_TABLE_VERSION_3_0) != 0 && AcpiTableInstance->Facs3 != NULL) ) { gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages); - gBS->FreePool (CurrentTableList); + gBS->FreePool(CurrentTableList); return EFI_ABORTED; } // @@ -905,7 +905,7 @@ AddTableToList ( ((Version & EFI_ACPI_TABLE_VERSION_3_0) != 0 && AcpiTableInstance->Dsdt3 != NULL) ) { gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages); - gBS->FreePool (CurrentTableList); + gBS->FreePool(CurrentTableList); return EFI_ABORTED; } // @@ -1015,8 +1015,8 @@ AddTableToList ( // if (AcpiTableInstance->NumberOfTableEntries1 >= mEfiAcpiMaxNumTables) { Status = ReallocateAcpiTableBuffer (AcpiTableInstance); - // ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + // ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } } @@ -1052,8 +1052,8 @@ AddTableToList ( // if (AcpiTableInstance->NumberOfTableEntries3 >= mEfiAcpiMaxNumTables) { Status = ReallocateAcpiTableBuffer (AcpiTableInstance); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } } @@ -1544,7 +1544,7 @@ DeleteTable ( // gBS->FreePages (Table->PageAddress, Table->NumberOfPages); RemoveEntryList (&(Table->Link)); - gBS->FreePool (Table); + gBS->FreePool(Table); } // // Done @@ -1593,14 +1593,14 @@ RemoveTableFromList ( &AcpiTableInstance->TableList, &Table ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } // // Remove the table // Status = DeleteTable (AcpiTableInstance, Version, Table); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } // @@ -1805,7 +1805,7 @@ AcpiTableAcpiTableConstructor ( &PageAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } diff --git a/CloverEFI/OsxAcpiTableDxe/AmlChild.c b/CloverEFI/OsxAcpiTableDxe/AmlChild.c index d663feaec..3e3b8a949 100644 --- a/CloverEFI/OsxAcpiTableDxe/AmlChild.c +++ b/CloverEFI/OsxAcpiTableDxe/AmlChild.c @@ -137,7 +137,7 @@ AmlGetChildFromOptionList ( (VOID **)&Data, &DataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (DataType == EFI_ACPI_DATA_TYPE_NONE) { @@ -206,7 +206,7 @@ AmlGetChildFromObjectChildList ( // Now, we get the last node. // Status = AmlGetOffsetAfterLastOption (AmlParentHandle, &CurrentBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -264,7 +264,7 @@ AmlGetChildFromNonRoot ( // 1. Get Option // Status = AmlGetChildFromOptionList (AmlParentHandle, AmlHandle, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (*Buffer != NULL) { diff --git a/CloverEFI/OsxAcpiTableDxe/AmlNamespace.c b/CloverEFI/OsxAcpiTableDxe/AmlNamespace.c index ee5ac335a..5fa88d4ca 100644 --- a/CloverEFI/OsxAcpiTableDxe/AmlNamespace.c +++ b/CloverEFI/OsxAcpiTableDxe/AmlNamespace.c @@ -323,7 +323,7 @@ AmlConstructNodeListForChild ( // Now, we get the last node. // Status = AmlGetOffsetAfterLastOption (AmlHandle, &CurrentBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -335,7 +335,7 @@ AmlConstructNodeListForChild ( // Find the child node. // Status = SdtOpenEx (CurrentBuffer, (UINTN)Buffer + BufferSize - (UINTN)CurrentBuffer, (EFI_ACPI_HANDLE *)&AmlChildHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No child found, break now. // @@ -350,7 +350,7 @@ AmlConstructNodeListForChild ( AmlRootNodeList, AmlParentNodeList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -457,7 +457,7 @@ AmlDestructNodeList ( // // Done. // - FreePool (AmlParentNodeList); + FreePool(AmlParentNodeList); return ; } @@ -542,7 +542,7 @@ AmlFindPath ( AmlRootNodeList, // Root AmlRootNodeList // Parent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } diff --git a/CloverEFI/OsxAcpiTableDxe/AmlOption.c b/CloverEFI/OsxAcpiTableDxe/AmlOption.c index 75dfb2cb3..9debebfc8 100644 --- a/CloverEFI/OsxAcpiTableDxe/AmlOption.c +++ b/CloverEFI/OsxAcpiTableDxe/AmlOption.c @@ -70,7 +70,7 @@ AmlParseOptionTerm ( break; case AML_NAME: Status = AmlGetNameStringSize (Buffer, DataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } break; @@ -90,7 +90,7 @@ AmlParseOptionTerm ( *DataType = AmlTypeToAcpiType (AML_NAME); } Status = AmlGetNameStringSize (Buffer, DataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } break; @@ -175,7 +175,7 @@ AmlParseOptionCommon ( // return NameString size // Status = AmlGetNameStringSize (Buffer, DataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (*DataSize > MaxBufferSize) { @@ -243,7 +243,7 @@ AmlParseOptionCommon ( Data, DataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -314,7 +314,7 @@ AmlGetObjectSize ( NULL, &DataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return 0; } else { return DataSize; @@ -370,7 +370,7 @@ AmlGetObjectName ( &NameString, &NameSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } // ASSERT (DataType == EFI_ACPI_DATA_TYPE_NAME_STRING); @@ -405,7 +405,7 @@ AmlGetOffsetAfterLastOption ( &Data, &DataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } diff --git a/CloverEFI/OsxBdsDxe/BdsEntry.c b/CloverEFI/OsxBdsDxe/BdsEntry.c index 1efedb18d..72af9fabf 100644 --- a/CloverEFI/OsxBdsDxe/BdsEntry.c +++ b/CloverEFI/OsxBdsDxe/BdsEntry.c @@ -84,7 +84,7 @@ BdsInitialize ( &gEfiBdsArchProtocolGuid, &gBds, NULL ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } @@ -180,7 +180,7 @@ BdsBootDeviceSelect ( // // Deleting variable with current variable implementation shouldn't fail. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Add the boot next boot option @@ -378,7 +378,7 @@ BdsFormalizeConsoleVariable ( 0, NULL ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } } @@ -455,7 +455,7 @@ BdsFormalizeEfiGlobalVariable ( 0, NULL ); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); } } @@ -487,7 +487,7 @@ BdsAllocateMemoryForPerformanceData ( EFI_SIZE_TO_PAGES (PERF_DATA_MAX_LENGTH), &AcpiLowMemoryBase ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Save the pointer to variable for use in S3 resume. // @@ -498,7 +498,7 @@ BdsAllocateMemoryForPerformanceData ( sizeof (EFI_PHYSICAL_ADDRESS), &AcpiLowMemoryBase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "[Bds] PerfDataMemAddr (%08x) cannot be saved to NV storage.\n", AcpiLowMemoryBase)); } // @@ -506,9 +506,9 @@ BdsAllocateMemoryForPerformanceData ( // Still lock it even the variable cannot be saved to prevent it's set by 3rd party code. // Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = VariableLock->RequestToLock (VariableLock, L"PerfDataMemAddr", &gPerformanceProtocolGuid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } } @@ -585,10 +585,10 @@ BdsEntry ( // Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock); DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n", Status)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < sizeof (mReadOnlyVariables) / sizeof (mReadOnlyVariables[0]); Index++) { Status = VariableLock->RequestToLock (VariableLock, mReadOnlyVariables[Index], &gEfiGlobalVariableGuid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -728,7 +728,7 @@ BdsDxeSetVariableAndReportStatusCodeOnError ( DataSize, Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { NameSize = StrSize (VariableName); SetVariableStatus = AllocatePool (sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize); if (SetVariableStatus != NULL) { @@ -750,7 +750,7 @@ BdsDxeSetVariableAndReportStatusCodeOnError ( sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize ); - FreePool (SetVariableStatus); + FreePool(SetVariableStatus); } } diff --git a/CloverEFI/OsxBdsDxe/BootMaint/BBSsupport.c b/CloverEFI/OsxBdsDxe/BootMaint/BBSsupport.c index 3842c1f48..eaabc18cb 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/BBSsupport.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/BBSsupport.c @@ -107,10 +107,10 @@ OrderLegacyBootOption4SameType ( DeviceTypeArray[Index] = BBS_TYPE_UNKNOWN; BbsIndexArray [Index] = 0xFFFF; } - FreePool (BootOption->DevicePath); - FreePool (BootOption->Description); - FreePool (BootOption->LoadOptions); - FreePool (BootOption); + FreePool(BootOption->DevicePath); + FreePool(BootOption->Description); + FreePool(BootOption->LoadOptions); + FreePool(BootOption); } // @@ -152,11 +152,11 @@ OrderLegacyBootOption4SameType ( // // Changing content without increasing its size with current variable implementation shouldn't fail. // -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); - FreePool (NewBootOption); - FreePool (DeviceTypeArray); - FreePool (BbsIndexArray); + FreePool(NewBootOption); + FreePool(DeviceTypeArray); + FreePool(BbsIndexArray); } /** @@ -237,10 +237,10 @@ GroupMultipleLegacyBootOption4SameType ( } } } - FreePool (BootOption->DevicePath); - FreePool (BootOption->Description); - FreePool (BootOption->LoadOptions); - FreePool (BootOption); + FreePool(BootOption->DevicePath); + FreePool(BootOption->Description); + FreePool(BootOption->LoadOptions); + FreePool(BootOption); } Status = gRT->SetVariable ( @@ -253,7 +253,7 @@ GroupMultipleLegacyBootOption4SameType ( // // Changing content without increasing its size with current variable implementation shouldn't fail. // - ASSERT_EFI_ERROR (Status); - FreePool (BootOrder); + ASSERT_EFI_ERROR(Status); + FreePool(BootOrder); } diff --git a/CloverEFI/OsxBdsDxe/BootMaint/BmLib.c b/CloverEFI/OsxBdsDxe/BootMaint/BmLib.c index 2954bdf28..713c90ef0 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/BmLib.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/BmLib.c @@ -46,7 +46,7 @@ EfiLibOpenRoot ( // // Open the root directory of the volume // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Volume->OpenVolume ( Volume, &File @@ -55,7 +55,7 @@ EfiLibOpenRoot ( // // Done // - return EFI_ERROR (Status) ? NULL : File; + return EFI_ERROR(Status) ? NULL : File; } /** @@ -96,7 +96,7 @@ EfiGrowBuffer ( if (*Status == EFI_BUFFER_TOO_SMALL) { if (*Buffer != NULL) { - FreePool (*Buffer); + FreePool(*Buffer); } *Buffer = AllocateZeroPool (BufferSize); @@ -110,8 +110,8 @@ EfiGrowBuffer ( // // If there's an error, free the buffer // - if (!TryAgain && EFI_ERROR (*Status) && (*Buffer != NULL)) { - FreePool (*Buffer); + if (!TryAgain && EFI_ERROR(*Status) && (*Buffer != NULL)) { + FreePool(*Buffer); *Buffer = NULL; } @@ -178,8 +178,8 @@ EfiLibDeleteVariable ( 0, NULL ); -// ASSERT (!EFI_ERROR (Status)); - FreePool (VarBuf); +// ASSERT (!EFI_ERROR(Status)); + FreePool(VarBuf); } return Status; @@ -423,7 +423,7 @@ EfiReallocatePool ( CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize); } - FreePool (OldPool); + FreePool(OldPool); } return NewPool; diff --git a/CloverEFI/OsxBdsDxe/BootMaint/BootMaint.c b/CloverEFI/OsxBdsDxe/BootMaint/BootMaint.c index d9e35bf01..a8203d1a5 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/BootMaint.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/BootMaint.c @@ -295,7 +295,7 @@ BootMaintExtractConfig ( } AllocatedRequest = TRUE; UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); } Status = gHiiConfigRouting->BlockToConfig ( @@ -310,7 +310,7 @@ BootMaintExtractConfig ( // Free the allocated config request string. // if (AllocatedRequest) { - FreePool (ConfigRequest); + FreePool(ConfigRequest); ConfigRequest = NULL; } // @@ -401,7 +401,7 @@ BootMaintRouteConfig ( NULL, (VOID**) &ConfigRouting ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -422,7 +422,7 @@ BootMaintRouteConfig ( &BufferSize, Progress ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Compare new and old BMM configuration data and only do action for modified item to // avoid setting unnecessary non-volatile variable @@ -738,7 +738,7 @@ BootMaintCallback ( // Initilize Form for legacy boot option. // Status = EfiLibLocateProtocol (&gEfiLegacyBiosProtocolGuid, (VOID **) &LegacyBios); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { InitializeLegacyBootOption (); } @@ -1217,7 +1217,7 @@ InitializeBM ( CopyGuid (&PackageListHeader->PackageListGuid, &gFileExploreFormSetGuid); Status = gHiiDatabase->UpdatePackageList (gHiiDatabase, BmmCallbackInfo->FeHiiHandle, PackageListHeader); - FreePool (PackageListHeader); + FreePool(PackageListHeader); // // Init OpCode Handle and Allocate space for creation of Buffer @@ -1441,7 +1441,7 @@ CleanUpStringDepository ( CurrentListNode = StringDepository->ListHead; for (NodeIndex = 0; NodeIndex < StringDepository->TotalNodeNumber; NodeIndex++) { NextListNode = CurrentListNode->Next; - FreePool (CurrentListNode); + FreePool(CurrentListNode); CurrentListNode = NextListNode; } @@ -1450,7 +1450,7 @@ CleanUpStringDepository ( // // Release string depository. // - FreePool (FileOptionStrDepository); + FreePool(FileOptionStrDepository); } /** @@ -1590,7 +1590,7 @@ InitBMPackage ( // Ptr = AllocateZeroPool (sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY)); if (Ptr == NULL) { - FreePool (BmmCallbackInfo); + FreePool(BmmCallbackInfo); BmmCallbackInfo = NULL; return EFI_OUT_OF_RESOURCES; } @@ -1627,8 +1627,8 @@ InitBMPackage ( &BmmCallbackInfo->BmmConfigAccess, NULL ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -1643,8 +1643,8 @@ InitBMPackage ( &BmmCallbackInfo->FeConfigAccess, NULL ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -1718,8 +1718,8 @@ FreeBMPackage ( ); } - FreePool (BmmCallbackInfo->LoadContext); - FreePool (BmmCallbackInfo); + FreePool(BmmCallbackInfo->LoadContext); + FreePool(BmmCallbackInfo); mBmmCallbackInfo = NULL; diff --git a/CloverEFI/OsxBdsDxe/BootMaint/BootOption.c b/CloverEFI/OsxBdsDxe/BootMaint/BootOption.c index 6fbcb9115..18039b6a7 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/BootOption.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/BootOption.c @@ -83,7 +83,7 @@ BOpt_CreateMenuEntry ( MenuEntry->VariableContext = AllocateZeroPool (ContextSize); if (MenuEntry->VariableContext == NULL) { - FreePool (MenuEntry); + FreePool(MenuEntry); return NULL; } @@ -116,19 +116,19 @@ BOpt_DestroyMenuEntry ( switch (MenuEntry->ContextSelection) { case BM_LOAD_CONTEXT_SELECT: LoadContext = (BM_LOAD_CONTEXT *) MenuEntry->VariableContext; - FreePool (LoadContext->FilePathList); - FreePool (LoadContext->LoadOption); + FreePool(LoadContext->FilePathList); + FreePool(LoadContext->LoadOption); if (LoadContext->OptionalData != NULL) { - FreePool (LoadContext->OptionalData); + FreePool(LoadContext->OptionalData); } - FreePool (LoadContext); + FreePool(LoadContext); break; case BM_FILE_CONTEXT_SELECT: FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext; if (!FileContext->IsRoot) { - FreePool (FileContext->DevicePath); + FreePool(FileContext->DevicePath); } else { if (FileContext->FHandle != NULL) { FileContext->FHandle->Close (FileContext->FHandle); @@ -136,45 +136,45 @@ BOpt_DestroyMenuEntry ( } if (FileContext->FileName != NULL) { - FreePool (FileContext->FileName); + FreePool(FileContext->FileName); } if (FileContext->Info != NULL) { - FreePool (FileContext->Info); + FreePool(FileContext->Info); } - FreePool (FileContext); + FreePool(FileContext); break; /* case BM_CONSOLE_CONTEXT_SELECT: ConsoleContext = (BM_CONSOLE_CONTEXT *) MenuEntry->VariableContext; - FreePool (ConsoleContext->DevicePath); - FreePool (ConsoleContext); + FreePool(ConsoleContext->DevicePath); + FreePool(ConsoleContext); break; case BM_TERMINAL_CONTEXT_SELECT: TerminalContext = (BM_TERMINAL_CONTEXT *) MenuEntry->VariableContext; - FreePool (TerminalContext->DevicePath); - FreePool (TerminalContext); + FreePool(TerminalContext->DevicePath); + FreePool(TerminalContext); break; */ case BM_HANDLE_CONTEXT_SELECT: HandleContext = (BM_HANDLE_CONTEXT *) MenuEntry->VariableContext; - FreePool (HandleContext); + FreePool(HandleContext); break; case BM_LEGACY_DEV_CONTEXT_SELECT: LegacyDevContext = (BM_LEGACY_DEVICE_CONTEXT *) MenuEntry->VariableContext; - FreePool (LegacyDevContext); + FreePool(LegacyDevContext); default: break; } - FreePool (MenuEntry->DisplayString); + FreePool(MenuEntry->DisplayString); if (MenuEntry->HelpString != NULL) { - FreePool (MenuEntry->HelpString); + FreePool(MenuEntry->HelpString); } - FreePool (MenuEntry); + FreePool(MenuEntry); } /** @@ -267,7 +267,7 @@ BOpt_FindFileSystem ( &NoBlkIoHandles, &BlkIoHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < NoBlkIoHandles; Index++) { Status = gBS->HandleProtocol ( BlkIoHandle[Index], @@ -275,7 +275,7 @@ BOpt_FindFileSystem ( (VOID **) &BlkIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -285,7 +285,7 @@ BOpt_FindFileSystem ( if (BlkIo->Media->RemovableMedia) { Buffer = AllocateZeroPool (BlkIo->Media->BlockSize); if (NULL == Buffer) { - FreePool (BlkIoHandle); + FreePool(BlkIoHandle); return EFI_OUT_OF_RESOURCES; } @@ -296,10 +296,10 @@ BOpt_FindFileSystem ( BlkIo->Media->BlockSize, Buffer ); - FreePool (Buffer); + FreePool(Buffer); } } - FreePool (BlkIoHandle); + FreePool(BlkIoHandle); } // @@ -312,7 +312,7 @@ BOpt_FindFileSystem ( &NoSimpleFsHandles, &SimpleFsHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Find all the instances of the File System prototocol // @@ -322,7 +322,7 @@ BOpt_FindFileSystem ( &gEfiBlockIoProtocolGuid, (VOID **) &BlkIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If no block IO exists assume it's NOT a removable media // @@ -339,7 +339,7 @@ BOpt_FindFileSystem ( // MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT); if (NULL == MenuEntry) { - FreePool (SimpleFsHandle); + FreePool(SimpleFsHandle); return EFI_OUT_OF_RESOURCES; } @@ -404,7 +404,7 @@ BOpt_FindFileSystem ( } if (NoSimpleFsHandles != 0) { - FreePool (SimpleFsHandle); + FreePool(SimpleFsHandle); } // // Searching for handles that support Load File protocol @@ -417,11 +417,11 @@ BOpt_FindFileSystem ( &LoadFileHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < NoLoadFileHandles; Index++) { MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT); if (NULL == MenuEntry) { - FreePool (LoadFileHandle); + FreePool(LoadFileHandle); return EFI_OUT_OF_RESOURCES; } @@ -453,7 +453,7 @@ BOpt_FindFileSystem ( } if (NoLoadFileHandles != 0) { - FreePool (LoadFileHandle); + FreePool(LoadFileHandle); } // @@ -464,7 +464,7 @@ BOpt_FindFileSystem ( NULL, (VOID **) &LegacyBios ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = BBS_TYPE_FLOPPY; Index <= BBS_TYPE_EMBEDDED_NETWORK; Index++) { MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT); @@ -587,7 +587,7 @@ BOpt_FindFiles ( Dir->Close (Dir); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -620,7 +620,7 @@ BOpt_FindFiles ( for (;;) { BufferSize = DirBufferSize; Status = NewDir->Read (NewDir, &BufferSize, DirInfo); - if (EFI_ERROR (Status) || BufferSize == 0) { + if (EFI_ERROR(Status) || BufferSize == 0) { break; } @@ -692,7 +692,7 @@ BOpt_FindFiles ( } DirectoryMenu.MenuNumber = OptionNumber; - FreePool (DirInfo); + FreePool(DirInfo); return EFI_SUCCESS; } @@ -743,7 +743,7 @@ BOpt_GetLegacyOptions ( NULL, (VOID **) &LegacyBios ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = LegacyBios->GetBbsInfo ( LegacyBios, &HddCount, @@ -751,7 +751,7 @@ BOpt_GetLegacyOptions ( &BbsCount, &BbsTable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -917,7 +917,7 @@ BOpt_GetBootOptions ( if (BootNext != NULL) { if (BootNextSize != sizeof (UINT16)) { - FreePool (BootNext); + FreePool(BootNext); BootNext = NULL; } } @@ -942,7 +942,7 @@ BOpt_GetBootOptions ( } CopyMem (LoadOption, LoadOptionFromVar, BootOptionSize); - FreePool (LoadOptionFromVar); + FreePool(LoadOptionFromVar); if (BootNext != NULL) { BootNextFlag = (BOOLEAN) (*BootNext == BootOrderList[Index]); @@ -951,7 +951,7 @@ BOpt_GetBootOptions ( } if (0 == (*((UINT32 *) LoadOption) & LOAD_OPTION_ACTIVE)) { - FreePool (LoadOption); + FreePool(LoadOption); continue; } // @@ -1073,10 +1073,10 @@ BOpt_GetBootOptions ( } if (BootNext != NULL) { - FreePool (BootNext); + FreePool(BootNext); } if (BootOrderList != NULL) { - FreePool (BootOrderList); + FreePool(BootOrderList); } BootOptionMenu.MenuNumber = MenuCount; return EFI_SUCCESS; @@ -1159,7 +1159,7 @@ BOpt_AppendFileName ( Ptr++; } - FreePool (TmpStr); + FreePool(TmpStr); return Str; } @@ -1232,7 +1232,7 @@ BOpt_IsEfiApp ( Status = Dir->Open (Dir, &File, FileName, EFI_FILE_MODE_READ, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -1314,7 +1314,7 @@ BOpt_FindDrivers ( &NoDevicePathHandles, &DevicePathHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1342,7 +1342,7 @@ BOpt_FindDrivers ( NewMenuEntry = BOpt_CreateMenuEntry (BM_HANDLE_CONTEXT_SELECT); if (NULL == NewMenuEntry) { - FreePool (DevicePathHandle); + FreePool(DevicePathHandle); return EFI_OUT_OF_RESOURCES; } @@ -1358,7 +1358,7 @@ BOpt_FindDrivers ( } if (DevicePathHandle != NULL) { - FreePool (DevicePathHandle); + FreePool(DevicePathHandle); } DriverMenu.MenuNumber = OptionNumber; @@ -1537,7 +1537,7 @@ BOpt_GetDriverOptions ( } CopyMem (LoadOption, LoadOptionFromVar, DriverOptionSize); - FreePool (LoadOptionFromVar); + FreePool(LoadOptionFromVar); NewMenuEntry = BOpt_CreateMenuEntry (BM_LOAD_CONTEXT_SELECT); if (NULL == NewMenuEntry) { @@ -1624,7 +1624,7 @@ BOpt_GetDriverOptions ( } if (DriverOrderList != NULL) { - FreePool (DriverOrderList); + FreePool(DriverOrderList); } DriverOptionMenu.MenuNumber = Index; return EFI_SUCCESS; diff --git a/CloverEFI/OsxBdsDxe/BootMaint/ConsoleOption.c b/CloverEFI/OsxBdsDxe/BootMaint/ConsoleOption.c index 32a9d7997..ca8ebcfdc 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/ConsoleOption.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/ConsoleOption.c @@ -313,7 +313,7 @@ RetrieveUartUid ( &gEfiDevicePathProtocolGuid, (VOID **) &DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -442,7 +442,7 @@ LocateSerialIo ( &NoHandles, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No serial ports present // @@ -479,7 +479,7 @@ LocateSerialIo ( if ((Acpi != NULL) && IsIsaSerialNode (Acpi)) { NewMenuEntry = BOpt_CreateMenuEntry (BM_TERMINAL_CONTEXT_SELECT); if (NewMenuEntry == NULL) { - FreePool (Handles); + FreePool(Handles); return EFI_OUT_OF_RESOURCES; } @@ -540,7 +540,7 @@ LocateSerialIo ( } } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } // @@ -585,7 +585,7 @@ LocateSerialIo ( (EFI_DEVICE_PATH_PROTOCOL *) &Vendor ); if (NewMenuEntry->HelpString != NULL) { - FreePool (NewMenuEntry->HelpString); + FreePool(NewMenuEntry->HelpString); } // // NewMenuEntry->HelpString = DevicePathToStr (NewDevicePath); diff --git a/CloverEFI/OsxBdsDxe/BootMaint/FileExplorer.c b/CloverEFI/OsxBdsDxe/BootMaint/FileExplorer.c index c9d9aa563..9f5ca9b45 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/FileExplorer.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/FileExplorer.c @@ -145,7 +145,7 @@ UpdateFileExplorer ( RemoveEntryList (&NewMenuEntry->Link); BOpt_FreeMenu (&DirectoryMenu); Status = BOpt_FindFiles (CallbackData, NewMenuEntry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ExitFileExplorer = TRUE; goto exit; } @@ -293,7 +293,7 @@ FileExplorerRouteConfig ( NULL, (VOID**) &ConfigRouting ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -314,11 +314,11 @@ FileExplorerRouteConfig ( &BufferSize, Progress ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (FeData->BootDescriptionData[0] != 0x00 || FeData->BootOptionalData[0] != 0x00) { Status = Var_UpdateBootOption (Private, FeData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -334,7 +334,7 @@ FileExplorerRouteConfig ( FeData->DriverOptionalData, FeData->ForceReconnect ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/CloverEFI/OsxBdsDxe/BootMaint/UpdatePage.c b/CloverEFI/OsxBdsDxe/BootMaint/UpdatePage.c index d8fdb0127..04eabf588 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/UpdatePage.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/UpdatePage.c @@ -799,7 +799,7 @@ UpdateConModePage ( // for (Mode = 0; Mode < MaxMode; Mode++) { Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } ValidMode++; @@ -827,7 +827,7 @@ UpdateConModePage ( // for (Mode = 0; Mode < MaxMode; Mode++) { Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -876,7 +876,7 @@ UpdateConModePage ( ); HiiFreeOpCodeHandle (OptionsOpCodeHandle); - FreePool (ModeToken); + FreePool(ModeToken); UpdatePageEnd (CallbackData); } @@ -1227,14 +1227,14 @@ GetLegacyBootOptionVar ( (BBS_BBS_DP == DevicePath->SubType) ) { *OptionIndex = OrderBuffer[Index]; - FreePool (OrderBuffer); + FreePool(OrderBuffer); return OptionBuffer; } else { - FreePool (OptionBuffer); + FreePool(OptionBuffer); } } - FreePool (OrderBuffer); + FreePool(OrderBuffer); return NULL; } diff --git a/CloverEFI/OsxBdsDxe/BootMaint/Variable.c b/CloverEFI/OsxBdsDxe/BootMaint/Variable.c index 5f1602f62..0e1cafa07 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/Variable.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/Variable.c @@ -123,7 +123,7 @@ Var_ChangeBootOrder ( // if (BootOrderList != NULL) { EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid); - FreePool (BootOrderList); + FreePool(BootOrderList); BootOrderList = NULL; } // @@ -165,7 +165,7 @@ Var_ChangeBootOrder ( BootOrderListSize * sizeof (UINT16), BootOrderList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -269,7 +269,7 @@ Var_ChangeDriverOrder ( // if (DriverOrderList != NULL) { EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid); - FreePool (DriverOrderList); + FreePool(DriverOrderList); DriverOrderList = NULL; } @@ -303,7 +303,7 @@ Var_ChangeDriverOrder ( DriverOrderListSize * sizeof (UINT16), DriverOrderList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -339,7 +339,7 @@ Var_UpdateAllConsoleOption ( GetDevicePathSize (OutDevicePath), OutDevicePath ); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); } if (InpDevicePath != NULL) { @@ -351,7 +351,7 @@ Var_UpdateAllConsoleOption ( GetDevicePathSize (InpDevicePath), InpDevicePath ); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); } if (ErrDevicePath != NULL) { @@ -363,7 +363,7 @@ Var_UpdateAllConsoleOption ( GetDevicePathSize (ErrDevicePath), ErrDevicePath ); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); } } */ @@ -408,7 +408,7 @@ Var_UpdateConsoleOption ( ConDevicePath = EfiLibGetVariable (ConsoleName, &gEfiGlobalVariableGuid); if (ConDevicePath != NULL) { EfiLibDeleteVariable (ConsoleName, &gEfiGlobalVariableGuid); - FreePool (ConDevicePath); + FreePool(ConDevicePath); ConDevicePath = NULL; }; @@ -466,7 +466,7 @@ Var_UpdateConsoleOption ( GetDevicePathSize (ConDevicePath), ConDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -590,7 +590,7 @@ Var_UpdateDriverOption ( NewMenuEntry = BOpt_CreateMenuEntry (BM_LOAD_CONTEXT_SELECT); if (NULL == NewMenuEntry) { - FreePool (Buffer); + FreePool(Buffer); return EFI_OUT_OF_RESOURCES; } @@ -671,7 +671,7 @@ Var_UpdateDriverOption ( BufferSize, Buffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DriverOrderList = BdsLibGetVariableAndSize ( L"DriverOrder", &gEfiGlobalVariableGuid, @@ -693,11 +693,11 @@ Var_UpdateDriverOption ( NewDriverOrderList ); if (DriverOrderList != NULL) { - FreePool (DriverOrderList); + FreePool(DriverOrderList); } DriverOrderList = NULL; - FreePool (NewDriverOrderList); - if (!EFI_ERROR (Status)) { + FreePool(NewDriverOrderList); + if (!EFI_ERROR(Status)) { InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link); DriverOptionMenu.MenuNumber++; @@ -852,7 +852,7 @@ Var_UpdateBootOption ( BufferSize, Buffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BootOrderList = BdsLibGetVariableAndSize ( L"BootOrder", @@ -868,7 +868,7 @@ if (BootOrderList != NULL) { NewBootOrderList[BootOrderListSize / sizeof (UINT16)] = Index; } - FreePool (BootOrderList); + FreePool(BootOrderList); } Status = gRT->SetVariable ( @@ -878,9 +878,9 @@ if (BootOrderList != NULL) { BootOrderListSize + sizeof (UINT16), NewBootOrderList ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { - FreePool (NewBootOrderList); + FreePool(NewBootOrderList); NewBootOrderList = NULL; InsertTailList (&BootOptionMenu.Head, &NewMenuEntry->Link); BootOptionMenu.MenuNumber++; @@ -1018,7 +1018,7 @@ Var_UpdateBootOrder ( BootOrderListSize, BootOrderList ); - FreePool (BootOrderList); + FreePool(BootOrderList); GroupMultipleLegacyBootOption4SameType (); @@ -1074,7 +1074,7 @@ Var_UpdateDriverOrder ( // if (DriverOrderList != NULL) { EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid); - FreePool (DriverOrderList); + FreePool(DriverOrderList); } ASSERT (DriverOptionMenu.MenuNumber <= (sizeof (CallbackData->BmmFakeNvData.DriverOptionOrder) / sizeof (CallbackData->BmmFakeNvData.DriverOptionOrder[0]))); @@ -1089,7 +1089,7 @@ Var_UpdateDriverOrder ( DriverOrderListSize, NewDriverOrderList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1205,13 +1205,13 @@ Var_UpdateBBSOption ( } if (VarData >= OriginalPtr + VarSize) { - FreePool (OriginalPtr); + FreePool(OriginalPtr); return EFI_NOT_FOUND; } NewOrder = AllocateZeroPool (DevOrder->Length - sizeof (DevOrder->Length)); if (NewOrder == NULL) { - FreePool (OriginalPtr); + FreePool(OriginalPtr); return EFI_OUT_OF_RESOURCES; } @@ -1243,7 +1243,7 @@ Var_UpdateBBSOption ( NewOrder, DevOrder->Length - sizeof (DevOrder->Length) ); - FreePool (NewOrder); + FreePool(NewOrder); Status = gRT->SetVariable ( VAR_LEGACY_DEV_ORDER, @@ -1292,7 +1292,7 @@ Var_UpdateBBSOption ( BootOptionVar ); - FreePool (BootOptionVar); + FreePool(BootOptionVar); } } @@ -1315,15 +1315,15 @@ Var_UpdateBBSOption ( BootOptionVar ); - FreePool (BootOptionVar); + FreePool(BootOptionVar); } } BOpt_GetBootOptions (CallbackData); - FreePool (OriginalPtr); - FreePool (EnBootOption); - FreePool (DisBootOption); + FreePool(OriginalPtr); + FreePool(EnBootOption); + FreePool(DisBootOption); return Status; } diff --git a/CloverEFI/OsxBdsDxe/BootMngr/BootManager.c b/CloverEFI/OsxBdsDxe/BootMngr/BootManager.c index 41bbe79ba..c0b26ed7e 100644 --- a/CloverEFI/OsxBdsDxe/BootMngr/BootManager.c +++ b/CloverEFI/OsxBdsDxe/BootMngr/BootManager.c @@ -165,7 +165,7 @@ InitializeBootManager ( &gBootManagerPrivate.ConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Publish our HII data @@ -399,7 +399,7 @@ CallBootManager ( // Status = BdsLibBootViaBootOption (gOption, gOption->DevicePath, &ExitDataSize, &ExitData); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED)); PlatformBdsBootSuccess (gOption); } else { diff --git a/CloverEFI/OsxBdsDxe/Capsules.c b/CloverEFI/OsxBdsDxe/Capsules.c index efb6d155b..4ac9bbd91 100644 --- a/CloverEFI/OsxBdsDxe/Capsules.c +++ b/CloverEFI/OsxBdsDxe/Capsules.c @@ -173,7 +173,7 @@ BdsProcessCapsules ( CapsuleTable->CapsuleArrayNumber = CapsuleNumber; CopyMem(&CapsuleTable->CapsulePtr[0], CapsulePtrCache, CapsuleNumber * sizeof(VOID*)); Status = gBS->InstallConfigurationTable (&CapsuleGuidCache[CacheIndex], (VOID*)CapsuleTable); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } CacheIndex++; } @@ -219,9 +219,9 @@ BdsProcessCapsules ( // // Free the allocated temp memory space. // - FreePool (CapsuleGuidCache); - FreePool (CapsulePtrCache); - FreePool (CapsulePtr); + FreePool(CapsuleGuidCache); + FreePool(CapsulePtrCache); + FreePool(CapsulePtr); return Status; } diff --git a/CloverEFI/OsxBdsDxe/DeviceMngr/DeviceManager.c b/CloverEFI/OsxBdsDxe/DeviceMngr/DeviceManager.c index 7a8d05c62..c9fd2d4a2 100644 --- a/CloverEFI/OsxBdsDxe/DeviceMngr/DeviceManager.c +++ b/CloverEFI/OsxBdsDxe/DeviceMngr/DeviceManager.c @@ -185,8 +185,8 @@ InitializeDeviceManager ( &gDeviceManagerPrivate.ConfigAccess, NULL ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -198,8 +198,8 @@ InitializeDeviceManager ( &gDeviceManagerPrivate.DriverHealthConfigAccess, NULL ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -278,7 +278,7 @@ ExtractDisplayedHiiFormFromHiiHandle ( // ASSERT (HiiPackageList != NULL); Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &BufferSize, HiiPackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -320,7 +320,7 @@ ExtractDisplayedHiiFormFromHiiHandle ( CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID)); *FormSetGuid = AllocateCopyPool (sizeof (EFI_GUID), &((EFI_IFR_FORM_SET *) OpCodeData)->Guid); ASSERT (*FormSetGuid != NULL); - FreePool (HiiPackageList); + FreePool(HiiPackageList); return TRUE; } ClassGuid ++; @@ -330,7 +330,7 @@ ExtractDisplayedHiiFormFromHiiHandle ( CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID)); *FormSetGuid = AllocateCopyPool (sizeof (EFI_GUID), &((EFI_IFR_FORM_SET *) OpCodeData)->Guid); ASSERT (*FormSetGuid != NULL); - FreePool (HiiPackageList); + FreePool(HiiPackageList); return TRUE; } } @@ -343,7 +343,7 @@ ExtractDisplayedHiiFormFromHiiHandle ( Offset += PackageHeader.Length; } - FreePool (HiiPackageList); + FreePool(HiiPackageList); return FALSE; } @@ -574,7 +574,7 @@ IsMacAddressDevicePath ( } if (Buffer != NULL) { - FreePool (Buffer); + FreePool(Buffer); } return ReturnVal; @@ -615,14 +615,14 @@ IsNeedAddNetworkMenu ( *ItemCount = 0; Status = gHiiDatabase->GetPackageListHandle (gHiiDatabase, Handle, &DriverHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } // // Get the device path by the got Driver handle . // Status = gBS->HandleProtocol (DriverHandle, &gEfiDevicePathProtocolGuid, (VOID **) &DevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } TmpDevicePath = DevicePath; @@ -646,7 +646,7 @@ IsNeedAddNetworkMenu ( // TmpDevicePath = DevicePath; Status = gBS->LocateDevicePath(&gEfiDevicePathProtocolGuid, &TmpDevicePath, &ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -665,7 +665,7 @@ IsNeedAddNetworkMenu ( &OpenInfoBuffer, &EntryCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -686,7 +686,7 @@ IsNeedAddNetworkMenu ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -719,7 +719,7 @@ IsNeedAddNetworkMenu ( Done: if (OpenInfoBuffer != NULL) { - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); } return IsNeedAdd; } @@ -783,9 +783,9 @@ AdjustArrayData ( CopyMem (NewGuidLists, *GuidLists, Offset * sizeof (EFI_GUID *)); NewGuidLists[Offset] = FormSetGuid; - FreePool (*HiiHandles); + FreePool(*HiiHandles); *HiiHandles = NewHiiHandles; - FreePool (*GuidLists); + FreePool(*GuidLists); *GuidLists = NewGuidLists; } @@ -886,8 +886,8 @@ CallDeviceManager ( NewStringTitle = AllocatePool (NewStringLen); UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, mSelectedMacAddrString); HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); - FreePool (String); - FreePool (NewStringTitle); + FreePool(String); + FreePool(NewStringTitle); } // @@ -973,7 +973,7 @@ CallDeviceManager ( } } Token = HiiSetString (HiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); String = HiiGetString (HiiHandles[Index], FormSetHelp, NULL); if (String == NULL) { @@ -984,7 +984,7 @@ CallDeviceManager ( } } TokenHelp = HiiSetString (HiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); // // Network device process @@ -1196,14 +1196,14 @@ Done: HiiFreeOpCodeHandle (StartOpCodeHandle); HiiFreeOpCodeHandle (EndOpCodeHandle); - FreePool (HiiHandles); + FreePool(HiiHandles); for (Index = 0; Index < HandleNum; Index++) { if (GuidLists[Index] != NULL) { - FreePool (GuidLists[Index]); + FreePool(GuidLists[Index]); } } - FreePool (GuidLists); + FreePool(GuidLists); return Status; } @@ -1399,7 +1399,7 @@ CallDriverHealth ( } Status = DriverHealthGetDriverName (DriverHealthInfo->DriverHandle, &DriverName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Can not get the Driver name, so use the Device path // @@ -1419,7 +1419,7 @@ CallDriverHealth ( &ControllerName ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Can not get the Controller name, just let it empty. // @@ -1466,11 +1466,11 @@ CallDriverHealth ( // ASSERT (TmpString != NULL); if (TmpString) { StrCatS (String, 512, TmpString); - FreePool (TmpString); + FreePool(TmpString); } Token = HiiSetString (HiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); TokenHelp = HiiSetString (HiiHandle, 0, GetStringById( STRING_TOKEN (STR_DH_REPAIR_SINGLE_HELP)), NULL); @@ -1638,7 +1638,7 @@ CallDriverHealth ( if (DriverHealthInfo->MessageList != NULL) { FreePool(DriverHealthInfo->MessageList); - FreePool (DriverHealthInfo); + FreePool(DriverHealthInfo); } } @@ -1749,7 +1749,7 @@ GetSingleControllerHealthStatus ( // Status = DriverHealth->GetHealthStatus (DriverHealth, ControllerHandle, ChildHandle, HealthStatus, &MessageList, &FormHiiHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If the health status could not be retrieved, then return immediately // @@ -1832,7 +1832,7 @@ GetAllControllersHealthStatus ( return EFI_NOT_FOUND; } - if (EFI_ERROR (Status) || DriverHealthHandles == NULL) { + if (EFI_ERROR(Status) || DriverHealthHandles == NULL) { // // If the list of Driver Health Protocol handles can not be retrieved, then // return EFI_OUT_OF_RESOURCES @@ -1860,7 +1860,7 @@ GetAllControllersHealthStatus ( &gEfiDriverHealthProtocolGuid, (VOID **)&DriverHealth ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If the Driver Health Protocol can not be retrieved, then skip to the next // Driver Health Protocol handle @@ -1877,7 +1877,7 @@ GetAllControllersHealthStatus ( // If Status is an error code, then the health information could not be retrieved, so assume healthy // and skip to the next Driver Health Protocol handle // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -1904,7 +1904,7 @@ GetAllControllersHealthStatus ( &HandleCount, &Handles ); - if (EFI_ERROR (Status) || Handles == NULL) { + if (EFI_ERROR(Status) || Handles == NULL) { // // If all the handles in the handle database can not be retrieved, then // return EFI_OUT_OF_RESOURCES @@ -1925,7 +1925,7 @@ GetAllControllersHealthStatus ( } Status = GetSingleControllerHealthStatus (DriverHealthList, DriverHealthHandles[DriverHealthIndex], Handles[ControllerIndex], NULL, DriverHealth, &HealthStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If Status is an error code, then the health information could not be retrieved, so assume healthy // @@ -1935,7 +1935,7 @@ GetAllControllersHealthStatus ( // // If CheckHealthSingleController() returned an error on a terminal state, then do not check the health of child controllers // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -1951,7 +1951,7 @@ GetAllControllersHealthStatus ( } Status = GetSingleControllerHealthStatus (DriverHealthList, DriverHealthHandles[DriverHealthIndex], Handles[ControllerIndex], Handles[ChildIndex], DriverHealth, &HealthStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If Status is an error code, then the health information could not be retrieved, so assume healthy // @@ -1961,7 +1961,7 @@ GetAllControllersHealthStatus ( // // If CheckHealthSingleController() returned an error on a terminal state, then skip to the next child // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } } @@ -1972,10 +1972,10 @@ GetAllControllersHealthStatus ( Done: if (Handles != NULL) { - gBS->FreePool (Handles); + gBS->FreePool(Handles); } if (DriverHealthHandles != NULL) { - gBS->FreePool (DriverHealthHandles); + gBS->FreePool(DriverHealthHandles); } return Status; @@ -2032,14 +2032,14 @@ PlaformHealthStatusCheck ( // // Found one or more Handles. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < NoHandles; Index++) { Status = gBS->HandleProtocol ( DriverHealthHandles[Index], &gEfiDriverHealthProtocolGuid, (VOID **) &DriverHealth ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = DriverHealth->GetHealthStatus ( DriverHealth, NULL, @@ -2052,7 +2052,7 @@ PlaformHealthStatusCheck ( // // Get the healthy status of the module // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (HealthStatus != EfiDriverHealthStatusHealthy) { // // Return immediately one driver's status not in healthy. @@ -2130,8 +2130,8 @@ ProcessSingleControllerHealth ( NULL, NULL ); -// ASSERT( !EFI_ERROR (Status)); - if (EFI_ERROR (Status)) { +// ASSERT( !EFI_ERROR(Status)); + if (EFI_ERROR(Status)) { break; } } else { @@ -2150,8 +2150,8 @@ ProcessSingleControllerHealth ( NULL, &FormHiiHandle ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { break; } @@ -2180,7 +2180,7 @@ ProcessSingleControllerHealth ( // if (LocalHealthStatus == EfiDriverHealthStatusReconnectRequired) { Status = gBS->DisconnectController (ControllerHandle, NULL, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Disconnect failed. Need to promote reconnect to a reboot. // @@ -2355,7 +2355,7 @@ DriverHealthSelectBestLanguage ( NULL ); if (LanguageVariable != NULL) { - FreePool (LanguageVariable); + FreePool(LanguageVariable); } return BestLanguage; @@ -2402,7 +2402,7 @@ GetComponentNameWorker ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2457,7 +2457,7 @@ GetDriverNameWorker ( &ComponentName, &BestLanguage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2469,7 +2469,7 @@ GetDriverNameWorker ( BestLanguage, DriverName ); - FreePool (BestLanguage); + FreePool(BestLanguage); return Status; } @@ -2503,7 +2503,7 @@ DriverHealthGetDriverName ( // Get driver name from UEFI 2.0 Component Name 2 protocol interface. // Status = GetDriverNameWorker (&gEfiComponentName2ProtocolGuid, DriverBindingHandle, DriverName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If it fails to get the driver name from Component Name protocol interface, we should fall back on // EFI 1.1 Component Name protocol interface. @@ -2562,7 +2562,7 @@ GetControllerNameWorker ( &ComponentName, &BestLanguage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2576,7 +2576,7 @@ GetControllerNameWorker ( BestLanguage, ControllerName ); - FreePool (BestLanguage); + FreePool(BestLanguage); return Status; } @@ -2624,7 +2624,7 @@ DriverHealthGetControllerName ( ChildHandle, ControllerName ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If it fails to get the controller name from Component Name protocol interface, we should fall back on // EFI 1.1 Component Name protocol interface. diff --git a/CloverEFI/OsxBdsDxe/FrontPage.c b/CloverEFI/OsxBdsDxe/FrontPage.c index 1f5127172..48d2c127b 100644 --- a/CloverEFI/OsxBdsDxe/FrontPage.c +++ b/CloverEFI/OsxBdsDxe/FrontPage.c @@ -240,7 +240,7 @@ FrontPageCallback ( *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; - FreePool (Lang); + FreePool(Lang); break; default: @@ -334,7 +334,7 @@ InitializeFrontPage ( // Locate Hii relative protocols // Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &gFormBrowser2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -349,7 +349,7 @@ InitializeFrontPage ( &gFrontPagePrivate.ConfigAccess, NULL ); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); // // Publish our HII data @@ -442,7 +442,7 @@ InitializeFrontPage ( ASSERT (gFrontPagePrivate.LanguageToken != NULL); Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &HiiString); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); LangCode = mLanguageString; OptionCount = 0; @@ -455,10 +455,10 @@ InitializeFrontPage ( StringBuffer = AllocateZeroPool (StringSize); ASSERT (StringBuffer != NULL); Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { StringBuffer = AllocatePool (AsciiStrSize (Lang) * sizeof (CHAR16)); ASSERT (StringBuffer != NULL); AsciiStrToUnicodeStrS (Lang, StringBuffer, AsciiStrSize(Lang)); @@ -466,7 +466,7 @@ InitializeFrontPage ( ASSERT (StringBuffer != NULL); gFrontPagePrivate.LanguageToken[OptionCount] = HiiSetString (HiiHandle, 0, StringBuffer, NULL); - FreePool (StringBuffer); + FreePool(StringBuffer); OptionCount++; } @@ -482,7 +482,7 @@ InitializeFrontPage ( while (*LangCode != 0) { GetNextLanguage (&LangCode, Lang); - if (CurrentLang != NULL && AsciiStrCmp (Lang, CurrentLang) == 0) { + if (CurrentLang != NULL && AsciiStrCmp(Lang, CurrentLang) == 0) { HiiCreateOneOfOptionOpCode ( OptionsOpCodeHandle, gFrontPagePrivate.LanguageToken[OptionCount], @@ -504,9 +504,9 @@ InitializeFrontPage ( } if (CurrentLang != NULL) { - FreePool (CurrentLang); + FreePool(CurrentLang); } - FreePool (Lang); + FreePool(Lang); HiiCreateOneOfOpCode ( StartOpCodeHandle, @@ -759,8 +759,8 @@ UpdateFrontPageStrings ( NULL, (VOID **) &Smbios ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -777,7 +777,7 @@ UpdateFrontPageStrings ( GetOptionalStringByIndex ((CHAR8*)((UINT8*)Type0Record + Type0Record->Hdr.Length), StrIndex, &NewString); TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_BIOS_VERSION); HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL); - FreePool (NewString); + FreePool(NewString); Find[0] = TRUE; } @@ -787,7 +787,7 @@ UpdateFrontPageStrings ( GetOptionalStringByIndex ((CHAR8*)((UINT8*)Type1Record + Type1Record->Hdr.Length), StrIndex, &NewString); TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_COMPUTER_MODEL); HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL); - FreePool (NewString); + FreePool(NewString); Find[1] = TRUE; } @@ -797,7 +797,7 @@ UpdateFrontPageStrings ( GetOptionalStringByIndex ((CHAR8*)((UINT8*)Type4Record + Type4Record->Hdr.Length), StrIndex, &NewString); TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_CPU_MODEL); HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL); - FreePool (NewString); + FreePool(NewString); Find[2] = TRUE; } @@ -806,7 +806,7 @@ UpdateFrontPageStrings ( ConvertProcessorToString(Type4Record->CurrentSpeed, 6, &NewString); TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_CPU_SPEED); HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL); - FreePool (NewString); + FreePool(NewString); Find[3] = TRUE; } @@ -818,7 +818,7 @@ UpdateFrontPageStrings ( ); TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_MEMORY_SIZE); HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL); - FreePool (NewString); + FreePool(NewString); Find[4] = TRUE; } } while ( !(Find[0] && Find[1] && Find[2] && Find[3] && Find[4])); @@ -852,7 +852,7 @@ WaitForSingleEvent ( // Create a timer event // Status = gBS->CreateEvent (EVT_TIMER, 0, NULL, NULL, &TimerEvent); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Set the timer event // @@ -873,7 +873,7 @@ WaitForSingleEvent ( // // If the timer expired, change the return to timed out // - if (!EFI_ERROR (Status) && Index == 1) { + if (!EFI_ERROR(Status) && Index == 1) { Status = EFI_TIMEOUT; } } @@ -882,7 +882,7 @@ WaitForSingleEvent ( // No timeout... just wait on the event // Status = gBS->WaitForEvent (1, &Event, &Index); -// ASSERT (!EFI_ERROR (Status)); +// ASSERT (!EFI_ERROR(Status)); // ASSERT (Index == 0); } @@ -962,7 +962,7 @@ ShowProgress ( } if (TmpStr != NULL) { - gBS->FreePool (TmpStr); + gBS->FreePool(TmpStr); } // @@ -976,7 +976,7 @@ ShowProgress ( // User pressed some key // Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1041,7 +1041,7 @@ PlatformBdsEnterFrontPage ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -1050,7 +1050,7 @@ PlatformBdsEnterFrontPage ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -1100,7 +1100,7 @@ PlatformBdsEnterFrontPage ( gST->ConOut->ClearScreen (gST->ConOut); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Timeout or user press enter to continue // @@ -1112,7 +1112,7 @@ PlatformBdsEnterFrontPage ( // Boot Logo is corrupted, report it using Boot Logo protocol. // Status = gBS->LocateProtocol (&gEfiBootLogoProtocolGuid, NULL, (VOID **) &BootLogo); - if (!EFI_ERROR (Status) && (BootLogo != NULL)) { + if (!EFI_ERROR(Status) && (BootLogo != NULL)) { BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0); } @@ -1213,7 +1213,7 @@ PlatformBdsEnterFrontPage ( } while (/*(Status == EFI_SUCCESS) && (*/gCallbackKey != FRONT_PAGE_KEY_CONTINUE); //); if (mLanguageString != NULL) { - FreePool (mLanguageString); + FreePool(mLanguageString); mLanguageString = NULL; } // @@ -1280,7 +1280,7 @@ BdsSetConsoleMode ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -1289,7 +1289,7 @@ BdsSetConsoleMode ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -1337,7 +1337,7 @@ BdsSetConsoleMode ( &SizeOfInfo, &Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Info->HorizontalResolution == NewHorizontalResolution) && (Info->VerticalResolution == NewVerticalResolution)) { if ((GraphicsOutput->Mode->Info->HorizontalResolution == NewHorizontalResolution) && @@ -1346,12 +1346,12 @@ BdsSetConsoleMode ( // Current resolution is same with required resolution, check if text mode need be set // Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow); - // ASSERT_EFI_ERROR (Status); - if ((EFI_ERROR (Status)) || (CurrentColumn == NewColumns && CurrentRow == NewRows)) { + // ASSERT_EFI_ERROR(Status); + if ((EFI_ERROR(Status)) || (CurrentColumn == NewColumns && CurrentRow == NewRows)) { // // If current text mode is same with required text mode. Do nothing // - FreePool (Info); + FreePool(Info); return EFI_SUCCESS; } else { // @@ -1365,13 +1365,13 @@ BdsSetConsoleMode ( // Required text mode is supported, set it. // Status = SimpleTextOut->SetMode (SimpleTextOut, Index); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); // // Update text mode PCD. // //PcdSet32 (PcdConOutColumn, mSetupTextModeColumn); //PcdSet32 (PcdConOutRow, mSetupTextModeRow); - FreePool (Info); + FreePool(Info); return EFI_SUCCESS; } } @@ -1380,7 +1380,7 @@ BdsSetConsoleMode ( // // If requried text mode is not supported, return error. // - FreePool (Info); + FreePool(Info); return EFI_UNSUPPORTED; } } @@ -1390,13 +1390,13 @@ BdsSetConsoleMode ( // In this case, the driver which produces simple text out need be restarted. // Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber); - if (!EFI_ERROR (Status)) { - FreePool (Info); + if (!EFI_ERROR(Status)) { + FreePool(Info); break; } } } - FreePool (Info); + FreePool(Info); } } @@ -1429,7 +1429,7 @@ BdsSetConsoleMode ( &HandleCount, &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleCount; Index++) { gBS->DisconnectController (HandleBuffer[Index], NULL, NULL); } @@ -1437,7 +1437,7 @@ BdsSetConsoleMode ( gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } } diff --git a/CloverEFI/OsxBdsDxe/Hotkey.c b/CloverEFI/OsxBdsDxe/Hotkey.c index fd0435b27..320b4ade3 100644 --- a/CloverEFI/OsxBdsDxe/Hotkey.c +++ b/CloverEFI/OsxBdsDxe/Hotkey.c @@ -59,7 +59,7 @@ IsKeyOptionValid ( // Check CRC for Boot Option // gBS->CalculateCrc32 (BootOptionVar, BootOptionSize, &Crc); - FreePool (BootOptionVar); + FreePool(BootOptionVar); return (BOOLEAN) ((KeyOption->BootOptionCrc == Crc) ? TRUE : FALSE); } @@ -141,8 +141,8 @@ RegisterHotkey ( // // Got the option, so just return // - FreePool (TempOption); - FreePool (KeyOrder); + FreePool(TempOption); + FreePool(KeyOrder); return EFI_SUCCESS; } @@ -160,12 +160,12 @@ RegisterHotkey ( } } - FreePool (TempOption); + FreePool(TempOption); } if (UpdateBootOption && (KeyOrder != NULL)) { RegisterOptionNumber = KeyOrder[Index]; - FreePool (TempOption); + FreePool(TempOption); } else { Index = 0; RegisterOptionNumber = (UINT16) (MaxOptionNumber + 1); @@ -186,8 +186,8 @@ RegisterHotkey ( KeyOptionSize, KeyOption ); - if (EFI_ERROR (Status)) { - FreePool (KeyOrder); + if (EFI_ERROR(Status)) { + FreePool(KeyOrder); return Status; } @@ -201,7 +201,7 @@ RegisterHotkey ( NewKeyOrder = AllocatePool (KeyOrderSize); if (NewKeyOrder == NULL) { - FreePool (KeyOrder); + FreePool(KeyOrder); return EFI_OUT_OF_RESOURCES; } @@ -220,9 +220,9 @@ RegisterHotkey ( ); if (KeyOrder != NULL) { - FreePool (KeyOrder); + FreePool(KeyOrder); } - FreePool (NewKeyOrder); + FreePool(NewKeyOrder); return Status; } @@ -300,7 +300,7 @@ UnregisterHotkey ( KeyOrder ); - FreePool (KeyOrder); + FreePool(KeyOrder); return Status; } @@ -332,7 +332,7 @@ HotkeyBoot ( Status = BdsLibBootViaBootOption (mHotkeyBootOption, mHotkeyBootOption->DevicePath, &ExitDataSize, &ExitData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Call platform action to indicate the boot fail // @@ -345,10 +345,10 @@ HotkeyBoot ( mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED)); PlatformBdsBootSuccess (mHotkeyBootOption); } - FreePool (mHotkeyBootOption->Description); - FreePool (mHotkeyBootOption->DevicePath); - FreePool (mHotkeyBootOption->LoadOptions); - FreePool (mHotkeyBootOption); + FreePool(mHotkeyBootOption->Description); + FreePool(mHotkeyBootOption->DevicePath); + FreePool(mHotkeyBootOption->LoadOptions); + FreePool(mHotkeyBootOption); mHotkeyBootOption = NULL; @@ -482,7 +482,7 @@ HotkeyRegisterNotify ( HotkeyCallback, &Hotkey->NotifyHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // some of the hotkey registry failed // @@ -525,7 +525,7 @@ HotkeyEvent ( &BufferSize, &Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If no more notification events exist // @@ -537,8 +537,8 @@ HotkeyEvent ( &gEfiSimpleTextInputExProtocolGuid, (VOID **) &SimpleTextInEx ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { // // If no more notification events exist // @@ -744,8 +744,8 @@ HotkeyGetOptionNumbers ( // if (Status == EFI_NOT_FOUND) { // break; // } -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { break; } @@ -771,7 +771,7 @@ HotkeyGetOptionNumbers ( } } - FreePool (Name); + FreePool(Name); return OptionNumbers; } @@ -817,8 +817,8 @@ InitializeHotkeyService ( // // Platform needs to make sure setting volatile variable before calling 3rd party code shouldn't fail. // -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -833,11 +833,11 @@ InitializeHotkeyService ( if (IsKeyOptionValid (KeyOption)) { HotkeyInsertList (KeyOption); } - FreePool (KeyOption); + FreePool(KeyOption); } if (KeyOptionNumbers != NULL) { - FreePool (KeyOptionNumbers); + FreePool(KeyOptionNumbers); } // @@ -850,8 +850,8 @@ InitializeHotkeyService ( NULL, &mHotkeyEvent ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -863,7 +863,7 @@ InitializeHotkeyService ( mHotkeyEvent, &mHotkeyRegistration ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } diff --git a/CloverEFI/OsxBdsDxe/Language.c b/CloverEFI/OsxBdsDxe/Language.c index 4ee3339d6..db1dccd13 100644 --- a/CloverEFI/OsxBdsDxe/Language.c +++ b/CloverEFI/OsxBdsDxe/Language.c @@ -434,7 +434,7 @@ InitializeLangVariable ( } if (Lang != NULL) { - FreePool (Lang); + FreePool(Lang); } } diff --git a/CloverEFI/OsxBdsDxe/MemoryTest.c b/CloverEFI/OsxBdsDxe/MemoryTest.c index 41f71425c..7abf31cc6 100644 --- a/CloverEFI/OsxBdsDxe/MemoryTest.c +++ b/CloverEFI/OsxBdsDxe/MemoryTest.c @@ -68,7 +68,7 @@ PlatformBdsShowProgress ( &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput ); - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { + if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { GraphicsOutput = NULL; Status = gBS->HandleProtocol ( @@ -77,7 +77,7 @@ PlatformBdsShowProgress ( (VOID **) &UgaDraw ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -94,7 +94,7 @@ PlatformBdsShowProgress ( &ColorDepth, &RefreshRate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } } else { @@ -261,8 +261,8 @@ BdsMemoryTest ( NULL, (VOID **) &GenMemoryTest ); - if (EFI_ERROR (Status)) { - FreePool (Pos); + if (EFI_ERROR(Status)) { + FreePool(Pos); return EFI_SUCCESS; } @@ -279,7 +279,7 @@ BdsMemoryTest ( // do the test, and then the status of EFI_NO_MEDIA will be returned by // "MemoryTestInit". So it does not need to test memory again, just return. // - FreePool (Pos); + FreePool(Pos); return EFI_SUCCESS; } @@ -288,7 +288,7 @@ BdsMemoryTest ( if (TmpStr != NULL) { PrintXY (10, 10, NULL, NULL, TmpStr); - FreePool (TmpStr); + FreePool(TmpStr); } } else { DEBUG ((EFI_D_INFO, "Enter memory test.\n")); @@ -305,7 +305,7 @@ BdsMemoryTest ( TmpStr = GetStringById (STRING_TOKEN (STR_SYSTEM_MEM_ERROR)); if (TmpStr != NULL) { PrintXY (10, 10, NULL, NULL, TmpStr); - FreePool (TmpStr); + FreePool(TmpStr); } // ASSERT (0); @@ -327,7 +327,7 @@ BdsMemoryTest ( // StrnCatS (StrPercent, 80, TmpStr, sizeof (StrPercent) / sizeof (CHAR16) - StrLen (StrPercent) - 1); PrintXY (10, 10, NULL, NULL, StrPercent); - FreePool (TmpStr); + FreePool(TmpStr); } TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST)); @@ -340,7 +340,7 @@ BdsMemoryTest ( TestPercent, (UINTN) PreviousValue ); - FreePool (TmpStr); + FreePool(TmpStr); } } @@ -351,7 +351,7 @@ BdsMemoryTest ( if (!PcdGetBool (PcdConInConnectOnDemand)) { KeyStatus = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); - if (!EFI_ERROR (KeyStatus) && (Key.ScanCode == SCAN_ESC)) { + if (!EFI_ERROR(KeyStatus) && (Key.ScanCode == SCAN_ESC)) { if (!RequireSoftECCInit) { if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) { TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST)); @@ -364,7 +364,7 @@ BdsMemoryTest ( 100, (UINTN) PreviousValue ); - FreePool (TmpStr); + FreePool(TmpStr); } PrintXY (10, 10, NULL, NULL, L"100"); @@ -391,7 +391,7 @@ Done: TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED)); if (TmpStr != NULL) { StrnCatS (StrTotalMemory, 80, TmpStr, StrTotalMemorySize / sizeof (CHAR16) - StrLen (StrTotalMemory) - 1); - FreePool (TmpStr); + FreePool(TmpStr); } PrintXY (10, 10, NULL, NULL, StrTotalMemory); @@ -408,7 +408,7 @@ Done: DEBUG ((EFI_D_INFO, "%d bytes of system memory tested OK\r\n", TotalMemorySize)); } - FreePool (Pos); + FreePool(Pos); // diff --git a/CloverEFI/OsxDxeCore/Dispatcher/Dependency.c b/CloverEFI/OsxDxeCore/Dispatcher/Dependency.c index 1d8a57b87..6aecf7fd7 100644 --- a/CloverEFI/OsxDxeCore/Dispatcher/Dependency.c +++ b/CloverEFI/OsxDxeCore/Dispatcher/Dependency.c @@ -68,7 +68,7 @@ GrowDepexStack ( // // Free The Old Stack // - FreePool (mDepexEvaluationStack); + FreePool(mDepexEvaluationStack); } // @@ -107,7 +107,7 @@ PushBool ( // Grow the stack // Status = GrowDepexStack (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -239,7 +239,7 @@ CoreIsSchedulable ( // Status = CoreAllEfiServicesAvailable (); DEBUG ((DEBUG_DISPATCH, " All UEFI Services Available = ")); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, "FALSE\n RESULT = FALSE\n")); return FALSE; } @@ -305,7 +305,7 @@ CoreIsSchedulable ( Status = CoreLocateProtocol (&DriverGuid, NULL, &Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = FALSE\n", &DriverGuid)); Status = PushBool (FALSE); } else { @@ -313,7 +313,7 @@ CoreIsSchedulable ( *Iterator = EFI_DEP_REPLACE_TRUE; Status = PushBool (TRUE); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -324,19 +324,19 @@ CoreIsSchedulable ( case EFI_DEP_AND: DEBUG ((DEBUG_DISPATCH, " AND\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PopBool (&Operator2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PushBool ((BOOLEAN)(Operator && Operator2)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -345,19 +345,19 @@ CoreIsSchedulable ( case EFI_DEP_OR: DEBUG ((DEBUG_DISPATCH, " OR\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PopBool (&Operator2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PushBool ((BOOLEAN)(Operator || Operator2)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -366,13 +366,13 @@ CoreIsSchedulable ( case EFI_DEP_NOT: DEBUG ((DEBUG_DISPATCH, " NOT\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PushBool ((BOOLEAN)(!Operator)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -381,7 +381,7 @@ CoreIsSchedulable ( case EFI_DEP_TRUE: DEBUG ((DEBUG_DISPATCH, " TRUE\n")); Status = PushBool (TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -390,7 +390,7 @@ CoreIsSchedulable ( case EFI_DEP_FALSE: DEBUG ((DEBUG_DISPATCH, " FALSE\n")); Status = PushBool (FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -399,7 +399,7 @@ CoreIsSchedulable ( case EFI_DEP_END: DEBUG ((DEBUG_DISPATCH, " END\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -411,7 +411,7 @@ CoreIsSchedulable ( DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = TRUE\n", &DriverGuid)); Status = PushBool (TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } diff --git a/CloverEFI/OsxDxeCore/Dispatcher/Dispatcher.c b/CloverEFI/OsxDxeCore/Dispatcher/Dispatcher.c index 59b3e7652..f1b7ecc63 100644 --- a/CloverEFI/OsxDxeCore/Dispatcher/Dispatcher.c +++ b/CloverEFI/OsxDxeCore/Dispatcher/Dispatcher.c @@ -267,7 +267,7 @@ CoreGetDepexSectionAndPreProccess ( (UINTN *)&DriverEntry->DepexSize, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_PROTOCOL_ERROR) { // // The section extraction protocol failed so set protocol error flag @@ -456,7 +456,7 @@ CoreDispatcher ( &gEfiEventDxeDispatchGuid, &DxeDispatchEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -492,7 +492,7 @@ CoreDispatcher ( // // Update the driver state to reflect that it's been loaded // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { CoreAcquireDispatcherLock (); if (Status == EFI_SECURITY_VIOLATION) { @@ -563,7 +563,7 @@ CoreDispatcher ( // so that SMM Dispatcher get chance to dispatch SMM Drivers which depend // on UEFI protocols // - if (!EFI_ERROR (ReturnStatus)) { + if (!EFI_ERROR(ReturnStatus)) { CoreSignalEvent (DxeDispatchEvent); } @@ -741,13 +741,13 @@ FvIsBeingProcesssed ( // FvNameGuidIsFound = FALSE; Status = CoreHandleProtocol (FvHandle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get the full FV header based on FVB protocol. // ASSERT (Fvb != NULL); Status = GetFwVolHeader (Fvb, &FwVolHeader); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (FwVolHeader != NULL); if (VerifyFvHeaderChecksum (FwVolHeader) && FwVolHeader->ExtHeaderOffset != 0) { ExtHeaderOffset = (UINT32) FwVolHeader->ExtHeaderOffset; @@ -775,11 +775,11 @@ FvIsBeingProcesssed ( // Read FvNameGuid from FV extension header. // Status = ReadFvbData (Fvb, &LbaIndex, &LbaOffset, sizeof (FvNameGuid), (UINT8 *) &FvNameGuid); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FvNameGuidIsFound = TRUE; } } - CoreFreePool (FwVolHeader); + CoreFreePool(FwVolHeader); } } @@ -839,7 +839,7 @@ CoreFvToDevicePath ( // Remember the device path of the FV // Status = CoreHandleProtocol (FvHandle, &gEfiDevicePathProtocolGuid, (VOID **)&FvDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FileNameDevicePath = NULL; } else { // @@ -1004,7 +1004,7 @@ CoreProcessFvImageFile ( &BufferSize, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Evaluate the authentication status of the Firmware Volume through // Security Architectural Protocol @@ -1017,7 +1017,7 @@ CoreProcessFvImageFile ( FvFileDevicePath ); if (FvFileDevicePath != NULL) { - FreePool (FvFileDevicePath); + FreePool(FvFileDevicePath); } if (Status != EFI_SUCCESS) { @@ -1025,7 +1025,7 @@ CoreProcessFvImageFile ( // Security check failed. The firmware volume should not be used for any purpose. // if (Buffer != NULL) { - FreePool (Buffer); + FreePool(Buffer); } return Status; } @@ -1063,7 +1063,7 @@ CoreProcessFvImageFile ( // CopyMem (AlignedBuffer, Buffer, BufferSize); FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) AlignedBuffer; - CoreFreePool (Buffer); + CoreFreePool(Buffer); Buffer = NULL; } } @@ -1079,12 +1079,12 @@ CoreProcessFvImageFile ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // ReadSection or Produce FVB failed, Free data buffer // if (Buffer != NULL) { - FreePool (Buffer); + FreePool(Buffer); } if (AlignedBuffer != NULL) { @@ -1150,7 +1150,7 @@ CoreFwVolEventProtocolNotify ( &BufferSize, &FvHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If no more notification events exit // @@ -1177,7 +1177,7 @@ CoreFwVolEventProtocolNotify ( } Status = CoreHandleProtocol (FvHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv); - if (EFI_ERROR (Status) || Fv == NULL) { + if (EFI_ERROR(Status) || Fv == NULL) { // // FvHandle must have Firmware Volume2 protocol thus we should never get here. // @@ -1186,7 +1186,7 @@ CoreFwVolEventProtocolNotify ( } Status = CoreHandleProtocol (FvHandle, &gEfiDevicePathProtocolGuid, (VOID **)&FvDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The Firmware volume doesn't have device path, can't be dispatched. // @@ -1214,7 +1214,7 @@ CoreFwVolEventProtocolNotify ( &Attributes, &Size ); - if (!EFI_ERROR (GetNextFileStatus)) { + if (!EFI_ERROR(GetNextFileStatus)) { if (Type == EFI_FV_FILETYPE_DXE_CORE) { // // If this is the DXE core fill in it's DevicePath & DeviceHandle @@ -1257,12 +1257,12 @@ CoreFwVolEventProtocolNotify ( &SizeOfBuffer, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If PEI depex section is found, this FV image will be ignored in DXE phase. // Now, DxeCore doesn't support FV image with more one type DEPEX section. // - FreePool (DepexBuffer); + FreePool(DepexBuffer); continue; } @@ -1280,12 +1280,12 @@ CoreFwVolEventProtocolNotify ( &SizeOfBuffer, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If SMM depex section is found, this FV image will be ignored in DXE phase. // Now, DxeCore doesn't support FV image with more one type DEPEX section. // - FreePool (DepexBuffer); + FreePool(DepexBuffer); continue; } @@ -1303,7 +1303,7 @@ CoreFwVolEventProtocolNotify ( &SizeOfBuffer, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If no depex section, produce a firmware volume block protocol for it so it gets dispatched from. // @@ -1312,7 +1312,7 @@ CoreFwVolEventProtocolNotify ( // // If depex section is found, this FV image will be dispatched until its depex is evaluated to TRUE. // - FreePool (DepexBuffer); + FreePool(DepexBuffer); CoreAddToDriverList (Fv, FvHandle, &NameGuid, Type); } } else { @@ -1322,7 +1322,7 @@ CoreFwVolEventProtocolNotify ( CoreAddToDriverList (Fv, FvHandle, &NameGuid, Type); } } - } while (!EFI_ERROR (GetNextFileStatus)); + } while (!EFI_ERROR(GetNextFileStatus)); } // @@ -1338,7 +1338,7 @@ CoreFwVolEventProtocolNotify ( &SizeOfBuffer, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AprioriEntryCount = SizeOfBuffer / sizeof (EFI_GUID); } else { AprioriEntryCount = 0; @@ -1370,7 +1370,7 @@ CoreFwVolEventProtocolNotify ( // // Free data allocated by Fv->ReadSection () // - CoreFreePool (AprioriFile); + CoreFreePool(AprioriFile); } } diff --git a/CloverEFI/OsxDxeCore/DxeMain.h b/CloverEFI/OsxDxeCore/DxeMain.h index d5e8d01b1..3087d5792 100644 --- a/CloverEFI/OsxDxeCore/DxeMain.h +++ b/CloverEFI/OsxDxeCore/DxeMain.h @@ -1295,7 +1295,7 @@ CoreAllocatePool ( **/ EFI_STATUS EFIAPI -CoreFreePool ( +CoreFreePool( IN VOID *Buffer ); diff --git a/CloverEFI/OsxDxeCore/DxeMain/DxeMain.c b/CloverEFI/OsxDxeCore/DxeMain/DxeMain.c index 84697234a..023013fae 100644 --- a/CloverEFI/OsxDxeCore/DxeMain/DxeMain.c +++ b/CloverEFI/OsxDxeCore/DxeMain/DxeMain.c @@ -256,7 +256,7 @@ DxeMain ( VectorInfoList = (EFI_VECTOR_HANDOFF_INFO *) (GET_GUID_HOB_DATA(GuidHob)); } Status = InitializeCpuExceptionHandlers (VectorInfoList); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -288,7 +288,7 @@ DxeMain ( // Start the Image Services. // Status = CoreInitializeImageServices (HobStart); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -313,7 +313,7 @@ DxeMain ( // Initialize the Global Coherency Domain Services // Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -324,7 +324,7 @@ DxeMain ( // Install the DXE Services Table into the EFI System Tables's Configuration Table // Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, gDxeCoreDS); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -333,7 +333,7 @@ DxeMain ( // Install the HOB List into the EFI System Tables's Configuration Table // Status = CoreInstallConfigurationTable (&gEfiHobListGuid, HobStart); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -342,7 +342,7 @@ DxeMain ( // Install Memory Type Information Table into the EFI System Tables's Configuration Table // Status = CoreInstallConfigurationTable (&gEfiMemoryTypeInformationGuid, &gMemoryTypeInformation); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -354,7 +354,7 @@ DxeMain ( // if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { Status = CoreInstallConfigurationTable (&gLoadFixedAddressConfigurationTableGuid, &gLoadModuleAtFixAddressConfigurationTable); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -405,7 +405,7 @@ DxeMain ( // Initialize the Event Services // Status = CoreInitializeEventServices (); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -427,7 +427,7 @@ DxeMain ( // ASSERT (VectorInfo != NULL); if (!VectorInfo) return; Status = CoreInstallConfigurationTable (&gEfiVectorHandoffTableGuid, (VOID *) VectorInfo); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -453,7 +453,7 @@ DxeMain ( &gEfiDecompressProtocolGuid, &gEfiDecompress, NULL ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -469,13 +469,13 @@ DxeMain ( // Produce Firmware Volume Protocols, one for each FV in the HOB list. // Status = FwVolBlockDriverInit (gDxeCoreImageHandle, gDxeCoreST); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } Status = FwVolDriverInit (gDxeCoreImageHandle, gDxeCoreST); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -484,7 +484,7 @@ DxeMain ( // Produce the Section Extraction Protocol // Status = InitializeSectionExtraction (gDxeCoreImageHandle, gDxeCoreST); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -531,7 +531,7 @@ DxeMain ( (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_EC_NO_ARCH) ); } -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } @@ -775,7 +775,7 @@ CoreExitBootServices ( // Terminate memory services if the MapKey matches // Status = CoreTerminateMemoryMap (MapKey); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Notify other drivers that ExitBootServices fail // @@ -948,7 +948,7 @@ DxeMainUefiDecompress ( } Status = UefiDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/CloverEFI/OsxDxeCore/DxeMain/DxeProtocolNotify.c b/CloverEFI/OsxDxeCore/DxeMain/DxeProtocolNotify.c index e5405b325..0dcefc002 100644 --- a/CloverEFI/OsxDxeCore/DxeMain/DxeProtocolNotify.c +++ b/CloverEFI/OsxDxeCore/DxeMain/DxeProtocolNotify.c @@ -131,7 +131,7 @@ GenericProtocolNotify ( // See if the expected protocol is present in the handle database // Status = CoreLocateProtocol (Entry->ProtocolGuid, Entry->Registration, &Protocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } diff --git a/CloverEFI/OsxDxeCore/Event/Event.c b/CloverEFI/OsxDxeCore/Event/Event.c index a864c6435..782f5a367 100644 --- a/CloverEFI/OsxDxeCore/Event/Event.c +++ b/CloverEFI/OsxDxeCore/Event/Event.c @@ -403,7 +403,7 @@ CoreCreateEventInternal ( break; } } - if(EFI_ERROR (Status)) { + if(EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -762,8 +762,8 @@ CoreCloseEvent ( // CoreUnregisterProtocolNotify (Event); - Status = CoreFreePool (Event); -// ASSERT_EFI_ERROR (Status); + Status = CoreFreePool(Event); +// ASSERT_EFI_ERROR(Status); return Status; } diff --git a/CloverEFI/OsxDxeCore/Event/Timer.c b/CloverEFI/OsxDxeCore/Event/Timer.c index 1e924d2b4..a0dd1eb93 100644 --- a/CloverEFI/OsxDxeCore/Event/Timer.c +++ b/CloverEFI/OsxDxeCore/Event/Timer.c @@ -186,8 +186,8 @@ CoreInitializeTimer ( NULL, &mEfiCheckTimerEvent ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { mEfiCheckTimerEvent = NULL; } } diff --git a/CloverEFI/OsxDxeCore/Event/Tpl.c b/CloverEFI/OsxDxeCore/Event/Tpl.c index 240e8e453..1701b4d9e 100644 --- a/CloverEFI/OsxDxeCore/Event/Tpl.c +++ b/CloverEFI/OsxDxeCore/Event/Tpl.c @@ -41,7 +41,7 @@ CoreSetInterruptState ( return; } Status = gSmmBase2->InSmm (gSmmBase2, &InSmm); - if (!EFI_ERROR (Status) && !InSmm) { + if (!EFI_ERROR(Status) && !InSmm) { gCpu->EnableInterrupt(gCpu); } } diff --git a/CloverEFI/OsxDxeCore/FwVol/FwVol.c b/CloverEFI/OsxDxeCore/FwVol/FwVol.c index 700b44ed2..55d202416 100644 --- a/CloverEFI/OsxDxeCore/FwVol/FwVol.c +++ b/CloverEFI/OsxDxeCore/FwVol/FwVol.c @@ -110,7 +110,7 @@ ReadFvbData ( *StartLba = *StartLba + 1; while (DataSize > 0) { Status = Fvb->GetBlockSize (Fvb, *StartLba, &BlockSize, &NumberOfBlocks); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -120,7 +120,7 @@ ReadFvbData ( BlockIndex = 0; while (BlockIndex < NumberOfBlocks && DataSize >= BlockSize) { Status = Fvb->Read (Fvb, *StartLba + BlockIndex, 0, &BlockSize, Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Data += BlockSize; @@ -146,7 +146,7 @@ ReadFvbData ( // if (DataSize > 0) { Status = Fvb->Read (Fvb, *StartLba + BlockIndex, 0, &DataSize, Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -194,7 +194,7 @@ GetFwVolHeader ( Offset = 0; FvhLength = sizeof (EFI_FIRMWARE_VOLUME_HEADER); Status = ReadFvbData (Fvb, &StartLba, &Offset, FvhLength, (UINT8 *)&TempFvh); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -217,11 +217,11 @@ GetFwVolHeader ( FvhLength = TempFvh.HeaderLength - sizeof (EFI_FIRMWARE_VOLUME_HEADER); Buffer = (UINT8 *)*FwVolHeader + sizeof (EFI_FIRMWARE_VOLUME_HEADER); Status = ReadFvbData (Fvb, &StartLba, &Offset, FvhLength, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Read failed so free buffer // - CoreFreePool (*FwVolHeader); + CoreFreePool(*FwVolHeader); } return Status; @@ -257,7 +257,7 @@ FreeFvDeviceResource ( CloseSectionStream (FfsFileEntry->StreamHandle); } - CoreFreePool (FfsFileEntry); + CoreFreePool(FfsFileEntry); FfsFileEntry = (FFS_FILE_LIST_ENTRY *) NextEntry; } @@ -266,12 +266,12 @@ FreeFvDeviceResource ( // // Free the cache // - CoreFreePool (FvDevice->CachedFv); + CoreFreePool(FvDevice->CachedFv); // // Free Volume Header // - CoreFreePool (FvDevice->FwVolHeader); + CoreFreePool(FvDevice->FwVolHeader); return; } @@ -316,7 +316,7 @@ FvCheck ( FwVolHeader = FvDevice->FwVolHeader; Status = Fvb->GetAttributes (Fvb, &FvbAttributes); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -384,7 +384,7 @@ FvCheck ( // // Not check EFI_BAD_BUFFER_SIZE, for Size = BlockMap->Length // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -521,7 +521,7 @@ FvCheck ( } Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreeFvDeviceResource (FvDevice); } @@ -577,7 +577,7 @@ NotifyFwVolBlock ( break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -585,8 +585,8 @@ NotifyFwVolBlock ( // Get the FirmwareVolumeBlock protocol on that handle // Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status) || (Fvb == NULL)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status) || (Fvb == NULL)) { if (FwVolHeader) { FreePool(FwVolHeader); } @@ -599,7 +599,7 @@ NotifyFwVolBlock ( // Make sure the Fv Header is O.K. // Status = GetFwVolHeader (Fvb, &FwVolHeader); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (FwVolHeader) { FreePool(FwVolHeader); } @@ -608,7 +608,7 @@ NotifyFwVolBlock ( // ASSERT (FwVolHeader != NULL); if (!VerifyFvHeaderChecksum (FwVolHeader)) { - CoreFreePool (FwVolHeader); + CoreFreePool(FwVolHeader); continue; } @@ -626,7 +626,7 @@ NotifyFwVolBlock ( // Check if there is an FV protocol already installed in that handle // Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update Fv to use a new Fvb // @@ -660,7 +660,7 @@ NotifyFwVolBlock ( FvDevice->AuthenticationStatus = GetFvbAuthenticationStatus (Fvb); } - if (!EFI_ERROR (FvCheck (FvDevice))) { + if (!EFI_ERROR(FvCheck (FvDevice))) { // // Install an New FV protocol on the existing handle // @@ -670,12 +670,12 @@ NotifyFwVolBlock ( EFI_NATIVE_INTERFACE, &FvDevice->Fv ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else { // // Free FvDevice Buffer for the corrupt FV image. // - CoreFreePool (FvDevice); + CoreFreePool(FvDevice); } } } diff --git a/CloverEFI/OsxDxeCore/FwVol/FwVolRead.c b/CloverEFI/OsxDxeCore/FwVol/FwVolRead.c index fe31ebed6..a44ad651a 100644 --- a/CloverEFI/OsxDxeCore/FwVol/FwVolRead.c +++ b/CloverEFI/OsxDxeCore/FwVol/FwVolRead.c @@ -125,7 +125,7 @@ FvGetNextFile ( FvDevice = FV_DEVICE_FROM_THIS (This); Status = FvGetVolumeAttributes (This, &FvAttributes); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ return Status; } @@ -303,7 +303,7 @@ FvReadFile ( &LocalAttributes, &FileSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } } while (!CompareGuid (&SearchNameGuid, NameGuid)); @@ -444,7 +444,7 @@ FvReadFileSection ( // FfsEntry = (FFS_FILE_LIST_ENTRY *) FvDevice->LastKey; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -465,7 +465,7 @@ FvReadFileSection ( FileBuffer, &FfsEntry->StreamHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -484,7 +484,7 @@ FvReadFileSection ( FvDevice->IsFfs3Fv ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Inherit the authentication status. // @@ -496,7 +496,7 @@ FvReadFileSection ( // Done: - CoreFreePool (FileBuffer); + CoreFreePool(FileBuffer); return Status; } diff --git a/CloverEFI/OsxDxeCore/FwVolBlock/FwVolBlock.c b/CloverEFI/OsxDxeCore/FwVolBlock/FwVolBlock.c index 849c37eb4..b95a53302 100644 --- a/CloverEFI/OsxDxeCore/FwVolBlock/FwVolBlock.c +++ b/CloverEFI/OsxDxeCore/FwVolBlock/FwVolBlock.c @@ -529,7 +529,7 @@ ProduceFVBProtocolOnBuffer ( // FvbDev->LbaCache = AllocatePool (FvbDev->NumBlocks * sizeof (LBA_CACHE)); if (FvbDev->LbaCache == NULL) { - CoreFreePool (FvbDev); + CoreFreePool(FvbDev); return EFI_OUT_OF_RESOURCES; } @@ -557,7 +557,7 @@ ProduceFVBProtocolOnBuffer ( // FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate); if (FvbDev->DevicePath == NULL) { - FreePool (FvbDev); + FreePool(FvbDev); return EFI_OUT_OF_RESOURCES; } ((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.StartingAddress = BaseAddress; @@ -568,7 +568,7 @@ ProduceFVBProtocolOnBuffer ( // FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); if (FvbDev->DevicePath == NULL) { - FreePool (FvbDev); + FreePool(FvbDev); return EFI_OUT_OF_RESOURCES; } CopyGuid ( diff --git a/CloverEFI/OsxDxeCore/Gcd/Gcd.c b/CloverEFI/OsxDxeCore/Gcd/Gcd.c index a84bb4027..bba7f9d89 100644 --- a/CloverEFI/OsxDxeCore/Gcd/Gcd.c +++ b/CloverEFI/OsxDxeCore/Gcd/Gcd.c @@ -148,7 +148,7 @@ CoreDumpGcdMemorySpaceMap ( UINTN Index; Status = CoreGetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { DEBUG ((DEBUG_GCD, "GCD:CoreGetMemorySpaceMap failed %r\n", Status)); return; @@ -170,7 +170,7 @@ CoreDumpGcdMemorySpaceMap ( )); } DEBUG ((DEBUG_GCD, "\n")); - FreePool (MemorySpaceMap); + FreePool(MemorySpaceMap); ); } @@ -194,7 +194,7 @@ CoreDumpGcdIoSpaceMap ( UINTN Index; Status = CoreGetIoSpaceMap (&NumberOfDescriptors, &IoSpaceMap); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { DEBUG ((DEBUG_GCD, "GCD:CoreGetIoSpaceMap failed %r\n", Status)); return; @@ -215,7 +215,7 @@ CoreDumpGcdIoSpaceMap ( )); } DEBUG ((DEBUG_GCD, "\n")); - FreePool (IoSpaceMap); + FreePool(IoSpaceMap); ); } @@ -388,7 +388,7 @@ CoreAllocateGcdMapEntry ( *BottomEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY)); if (*BottomEntry == NULL) { - CoreFreePool (*TopEntry); + CoreFreePool(*TopEntry); return EFI_OUT_OF_RESOURCES; } @@ -520,7 +520,7 @@ CoreMergeGcdMapEntry ( Entry->BaseAddress = AdjacentEntry->BaseAddress; } RemoveEntryList (AdjacentLink); - CoreFreePool (AdjacentEntry); + CoreFreePool(AdjacentEntry); return EFI_SUCCESS; } @@ -550,10 +550,10 @@ CoreCleanupGcdMapEntry ( LIST_ENTRY *Link; if (TopEntry->Signature == 0) { - CoreFreePool (TopEntry); + CoreFreePool(TopEntry); } if (BottomEntry->Signature == 0) { - CoreFreePool (BottomEntry); + CoreFreePool(BottomEntry); } Link = StartLink; @@ -754,7 +754,7 @@ CoreConvertSpace ( // Search for the list of descriptors that cover the range BaseAddress to BaseAddress+Length // Status = CoreSearchGcdMapEntry (BaseAddress, Length, &StartLink, &EndLink, Map); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto Done; @@ -844,7 +844,7 @@ CoreConvertSpace ( // Allocate work space to perform this operation // Status = CoreAllocateGcdMapEntry (&TopEntry, &BottomEntry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto Done; } @@ -870,9 +870,9 @@ CoreConvertSpace ( CpuArchAttributes ); } - if (EFI_ERROR (Status)) { - CoreFreePool (TopEntry); - CoreFreePool (BottomEntry); + if (EFI_ERROR(Status)) { + CoreFreePool(TopEntry); + CoreFreePool(BottomEntry); goto Done; } } @@ -1101,7 +1101,7 @@ CoreAllocateSpace ( // Search for the list of descriptors that cover the range BaseAddress to BaseAddress+Length // Status = CoreSearchGcdMapEntry (*BaseAddress, Length, &StartLink, &EndLink, Map); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; goto Done; } @@ -1119,7 +1119,7 @@ CoreAllocateSpace ( Entry = CR (Link, EFI_GCD_MAP_ENTRY, Link, EFI_GCD_MAP_SIGNATURE); Link = Link->ForwardLink; Status = CoreAllocateSpaceCheckEntry (Operation, Entry, GcdMemoryType, GcdIoType); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -1158,7 +1158,7 @@ CoreAllocateSpace ( } Status = CoreAllocateSpaceCheckEntry (Operation, Entry, GcdMemoryType, GcdIoType); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -1189,7 +1189,7 @@ CoreAllocateSpace ( // Search for the list of descriptors that cover the range BaseAddress to BaseAddress+Length // Status = CoreSearchGcdMapEntry (*BaseAddress, Length, &StartLink, &EndLink, Map); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; goto Done; } @@ -1208,7 +1208,7 @@ CoreAllocateSpace ( while (SubLink != EndLink->ForwardLink) { Entry = CR (SubLink, EFI_GCD_MAP_ENTRY, Link, EFI_GCD_MAP_SIGNATURE); Status = CoreAllocateSpaceCheckEntry (Operation, Entry, GcdMemoryType, GcdIoType); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Link = SubLink; Found = FALSE; break; @@ -1229,7 +1229,7 @@ CoreAllocateSpace ( // Allocate work space to perform this operation // Status = CoreAllocateGcdMapEntry (&TopEntry, &BottomEntry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto Done; } @@ -1258,7 +1258,7 @@ CoreAllocateSpace ( Done: DEBUG ((DEBUG_GCD, " Status = %r", Status)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_GCD, " (BaseAddress = %016lx)", *BaseAddress)); } DEBUG ((DEBUG_GCD, "\n")); @@ -1391,7 +1391,7 @@ CoreAddMemorySpace ( Status = CoreInternalAddMemorySpace (GcdMemoryType, BaseAddress, Length, Capabilities); - if (!EFI_ERROR (Status) && GcdMemoryType == EfiGcdMemoryTypeSystemMemory) { + if (!EFI_ERROR(Status) && GcdMemoryType == EfiGcdMemoryTypeSystemMemory) { PageBaseAddress = PageAlignLength (BaseAddress); PageLength = PageAlignLength (BaseAddress + Length - PageBaseAddress); @@ -1406,7 +1406,7 @@ CoreAddMemorySpace ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CoreAddMemoryDescriptor ( EfiConventionalMemory, PageBaseAddress, @@ -1425,7 +1425,7 @@ CoreAddMemorySpace ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CoreAddMemoryDescriptor ( EfiConventionalMemory, PageBaseAddress, @@ -1544,7 +1544,7 @@ CoreGetMemorySpaceDescriptor ( // Search for the list of descriptors that contain BaseAddress // Status = CoreSearchGcdMapEntry (BaseAddress, 1, &StartLink, &EndLink, &mGcdMemorySpaceMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; } else { // ASSERT (StartLink != NULL && EndLink != NULL); @@ -1853,7 +1853,7 @@ CoreGetIoSpaceDescriptor ( // Search for the list of descriptors that contain BaseAddress // Status = CoreSearchGcdMapEntry (BaseAddress, 1, &StartLink, &EndLink, &mGcdIoSpaceMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; } else { // ASSERT (StartLink != NULL && EndLink != NULL); @@ -2427,7 +2427,7 @@ CoreInitializeGcdServices ( MemoryHob = Hob.MemoryAllocation; BaseAddress = MemoryHob->AllocDescriptor.MemoryBaseAddress; Status = CoreGetMemorySpaceDescriptor (BaseAddress, &Descriptor); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = CoreAllocateMemorySpace ( EfiGcdAllocateAddress, Descriptor.GcdMemoryType, @@ -2437,7 +2437,7 @@ CoreInitializeGcdServices ( gDxeCoreImageHandle, NULL ); - if (!EFI_ERROR (Status) && Descriptor.GcdMemoryType == EfiGcdMemoryTypeSystemMemory) { + if (!EFI_ERROR(Status) && Descriptor.GcdMemoryType == EfiGcdMemoryTypeSystemMemory) { CoreAddMemoryDescriptor ( MemoryHob->AllocDescriptor.MemoryType, MemoryHob->AllocDescriptor.MemoryBaseAddress, @@ -2514,7 +2514,7 @@ CoreInitializeGcdServices ( } } } - CoreFreePool (MemorySpaceMap); + CoreFreePool(MemorySpaceMap); return EFI_SUCCESS; } diff --git a/CloverEFI/OsxDxeCore/Hand/DriverSupport.c b/CloverEFI/OsxDxeCore/Hand/DriverSupport.c index f659a656b..eaa521375 100644 --- a/CloverEFI/OsxDxeCore/Hand/DriverSupport.c +++ b/CloverEFI/OsxDxeCore/Hand/DriverSupport.c @@ -75,7 +75,7 @@ CoreConnectController ( // Make sure ControllerHandle is valid // Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -84,7 +84,7 @@ CoreConnectController ( // Check whether the user has permission to start UEFI device drivers. // Status = CoreHandleProtocol (ControllerHandle, &gEfiDevicePathProtocolGuid, (VOID **)&HandleFilePath); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FilePath = HandleFilePath; TempFilePath = NULL; if (RemainingDevicePath != NULL && !Recursive) { @@ -104,9 +104,9 @@ CoreConnectController ( FALSE ); if (TempFilePath != NULL) { - FreePool (TempFilePath); + FreePool(TempFilePath); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -144,7 +144,7 @@ CoreConnectController ( // Free the aligned copy of RemainingDevicePath // if (AlignedRemainingDevicePath != NULL) { - CoreFreePool (AlignedRemainingDevicePath); + CoreFreePool(AlignedRemainingDevicePath); } // @@ -160,7 +160,7 @@ CoreConnectController ( // Make sure the DriverBindingHandle is valid // Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Release the protocol lock on the handle database // @@ -230,7 +230,7 @@ CoreConnectController ( // // Free the handle buffer of ControllerHandle's children // - CoreFreePool (ChildHandleBuffer); + CoreFreePool(ChildHandleBuffer); } return ReturnStatus; @@ -274,7 +274,7 @@ AddSortedDriverBindingProtocol ( // Make sure the DriverBindingHandle is valid // Status = CoreValidateHandle (DriverBindingHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -295,7 +295,7 @@ AddSortedDriverBindingProtocol ( &gEfiDriverBindingProtocolGuid, (VOID **) &DriverBinding ); - if (EFI_ERROR (Status) || DriverBinding == NULL) { + if (EFI_ERROR(Status) || DriverBinding == NULL) { continue; } @@ -328,7 +328,7 @@ AddSortedDriverBindingProtocol ( // // If DriverBindingHandle does not support the Driver Binding Protocol then return // - if (EFI_ERROR (Status) || DriverBinding == NULL) { + if (EFI_ERROR(Status) || DriverBinding == NULL) { return; } @@ -428,7 +428,7 @@ CoreConnectSingleController ( &DriverBindingHandleCount, &DriverBindingHandleBuffer ); - if (EFI_ERROR (Status) || (DriverBindingHandleCount == 0)) { + if (EFI_ERROR(Status) || (DriverBindingHandleCount == 0)) { return EFI_NOT_FOUND; } @@ -437,7 +437,7 @@ CoreConnectSingleController ( // SortedDriverBindingProtocols = AllocatePool (sizeof (VOID *) * DriverBindingHandleCount); if (SortedDriverBindingProtocols == NULL) { - CoreFreePool (DriverBindingHandleBuffer); + CoreFreePool(DriverBindingHandleBuffer); return EFI_OUT_OF_RESOURCES; } @@ -465,7 +465,7 @@ CoreConnectSingleController ( NULL, (VOID **) &PlatformDriverOverride ); - if (!EFI_ERROR (Status) && (PlatformDriverOverride != NULL)) { + if (!EFI_ERROR(Status) && (PlatformDriverOverride != NULL)) { DriverImageHandle = NULL; do { Status = PlatformDriverOverride->GetDriver ( @@ -473,7 +473,7 @@ CoreConnectSingleController ( ControllerHandle, &DriverImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AddSortedDriverBindingProtocol ( DriverImageHandle, &NumberOfSortedDriverBindingProtocols, @@ -483,7 +483,7 @@ CoreConnectSingleController ( TRUE ); } - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); } #if FAMILY_OVERRIDE // @@ -498,7 +498,7 @@ CoreConnectSingleController ( &gEfiDriverFamilyOverrideProtocolGuid, (VOID **) &DriverFamilyOverride ); - if (!EFI_ERROR (Status) && (DriverFamilyOverride != NULL)) { + if (!EFI_ERROR(Status) && (DriverFamilyOverride != NULL)) { DriverFamilyOverrideVersion = DriverFamilyOverride->GetVersion (DriverFamilyOverride); if ((HighestIndex == DriverBindingHandleCount) || (DriverFamilyOverrideVersion > HighestVersion)) { HighestVersion = DriverFamilyOverrideVersion; @@ -529,14 +529,14 @@ CoreConnectSingleController ( &gEfiBusSpecificDriverOverrideProtocolGuid, (VOID **) &BusSpecificDriverOverride ); - if (!EFI_ERROR (Status) && (BusSpecificDriverOverride != NULL)) { + if (!EFI_ERROR(Status) && (BusSpecificDriverOverride != NULL)) { DriverImageHandle = NULL; do { Status = BusSpecificDriverOverride->GetDriver ( BusSpecificDriverOverride, &DriverImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AddSortedDriverBindingProtocol ( DriverImageHandle, &NumberOfSortedDriverBindingProtocols, @@ -546,7 +546,7 @@ CoreConnectSingleController ( TRUE ); } - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); } // @@ -567,7 +567,7 @@ CoreConnectSingleController ( // // Free the Driver Binding Handle Buffer // - CoreFreePool (DriverBindingHandleBuffer); + CoreFreePool(DriverBindingHandleBuffer); // // If the number of Driver Binding Protocols has increased since this function started, then return @@ -580,12 +580,12 @@ CoreConnectSingleController ( &NewDriverBindingHandleCount, &NewDriverBindingHandleBuffer ); - CoreFreePool (NewDriverBindingHandleBuffer); + CoreFreePool(NewDriverBindingHandleBuffer); if (NewDriverBindingHandleCount > DriverBindingHandleCount) { // // Free any buffers that were allocated with AllocatePool() // - CoreFreePool (SortedDriverBindingProtocols); + CoreFreePool(SortedDriverBindingProtocols); return EFI_NOT_READY; } @@ -649,7 +649,7 @@ CoreConnectSingleController ( RemainingDevicePath ); // PERF_END (DriverBinding->DriverBindingHandle, "DB:Support:", NULL, 0); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SortedDriverBindingProtocols[Index] = NULL; DriverFound = TRUE; if (PlatformDriverOverride) { @@ -673,7 +673,7 @@ CoreConnectSingleController ( ); // PERF_END (DriverBinding->DriverBindingHandle, "DB:Start:", NULL, 0); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The driver was successfully started on ControllerHandle, so set a flag // @@ -694,7 +694,7 @@ CoreConnectSingleController ( // // Free any buffers that were allocated with AllocatePool() // - CoreFreePool (SortedDriverBindingProtocols); + CoreFreePool(SortedDriverBindingProtocols); // // If at least one driver was started on ControllerHandle, then return EFI_SUCCESS. @@ -783,7 +783,7 @@ CoreDisconnectController ( // Make sure ControllerHandle is valid // Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -792,7 +792,7 @@ CoreDisconnectController ( // if (ChildHandle != NULL) { Status = CoreValidateHandle (ChildHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -881,7 +881,7 @@ CoreDisconnectController ( &gEfiDriverBindingProtocolGuid, (VOID **)&DriverBinding ); - if (EFI_ERROR (Status) || DriverBinding == NULL) { + if (EFI_ERROR(Status) || DriverBinding == NULL) { Status = EFI_INVALID_PARAMETER; goto Done; } @@ -964,16 +964,16 @@ CoreDisconnectController ( Status = DriverBinding->Stop (DriverBinding, ControllerHandle, ChildrenToStop, ChildBuffer); } } - if (!EFI_ERROR (Status) && ((ChildHandle == NULL) || (ChildBufferCount == ChildrenToStop))) { + if (!EFI_ERROR(Status) && ((ChildHandle == NULL) || (ChildBufferCount == ChildrenToStop))) { Status = DriverBinding->Stop (DriverBinding, ControllerHandle, 0, NULL); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { StopCount++; } } if (ChildBuffer != NULL) { - CoreFreePool (ChildBuffer); + CoreFreePool(ChildBuffer); } } } @@ -987,7 +987,7 @@ CoreDisconnectController ( Done: if (DriverImageHandleBuffer != NULL) { - CoreFreePool (DriverImageHandleBuffer); + CoreFreePool(DriverImageHandleBuffer); } return Status; diff --git a/CloverEFI/OsxDxeCore/Hand/Handle.c b/CloverEFI/OsxDxeCore/Hand/Handle.c index c413601a1..36794e986 100644 --- a/CloverEFI/OsxDxeCore/Hand/Handle.c +++ b/CloverEFI/OsxDxeCore/Hand/Handle.c @@ -277,7 +277,7 @@ CoreUnregisterProtocolNotify ( do { Status = CoreUnregisterProtocolNotifyEvent (Event); - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); return EFI_SUCCESS; } @@ -373,7 +373,7 @@ CoreInstallProtocolInterfaceNotify ( if (*UserHandle != NULL) { Status = CoreHandleProtocol (*UserHandle, Protocol, (VOID **)&ExistingInterface); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } } @@ -431,7 +431,7 @@ CoreInstallProtocolInterfaceNotify ( } Status = CoreValidateHandle (Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -479,7 +479,7 @@ Done: // Done, unlock the database and return // CoreReleaseProtocolLock (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Return the new handle back to the caller // @@ -489,7 +489,7 @@ Done: // There was an error, clean up // if (Prot != NULL) { - CoreFreePool (Prot); + CoreFreePool(Prot); } } @@ -552,7 +552,7 @@ CoreInstallMultipleProtocolInterfaces ( // Check for duplicate device path and install the protocol interfaces // VA_START (Args, Handle); - for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { + for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR(Status); Index++) { // // If protocol is NULL, then it's the end of the list // @@ -570,7 +570,7 @@ CoreInstallMultipleProtocolInterfaces ( DeviceHandle = NULL; DevicePath = Interface; Status = CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(DevicePath)) { + if (!EFI_ERROR(Status) && (DeviceHandle != NULL) && IsDevicePathEnd(DevicePath)) { // If we wish to keep installing anyway, we should just prevent the status change here, otherwise function will return EFI_ALREADY_STARTED //Status = EFI_ALREADY_STARTED; continue; @@ -587,7 +587,7 @@ CoreInstallMultipleProtocolInterfaces ( // // If there was an error, remove all the interfaces that were installed without any errors // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Reset the va_arg back to the first argument. // @@ -651,7 +651,7 @@ CoreDisconnectControllersUsingProtocolInterface ( CoreReleaseProtocolLock (); Status = CoreDisconnectController (UserHandle, OpenData->AgentHandle, NULL); CoreAcquireProtocolLock (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ItemFound = FALSE; break; } @@ -659,7 +659,7 @@ CoreDisconnectControllersUsingProtocolInterface ( } } while (ItemFound); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Attempt to remove BY_HANDLE_PROTOOCL and GET_PROTOCOL and TEST_PROTOCOL Open List items // @@ -674,7 +674,7 @@ CoreDisconnectControllersUsingProtocolInterface ( ItemFound = TRUE; RemoveEntryList (&OpenData->Link); Prot->OpenListCount--; - CoreFreePool (OpenData); + CoreFreePool(OpenData); } } } while (ItemFound); @@ -683,7 +683,7 @@ CoreDisconnectControllersUsingProtocolInterface ( // // If there are errors or still has open items in the list, then reconnect all the drivers and return an error // - if (EFI_ERROR (Status) || (Prot->OpenListCount > 0)) { + if (EFI_ERROR(Status) || (Prot->OpenListCount > 0)) { CoreReleaseProtocolLock (); CoreConnectController (UserHandle, NULL, NULL, TRUE); CoreAcquireProtocolLock (); @@ -731,7 +731,7 @@ CoreUninstallProtocolInterface ( // Check that UserHandle is a valid handle // Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -756,7 +756,7 @@ CoreUninstallProtocolInterface ( UserHandle, Prot ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // One or more drivers refused to release, so return the error // @@ -786,7 +786,7 @@ CoreUninstallProtocolInterface ( // Free the memory // Prot->Signature = 0; - CoreFreePool (Prot); + CoreFreePool(Prot); Status = EFI_SUCCESS; } @@ -796,7 +796,7 @@ CoreUninstallProtocolInterface ( if (IsListEmpty (&Handle->Protocols)) { Handle->Signature = 0; RemoveEntryList (&Handle->AllHandles); - CoreFreePool (Handle); + CoreFreePool(Handle); } Done: @@ -838,7 +838,7 @@ CoreUninstallMultipleProtocolInterfaces ( UINTN Index; VA_START (Args, Handle); - for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { + for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR(Status); Index++) { // // If protocol is NULL, then it's the end of the list // @@ -860,7 +860,7 @@ CoreUninstallMultipleProtocolInterfaces ( // If there was an error, add all the interfaces that were // uninstalled without any errors // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Reset the va_arg back to the first argument. // @@ -899,7 +899,7 @@ CoreGetProtocolInterface ( LIST_ENTRY *Link; Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -1017,7 +1017,7 @@ CoreOpenProtocol ( // Check for invalid UserHandle // Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1027,11 +1027,11 @@ CoreOpenProtocol ( switch (Attributes) { case EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER : Status = CoreValidateHandle (ImageHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (UserHandle == ControllerHandle) { @@ -1041,17 +1041,17 @@ CoreOpenProtocol ( case EFI_OPEN_PROTOCOL_BY_DRIVER : case EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE : Status = CoreValidateHandle (ImageHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } break; case EFI_OPEN_PROTOCOL_EXCLUSIVE : Status = CoreValidateHandle (ImageHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } break; @@ -1138,7 +1138,7 @@ CoreOpenProtocol ( CoreReleaseProtocolLock (); Status = CoreDisconnectController (UserHandle, OpenData->AgentHandle, NULL); CoreAcquireProtocolLock (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_ACCESS_DENIED; goto Done; } @@ -1228,16 +1228,16 @@ CoreCloseProtocol ( // Check for invalid parameters // Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = CoreValidateHandle (AgentHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (ControllerHandle != NULL) { Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1269,7 +1269,7 @@ CoreCloseProtocol ( if ((OpenData->AgentHandle == AgentHandle) && (OpenData->ControllerHandle == ControllerHandle)) { RemoveEntryList (&OpenData->Link); ProtocolInterface->OpenListCount--; - CoreFreePool (OpenData); + CoreFreePool(OpenData); Status = EFI_SUCCESS; } } @@ -1422,7 +1422,7 @@ CoreProtocolsPerHandle ( EFI_GUID **Buffer; Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/CloverEFI/OsxDxeCore/Hand/Locate.c b/CloverEFI/OsxDxeCore/Hand/Locate.c index d4bc63c2e..aaae6e162 100644 --- a/CloverEFI/OsxDxeCore/Hand/Locate.c +++ b/CloverEFI/OsxDxeCore/Hand/Locate.c @@ -469,7 +469,7 @@ CoreLocateDevicePath ( // Get a list of all handles that support the requested protocol // Status = CoreLocateHandleBuffer (ByProtocol, Protocol, NULL, &HandleCount, &Handles); - if (EFI_ERROR (Status) || HandleCount == 0) { + if (EFI_ERROR(Status) || HandleCount == 0) { return EFI_NOT_FOUND; } @@ -477,7 +477,7 @@ CoreLocateDevicePath ( for(Index = 0; Index < HandleCount; Index += 1) { Handle = Handles[Index]; Status = CoreHandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID **)&TmpDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If this handle doesn't support device path, then skip it // @@ -507,7 +507,7 @@ CoreLocateDevicePath ( } } - CoreFreePool (Handles); + CoreFreePool(Handles); // // If there wasn't any match, then no parts of the device path was found. diff --git a/CloverEFI/OsxDxeCore/Hand/Notify.c b/CloverEFI/OsxDxeCore/Hand/Notify.c index 53780f8e6..a102578a2 100644 --- a/CloverEFI/OsxDxeCore/Hand/Notify.c +++ b/CloverEFI/OsxDxeCore/Hand/Notify.c @@ -194,7 +194,7 @@ CoreReinstallProtocolInterface ( PROTOCOL_ENTRY *ProtEntry; Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -225,7 +225,7 @@ CoreReinstallProtocolInterface ( UserHandle, Prot ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // One or more drivers refused to release, so return the error // diff --git a/CloverEFI/OsxDxeCore/Image/Image.c b/CloverEFI/OsxDxeCore/Image/Image.c index bc8663a8a..edbc4b3cc 100644 --- a/CloverEFI/OsxDxeCore/Image/Image.c +++ b/CloverEFI/OsxDxeCore/Image/Image.c @@ -180,7 +180,7 @@ CoreInitializeImageServices ( EFI_NATIVE_INTERFACE, &Image->Info ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mCurrentImage = Image; @@ -386,7 +386,7 @@ GetPeCoffImageFixLoadingAssignedAddress( &Size, &SectionHeader ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (Size != sizeof (EFI_IMAGE_SECTION_HEADER)) { @@ -468,7 +468,7 @@ CoreLoadPeImage ( // Get information about the image being loaded // Status = PeCoffLoaderGetImageInfo (&Image->ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -538,7 +538,7 @@ CoreLoadPeImage ( if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 ) { Status = GetPeCoffImageFixLoadingAssignedAddress (&(Image->ImageContext)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If the code memory is not ready, invoke CoreAllocatePage with AllocateAnyPages to load the driver. // @@ -567,7 +567,7 @@ CoreLoadPeImage ( &Image->ImageContext.ImageAddress ); } - if (EFI_ERROR (Status) && !Image->ImageContext.RelocationsStripped) { + if (EFI_ERROR(Status) && !Image->ImageContext.RelocationsStripped) { Status = CoreAllocatePages ( AllocateAnyPages, (EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType), @@ -576,7 +576,7 @@ CoreLoadPeImage ( ); } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DstBufAlocated = TRUE; @@ -616,7 +616,7 @@ CoreLoadPeImage ( // Load the image from the file into the allocated memory // Status = PeCoffLoaderLoadImage (&Image->ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -639,7 +639,7 @@ CoreLoadPeImage ( // Relocate the image in memory // Status = PeCoffLoaderRelocateImage (&Image->ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -796,7 +796,7 @@ Done: } if (Image->ImageContext.FixupData != NULL) { - CoreFreePool (Image->ImageContext.FixupData); + CoreFreePool(Image->ImageContext.FixupData); } return Status; @@ -826,7 +826,7 @@ CoreLoadedImageInfo ( &gEfiLoadedImageProtocolGuid, (VOID **)&LoadedImage ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Image = LOADED_IMAGE_PRIVATE_DATA_FROM_THIS (LoadedImage); } else { DEBUG ((DEBUG_LOAD, "CoreLoadedImageInfo: Not an ImageHandle %p\n", ImageHandle)); @@ -885,14 +885,14 @@ CoreUnloadAndCloseImage ( &HandleCount, &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { Status = CoreProtocolsPerHandle ( HandleBuffer[HandleIndex], &ProtocolGuidArray, &ArrayCount ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) { Status = CoreOpenProtocolInformation ( HandleBuffer[HandleIndex], @@ -900,7 +900,7 @@ CoreUnloadAndCloseImage ( &OpenInfo, &OpenInfoCount ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { if (OpenInfo[OpenInfoIndex].AgentHandle == Image->Handle) { Status = CoreCloseProtocol ( @@ -922,7 +922,7 @@ CoreUnloadAndCloseImage ( } } if (HandleBuffer != NULL) { - CoreFreePool (HandleBuffer); + CoreFreePool(HandleBuffer); } } @@ -957,7 +957,7 @@ CoreUnloadAndCloseImage ( // RemoveEntryList (&Image->RuntimeData->Link); } - CoreFreePool (Image->RuntimeData); + CoreFreePool(Image->RuntimeData); } // @@ -971,18 +971,18 @@ CoreUnloadAndCloseImage ( // Done with the Image structure // if (Image->Info.FilePath != NULL) { - CoreFreePool (Image->Info.FilePath); + CoreFreePool(Image->Info.FilePath); } if (Image->LoadedImageDevicePath != NULL) { - CoreFreePool (Image->LoadedImageDevicePath); + CoreFreePool(Image->LoadedImageDevicePath); } if (Image->FixupData != NULL) { - CoreFreePool (Image->FixupData); + CoreFreePool(Image->FixupData); } - CoreFreePool (Image); + CoreFreePool(Image); } @@ -1090,7 +1090,7 @@ CoreLoadImageCommon ( FHand.Source = SourceBuffer; FHand.SourceSize = SourceSize; Status = CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &HandleFilePath, &DeviceHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DeviceHandle = NULL; } if (SourceSize > 0) { @@ -1119,17 +1119,17 @@ CoreLoadImageCommon ( // FHand.FreeBuffer = TRUE; Status = CoreLocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &HandleFilePath, &DeviceHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ImageIsFromFv = TRUE; } else { HandleFilePath = FilePath; Status = CoreLocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &HandleFilePath, &DeviceHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!BootPolicy) { HandleFilePath = FilePath; Status = CoreLocateDevicePath (&gEfiLoadFile2ProtocolGuid, &HandleFilePath, &DeviceHandle); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { HandleFilePath = FilePath; Status = CoreLocateDevicePath (&gEfiLoadFileProtocolGuid, &HandleFilePath, &DeviceHandle); } @@ -1141,7 +1141,7 @@ CoreLoadImageCommon ( if (Status == EFI_ALREADY_STARTED) { Image = NULL; goto Done; - } else if (EFI_ERROR (Status)) { + } else if (EFI_ERROR(Status)) { return Status; } @@ -1156,7 +1156,7 @@ CoreLoadImageCommon ( FHand.SourceSize, BootPolicy ); - if (!EFI_ERROR (SecurityStatus) && ImageIsFromFv) { + if (!EFI_ERROR(SecurityStatus) && ImageIsFromFv) { // // When Security2 is installed, Security Architectural Protocol must be published. // @@ -1186,7 +1186,7 @@ CoreLoadImageCommon ( // // Check Security Status. // - if (EFI_ERROR (SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) { + if (EFI_ERROR(SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) { if (SecurityStatus == EFI_ACCESS_DENIED) { // // Image was not loaded because the platform policy prohibits the image from being loaded. @@ -1213,7 +1213,7 @@ CoreLoadImageCommon ( FilePath = OriginalFilePath; if (DeviceHandle != NULL) { Status = CoreHandleProtocol (DeviceHandle, &gEfiDevicePathProtocolGuid, (VOID **)&HandleFilePath); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FilePathSize = GetDevicePathSize (HandleFilePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL); FilePath = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *)FilePath) + FilePathSize ); } @@ -1246,7 +1246,7 @@ CoreLoadImageCommon ( &Image->Info, FALSE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1254,7 +1254,7 @@ CoreLoadImageCommon ( // Load the image. If EntryPoint is Null, it will not be set. // Status = CoreLoadPeImage (BootPolicy, &FHand, Image, DstBuffer, EntryPoint, Attribute); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if ((Status == EFI_BUFFER_TOO_SMALL) || (Status == EFI_OUT_OF_RESOURCES)) { if (NumberOfPages != NULL) { *NumberOfPages = Image->NumberOfPages; @@ -1283,7 +1283,7 @@ CoreLoadImageCommon ( &Image->Info, &Image->Info ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1304,7 +1304,7 @@ CoreLoadImageCommon ( EFI_NATIVE_INTERFACE, Image->LoadedImageDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1318,7 +1318,7 @@ CoreLoadImageCommon ( EFI_NATIVE_INTERFACE, (VOID *) (UINTN) Image->ImageContext.HiiResourceData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -1334,18 +1334,18 @@ Done: // If we allocated the Source buffer, free it // if (FHand.FreeBuffer) { - CoreFreePool (FHand.Source); + CoreFreePool(FHand.Source); } // // There was an error. If there's an Image structure, free it // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Image != NULL) { CoreUnloadAndCloseImage (Image, (BOOLEAN)(DstBuffer == 0)); Image = NULL; } - } else if (EFI_ERROR (SecurityStatus)) { + } else if (EFI_ERROR(SecurityStatus)) { Status = SecurityStatus; } @@ -1430,7 +1430,7 @@ CoreLoadImage ( ); Handle = NULL; - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // ImageHandle will be valid only Status is success. // @@ -1520,7 +1520,7 @@ CoreLoadImageEx ( ); Handle = NULL; - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // ImageHandle will be valid only Status is success. // @@ -1576,7 +1576,7 @@ CoreStartImage ( if (Image == NULL || Image->Started) { return EFI_INVALID_PARAMETER; } - if (EFI_ERROR (Image->LoadImageStatus)) { + if (EFI_ERROR(Image->LoadImageStatus)) { return Image->LoadImageStatus; } @@ -1643,7 +1643,7 @@ CoreStartImage ( // all the resource in this situation. // DEBUG_CODE_BEGIN (); - if (EFI_ERROR (Image->Status)) { + if (EFI_ERROR(Image->Status)) { DEBUG ((DEBUG_ERROR, "Error: Image at %11p start failed: %r\n", Image->Info.ImageBase, Image->Status)); } DEBUG_CODE_END (); @@ -1660,7 +1660,7 @@ CoreStartImage ( ASSERT (Image->Tpl == gEfiCurrentTpl); CoreRestoreTpl (Image->Tpl); - CoreFreePool (Image->JumpBuffer); + CoreFreePool(Image->JumpBuffer); // // Pop the current start image context @@ -1696,7 +1696,7 @@ CoreStartImage ( // // Caller doesn't want the exit data, free it // - CoreFreePool (Image->ExitData); + CoreFreePool(Image->ExitData); Image->ExitData = NULL; } @@ -1709,7 +1709,7 @@ CoreStartImage ( // If the image returned an error, or if the image is an application // unload it // - if (EFI_ERROR (Image->Status) || Image->Type == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) { + if (EFI_ERROR(Image->Status) || Image->Type == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) { CoreUnloadAndCloseImage (Image, TRUE); // // ImageHandle may be invalid after the image is unloaded, so use NULL handle to record perf log. @@ -1874,7 +1874,7 @@ CoreUnloadImage ( } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // if the Image was not started or Unloaded O.K. then clean up // diff --git a/CloverEFI/OsxDxeCore/Mem/Page.c b/CloverEFI/OsxDxeCore/Mem/Page.c index 942f866e9..72be3b4e6 100644 --- a/CloverEFI/OsxDxeCore/Mem/Page.c +++ b/CloverEFI/OsxDxeCore/Mem/Page.c @@ -589,7 +589,7 @@ CoreAddMemoryDescriptor ( gMemoryTypeInformation[Index].NumberOfPages, &mMemoryTypeStatistics[Type].BaseAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If an error occurs allocating the pages for the current memory type, then // free all the pages allocates for the previous memory types and return. This @@ -1191,7 +1191,7 @@ CoreAllocatePages ( Done: CoreReleaseMemoryLock (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *Memory = Start; } @@ -1264,7 +1264,7 @@ CoreFreePages ( Status = CoreConvertPages (Memory, NumberOfPages, EfiConventionalMemory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } diff --git a/CloverEFI/OsxDxeCore/Mem/Pool.c b/CloverEFI/OsxDxeCore/Mem/Pool.c index 92b73c2f2..49f9b0255 100644 --- a/CloverEFI/OsxDxeCore/Mem/Pool.c +++ b/CloverEFI/OsxDxeCore/Mem/Pool.c @@ -209,7 +209,7 @@ CoreAllocatePool ( // Acquire the memory lock and make the allocation // Status = CoreAcquireLockOrFail (&gMemoryLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -373,7 +373,7 @@ Done: **/ EFI_STATUS EFIAPI -CoreFreePool ( +CoreFreePool( IN VOID *Buffer ) { diff --git a/CloverEFI/OsxDxeCore/Misc/DebugImageInfo.c b/CloverEFI/OsxDxeCore/Misc/DebugImageInfo.c index 01621d15f..b09ff2fdb 100644 --- a/CloverEFI/OsxDxeCore/Misc/DebugImageInfo.c +++ b/CloverEFI/OsxDxeCore/Misc/DebugImageInfo.c @@ -70,7 +70,7 @@ CoreInitializeDebugImageInfoTable ( RealPages, &Memory ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { /* if (PcdGet64 (PcdMaxEfiSystemTablePointerAddress) != 0) { DEBUG ((EFI_D_INFO, "Allocate memory for EFI_SYSTEM_TABLE_POINTER below PcdMaxEfiSystemTablePointerAddress failed. \ Retry to allocate memroy as close to the top of memory as feasible.\n")); @@ -86,8 +86,8 @@ CoreInitializeDebugImageInfoTable ( RealPages, &Memory ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } @@ -102,7 +102,7 @@ CoreInitializeDebugImageInfoTable ( // Free first unaligned page(s). // Status = CoreFreePages (Memory, UnalignedPages); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } Memory = (EFI_PHYSICAL_ADDRESS)(UINTN)(AlignedMemory + EFI_PAGES_TO_SIZE (Pages)); UnalignedPages = RealPages - Pages - UnalignedPages; @@ -111,7 +111,7 @@ CoreInitializeDebugImageInfoTable ( // Free last unaligned page(s). // Status = CoreFreePages (Memory, UnalignedPages); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } // @@ -132,7 +132,7 @@ CoreInitializeDebugImageInfoTable ( // Configuration Table // Status = CoreInstallConfigurationTable (&gEfiDebugImageInfoTableGuid, &mDebugInfoTableHeader); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } @@ -213,7 +213,7 @@ CoreNewDebugImageInfoEntry ( // // Free the old table // - CoreFreePool (Table); + CoreFreePool(Table); // // Update the table header // @@ -273,7 +273,7 @@ CoreRemoveDebugImageInfoEntry ( // Found a match. Free up the record, then NULL the pointer to indicate the slot // is free. // - CoreFreePool (Table[Index].NormalImage); + CoreFreePool(Table[Index].NormalImage); Table[Index].NormalImage = NULL; // // Decrease the number of EFI_DEBUG_IMAGE_INFO elements and set the mDebugInfoTable in modified status. diff --git a/CloverEFI/OsxDxeCore/Misc/InstallConfigurationTable.c b/CloverEFI/OsxDxeCore/Misc/InstallConfigurationTable.c index 7c0df5f66..bbc60fdb3 100644 --- a/CloverEFI/OsxDxeCore/Misc/InstallConfigurationTable.c +++ b/CloverEFI/OsxDxeCore/Misc/InstallConfigurationTable.c @@ -142,7 +142,7 @@ CoreInstallConfigurationTable ( // Free Old Table // // Print(L"Free Old Table\n"); - CoreFreePool (gDxeCoreST->ConfigurationTable); + CoreFreePool(gDxeCoreST->ConfigurationTable); } // diff --git a/CloverEFI/OsxDxeCore/Misc/SetWatchdogTimer.c b/CloverEFI/OsxDxeCore/Misc/SetWatchdogTimer.c index f153815e8..caf6769e1 100644 --- a/CloverEFI/OsxDxeCore/Misc/SetWatchdogTimer.c +++ b/CloverEFI/OsxDxeCore/Misc/SetWatchdogTimer.c @@ -64,7 +64,7 @@ CoreSetWatchdogTimer ( // // Check for errors // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } diff --git a/CloverEFI/OsxDxeCore/SectionExtraction/CoreSectionExtraction.c b/CloverEFI/OsxDxeCore/SectionExtraction/CoreSectionExtraction.c index f00c67f14..5b8279765 100644 --- a/CloverEFI/OsxDxeCore/SectionExtraction/CoreSectionExtraction.c +++ b/CloverEFI/OsxDxeCore/SectionExtraction/CoreSectionExtraction.c @@ -242,7 +242,7 @@ InitializeSectionExtraction ( EFI_NATIVE_INTERFACE, &mCustomGuidedSectionExtractionProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return Status; @@ -363,7 +363,7 @@ OpenSectionStreamEx ( if (SectionStreamLength > 0) { NewStream->StreamBuffer = AllocatePool (SectionStreamLength); if (NewStream->StreamBuffer == NULL) { - CoreFreePool (NewStream); + CoreFreePool(NewStream); return EFI_OUT_OF_RESOURCES; } // @@ -523,7 +523,7 @@ VerifyGuidedSectionGuid ( // Found the recorded GuidedSectionGuid. // Status = CoreLocateProtocol (GuidedSectionGuid, NULL, (VOID **) &Interface); - if (!EFI_ERROR (Status) && Interface != NULL) { + if (!EFI_ERROR(Status) && Interface != NULL) { // // Found the supported Guided Section Extraction Porotocol for the Guided Section. // @@ -576,7 +576,7 @@ NotifyGuidedExtraction ( &NewStreamBufferSize, &AuthenticationStatus ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Make sure we initialize the new stream with the correct @@ -602,14 +602,14 @@ NotifyGuidedExtraction ( AuthenticationStatus, &Context->ChildNode->EncapsulatedStreamHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Close the event when done. // gBS->CloseEvent (Event); Context->ChildNode->Event = NULL; - FreePool (Context); + FreePool(Context); } /** @@ -726,7 +726,7 @@ CreateChildNode ( // Get the CompressionSectionHeader // if (Node->Size < sizeof (EFI_COMPRESSION_SECTION)) { - CoreFreePool (Node); + CoreFreePool(Node); return EFI_NOT_FOUND; } @@ -751,7 +751,7 @@ CreateChildNode ( NewStreamBufferSize = UncompressedLength; NewStreamBuffer = AllocatePool (NewStreamBufferSize); if (NewStreamBuffer == NULL) { - CoreFreePool (Node); + CoreFreePool(Node); return EFI_OUT_OF_RESOURCES; } @@ -769,7 +769,7 @@ CreateChildNode ( // Decompress the stream // Status = CoreLocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (Decompress != NULL); Status = Decompress->GetInfo ( @@ -779,10 +779,10 @@ CreateChildNode ( (UINT32 *)&NewStreamBufferSize, &ScratchSize ); - if (EFI_ERROR (Status) || (NewStreamBufferSize != UncompressedLength)) { - CoreFreePool (Node); - CoreFreePool (NewStreamBuffer); - if (!EFI_ERROR (Status)) { + if (EFI_ERROR(Status) || (NewStreamBufferSize != UncompressedLength)) { + CoreFreePool(Node); + CoreFreePool(NewStreamBuffer); + if (!EFI_ERROR(Status)) { Status = EFI_BAD_BUFFER_SIZE; } return Status; @@ -790,8 +790,8 @@ CreateChildNode ( ScratchBuffer = AllocatePool (ScratchSize); if (ScratchBuffer == NULL) { - CoreFreePool (Node); - CoreFreePool (NewStreamBuffer); + CoreFreePool(Node); + CoreFreePool(NewStreamBuffer); return EFI_OUT_OF_RESOURCES; } @@ -804,10 +804,10 @@ CreateChildNode ( ScratchBuffer, ScratchSize ); - CoreFreePool (ScratchBuffer); - if (EFI_ERROR (Status)) { - CoreFreePool (Node); - CoreFreePool (NewStreamBuffer); + CoreFreePool(ScratchBuffer); + if (EFI_ERROR(Status)) { + CoreFreePool(Node); + CoreFreePool(NewStreamBuffer); return Status; } } @@ -823,9 +823,9 @@ CreateChildNode ( Stream->AuthenticationStatus, &Node->EncapsulatedStreamHandle ); - if (EFI_ERROR (Status)) { - CoreFreePool (Node); - CoreFreePool (NewStreamBuffer); + if (EFI_ERROR(Status)) { + CoreFreePool(Node); + CoreFreePool(NewStreamBuffer); return Status; } break; @@ -851,8 +851,8 @@ CreateChildNode ( &NewStreamBufferSize, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { - CoreFreePool (*ChildNode); + if (EFI_ERROR(Status)) { + CoreFreePool(*ChildNode); return EFI_PROTOCOL_ERROR; } @@ -880,9 +880,9 @@ CreateChildNode ( AuthenticationStatus, &Node->EncapsulatedStreamHandle ); - if (EFI_ERROR (Status)) { - CoreFreePool (*ChildNode); - CoreFreePool (NewStreamBuffer); + if (EFI_ERROR(Status)) { + CoreFreePool(*ChildNode); + CoreFreePool(NewStreamBuffer); return Status; } } else { @@ -918,8 +918,8 @@ CreateChildNode ( &Node->EncapsulatedStreamHandle ); } - if (EFI_ERROR (Status)) { - CoreFreePool (Node); + if (EFI_ERROR(Status)) { + CoreFreePool(Node); return Status; } } @@ -1005,9 +1005,9 @@ FindChildNode ( // So, its size should be >= the size of commen section header. // Status = CreateChildNode (SourceStream, 0, &CurrentChildNode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (CurrentChildNode != NULL) { - CoreFreePool (CurrentChildNode); + CoreFreePool(CurrentChildNode); } return Status; } @@ -1058,7 +1058,7 @@ FindChildNode ( // to find the request child node in the rest stream. // if (*SectionInstance == 0) { - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); *FoundChild = RecursedChildNode; *FoundStream = RecursedFoundStream; return EFI_SUCCESS; @@ -1098,14 +1098,14 @@ FindChildNode ( // There's an unparsed child remaining in the stream, so create a new child node // Status = CreateChildNode (SourceStream, NextChildOffset, &CurrentChildNode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (CurrentChildNode != NULL) { - CoreFreePool (CurrentChildNode); + CoreFreePool(CurrentChildNode); } return Status; } } else { -// ASSERT (EFI_ERROR (ErrorStatus)); +// ASSERT (EFI_ERROR(ErrorStatus)); return ErrorStatus; } } @@ -1242,7 +1242,7 @@ GetSection ( // Locate target stream // Status = FindStreamNode (SectionStreamHandle, &StreamNode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_INVALID_PARAMETER; goto GetSection_Done; } @@ -1270,7 +1270,7 @@ GetSection ( &ChildStreamNode, &ExtractedAuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto GetSection_Done; } @@ -1353,7 +1353,7 @@ FreeChildNode ( // // Last, free the child node itself // - CoreFreePool (ChildNode); + CoreFreePool(ChildNode); } @@ -1386,7 +1386,7 @@ CloseSectionStream ( // Locate target stream // Status = FindStreamNode (StreamHandleToClose, &StreamNode); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Found the stream, so close it // @@ -1396,8 +1396,8 @@ CloseSectionStream ( ChildNode = CHILD_SECTION_NODE_FROM_LINK (Link); FreeChildNode (ChildNode); } - CoreFreePool (StreamNode->StreamBuffer); - CoreFreePool (StreamNode); + CoreFreePool(StreamNode->StreamBuffer); + CoreFreePool(StreamNode); Status = EFI_SUCCESS; } else { Status = EFI_INVALID_PARAMETER; @@ -1524,7 +1524,7 @@ CustomGuidedSectionExtract ( &SectionAttribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "GetInfo from guided section Failed - %r\n", Status)); return Status; } @@ -1545,7 +1545,7 @@ CustomGuidedSectionExtract ( // AllocatedOutputBuffer = AllocatePool (OutputBufferSize); if (AllocatedOutputBuffer == NULL) { - FreePool (ScratchBuffer); + FreePool(ScratchBuffer); return EFI_OUT_OF_RESOURCES; } *OutputBuffer = AllocatedOutputBuffer; @@ -1560,15 +1560,15 @@ CustomGuidedSectionExtract ( ScratchBuffer, AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Decode failed // if (AllocatedOutputBuffer != NULL) { - CoreFreePool (AllocatedOutputBuffer); + CoreFreePool(AllocatedOutputBuffer); } if (ScratchBuffer != NULL) { - CoreFreePool (ScratchBuffer); + CoreFreePool(ScratchBuffer); } DEBUG ((DEBUG_ERROR, "Extract guided section Failed - %r\n", Status)); return Status; @@ -1592,7 +1592,7 @@ CustomGuidedSectionExtract ( // Free unused scratch buffer. // if (ScratchBuffer != NULL) { - CoreFreePool (ScratchBuffer); + CoreFreePool(ScratchBuffer); } return EFI_SUCCESS; diff --git a/CloverEFI/OsxEfiLdr/EfiLoader.c b/CloverEFI/OsxEfiLdr/EfiLoader.c index 960d8739e..78a977265 100644 --- a/CloverEFI/OsxEfiLdr/EfiLoader.c +++ b/CloverEFI/OsxEfiLdr/EfiLoader.c @@ -110,7 +110,7 @@ EfiLoader ( &ScratchSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SystemHang ("Failed to get decompress information for BFV!\n"); } @@ -124,7 +124,7 @@ EfiLoader ( ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SystemHang ("Failed to decompress BFV!\n"); } @@ -159,7 +159,7 @@ EfiLoader ( &DestinationSize, &ScratchSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SystemHang ("Failed to get decompress information for DxeIpl!\n"); } @@ -169,7 +169,7 @@ EfiLoader ( (VOID *)(UINTN)EFI_DECOMPRESSED_BUFFER_ADDRESS, (VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SystemHang ("Failed to decompress DxeIpl image\n"); } @@ -184,7 +184,7 @@ EfiLoader ( &NumberOfMemoryMapEntries, EfiMemoryDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SystemHang ("Failed to load and relocate DxeIpl PE image!\n"); } /* PrintString ( @@ -216,7 +216,7 @@ EfiLoader ( &DestinationSize, &ScratchSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SystemHang ("Failed to get decompress information for DxeMain FV image!\n"); } @@ -226,7 +226,7 @@ EfiLoader ( (VOID *)(UINTN)EFI_DECOMPRESSED_BUFFER_ADDRESS, (VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SystemHang ("Failed to decompress DxeMain FV image!\n"); } @@ -239,7 +239,7 @@ EfiLoader ( &NumberOfMemoryMapEntries, EfiMemoryDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SystemHang ("Failed to load/relocate DxeMain!\n"); } /* PrintString ( diff --git a/CloverEFI/OsxEfiLdr/PeLoader.c b/CloverEFI/OsxEfiLdr/PeLoader.c index a6b7df8c5..2920c1d92 100644 --- a/CloverEFI/OsxEfiLdr/PeLoader.c +++ b/CloverEFI/OsxEfiLdr/PeLoader.c @@ -212,7 +212,7 @@ EfiLdrPeCoffLoadPeImage ( sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), &TempDebugEntry ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (TempDebugEntry.Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) { CodeViewSize = TempDebugEntry.SizeOfData; CodeViewFileOffset = TempDebugEntry.FileOffset; diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciBus.c b/CloverEFI/OsxPciBusNoEnumerationDxe/PciBus.c index 9c2ee3c7f..281cfb1ec 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciBus.c +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciBus.c @@ -128,7 +128,7 @@ Returns: &gPciBusComponentName, &gPciBusComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); InitializePciDevicePool (); @@ -190,7 +190,7 @@ Returns: return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -213,7 +213,7 @@ Returns: return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -260,7 +260,7 @@ Returns: // Status = PciEnumerator (Controller); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -342,7 +342,7 @@ Returns: // Status = DeRegisterPciDevice (Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciDeviceSupport.c b/CloverEFI/OsxPciBusNoEnumerationDxe/PciDeviceSupport.c index e15ead61c..86740cb6a 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciDeviceSupport.c +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciDeviceSupport.c @@ -149,7 +149,7 @@ Returns: { DestroyPciDeviceTree (RootBridge); - gBS->FreePool (RootBridge); + gBS->FreePool(RootBridge); return EFI_SUCCESS; } @@ -192,7 +192,7 @@ Returns: if (IS_PCI_BRIDGE (&(Temp->Pci))) { DestroyPciDeviceTree (Temp); } - gBS->FreePool (Temp); + gBS->FreePool(Temp); } return EFI_SUCCESS; @@ -303,7 +303,7 @@ Returns: ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("PciIo protocol not installed Status=%r\n", Status); return Status; } else { @@ -315,7 +315,7 @@ Returns: PciIoDevice->Handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -334,7 +334,7 @@ Returns: &PciExpressCapRegOffset, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIoDevice->IsPciExp = TRUE; // DEBUG ((EFI_D_ERROR, "PciExp - %x (B-%x, D-%x, F-%x)\n", PciIoDevice->IsPciExp, PciIoDevice->BusNumber, PciIoDevice->DeviceNumber, PciIoDevice->FunctionNumber)); DBG("PciExp - %x (B-%x, D-%x, F-%x)\n", PciIoDevice->IsPciExp, PciIoDevice->BusNumber, PciIoDevice->DeviceNumber, PciIoDevice->FunctionNumber); @@ -388,7 +388,7 @@ Returns: Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (PciIo); // @@ -410,7 +410,7 @@ Returns: Node = PCI_IO_DEVICE_FROM_LINK (CurrentLink); Status = DeRegisterPciDevice (Controller, Node->Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -462,7 +462,7 @@ Returns: ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiPciRootBridgeIoProtocolGuid, @@ -775,7 +775,7 @@ Returns: (VOID **) &Dev ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciDriverOverride.c b/CloverEFI/OsxPciBusNoEnumerationDxe/PciDriverOverride.c index 4ba5fb712..2b866d021 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciDriverOverride.c +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciDriverOverride.c @@ -143,7 +143,7 @@ Returns: PCI_DRIVER_OVERRIDE_LIST *Node; Status = gBS->HandleProtocol (DriverImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -167,7 +167,7 @@ Returns: // Get information about the image // Status = PeCoffLoaderGetImageInfo (&ImageContext); -/* if (EFI_ERROR (Status)) { +/* if (EFI_ERROR(Status)) { return EFI_SUCCESS; } diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciEnumeratorSupport.c b/CloverEFI/OsxPciBusNoEnumerationDxe/PciEnumeratorSupport.c index 5b615e12d..7c7adfbb1 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciEnumeratorSupport.c +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciEnumeratorSupport.c @@ -162,7 +162,7 @@ Returns: Pci ); - if (!EFI_ERROR (Status) && (Pci->Hdr).VendorId != 0xffff) { + if (!EFI_ERROR(Status) && (Pci->Hdr).VendorId != 0xffff) { // // Read the entire config header for the device @@ -226,14 +226,14 @@ Returns: (UINT8) Func ); - if (EFI_ERROR (Status) && Func == 0) { + if (EFI_ERROR(Status) && Func == 0) { // // go to next device if there is no Function 0 // break; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Collect all the information about the PCI device discovered @@ -252,7 +252,7 @@ Returns: // // - if (!EFI_ERROR (Status) && (IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci))) { + if (!EFI_ERROR(Status) && (IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci))) { // // If it is PPB, we need to get the secondary bus to continue the enumeration @@ -261,7 +261,7 @@ Returns: Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x19, 1, &SecBus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -556,7 +556,7 @@ Returns: // // test if it supports 64 memory or not // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = BarExisted ( PciIoDevice, @@ -565,7 +565,7 @@ Returns: NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIoDevice->Decodes |= EFI_BRIDGE_PMEM32_DECODE_SUPPORTED; PciIoDevice->Decodes |= EFI_BRIDGE_PMEM64_DECODE_SUPPORTED; } else { @@ -899,7 +899,7 @@ Returns: &OriginalValue ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { PciIoDevice->PciBar[BarIndex].BaseAddress = 0; PciIoDevice->PciBar[BarIndex].Length = 0; PciIoDevice->PciBar[BarIndex].Alignment = 0; @@ -1001,7 +1001,7 @@ Returns: &OriginalValue ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Offset + 4; } @@ -1166,7 +1166,7 @@ Returns: (VOID **) &PciIoDevice ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -1201,8 +1201,8 @@ Returns: InitializePciIoInstance (PciIoDevice); Status = InitializePciDriverOverrideInstance (PciIoDevice); - if (EFI_ERROR (Status)) { - gBS->FreePool (PciIoDevice); + if (EFI_ERROR(Status)) { + gBS->FreePool(PciIoDevice); return NULL; } @@ -1274,7 +1274,7 @@ Returns: Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { return Status; } @@ -1289,7 +1289,7 @@ Returns: Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { return Status; } @@ -1300,7 +1300,7 @@ Returns: Status = PciRootBridgeIo->Configuration (PciRootBridgeIo, (VOID **) &Descriptors); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1326,7 +1326,7 @@ Returns: (UINT8) MinBus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If successfully, insert the node into device pool diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciIo.c b/CloverEFI/OsxPciBusNoEnumerationDxe/PciIo.c index d8208d196..0c5bdf257 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciIo.c +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciIo.c @@ -480,7 +480,7 @@ Returns: } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, 1, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -536,7 +536,7 @@ Returns: } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, 1, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -591,7 +591,7 @@ Returns: } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, Count, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -644,7 +644,7 @@ Returns: } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, Count, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -697,7 +697,7 @@ Returns: } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, Count, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -750,7 +750,7 @@ Returns: } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, Count, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -796,7 +796,7 @@ Returns: Address = Offset; Status = PciIoVerifyConfigAccess (PciIoDevice, Width, Count, &Address); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -842,7 +842,7 @@ Returns: Address = Offset; Status = PciIoVerifyConfigAccess (PciIoDevice, Width, Count, &Address); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -903,12 +903,12 @@ Returns: } Status = PciIoVerifyBarAccess (PciIoDevice, DestBarIndex, PciBarTypeMem, Width, Count, &DestOffset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } Status = PciIoVerifyBarAccess (PciIoDevice, SrcBarIndex, PciBarTypeMem, Width, Count, &SrcOffset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1373,7 +1373,7 @@ Returns: NULL, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The PCI Root Bridge could not modify the attributes, so return the error. // @@ -1788,7 +1788,7 @@ Returns: (UINT32) *Length, &NonRelativeOffset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciOptionRomSupport.c b/CloverEFI/OsxPciBusNoEnumerationDxe/PciOptionRomSupport.c index 2859ffaf3..049d80851 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciOptionRomSupport.c +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciOptionRomSupport.c @@ -97,7 +97,7 @@ Returns: 1, &AllOnes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -111,7 +111,7 @@ Returns: 1, &AllOnes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -198,7 +198,7 @@ Returns: RomPcir = AllocatePool (sizeof (PCI_DATA_STRUCTURE)); if (RomPcir == NULL) { - FreePool (RomHeader); + FreePool(RomHeader); return EFI_OUT_OF_RESOURCES; } @@ -282,8 +282,8 @@ Returns: Image = AllocatePool ((UINT32) RomImageSize); if (Image == NULL) { RomDecode (PciDevice, RomBarIndex, RomBar, FALSE); - gBS->FreePool (RomHeader); - gBS->FreePool (RomPcir); + gBS->FreePool(RomHeader); + gBS->FreePool(RomPcir); return EFI_OUT_OF_RESOURCES; } @@ -308,8 +308,8 @@ Returns: // // Free allocated memory // - gBS->FreePool (RomHeader); - gBS->FreePool (RomPcir); + gBS->FreePool(RomHeader); + gBS->FreePool(RomPcir); return retStatus; } @@ -492,7 +492,7 @@ Returns: if (EfiRomHeader->CompressionType == EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) { Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **) &Decompress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SkipImage = TRUE; } else { SkipImage = TRUE; @@ -503,7 +503,7 @@ Returns: &DestinationSize, &ScratchSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { //DecompressedImageBuffer = NULL; DecompressedImageBuffer = AllocatePool (DestinationSize); if (DecompressedImageBuffer != NULL) { @@ -518,13 +518,13 @@ Returns: Scratch, ScratchSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ImageBuffer = DecompressedImageBuffer; ImageLength = DestinationSize; SkipImage = FALSE; } - gBS->FreePool (Scratch); + gBS->FreePool(Scratch); } } } @@ -543,9 +543,9 @@ Returns: ImageLength, &ImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->StartImage (ImageHandle, NULL, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AddDriver (PciDevice, ImageHandle); retStatus = EFI_SUCCESS; } diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciPowerManagement.c b/CloverEFI/OsxPciBusNoEnumerationDxe/PciPowerManagement.c index 58561a39a..6e1dd55f3 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciPowerManagement.c +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciPowerManagement.c @@ -58,7 +58,7 @@ Returns: NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -77,7 +77,7 @@ Returns: 1, &PowerManagementCSR ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Clear PME_Status bit // diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciRomTable.c b/CloverEFI/OsxPciBusNoEnumerationDxe/PciRomTable.c index 6d9531c34..6cbe34faa 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciRomTable.c +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciRomTable.c @@ -64,7 +64,7 @@ PciRomAddImageMapping ( CopyMem (TempMapping, mRomImageTable, mNumberOfPciRomImages * sizeof (EFI_PCI_ROM_IMAGE_MAPPING)); if (mRomImageTable != NULL) { - gBS->FreePool (mRomImageTable); + gBS->FreePool(mRomImageTable); } mRomImageTable = TempMapping; @@ -204,7 +204,7 @@ Returns: if (EfiRomHeader->CompressionType == EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) { Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **) &Decompress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SkipImage = TRUE; } else { SkipImage = TRUE; @@ -215,7 +215,7 @@ Returns: &DestinationSize, &ScratchSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // DecompressedImageBuffer = NULL; DecompressedImageBuffer = AllocatePool (DestinationSize); if (DecompressedImageBuffer != NULL) { @@ -230,13 +230,13 @@ Returns: Scratch, ScratchSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ImageBuffer = DecompressedImageBuffer; ImageLength = DestinationSize; SkipImage = FALSE; } - gBS->FreePool (Scratch); + gBS->FreePool(Scratch); } } } @@ -260,9 +260,9 @@ Returns: ImageLength, &ImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->StartImage (ImageHandle, NULL, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciRomAddImageMapping ( ImageHandle, PciOptionRomDescriptor->Seg, @@ -274,12 +274,12 @@ Returns: } } if (FilePath != NULL) { - gBS->FreePool (FilePath); + gBS->FreePool(FilePath); } } if (DecompressedImageBuffer != NULL) { - gBS->FreePool (DecompressedImageBuffer); + gBS->FreePool(DecompressedImageBuffer); } } @@ -316,7 +316,7 @@ Returns: UINT16 MaxBus; Status = EfiGetSystemConfigurationTable (&gEfiPciOptionRomTableGuid, (VOID **) &PciOptionRomTable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -327,7 +327,7 @@ Returns: if (!PciOptionRomDescriptor->DontLoadEfiRom) { if (PciOptionRomDescriptor->Seg == PciRootBridgeIo->SegmentNumber) { Status = PciRootBridgeIo->Configuration (PciRootBridgeIo, (VOID **) &Descriptors); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -365,7 +365,7 @@ Returns: UINTN Index; Status = EfiGetSystemConfigurationTable (&gEfiPciOptionRomTableGuid, (VOID **) &PciOptionRomTable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } diff --git a/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.c b/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.c index a6c2ddc49..60dcda029 100644 --- a/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.c +++ b/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.c @@ -76,10 +76,10 @@ InstallProcessorSmbios ( Token = HiiSetString (gStringHandle, 0, UString, NULL); if (Token == 0) { - gBS->FreePool (UString); + gBS->FreePool(UString); return ; } - gBS->FreePool (UString); + gBS->FreePool(UString); return ; } @@ -144,10 +144,10 @@ InstallMiscSmbios ( Token = HiiSetString (gStringHandle, 0, UString, NULL); if (Token == 0) { - gBS->FreePool (UString); + gBS->FreePool(UString); return ; } - gBS->FreePool (UString); + gBS->FreePool(UString); // // Log Smios Type 0 @@ -174,10 +174,10 @@ InstallMiscSmbios ( Token = HiiSetString (gStringHandle, 0, UString, NULL); if (Token == 0) { - gBS->FreePool (UString); + gBS->FreePool(UString); return ; } - gBS->FreePool (UString); + gBS->FreePool(UString); // // Log Smbios Type 1 @@ -207,7 +207,7 @@ SmbiosGenEntrypoint ( NULL, (VOID**)&gSmbios ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -326,5 +326,5 @@ LogSmbiosData ( &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*)Buffer ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } diff --git a/CloverEFI/PcatRealTimeClockRuntimeDxe/PcRtc.c b/CloverEFI/PcatRealTimeClockRuntimeDxe/PcRtc.c index b81fc2458..4e2c71427 100644 --- a/CloverEFI/PcatRealTimeClockRuntimeDxe/PcRtc.c +++ b/CloverEFI/PcatRealTimeClockRuntimeDxe/PcRtc.c @@ -149,7 +149,7 @@ PcRtcInit ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Set the variable with default value if the RTC is functioning incorrectly. // @@ -196,7 +196,7 @@ PcRtcInit ( &DataSize, (VOID *) &TimerVar ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Time.TimeZone = (INT16) TimerVar; Time.Daylight = (UINT8) (TimerVar >> 16); } else { @@ -208,10 +208,10 @@ PcRtcInit ( // Validate time fields // Status = ConvertRtcTimeToEfiTime (&Time, RegisterB); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = RtcTimeFieldsValid (&Time); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Time.Second = RTC_INIT_SECOND; Time.Minute = RTC_INIT_MINUTE; Time.Hour = RTC_INIT_HOUR; @@ -227,7 +227,7 @@ PcRtcInit ( // Reset time value according to new RTC configuration // Status = PcRtcSetTime (&Time, Global); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -237,7 +237,7 @@ PcRtcInit ( // so we can use them to get and set wakeup time. // Status = PcRtcGetWakeupTime (&Enabled, &Pending, &Time, Global); - if ((Enabled) || (!EFI_ERROR (Status))) { + if ((Enabled) || (!EFI_ERROR(Status))) { return EFI_SUCCESS; } @@ -265,7 +265,7 @@ PcRtcInit ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -284,7 +284,7 @@ PcRtcInit ( sizeof (Time), &Time ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -360,7 +360,7 @@ PcRtcGetTime ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -398,10 +398,10 @@ PcRtcGetTime ( // Make sure all field values are in correct range // Status = ConvertRtcTimeToEfiTime (Time, RegisterB); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = RtcTimeFieldsValid (Time); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -452,7 +452,7 @@ PcRtcSetTime ( // Make sure that the time fields are valid // Status = RtcTimeFieldsValid (Time); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -468,7 +468,7 @@ PcRtcSetTime ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -487,7 +487,7 @@ PcRtcSetTime ( sizeof (TimerVar), &TimerVar ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -578,7 +578,7 @@ PcRtcGetWakeupTime ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -616,7 +616,7 @@ PcRtcGetWakeupTime ( &DataSize, &RtcTime ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The alarm variable exists. In this case, we read variable to get info. // @@ -636,10 +636,10 @@ PcRtcGetWakeupTime ( // Make sure all field values are in correct range // Status = ConvertRtcTimeToEfiTime (Time, RegisterB); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = RtcTimeFieldsValid (Time); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -684,7 +684,7 @@ PcRtcSetWakeupTime ( // Make sure that the time fields are valid // Status = RtcTimeFieldsValid (Time); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } // @@ -692,7 +692,7 @@ PcRtcSetWakeupTime ( // PcRtcGetTime (&RtcTime, &Capabilities, Global); Status = RtcTimeFieldsValid (&RtcTime); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } if (!IsWithinOneDay (&RtcTime, Time)) { @@ -714,7 +714,7 @@ PcRtcSetWakeupTime ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -751,7 +751,7 @@ PcRtcSetWakeupTime ( sizeof (RtcTime), &RtcTime ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } diff --git a/CloverEFI/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c b/CloverEFI/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c index 9cf398870..5ea05b836 100644 --- a/CloverEFI/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c +++ b/CloverEFI/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c @@ -137,7 +137,7 @@ InitializePcRtc ( EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_CALLBACK); Status = PcRtcInit (&mModuleGlobal); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); gRT->GetTime = PcRtcEfiGetTime; gRT->SetTime = PcRtcEfiSetTime; @@ -150,7 +150,7 @@ InitializePcRtc ( NULL, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/CloverEFI/PciRootBridgeDxe/DeviceIo.c b/CloverEFI/PciRootBridgeDxe/DeviceIo.c index b9cae2b2c..8545c21cf 100644 --- a/CloverEFI/PciRootBridgeDxe/DeviceIo.c +++ b/CloverEFI/PciRootBridgeDxe/DeviceIo.c @@ -91,7 +91,7 @@ Returns: &Private->DeviceIo, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -767,7 +767,7 @@ Returns: Pages, &HostAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/CloverEFI/PciRootBridgeDxe/Ia32/PcatIo.c b/CloverEFI/PciRootBridgeDxe/Ia32/PcatIo.c index 051394b8b..520d5ae3e 100644 --- a/CloverEFI/PciRootBridgeDxe/Ia32/PcatIo.c +++ b/CloverEFI/PciRootBridgeDxe/Ia32/PcatIo.c @@ -475,7 +475,7 @@ CheckForRom ( &RomBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Copy the contents of the Option ROM to the memory buffer @@ -617,7 +617,7 @@ ScanPciRootBridgeForRoms( } Status = IoDev->Configuration(IoDev, (VOID **)&Descriptors); - if (EFI_ERROR (Status) || Descriptors == NULL) { + if (EFI_ERROR(Status) || Descriptors == NULL) { return EFI_NOT_FOUND; } @@ -690,7 +690,7 @@ ScanPciRootBridgeForRoms( (VOID **)&Context.CommandRegisterBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/CloverEFI/PciRootBridgeDxe/PcatIo.c b/CloverEFI/PciRootBridgeDxe/PcatIo.c index 198580d06..6d0bf48c6 100644 --- a/CloverEFI/PciRootBridgeDxe/PcatIo.c +++ b/CloverEFI/PciRootBridgeDxe/PcatIo.c @@ -476,7 +476,7 @@ CheckForRom ( &RomBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Copy the contents of the Option ROM to the memory buffer @@ -618,7 +618,7 @@ ScanPciRootBridgeForRoms( } Status = IoDev->Configuration(IoDev, (VOID **)&Descriptors); - if (EFI_ERROR (Status) || Descriptors == NULL) { + if (EFI_ERROR(Status) || Descriptors == NULL) { return EFI_NOT_FOUND; } @@ -691,7 +691,7 @@ ScanPciRootBridgeForRoms( (VOID **)&Context.CommandRegisterBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/CloverEFI/PciRootBridgeDxe/PcatPciRootBridge.c b/CloverEFI/PciRootBridgeDxe/PcatPciRootBridge.c index 921f0233b..c7dd4df14 100644 --- a/CloverEFI/PciRootBridgeDxe/PcatPciRootBridge.c +++ b/CloverEFI/PciRootBridgeDxe/PcatPciRootBridge.c @@ -73,7 +73,7 @@ Returns: // Initialize gCpuIo now since the chipset init code requires it. // Status = gBS->LocateProtocol (&gEfiCpuIo2ProtocolGuid, NULL, (VOID **)&gCpuIo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Initialize variables required to search all PCI segments for PCI devices @@ -91,7 +91,7 @@ Returns: sizeof (PCAT_PCI_ROOT_BRIDGE_INSTANCE), (VOID **)&PrivateData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -136,7 +136,7 @@ Returns: &PrivateData->PhysicalIoBase, &PrivateData->PhysicalMemoryBase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -162,7 +162,7 @@ Returns: // Build the EFI Device Path Protocol instance for this PCI Root Bridge // Status = PcatRootBridgeDevicePathConstructor (&PrivateData->DevicePath, PciRootBridgeIndex, (BOOLEAN)((PrivateData->PciExpressBaseAddress != 0) ? TRUE : FALSE)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -170,7 +170,7 @@ Returns: // Build the PCI Root Bridge I/O Protocol instance for this PCI Root Bridge // Status = PcatRootBridgeIoConstructor (&PrivateData->Io, PciSegmentIndex); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -196,7 +196,7 @@ Returns: sizeof (VendorId) / sizeof (UINT16), &VendorId ); - if ((EFI_ERROR (Status)) || ((VendorId == 0xffff) && (Function == 0))) { + if ((EFI_ERROR(Status)) || ((VendorId == 0xffff) && (Function == 0))) { // // If the PCI Configuration Read fails, or a PCI device does not exist, then // skip this entire PCI device @@ -220,7 +220,7 @@ Returns: sizeof (PciConfigurationHeader) / sizeof (UINT16), &PciConfigurationHeader ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If the entire PCI Configuration Header can not be read, then skip this entire PCI device // @@ -510,7 +510,7 @@ Returns: // Build ACPI descriptors for the resources on the PCI Root Bridge // Status = ConstructConfiguration(PrivateData); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Create the handle for this PCI Root Bridge @@ -523,7 +523,7 @@ Returns: &PrivateData->Io, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Contruct DeviceIoProtocol @@ -535,7 +535,7 @@ Returns: (UINT16)PrivateData->PrimaryBus, (UINT16)PrivateData->SubordinateBus ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); #if 0 //patch by nms42 // // Scan this PCI Root Bridge for PCI Option ROMs and add them to the PCI Option ROM Table @@ -584,7 +584,7 @@ Done: if (PrivateData->DevicePath) { gBS->FreePool(PrivateData->DevicePath); } - gBS->FreePool (PrivateData); + gBS->FreePool(PrivateData); } // @@ -652,7 +652,7 @@ Returns: sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR), (VOID **)&PrivateData->Configuration ); - if (EFI_ERROR (Status )) { + if (EFI_ERROR(Status )) { return Status; } @@ -681,7 +681,7 @@ Returns: sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * NumConfig + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR), (VOID **)&PrivateData->Configuration ); - if (EFI_ERROR (Status )) { + if (EFI_ERROR(Status )) { return Status; } @@ -906,7 +906,7 @@ Returns: &Value ); - if (!EFI_ERROR (Status )) { + if (!EFI_ERROR(Status )) { if ( Value & 0x01 ) { if (Command & 0x0001) { // diff --git a/CloverEFI/PciRootBridgeDxe/PcatPciRootBridgeIo.c b/CloverEFI/PciRootBridgeDxe/PcatPciRootBridgeIo.c index d5d79aee2..24a0fae43 100644 --- a/CloverEFI/PciRootBridgeDxe/PcatPciRootBridgeIo.c +++ b/CloverEFI/PciRootBridgeDxe/PcatPciRootBridgeIo.c @@ -514,7 +514,7 @@ PcatRootBridgeIoCopyMem ( 1, &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PcatRootBridgeIoMemWrite ( @@ -524,7 +524,7 @@ PcatRootBridgeIoCopyMem ( 1, &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (Direction) { @@ -639,7 +639,7 @@ PcatRootBridgeIoMap ( sizeof(MAP_INFO), (VOID **)&MapInfo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *NumberOfBytes = 0; return Status; } @@ -668,7 +668,7 @@ PcatRootBridgeIoMap ( &MapInfo->MappedHostAddress ); if (EFI_ERROR(Status)) { - gBS->FreePool (MapInfo); + gBS->FreePool(MapInfo); *NumberOfBytes = 0; return Status; } @@ -694,7 +694,7 @@ PcatRootBridgeIoMap ( ); if (EFI_ERROR(Status)) { gBS->FreePages (MapInfo->MappedHostAddress,MapInfo->NumberOfPages); - gBS->FreePool (MapInfo); + gBS->FreePool(MapInfo); *NumberOfBytes = 0; return Status; } @@ -780,7 +780,7 @@ PcatRootBridgeIoUnmap ( // Free the mapped buffer and the MAP_INFO structure. // gBS->FreePages (MapInfo->MappedHostAddress, MapInfo->NumberOfPages); - gBS->FreePool (Mapping); + gBS->FreePool(Mapping); } // @@ -832,7 +832,7 @@ PcatRootBridgeIoAllocateBuffer ( PhysicalAddress = (EFI_PHYSICAL_ADDRESS)(0xffffffff); Status = gBS->AllocatePages (AllocateMaxAddress, MemoryType, Pages, &PhysicalAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/CloverEFI/PciRootBridgeDxe/X64/PcatIo.c b/CloverEFI/PciRootBridgeDxe/X64/PcatIo.c index acffaa46a..78b2bc918 100644 --- a/CloverEFI/PciRootBridgeDxe/X64/PcatIo.c +++ b/CloverEFI/PciRootBridgeDxe/X64/PcatIo.c @@ -475,7 +475,7 @@ CheckForRom ( &RomBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Copy the contents of the Option ROM to the memory buffer @@ -617,7 +617,7 @@ ScanPciRootBridgeForRoms( } Status = IoDev->Configuration(IoDev, (VOID **) &Descriptors); - if (EFI_ERROR (Status) || Descriptors == NULL) { + if (EFI_ERROR(Status) || Descriptors == NULL) { return EFI_NOT_FOUND; } @@ -690,7 +690,7 @@ ScanPciRootBridgeForRoms( (VOID **) &Context.CommandRegisterBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/CloverEFI/UefiCpuPkg/CpuDxe/CpuDxe.c b/CloverEFI/UefiCpuPkg/CpuDxe/CpuDxe.c index c090211b5..be943d91d 100644 --- a/CloverEFI/UefiCpuPkg/CpuDxe/CpuDxe.c +++ b/CloverEFI/UefiCpuPkg/CpuDxe/CpuDxe.c @@ -846,7 +846,7 @@ SetGcdMemorySpaceAttributes ( &StartIndex, &EndIndex ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -944,7 +944,7 @@ RefreshGcdMemoryAttributes ( &NumberOfDescriptors, &MemorySpaceMap ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DefaultMemoryType = (UINT8) MtrrGetDefaultMemoryType (); DefaultAttributes = GetMemorySpaceAttributeFromMtrrType (DefaultMemoryType); @@ -1069,7 +1069,7 @@ RefreshGcdMemoryAttributes ( // Free memory space map allocated by GCD service GetMemorySpaceMap () // if (MemorySpaceMap != NULL) { - FreePool (MemorySpaceMap); + FreePool(MemorySpaceMap); } mIsFlushingGCD = FALSE; @@ -1213,14 +1213,14 @@ InitInterruptDescriptorTable ( IdtPtr->Limit = (UINT16) (sizeof (gIdtTable) - 1); AsmWriteIdtr (IdtPtr); - FreePool (IdtPtrAlignmentBuffer); + FreePool(IdtPtrAlignmentBuffer); // // Initialize Exception Handlers // for (Index = OldIdtSize; Index < 32; Index++) { Status = CpuRegisterInterruptHandler (&gCpu, Index, CommonExceptionHandler); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } // @@ -1301,8 +1301,8 @@ InitializeCpu ( &gEfiCpuArchProtocolGuid, &gCpu, NULL ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -1322,7 +1322,7 @@ InitializeCpu ( &gIdleLoopEventGuid, &IdleLoopEvent ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } diff --git a/CloverEFI/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c b/CloverEFI/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c index f53606692..75ca44479 100644 --- a/CloverEFI/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c +++ b/CloverEFI/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c @@ -243,7 +243,7 @@ CpuMemoryServiceRead ( UINT8 *Uint8Buffer; Status = CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -323,7 +323,7 @@ CpuMemoryServiceWrite ( UINT8 *Uint8Buffer; Status = CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -403,7 +403,7 @@ CpuIoServiceRead ( UINT8 *Uint8Buffer; Status = CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -485,7 +485,7 @@ CpuIoServiceWrite ( // Make sure the parameters are valid // Status = CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -533,7 +533,7 @@ CpuIo2Initialize ( &gEfiCpuIo2ProtocolGuid, &mCpuIo2, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/CloverEFI/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c b/CloverEFI/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c index 1c172a096..37f5c32bb 100644 --- a/CloverEFI/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c +++ b/CloverEFI/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c @@ -171,7 +171,7 @@ CpuMemoryServiceRead ( UINT8 *Uint8Buffer; Status = CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -231,7 +231,7 @@ CpuMemoryServiceWrite ( UINT8 *Uint8Buffer; Status = CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -291,7 +291,7 @@ CpuIoServiceRead ( UINT8 *Uint8Buffer; Status = CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -353,7 +353,7 @@ CpuIoServiceWrite ( // Make sure the parameters are valid // Status = CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -407,7 +407,7 @@ SmmCpuIo2Initialize ( EFI_NATIVE_INTERFACE, &mSmmCpuIo2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/CloverEFI/UefiCpuPkg/CpuIoPei/CpuIoPei.c b/CloverEFI/UefiCpuPkg/CpuIoPei/CpuIoPei.c index 888800053..efef214f4 100644 --- a/CloverEFI/UefiCpuPkg/CpuIoPei/CpuIoPei.c +++ b/CloverEFI/UefiCpuPkg/CpuIoPei/CpuIoPei.c @@ -217,7 +217,7 @@ CpuMemoryServiceRead ( UINT8 *Uint8Buffer; Status = CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -291,7 +291,7 @@ CpuMemoryServiceWrite ( UINT8 *Uint8Buffer; Status = CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -365,7 +365,7 @@ CpuIoServiceRead ( UINT8 *Uint8Buffer; Status = CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -437,7 +437,7 @@ CpuIoServiceWrite ( // Make sure the parameters are valid // Status = CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -857,7 +857,7 @@ CpuIoInitialize ( // DEBUG ((EFI_D_INFO, "CpuIO PPI has been loaded into memory. Reinstalled PPI=0x%x\n", &gCpuIoPpi)); } else { Status = PeiServicesInstallPpi (&gPpiList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return EFI_SUCCESS; diff --git a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c index f02355ec8..ae60e6db4 100644 --- a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c +++ b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c @@ -83,8 +83,8 @@ InitializeCpuInterruptHandlers ( SetMem ((VOID *) mReservedVectors, sizeof (RESERVED_VECTORS_DATA) * CPU_INTERRUPT_NUM, 0xff); if (VectorInfo != NULL) { Status = ReadAndVerifyVectorInfo (VectorInfo, mReservedVectors, CPU_INTERRUPT_NUM); - if (EFI_ERROR (Status)) { - FreePool (mReservedVectors); + if (EFI_ERROR(Status)) { + FreePool(mReservedVectors); return EFI_INVALID_PARAMETER; } } diff --git a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c index 482901614..74b551924 100644 --- a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c +++ b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c @@ -220,7 +220,7 @@ InitializeCpuExceptionHandlersWorker ( SetMem ((VOID *) mReservedVectors, sizeof (RESERVED_VECTORS_DATA) * CPU_EXCEPTION_NUM, 0xff); if (VectorInfo != NULL) { Status = ReadAndVerifyVectorInfo (VectorInfo, mReservedVectors, CPU_EXCEPTION_NUM); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } } diff --git a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c index 7e94e38ae..711187c20 100644 --- a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c +++ b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c @@ -82,7 +82,7 @@ InitializeCpuExceptionHandlers ( if (VectorInfo != NULL) { SetMem ((VOID *) ReservedVectorData, sizeof (RESERVED_VECTORS_DATA) * CPU_EXCEPTION_NUM, 0xff); Status = ReadAndVerifyVectorInfo (VectorInfo, ReservedVectorData, CPU_EXCEPTION_NUM); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } } @@ -180,4 +180,4 @@ RegisterCpuInterruptHandler ( ) { return EFI_UNSUPPORTED; -} \ No newline at end of file +} diff --git a/CloverEFI/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/CloverEFI/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c index 58ba2a9ed..6bf73c87e 100644 --- a/CloverEFI/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c +++ b/CloverEFI/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c @@ -284,7 +284,7 @@ WriteToOsS3PerformanceData ( NULL, (VOID **) &VariableServices ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); VarSize = sizeof (EFI_PHYSICAL_ADDRESS); Status = VariableServices->GetVariable ( @@ -295,7 +295,7 @@ WriteToOsS3PerformanceData ( &VarSize, &mAcpiLowMemoryBase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Fail to retrieve variable to log S3 performance data \n")); return; } @@ -394,7 +394,7 @@ S3ResumeBootOs ( // Install BootScriptDonePpi // Status = PeiServicesInstallPpi (&mPpiListPostScriptTable); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Get ACPI Table Address @@ -417,7 +417,7 @@ S3ResumeBootOs ( // Install EndOfPeiPpi // Status = PeiServicesInstallPpi (&mPpiListEndOfPeiTable); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); PERF_CODE ( WriteToOsS3PerformanceData (); @@ -681,13 +681,13 @@ S3ResumeExecuteBootScript ( DEBUG ((EFI_D_ERROR, "Close all SMRAM regions before executing boot script\n")); - for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { + for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR(Status); Index++) { Status = SmmAccess->Close ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); } DEBUG ((EFI_D_ERROR, "Lock all SMRAM regions before executing boot script\n")); - for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { + for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR(Status); Index++) { Status = SmmAccess->Lock ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); } } @@ -827,7 +827,7 @@ S3RestoreConfig2 ( NULL, (VOID **) &SmmAccess ); - for (Index = 0; !EFI_ERROR (Status); Index++) { + for (Index = 0; !EFI_ERROR(Status); Index++) { Status = SmmAccess->Open ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); } @@ -837,7 +837,7 @@ S3RestoreConfig2 ( NULL, (VOID **) &VariableServices ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -847,7 +847,7 @@ S3RestoreConfig2 ( &TempAcpiS3Context, &VarSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); AcpiS3Context = (ACPI_S3_CONTEXT *)(UINTN)TempAcpiS3Context; ASSERT (AcpiS3Context != NULL); @@ -857,7 +857,7 @@ S3RestoreConfig2 ( NULL, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); VarSize = sizeof (TempEfiBootScriptExecutorVariable); Status = RestoreLockBox ( @@ -865,14 +865,14 @@ S3RestoreConfig2 ( &TempEfiBootScriptExecutorVariable, &VarSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = RestoreLockBox ( &gEfiBootScriptExecutorContextGuid, NULL, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); EfiBootScriptExecutorVariable = (BOOT_SCRIPT_EXECUTOR_VARIABLE *) (UINTN) TempEfiBootScriptExecutorVariable; @@ -889,8 +889,8 @@ S3RestoreConfig2 ( // We just use restore all lock box in place, no need restore one by one. // Status = RestoreAllLockBoxInPlace (); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { // Something wrong CpuDeadLoop (); } @@ -984,7 +984,7 @@ PeimS3ResumeEntryPoint ( // Install S3 Resume Ppi // Status = (**PeiServices).InstallPpi (PeiServices, &mPpiList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/Drivers/AtaAtapi/AhciMode.c b/Drivers/AtaAtapi/AhciMode.c index 1f25440b7..674e84c1e 100644 --- a/Drivers/AtaAtapi/AhciMode.c +++ b/Drivers/AtaAtapi/AhciMode.c @@ -752,7 +752,7 @@ AhciPioTransfer ( &Map ); - if (EFI_ERROR (Status) || (DataCount != MapLength)) { + if (EFI_ERROR(Status) || (DataCount != MapLength)) { return EFI_BAD_BUFFER_SIZE; } @@ -786,7 +786,7 @@ AhciPioTransfer ( 0, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -806,7 +806,7 @@ AhciPioTransfer ( D2hFisReceived = FALSE; Offset = FisBaseAddr + EFI_AHCI_PIO_FIS_OFFSET; Status = AhciCheckMemSet (Offset, EFI_AHCI_FIS_TYPE_MASK, EFI_AHCI_FIS_PIO_SETUP, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PioFisReceived = TRUE; } // @@ -818,7 +818,7 @@ AhciPioTransfer ( // Offset = FisBaseAddr + EFI_AHCI_D2H_FIS_OFFSET; Status = AhciCheckMemSet (Offset, EFI_AHCI_FIS_TYPE_MASK, EFI_AHCI_FIS_REGISTER_D2H, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { D2hFisReceived = TRUE; } @@ -862,7 +862,7 @@ AhciPioTransfer ( Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -999,7 +999,7 @@ AhciDmaTransfer ( &Map ); - if (EFI_ERROR (Status) || (DataCount != MapLength)) { + if (EFI_ERROR(Status) || (DataCount != MapLength)) { return EFI_BAD_BUFFER_SIZE; } @@ -1036,7 +1036,7 @@ AhciDmaTransfer ( 0, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } } @@ -1065,7 +1065,7 @@ AhciDmaTransfer ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1185,7 +1185,7 @@ AhciNonDataTransfer ( 0, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1201,7 +1201,7 @@ AhciNonDataTransfer ( Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1311,7 +1311,7 @@ AhciStartCommand ( Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1415,7 +1415,7 @@ AhciPortReset ( Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1538,7 +1538,7 @@ AhciAtaSmartReturnStatusCheck ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_ATA_BUS_SMART_DISABLED) @@ -1661,7 +1661,7 @@ AhciAtaSmartSupport ( ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Send S.M.A.R.T AutoSave command to device // @@ -1686,7 +1686,7 @@ AhciAtaSmartSupport ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { /*Status = */AhciAtaSmartReturnStatusCheck ( PciIo, AhciRegisters, @@ -2047,7 +2047,7 @@ AhciCreateTransferDescriptor ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -2066,7 +2066,7 @@ AhciCreateTransferDescriptor ( &AhciRegisters->MapRFis ); - if (EFI_ERROR (Status) || (Bytes != MaxReceiveFisSize)) { + if (EFI_ERROR(Status) || (Bytes != MaxReceiveFisSize)) { // // Map error or unable to map the whole RFis buffer into a contiguous region. // @@ -2098,7 +2098,7 @@ AhciCreateTransferDescriptor ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free mapped resource. // @@ -2121,7 +2121,7 @@ AhciCreateTransferDescriptor ( &AhciRegisters->MapCmdList ); - if (EFI_ERROR (Status) || (Bytes != MaxCommandListSize)) { + if (EFI_ERROR(Status) || (Bytes != MaxCommandListSize)) { // // Map error or unable to map the whole cmd list buffer into a contiguous region. // @@ -2154,7 +2154,7 @@ AhciCreateTransferDescriptor ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free mapped resource. // @@ -2177,7 +2177,7 @@ AhciCreateTransferDescriptor ( &AhciRegisters->MapCommandTable ); - if (EFI_ERROR (Status) || (Bytes != MaxCommandTableSize)) { + if (EFI_ERROR(Status) || (Bytes != MaxCommandTableSize)) { // // Map error or unable to map the whole cmd list buffer into a contiguous region. // @@ -2277,7 +2277,7 @@ AhciModeInitialization ( Status = AhciReset (PciIo, EFI_AHCI_BUS_RESET_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -2317,7 +2317,7 @@ AhciModeInitialization ( AhciRegisters = &Instance->AhciRegisters; Status = AhciCreateTransferDescriptor (PciIo, AhciRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } // DEBUG ((EFI_D_ERROR, "MaxPortNumber = %d\n", MaxPortNumber)); @@ -2382,7 +2382,7 @@ AhciModeInitialization ( EFI_AHCI_PORT_CMD_FR_CLEAR_TIMEOUT ); */ Status = AhciEnableFisReceive( PciIo, Port, EFI_AHCI_PORT_CMD_FR_CLEAR_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2448,7 +2448,7 @@ AhciModeInitialization ( 0x00000101, EFI_TIMER_PERIOD_SECONDS(16) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2456,7 +2456,7 @@ AhciModeInitialization ( if ((Data & EFI_AHCI_ATAPI_SIG_MASK) == EFI_AHCI_ATAPI_DEVICE_SIG) { Status = AhciIdentifyPacket (PciIo, AhciRegisters, Port, 0, &Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2464,7 +2464,7 @@ AhciModeInitialization ( } else if ((Data & EFI_AHCI_ATAPI_SIG_MASK) == EFI_AHCI_ATA_DEVICE_SIG) { Status = AhciIdentify (PciIo, AhciRegisters, Port, 0, &Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_NOT_DETECTED)); continue; } @@ -2506,7 +2506,7 @@ AhciModeInitialization ( 0, &SupportedModes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "Calculate Mode Fail, Status = %r\n", Status)); // Print(L"Calculate Mode Fail, Status = %r\n", Status); continue; @@ -2539,7 +2539,7 @@ AhciModeInitialization ( FreePool(SupportedModes); Status = AhciDeviceSetFeature (PciIo, AhciRegisters, Port, 0, 0x03, (UINT32)(*(UINT8 *)&TransferMode)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status)); // Print(L"Set transfer Mode Fail, Status = %r\n", Status); continue; diff --git a/Drivers/AtaAtapi/AtaAtapiPassThru.c b/Drivers/AtaAtapi/AtaAtapiPassThru.c index b23c04e0f..3d54d3d9e 100644 --- a/Drivers/AtaAtapi/AtaAtapiPassThru.c +++ b/Drivers/AtaAtapi/AtaAtapiPassThru.c @@ -214,7 +214,7 @@ AtaPassThruPassThruExecute ( // Status = GetIdeRegisterIoAddr (Instance->PciIo, Instance->IdeRegisters); // DBG(L"GetIdeRegisterIoAddr Status=%r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } #endif @@ -446,7 +446,7 @@ AsyncNonBlockingTransferRoutine ( } else { RemoveEntryList (&Task->Link); gBS->SignalEvent (Task->Event); - FreePool (Task); + FreePool(Task); } } } @@ -481,7 +481,7 @@ InitializeAtaAtapiPassThru ( &gAtaAtapiPassThruComponentName, &gAtaAtapiPassThruComponentName2 ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } @@ -554,7 +554,7 @@ AtaAtapiPassThruSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EFI_ALREADY_STARTED is also an error // @@ -579,7 +579,7 @@ AtaAtapiPassThruSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EFI_ALREADY_STARTED is also an error // @@ -607,7 +607,7 @@ AtaAtapiPassThruSupported ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -621,7 +621,7 @@ AtaAtapiPassThruSupported ( sizeof (PciData.Hdr.ClassCode), PciData.Hdr.ClassCode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -698,7 +698,7 @@ AtaAtapiPassThruStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG (L"Open Ide_Controller_Init Error, Status=%r", Status); goto ErrorExit; } @@ -711,7 +711,7 @@ AtaAtapiPassThruStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "Get Pci_Io Protocol Error, Status=%r", Status)); goto ErrorExit; } @@ -723,7 +723,7 @@ AtaAtapiPassThruStart ( &OriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG(L"OriginalPciAttributes status=%r\n", Status); goto ErrorExit; } @@ -734,7 +734,7 @@ AtaAtapiPassThruStart ( 0, &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -744,7 +744,7 @@ AtaAtapiPassThruStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -774,7 +774,7 @@ AtaAtapiPassThruStart ( Instance, &Instance->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -782,7 +782,7 @@ AtaAtapiPassThruStart ( // Set 1ms timer. // Status = gBS->SetTimer (Instance->TimerEvent, TimerPeriodic, 10000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -790,7 +790,7 @@ AtaAtapiPassThruStart ( // Enumerate all inserted ATA devices. // Status = EnumerateAttachedDevice (Instance); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -800,7 +800,7 @@ AtaAtapiPassThruStart ( &gEfiExtScsiPassThruProtocolGuid, &(Instance->ExtScsiPassThru), NULL ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // DBG(L"AtaPassThru success\n"); return Status; @@ -825,7 +825,7 @@ ErrorExit: DestroyDeviceInfoList(Instance); if (Instance != NULL) { - FreePool (Instance); + FreePool(Instance); } return EFI_UNSUPPORTED; } @@ -883,7 +883,7 @@ AtaAtapiPassThruStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -896,7 +896,7 @@ AtaAtapiPassThruStop ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -969,7 +969,7 @@ AtaAtapiPassThruStop ( 0, &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; PciIo->Attributes ( PciIo, @@ -988,9 +988,9 @@ AtaAtapiPassThruStop ( Instance->OriginalPciAttributes, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - FreePool (Instance); + FreePool(Instance); return Status; } @@ -1078,7 +1078,7 @@ CreateNewDeviceInfo ( // DBG(L" IdentifyData copied\n"); DeviceInfo->IdentifyData = AllocateCopyPool (sizeof (EFI_IDENTIFY_DATA), IdentifyData); if (DeviceInfo->IdentifyData == NULL) { - FreePool (DeviceInfo); + FreePool(DeviceInfo); return EFI_OUT_OF_RESOURCES; } } @@ -1111,9 +1111,9 @@ DestroyDeviceInfoList ( RemoveEntryList (&DeviceInfo->Link); if (DeviceInfo->IdentifyData != NULL) { - FreePool (DeviceInfo->IdentifyData); + FreePool(DeviceInfo->IdentifyData); } - FreePool (DeviceInfo); + FreePool(DeviceInfo); } } @@ -1154,7 +1154,7 @@ DestroyAsynTaskList ( Task->Packet->Asb->AtaStatus = 0x01; gBS->SignalEvent (Task->Event); } - FreePool (Task); + FreePool(Task); } } gBS->RestoreTPL (OldTpl); @@ -1193,8 +1193,8 @@ EnumerateAttachedDevice ( sizeof (PciData.Hdr.ClassCode), PciData.Hdr.ClassCode ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -1210,7 +1210,7 @@ EnumerateAttachedDevice ( Status = IdeModeInitialization (Instance); // DBG(L"IdeModeInitialization Status=%r\n", Status); //anyway goto Done - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; // goto Done; } @@ -1229,7 +1229,7 @@ EnumerateAttachedDevice ( Status = AhciModeInitialization (Instance); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; // goto Done; } @@ -2082,7 +2082,7 @@ ExtScsiPassThruPassThru ( // Status = GetIdeRegisterIoAddr (Instance->PciIo, Instance->IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG(L"GetIdeRegisterIoAddr Status=%r\n", Status); return Status; } @@ -2104,7 +2104,7 @@ ExtScsiPassThruPassThru ( // // If the cmd doesn't get executed correctly, then check sense data. // - if (EFI_ERROR (Status) && (Packet->SenseDataLength != 0) && (*((UINT8*)Packet->Cdb) != ATA_CMD_REQUEST_SENSE)) { + if (EFI_ERROR(Status) && (Packet->SenseDataLength != 0) && (*((UINT8*)Packet->Cdb) != ATA_CMD_REQUEST_SENSE)) { PtrSenseData = AllocateAlignedPages (EFI_SIZE_TO_PAGES (sizeof (EFI_SCSI_SENSE_DATA)), This->Mode->IoAlign); if (PtrSenseData == NULL) { return EFI_DEVICE_ERROR; @@ -2119,7 +2119,7 @@ ExtScsiPassThruPassThru ( sizeof (EFI_SCSI_SENSE_DATA), Packet->Timeout ); - if (EFI_ERROR (SenseStatus)) { + if (EFI_ERROR(SenseStatus)) { break; } diff --git a/Drivers/AtaAtapi/ComponentName.c b/Drivers/AtaAtapi/ComponentName.c index c3f7738d4..b1f81993d 100644 --- a/Drivers/AtaAtapi/ComponentName.c +++ b/Drivers/AtaAtapi/ComponentName.c @@ -212,7 +212,7 @@ AtaAtapiPassThruComponentNameGetControllerName ( gAtaAtapiPassThruDriverBinding.DriverBindingHandle, &gEfiIdeControllerInitProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -227,7 +227,7 @@ AtaAtapiPassThruComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } diff --git a/Drivers/AtaAtapi/IdeMode.c b/Drivers/AtaAtapi/IdeMode.c index 09f76b4cf..50fb61149 100644 --- a/Drivers/AtaAtapi/IdeMode.c +++ b/Drivers/AtaAtapi/IdeMode.c @@ -218,7 +218,7 @@ IdeWritePortWMultiple ( ); if (AlignedBuffer != Buffer) { - gBS->FreePool (WorkingBuffer); + gBS->FreePool(WorkingBuffer); } } @@ -283,7 +283,7 @@ IdeReadPortWMultiple ( // Copy data to user buffer // CopyMem (Buffer, AlignedBuffer, Size); - gBS->FreePool (WorkingBuffer); + gBS->FreePool(WorkingBuffer); } } @@ -1162,7 +1162,7 @@ GetIdeRegisterIoAddr ( &PciData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1335,7 +1335,7 @@ AtaIssueCommand ( AtaCommand = AtaCommandBlock->AtaCommand; Status = WaitForBSYClear (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1355,7 +1355,7 @@ AtaIssueCommand ( if (LBAMidReg == 0) { Status = DRDYReady (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } } @@ -1365,7 +1365,7 @@ AtaIssueCommand ( // Before write to all the following registers, BSY and DRQ must be 0. // Status = DRQClear2 (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1460,7 +1460,7 @@ AtaPioDataInOut ( // Issue ATA command // Status = AtaIssueCommand (PciIo, IdeRegisters, AtaCommandBlock, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1494,13 +1494,13 @@ AtaPioDataInOut ( // Poll DRQ bit set, data transfer can be performed only when DRQ is ready // Status = DRQReady2 (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1533,13 +1533,13 @@ AtaPioDataInOut ( } Status = DRQClear (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Exit: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG(L"DataInOut Status=%r WordCount=%d\n", Status, WordCount); } // @@ -1592,7 +1592,7 @@ AtaNonDataCommandIn ( // Issue ATA command // Status = AtaIssueCommand (PciIo, IdeRegisters, AtaCommandBlock, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1601,13 +1601,13 @@ AtaNonDataCommandIn ( // Wait for command completion // Status = WaitForBSYClear (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1659,7 +1659,7 @@ AtaUdmStatusWait ( do { Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; break; } @@ -1715,7 +1715,7 @@ AtaUdmStatusCheck ( Task->RetryTimes--; Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1884,7 +1884,7 @@ AtaUdmaInOut ( &PrdTableMapAddr, &PrdTableMap ); - if (EFI_ERROR (Status) || (ByteCount != EFI_PAGES_TO_SIZE (PageCount))) { + if (EFI_ERROR(Status) || (ByteCount != EFI_PAGES_TO_SIZE (PageCount))) { // // If the data length actually mapped is not equal to the requested amount, // it means the DMA operation may be broken into several discontinuous smaller chunks. @@ -1914,7 +1914,7 @@ AtaUdmaInOut ( &BufferMapAddress, &BufferMap ); - if (EFI_ERROR (Status) || (ByteCount != DataLength)) { + if (EFI_ERROR(Status) || (ByteCount != DataLength)) { PciIo->Unmap (PciIo, PrdTableMap); FreeAlignedPages(PrdBaseAddr, PageCount); return EFI_OUT_OF_RESOURCES; @@ -2001,13 +2001,13 @@ AtaUdmaInOut ( // Status = AtaIssueCommand (PciIo, IdeRegisters, AtaCommandBlock, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } // Status = CheckStatusRegister (PciIo, IdeRegisters); -// if (EFI_ERROR (Status)) { +// if (EFI_ERROR(Status)) { // Status = EFI_NOT_READY; // goto Exit; // } @@ -2093,7 +2093,7 @@ Exit: DumpAllIdeRegisters (PciIo, IdeRegisters, AtaStatusBlock); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG(L"AtaUdmaInOut Status=%r", Status); } @@ -2195,12 +2195,12 @@ AtaPacketReadWrite ( // to see whether indicates device is ready to transfer data. // Status = DRQReady2 (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_READY; } Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_READY; } @@ -2234,7 +2234,7 @@ AtaPacketReadWrite ( // read status register to check whether error happens. // Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -2255,7 +2255,7 @@ AtaPacketReadWrite ( // read status register to check whether error happens. // Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -2263,7 +2263,7 @@ AtaPacketReadWrite ( // After data transfer is completed, normally, DRQ bit should clear. // Status = DRQClear2 (PciIo, IdeRegisters, Timeout); //or DRQClear ? - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -2337,12 +2337,12 @@ AtaPacketCommandExecute ( // Issue ATA PACKET command firstly // Status = AtaIssueCommand (PciIo, IdeRegisters, &AtaCommandBlock, Packet->Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = DRQReady (PciIo, IdeRegisters, Packet->Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2546,7 +2546,7 @@ IdeAtaSmartReturnStatusCheck ( ); // DBG(L"Send S.M.A.R.T DeviceHead=%x Status=%r\n", AtaCommandBlock.AtaDeviceHead, Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_ATA_BUS_SMART_DISABLED) @@ -2658,7 +2658,7 @@ IdeAtaSmartSupport ( ); DBG(L"Send S.M.A.R.T enable DeviceHead=%x Status=%r\n", AtaCommandBlock.AtaDeviceHead, Status); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Send S.M.A.R.T AutoSave command to device // @@ -2680,7 +2680,7 @@ IdeAtaSmartSupport ( NULL ); DBG(L"Send S.M.A.R.T autosave DeviceHead=%x Status=%r\n", AtaCommandBlock.AtaDeviceHead, Status); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { /*Status = */IdeAtaSmartReturnStatusCheck ( Instance, Channel, @@ -2917,7 +2917,7 @@ DetectAndConfigIdeDevice ( IdeWritePortB (PciIo, IdeRegisters->CmdOrStatus, ATA_CMD_EXEC_DRIVE_DIAG); Status = WaitForBSYClear (PciIo, IdeRegisters, 5000000); //discussable. The value from Intel/Ide.c=35000000 - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG((EFI_D_ERROR, "New detecting method: Send Execute Diagnostic Command: WaitForBSYClear: Status: %d\n", Status)); DBG(L"New detecting method: Send Execute Diagnostic Command: WaitForBSYClear: Status: %r\n", Status); continue; @@ -2995,7 +2995,7 @@ DetectAndConfigIdeDevice ( // // if identifying ata device is failure, then try to send identify packet cmd. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_NOT_DETECTED)); DeviceType = EfiIdeCdrom; @@ -3006,13 +3006,13 @@ DetectAndConfigIdeDevice ( // // if identifying atapi device is failure, then try to send identify cmd. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DeviceType = EfiIdeHarddisk; Status = AtaIdentify (Instance, IdeChannel, IdeDevice, &Buffer, NULL); } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No device is found at this port // @@ -3054,7 +3054,7 @@ DetectAndConfigIdeDevice ( IdeDevice, &SupportedModes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "Calculate Mode Fail, Status = %r\n", Status)); // DBG(L"Calculate Mode Fail, Status = %r\n", Status); continue; @@ -3074,7 +3074,7 @@ DetectAndConfigIdeDevice ( if (SupportedModes->ExtModeCount == 0){ Status = SetDeviceTransferMode (Instance, IdeChannel, IdeDevice, &TransferMode, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status)); DBG(L"Set PIO transfer Mode %d Fail, Status = %r\n", TransferMode.ModeNumber, Status); FreePool(SupportedModes); @@ -3093,7 +3093,7 @@ DetectAndConfigIdeDevice ( TransferMode.ModeNumber = (UINT8) (SupportedModes->UdmaMode.Mode); Status = SetDeviceTransferMode (Instance, IdeChannel, IdeDevice, &TransferMode, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status)); DBG(L"Set DMA transfer Mode %d Fail, Status = %r\n", TransferMode.ModeNumber, Status); FreePool(SupportedModes); @@ -3104,7 +3104,7 @@ DetectAndConfigIdeDevice ( TransferMode.ModeNumber = (UINT8) SupportedModes->MultiWordDmaMode.Mode; Status = SetDeviceTransferMode (Instance, IdeChannel, IdeDevice, &TransferMode, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status)); DBG(L"Set transfer Mode Fail, Status = %r\n", Status); FreePool(SupportedModes); @@ -3139,7 +3139,7 @@ DetectAndConfigIdeDevice ( // Now insert the device into device list. // Status = CreateNewDeviceInfo (Instance, IdeChannel, IdeDevice, DeviceType, &Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG(L"CreateNewDeviceInfo fails Status=%r\n", Status); continue; } @@ -3182,7 +3182,7 @@ IdeModeInitialization ( // Obtain IDE IO port registers' base addresses // Status = GetIdeRegisterIoAddr (PciIo, Instance->IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG(L"GetIdeRegisterIoAddr fails Status=%r\n", Status); goto ErrorExit; } @@ -3199,7 +3199,7 @@ IdeModeInitialization ( &ChannelEnabled, &MaxDevices ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "[GetChannel, Status=%x]", Status)); // DBG(L"[GetChannel, Status=%r]", Status); continue; diff --git a/Drivers/AtaBus/AtaBus.c b/Drivers/AtaBus/AtaBus.c index 955d86e9d..f14492056 100644 --- a/Drivers/AtaBus/AtaBus.c +++ b/Drivers/AtaBus/AtaBus.c @@ -175,7 +175,7 @@ ReleaseAtaResources ( FreeAlignedBuffer (AtaDevice->Asb, sizeof (EFI_ATA_STATUS_BLOCK)); FreeAlignedBuffer (AtaDevice->IdentifyData, sizeof (ATA_IDENTIFY_DATA)); if (AtaDevice->DevicePath != NULL) { - FreePool (AtaDevice->DevicePath); + FreePool(AtaDevice->DevicePath); } OldTpl = gBS->RaiseTPL (TPL_NOTIFY); if (!IsListEmpty (&AtaDevice->AtaSubTaskList)) { @@ -205,7 +205,7 @@ ReleaseAtaResources ( AtaTask = ATA_AYNS_TASK_FROM_ENTRY (DelEntry); RemoveEntryList (DelEntry); - FreePool (AtaTask); + FreePool(AtaTask); } } if (AtaDevice->ExitBootServiceEvent != NULL) { @@ -214,7 +214,7 @@ ReleaseAtaResources ( } gBS->RestoreTPL (OldTpl); - FreePool (AtaDevice); + FreePool(AtaDevice); } /** @@ -249,7 +249,7 @@ ClearInterrupt ( // Obtain IDE IO port registers' base addresses in case switch native<->legacy // /* Status = ReassignIdeResources (IdeDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; }*/ @@ -265,7 +265,7 @@ ClearInterrupt ( // Status = AtaDev->BlockIo.Reset(AtaDev->BlockIo, FALSE); // Status = AtaPassThru->ResetPort(AtaPassThru->ResetPort, 0); Status = ResetAtaDevice(AtaDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } /* @@ -358,7 +358,7 @@ RegisterAtaDevice ( // AtaPassThru = AtaBusDriverData->AtaPassThru; Status = AtaPassThru->BuildDevicePath (AtaPassThru, Port, PortMultiplierPort, &NewDevicePathNode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -371,9 +371,9 @@ RegisterAtaDevice ( DeviceHandle = NULL; RemainingDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { + if (!EFI_ERROR(Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { Status = EFI_ALREADY_STARTED; - FreePool (DevicePath); + FreePool(DevicePath); goto Done; } @@ -416,7 +416,7 @@ RegisterAtaDevice ( // Try to identify the ATA device via the ATA pass through command. // Status = DiscoverAtaDevice (AtaDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -430,7 +430,7 @@ RegisterAtaDevice ( AtaDevice->ModelName, TRUE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -441,7 +441,7 @@ RegisterAtaDevice ( AtaDevice->ModelName, FALSE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -465,7 +465,7 @@ RegisterAtaDevice ( &AtaDevice->DiskInfo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -482,7 +482,7 @@ RegisterAtaDevice ( EFI_NATIVE_INTERFACE, &AtaDevice->StorageSecurity ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } DEBUG ((EFI_D_INFO, "Successfully Install Storage Security Protocol on the ATA device\n")); @@ -523,10 +523,10 @@ RegisterAtaDevice ( Done: if (NewDevicePathNode != NULL) { - FreePool (NewDevicePathNode); + FreePool(NewDevicePathNode); } - if (EFI_ERROR (Status) && (AtaDevice != NULL)) { + if (EFI_ERROR(Status) && (AtaDevice != NULL)) { ReleaseAtaResources (AtaDevice); // DEBUG ((EFI_D_ERROR | EFI_D_INIT, "Failed to initialize Port %x PortMultiplierPort %x, status = %r\n", Port, PortMultiplierPort, Status)); DBG(L"Failed to initialize Port %x PortMultiplierPort %x, status = %r\n", Port, PortMultiplierPort, Status); @@ -574,7 +574,7 @@ UnregisterAtaDevice ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Locate BlockIo2 protocol // @@ -586,7 +586,7 @@ UnregisterAtaDevice ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -627,7 +627,7 @@ UnregisterAtaDevice ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiAtaPassThruProtocolGuid, @@ -651,13 +651,13 @@ UnregisterAtaDevice ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->UninstallProtocolInterface ( Handle, &gEfiStorageSecurityCommandProtocolGuid, &AtaDevice->StorageSecurity ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiAtaPassThruProtocolGuid, @@ -748,7 +748,7 @@ AtaBusDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -757,7 +757,7 @@ AtaBusDriverBindingSupported ( // if ((RemainingDevicePath != NULL) && !IsDevicePathEnd (RemainingDevicePath)) { Status = AtaPassThru->GetDevice (AtaPassThru, RemainingDevicePath, &Port, &PortMultiplierPort); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -847,7 +847,7 @@ AtaBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -859,7 +859,7 @@ AtaBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if ((EFI_ERROR (Status)) && (Status != EFI_ALREADY_STARTED)) { + if ((EFI_ERROR(Status)) && (Status != EFI_ALREADY_STARTED)) { goto ErrorExit; } @@ -884,7 +884,7 @@ AtaBusDriverBindingStart ( AtaBusDriverData, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -897,7 +897,7 @@ AtaBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AtaBusDriverData = NULL; goto ErrorExit; } @@ -907,7 +907,7 @@ AtaBusDriverBindingStart ( Port = 0xFFFF; while (TRUE) { Status = AtaPassThru->GetNextPort (AtaPassThru, &Port); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // We cannot find more legal port then we are done. // @@ -917,7 +917,7 @@ AtaBusDriverBindingStart ( PortMultiplierPort = 0xFFFF; while (TRUE) { Status = AtaPassThru->GetNextDevice (AtaPassThru, Port, &PortMultiplierPort); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // We cannot find more legal port multiplier port number for ATA device // on the port, then we are done. @@ -930,7 +930,7 @@ AtaBusDriverBindingStart ( Status = EFI_SUCCESS; } else if (!IsDevicePathEnd (RemainingDevicePath)) { Status = AtaPassThru->GetDevice (AtaPassThru, RemainingDevicePath, &Port, &PortMultiplierPort); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = RegisterAtaDevice (AtaBusDriverData,Port, PortMultiplierPort); } } @@ -946,7 +946,7 @@ ErrorExit: AtaBusDriverData, NULL ); - FreePool (AtaBusDriverData); + FreePool(AtaBusDriverData); } gBS->CloseProtocol ( @@ -1010,14 +1010,14 @@ AtaBusDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Controller, &gEfiCallerIdGuid, AtaBusDriverData, NULL ); - FreePool (AtaBusDriverData); + FreePool(AtaBusDriverData); } gBS->CloseProtocol ( @@ -1035,7 +1035,7 @@ AtaBusDriverBindingStop ( for (Index = 0; Index < NumberOfChildren; Index++) { Status = UnregisterAtaDevice (This, Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -1076,7 +1076,7 @@ AtaBlockIoReset ( Status = ResetAtaDevice (AtaDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -1299,7 +1299,7 @@ AtaBlockIoResetEx ( Status = ResetAtaDevice (AtaDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -1798,8 +1798,8 @@ InitializeAtaBus( &gAtaBusComponentName, &gAtaBusComponentName2 ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -1815,7 +1815,7 @@ InitializeAtaBus( &mMorControl ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_INFO, "AtaBus:gEfiMemoryOverwriteControlDataGuid doesn't exist!!***\n")); mHasMor = FALSE; mMorControl = 0; @@ -1891,7 +1891,7 @@ InitiateTPerReset ( Buffer, // PayloadBuffer &XferSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1928,7 +1928,7 @@ InitiateTPerReset ( &XferSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1979,7 +1979,7 @@ InitiateTPerReset ( Buffer // PayloadBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "Send TPer Reset Command Successfully !\n")); } else { DEBUG ((EFI_D_INFO, "Send TPer Reset Command Fail !\n")); diff --git a/Drivers/AtaBus/AtaPassThruExecute.c b/Drivers/AtaBus/AtaPassThruExecute.c index ae23f6d2c..470ec2647 100644 --- a/Drivers/AtaBus/AtaPassThruExecute.c +++ b/Drivers/AtaBus/AtaPassThruExecute.c @@ -437,13 +437,13 @@ DiscoverAtaDevice ( Retry = MAX_RETRY_TIMES; do { Status = AtaDevicePassThru (AtaDevice, NULL, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The command is issued successfully // Status = IdentifyAtaDevice (AtaDevice); //Slice - this change is appeared in rev 13908 -// if (!EFI_ERROR (Status)) { +// if (!EFI_ERROR(Status)) { return Status; // } } @@ -592,10 +592,10 @@ FreeAtaSubTask ( FreeAlignedBuffer (Task->Packet.Asb, sizeof (EFI_ATA_STATUS_BLOCK)); } if (Task->Packet.Acb != NULL) { - FreePool (Task->Packet.Acb); + FreePool(Task->Packet.Acb); } - FreePool (Task); + FreePool(Task); } /** @@ -660,8 +660,8 @@ AtaNonBlockingCallBack ( // DEBUG ((EFI_D_BLKIO, "Signal the upper layer event!\n")); } - FreePool (Task->UnsignalledEventCount); - FreePool (Task->IsError); + FreePool(Task->UnsignalledEventCount); + FreePool(Task->IsError); // @@ -680,12 +680,12 @@ AtaNonBlockingCallBack ( AtaTask->IsWrite, AtaTask->Token ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AtaTask->Token->TransactionStatus = Status; gBS->SignalEvent (AtaTask->Token->Event); } RemoveEntryList (Entry); - FreePool (AtaTask); + FreePool(AtaTask); } } @@ -797,7 +797,7 @@ AccessAtaDevice( IsError = AllocateZeroPool (sizeof (BOOLEAN)); if (IsError == NULL) { - FreePool (EventCount); + FreePool(EventCount); return EFI_OUT_OF_RESOURCES; } *IsError = FALSE; @@ -857,7 +857,7 @@ AccessAtaDevice( // If resource allocation fail, the un-signalled event count should equal to // the original one minus the unassigned subtasks number. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto EXIT; } @@ -870,7 +870,7 @@ AccessAtaDevice( Status = TransferAtaDevice (AtaDevice, NULL, Buffer, StartLba, (UINT32) TransferBlockNumber, IsWrite, NULL); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -884,15 +884,15 @@ EXIT: // // Release resource at non-blocking mode. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); Token->TransactionStatus = Status; *EventCount = (*EventCount) - (TempCount - Index); *IsError = TRUE; if (*EventCount == 0) { - FreePool (EventCount); - FreePool (IsError); + FreePool(EventCount); + FreePool(IsError); } if (SubTask != NULL) { @@ -1007,7 +1007,7 @@ TrustTransferAtaDevice ( } CopyMem (NewBuffer, Buffer, TransferLength); - FreePool (Buffer); + FreePool(Buffer); Buffer = NewBuffer; } Packet->OutDataBuffer = Buffer; diff --git a/Drivers/AtaBus/ComponentName.c b/Drivers/AtaBus/ComponentName.c index 599e554f6..7bbc1fb99 100644 --- a/Drivers/AtaBus/ComponentName.c +++ b/Drivers/AtaBus/ComponentName.c @@ -198,7 +198,7 @@ AtaBusComponentNameGetControllerName ( gAtaBusDriverBinding.DriverBindingHandle, &gEfiAtaPassThruProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -209,7 +209,7 @@ AtaBusComponentNameGetControllerName ( ChildHandle, &gEfiAtaPassThruProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -238,7 +238,7 @@ AtaBusComponentNameGetControllerName ( ChildHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } AtaDevice = ATA_DEVICE_FROM_BLOCK_IO (BlockIo); diff --git a/Drivers/AudioDxe/HdaCodec/HdaCodec.c b/Drivers/AudioDxe/HdaCodec/HdaCodec.c index 0a3772a69..d767ac32d 100644 --- a/Drivers/AudioDxe/HdaCodec/HdaCodec.c +++ b/Drivers/AudioDxe/HdaCodec/HdaCodec.c @@ -1086,7 +1086,7 @@ HdaCodecDriverBindingStart( // Open Device Path protocol. Status = gBS->OpenProtocol(ControllerHandle, &gEfiDevicePathProtocolGuid, (VOID**)&HdaCodecDevicePath, This->DriverBindingHandle, ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) goto CLOSE_CODEC; // Allocate codec device. HdaCodecDev = AllocateZeroPool(sizeof(HDA_CODEC_DEV)); @@ -1102,18 +1102,18 @@ HdaCodecDriverBindingStart( HdaCodecDev->ControllerHandle = ControllerHandle; // Probe codec. Status = HdaCodecProbeCodec(HdaCodecDev); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) goto FREE_CODEC; // Get ports. Status = HdaCodecParsePorts(HdaCodecDev); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) goto FREE_CODEC; // Publish protocols. Status = HdaCodecInstallProtocols(HdaCodecDev); ASSERT_EFI_ERROR(Status); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) goto FREE_CODEC; // Success. diff --git a/Drivers/AudioDxe/HdaController/HdaController.c b/Drivers/AudioDxe/HdaController/HdaController.c index 39eb6a452..ee7b36764 100644 --- a/Drivers/AudioDxe/HdaController/HdaController.c +++ b/Drivers/AudioDxe/HdaController/HdaController.c @@ -148,7 +148,7 @@ HdaControllerInitPciHw( // Get vendor and device IDs of PCI device. Status = PciIo->Pci.Read(PciIo, EfiPciIoWidthUint32, PCI_VENDOR_ID_OFFSET, 1, &HdaControllerDev->VendorId); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; // DEBUG((DEBUG_INFO, "HdaControllerInitPciHw(): controller %4X:%4X\n", @@ -158,24 +158,24 @@ HdaControllerInitPciHw( if (GET_PCI_VENDOR_ID(HdaControllerDev->VendorId) == VEN_INTEL_ID) { // Set TC0 in TCSEL register. Status = PciIo->Pci.Read(PciIo, EfiPciIoWidthUint8, PCI_HDA_TCSEL_OFFSET, 1, &HdaTcSel); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; HdaTcSel &= PCI_HDA_TCSEL_TC0_MASK; Status = PciIo->Pci.Write(PciIo, EfiPciIoWidthUint8, PCI_HDA_TCSEL_OFFSET, 1, &HdaTcSel); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; } // Get device control PCI register. Status = PciIo->Pci.Read(PciIo, EfiPciIoWidthUint16, PCI_HDA_DEVC_OFFSET, 1, &HdaDevC); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; // If No Snoop is currently enabled, disable it. if (HdaDevC & PCI_HDA_DEVC_NOSNOOPEN) { HdaDevC &= ~PCI_HDA_DEVC_NOSNOOPEN; Status = PciIo->Pci.Write(PciIo, EfiPciIoWidthUint16, PCI_HDA_DEVC_OFFSET, 1, &HdaDevC); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; } @@ -707,13 +707,13 @@ HdaControllerDriverBindingStart( // Open PCI I/O protocol. Status = gBS->OpenProtocol(ControllerHandle, &gEfiPciIoProtocolGuid, (VOID**)&PciIo, This->DriverBindingHandle, ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; // Open Device Path protocol. Status = gBS->OpenProtocol(ControllerHandle, &gEfiDevicePathProtocolGuid, (VOID**)&HdaControllerDevicePath, This->DriverBindingHandle, ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) goto CLOSE_PCIIO; // Allocate controller device. diff --git a/Drivers/DVDBus/ScsiBus.c b/Drivers/DVDBus/ScsiBus.c index 6d1a1e376..ad096c010 100644 --- a/Drivers/DVDBus/ScsiBus.c +++ b/Drivers/DVDBus/ScsiBus.c @@ -156,7 +156,7 @@ InitializeScsiBus( &gScsiBusComponentName, &gScsiBusComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -269,7 +269,7 @@ SCSIBusDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -349,7 +349,7 @@ SCSIBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (DevicePathStatus) && (DevicePathStatus != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(DevicePathStatus) && (DevicePathStatus != EFI_ALREADY_STARTED)) { return DevicePathStatus; } @@ -383,7 +383,7 @@ SCSIBusDriverBindingStart ( // // Fail to open EFI PassThru Protocol, Close the DevicePathProtocol if it is opened by this time. // - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { if (!EFI_ERROR(DevicePathStatus)) { gBS->CloseProtocol ( Controller, @@ -444,7 +444,7 @@ SCSIBusDriverBindingStart ( EFI_NATIVE_INTERFACE, &ScsiBusDev->BusIdentify ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } } else { @@ -461,7 +461,7 @@ SCSIBusDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ScsiBusDev = SCSI_BUS_CONTROLLER_DEVICE_FROM_THIS (BusIdentify); @@ -486,7 +486,7 @@ SCSIBusDriverBindingStart ( Status = ScsiBusDev->ScsiInterface->GetTargetLun (ScsiBusDev->ScsiInterface, RemainingDevicePath, &ScsiTargetId.ScsiId.Scsi, &Lun); } DBG(L"GetTargetLun=%d status=%r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -510,7 +510,7 @@ SCSIBusDriverBindingStart ( Status = ScsiBusDev->ScsiInterface->GetNextDevice (ScsiBusDev->ScsiInterface, &ScsiTargetId.ScsiId.Scsi, &Lun); } DBG(L"GetNextDevice=%d status=%r\n", Lun, Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // no legal Pun and Lun found any more // @@ -544,7 +544,7 @@ SCSIBusDriverBindingStart ( ErrorExit: if (ScsiBusDev != NULL) { - FreePool (ScsiBusDev); + FreePool(ScsiBusDev); } if (ExtScsiSupport) { @@ -554,7 +554,7 @@ ErrorExit: This->DriverBindingHandle, Controller ); - if (!EFI_ERROR (PassThruStatus)) { + if (!EFI_ERROR(PassThruStatus)) { gBS->CloseProtocol ( Controller, &gEfiScsiPassThruProtocolGuid, @@ -623,7 +623,7 @@ SCSIBusDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -677,7 +677,7 @@ SCSIBusDriverBindingStop ( This->DriverBindingHandle, Controller ); - FreePool (ScsiBusDev); + FreePool(ScsiBusDev); return EFI_SUCCESS; } @@ -693,7 +693,7 @@ SCSIBusDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; continue; } @@ -727,7 +727,7 @@ SCSIBusDriverBindingStop ( &ScsiIoDevice->ScsiIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; if (ScsiIoDevice->ExtScsiSupport) { gBS->OpenProtocol ( @@ -749,7 +749,7 @@ SCSIBusDriverBindingStop ( ); } } else { - FreePool (ScsiIoDevice); + FreePool(ScsiIoDevice); } } @@ -1139,7 +1139,7 @@ ScsiScanCreateDevice ( DeviceHandle = NULL; RemainingDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { + if (!EFI_ERROR(Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { // // The device has been started, directly return to fast boot. // @@ -1192,7 +1192,7 @@ ScsiScanCreateDevice ( &ScsiIoDevice->ScsiIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } else { if (ScsiBusDev->ExtScsiSupport) { @@ -1224,14 +1224,14 @@ ErrorExit: // ScsiPassThru->BuildDevicePath() function; It is no longer used // after AppendDevicePathNode,so free the memory it occupies. // - FreePool (ScsiDevicePath); + FreePool(ScsiDevicePath); if (DevicePath != NULL) { - FreePool (DevicePath); + FreePool(DevicePath); } if (ScsiIoDevice != NULL) { - FreePool (ScsiIoDevice); + FreePool(ScsiIoDevice); } return Status; @@ -1293,7 +1293,7 @@ DiscoverScsiDevice ( FALSE ); DBG(L"ScsiInquiryCommand Status=%r\n", Status); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } else if ((Status == EFI_BAD_BUFFER_SIZE) || (Status == EFI_INVALID_PARAMETER) || diff --git a/Drivers/DVDDisk/ComponentName.c b/Drivers/DVDDisk/ComponentName.c index 09de8920a..6388382a7 100644 --- a/Drivers/DVDDisk/ComponentName.c +++ b/Drivers/DVDDisk/ComponentName.c @@ -199,7 +199,7 @@ ScsiDiskComponentNameGetControllerName ( gScsiDiskDriverBinding.DriverBindingHandle, &gEfiScsiIoProtocolGuid //gEfiIdeControllerInitProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -214,7 +214,7 @@ ScsiDiskComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/DVDDisk/ScsiDisk.c b/Drivers/DVDDisk/ScsiDisk.c index c4898a799..83cc023c5 100644 --- a/Drivers/DVDDisk/ScsiDisk.c +++ b/Drivers/DVDDisk/ScsiDisk.c @@ -106,7 +106,7 @@ InitializeScsiDisk( &gScsiDiskComponentName, &gScsiDiskComponentName2 ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; @@ -151,12 +151,12 @@ ScsiDiskDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = ScsiIo->GetDeviceType (ScsiIo, &DeviceType); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((DeviceType == EFI_SCSI_TYPE_DISK) || (DeviceType == EFI_SCSI_TYPE_CDROM)) { Status = EFI_SUCCESS; } else { @@ -225,8 +225,8 @@ ScsiDiskDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { - FreePool (ScsiDiskDevice); + if (EFI_ERROR(Status)) { + FreePool(ScsiDiskDevice); return Status; } @@ -266,7 +266,7 @@ ScsiDiskDriverBindingStart ( This->DriverBindingHandle, Controller ); - FreePool (ScsiDiskDevice); + FreePool(ScsiDiskDevice); return EFI_OUT_OF_RESOURCES; } @@ -276,19 +276,19 @@ ScsiDiskDriverBindingStart ( MaxRetry = 2; for (Index = 0; Index < MaxRetry; Index++) { Status = ScsiDiskInquiryDevice (ScsiDiskDevice, &NeedRetry); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } if (!NeedRetry) { - FreePool (ScsiDiskDevice->SenseData); + FreePool(ScsiDiskDevice->SenseData); gBS->CloseProtocol ( Controller, &gEfiScsiIoProtocolGuid, This->DriverBindingHandle, Controller ); - FreePool (ScsiDiskDevice); + FreePool(ScsiDiskDevice); return EFI_DEVICE_ERROR; } } @@ -297,7 +297,7 @@ ScsiDiskDriverBindingStart ( // retrieve media capacity // Status = ScsiDiskDetectMedia (ScsiDiskDevice, MustReadCapacity, &Temp); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Determine if Block IO should be produced on this controller handle // @@ -332,8 +332,8 @@ ScsiDiskDriverBindingStart ( } } - gBS->FreePool (ScsiDiskDevice->SenseData); - gBS->FreePool (ScsiDiskDevice); + gBS->FreePool(ScsiDiskDevice->SenseData); + gBS->FreePool(ScsiDiskDevice); gBS->CloseProtocol ( Controller, &gEfiScsiIoProtocolGuid, @@ -385,7 +385,7 @@ ScsiDiskDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -398,7 +398,7 @@ ScsiDiskDriverBindingStop ( &ScsiDiskDevice->DiskInfo, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiScsiIoProtocolGuid, @@ -446,7 +446,7 @@ ScsiDiskReset ( Status = ScsiDiskDevice->ScsiIo->ResetDevice (ScsiDiskDevice->ScsiIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -457,7 +457,7 @@ ScsiDiskReset ( Status = ScsiDiskDevice->ScsiIo->ResetBus (ScsiDiskDevice->ScsiIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -509,7 +509,7 @@ ScsiDiskReadBlocks ( if (!IS_DEVICE_FIXED(ScsiDiskDevice)) { Status = ScsiDiskDetectMedia (ScsiDiskDevice, FALSE, &MediaChange); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -627,7 +627,7 @@ ScsiDiskWriteBlocks ( if (!IS_DEVICE_FIXED(ScsiDiskDevice)) { Status = ScsiDiskDetectMedia (ScsiDiskDevice, FALSE, &MediaChange); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -772,12 +772,12 @@ ScsiDiskDetectMedia ( NULL, &TimeoutEvt ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->SetTimer (TimeoutEvt, TimerRelative, EFI_TIMER_PERIOD_SECONDS(120)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -786,21 +786,21 @@ ScsiDiskDetectMedia ( // If the sense data shows the drive is not ready or reset before, we need poll the device status again. // We limit the upper boundary to 120 seconds. // - while (EFI_ERROR (gBS->CheckEvent (TimeoutEvt))) { + while (EFI_ERROR(gBS->CheckEvent (TimeoutEvt))) { Status = ScsiDiskTestUnitReady ( ScsiDiskDevice, &NeedRetry, &SenseData, &NumberOfSenseKeys ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = DetectMediaParsingSenseKeys ( ScsiDiskDevice, SenseData, NumberOfSenseKeys, &Action ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } else if (Action == ACTION_RETRY_COMMAND_LATER) { continue; @@ -815,7 +815,7 @@ ScsiDiskDetectMedia ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -842,7 +842,7 @@ ScsiDiskDetectMedia ( &SenseData, &NumberOfSenseKeys ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // analyze sense key to action // @@ -852,7 +852,7 @@ ScsiDiskDetectMedia ( NumberOfSenseKeys, &Action ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // if Status is error, it may indicate crisis error, // so return without retry. @@ -872,7 +872,7 @@ ScsiDiskDetectMedia ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } } @@ -996,7 +996,7 @@ ScsiDiskInquiryDevice ( TRUE, EFI_SCSI_PAGE_CODE_SUPPORTED_VPD ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PageLength = (SupportedVpdPages->PageLength2 << 8) | SupportedVpdPages->PageLength1; for (Index = 0; Index < PageLength; Index++) { @@ -1030,7 +1030,7 @@ ScsiDiskInquiryDevice ( TRUE, EFI_SCSI_PAGE_CODE_BLOCK_LIMITS_VPD ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ScsiDiskDevice->BlkIo.Media->OptimalTransferLengthGranularity = (BlockLimits->OptimalTransferLengthGranularity2 << 8) | BlockLimits->OptimalTransferLengthGranularity1; @@ -1044,7 +1044,7 @@ ScsiDiskInquiryDevice ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } else if (Status == EFI_NOT_READY) { @@ -1101,7 +1101,7 @@ ScsiDiskInquiryDevice ( &NumberOfSenseKeys, TRUE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *NeedRetry = TRUE; return EFI_DEVICE_ERROR; } @@ -1215,7 +1215,7 @@ ScsiDiskTestUnitReady ( NumberOfSenseKeys, FALSE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -1389,7 +1389,7 @@ ScsiDiskReadCapacity ( ); ScsiDiskDevice->Cdb16Byte = FALSE; - if ((!EFI_ERROR (CommandStatus)) && (CapacityData10->LastLba3 == 0xff) && (CapacityData10->LastLba2 == 0xff) && + if ((!EFI_ERROR(CommandStatus)) && (CapacityData10->LastLba3 == 0xff) && (CapacityData10->LastLba2 == 0xff) && (CapacityData10->LastLba1 == 0xff) && (CapacityData10->LastLba0 == 0xff)) { // // use Read Capacity (16), Read (16) and Write (16) next when hard disk size > 2TB @@ -1481,7 +1481,7 @@ ScsiDiskReadCapacity ( NumberOfSenseKeys, TRUE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -1655,7 +1655,7 @@ ScsiDiskRequestSenseKeys ( FallStatus = EFI_DEVICE_ERROR; } - if (EFI_ERROR (FallStatus)) { + if (EFI_ERROR(FallStatus)) { if (*NumberOfSenseKeys != 0) { *NeedRetry = FALSE; Status = EFI_SUCCESS; @@ -1879,7 +1879,7 @@ ScsiDiskReadSectors ( SectorCount ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } @@ -2023,7 +2023,7 @@ ScsiDiskWriteSectors ( SectorCount ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } @@ -2143,7 +2143,7 @@ BackOff: return EFI_DEVICE_ERROR; } - if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) { + if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR(ReturnStatus))) { // DEBUG ((EFI_D_ERROR, "ScsiDiskRead10: Check Condition happened!\n")); Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action); if (Action == ACTION_RETRY_COMMAND_LATER) { @@ -2267,7 +2267,7 @@ BackOff: return EFI_DEVICE_ERROR; } - if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) { + if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR(ReturnStatus))) { DEBUG ((EFI_D_ERROR, "ScsiDiskWrite10: Check Condition happened!\n")); Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action); if (Action == ACTION_RETRY_COMMAND_LATER) { @@ -2390,7 +2390,7 @@ BackOff: return EFI_DEVICE_ERROR; } - if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) { + if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR(ReturnStatus))) { DEBUG ((EFI_D_ERROR, "ScsiDiskRead16: Check Condition happened!\n")); Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action); if (Action == ACTION_RETRY_COMMAND_LATER) { @@ -2514,7 +2514,7 @@ BackOff: return EFI_DEVICE_ERROR; } - if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) { + if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR(ReturnStatus))) { DEBUG ((EFI_D_ERROR, "ScsiDiskWrite16: Check Condition happened!\n")); Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action); if (Action == ACTION_RETRY_COMMAND_LATER) { @@ -2915,7 +2915,7 @@ ReleaseScsiDiskDeviceResources ( } if (ScsiDiskDevice->SenseData != NULL) { - FreePool (ScsiDiskDevice->SenseData); + FreePool(ScsiDiskDevice->SenseData); ScsiDiskDevice->SenseData = NULL; } @@ -2924,7 +2924,7 @@ ReleaseScsiDiskDeviceResources ( ScsiDiskDevice->ControllerNameTable = NULL; } - FreePool (ScsiDiskDevice); + FreePool(ScsiDiskDevice); // ScsiDiskDevice = NULL; } @@ -3008,7 +3008,7 @@ GetParentProtocol ( &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -3017,16 +3017,16 @@ GetParentProtocol ( // for (Index = 0; Index < HandleCount; Index++) { Status = EfiTestChildHandle (HandleBuffer[Index], ChildHandle, ProtocolGuid); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (HandleBuffer[Index], ProtocolGuid, (VOID **)&Interface); - if (!EFI_ERROR (Status)) { - gBS->FreePool (HandleBuffer); + if (!EFI_ERROR(Status)) { + gBS->FreePool(HandleBuffer); return Interface; } } } - gBS->FreePool (HandleBuffer); + gBS->FreePool(HandleBuffer); return NULL; } @@ -3249,7 +3249,7 @@ InitializeInstallDiskInfo ( // // Device Path protocol must be installed on the device handle. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Copy the DiskInfo protocol template. // @@ -3270,7 +3270,7 @@ InitializeInstallDiskInfo ( // with IDE/AHCI interface GUID. // Status = AtapiIdentifyDevice (ScsiDiskDevice); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (DevicePathSubType(ChildDevicePathNode) == MSG_ATAPI_DP) { // // We find the valid ATAPI device path diff --git a/Drivers/Isa/IsaBusDxe/IsaBus.c b/Drivers/Isa/IsaBusDxe/IsaBus.c index 1312f260f..21144105c 100644 --- a/Drivers/Isa/IsaBusDxe/IsaBus.c +++ b/Drivers/Isa/IsaBusDxe/IsaBus.c @@ -60,7 +60,7 @@ InitializeIsaBus( &gIsaBusComponentName, &gIsaBusComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -135,7 +135,7 @@ IsaBusControllerDriverSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -158,7 +158,7 @@ IsaBusControllerDriverSupported ( Controller, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -173,7 +173,7 @@ IsaBusControllerDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -252,7 +252,7 @@ IsaBusControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -267,7 +267,7 @@ IsaBusControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { return Status; } @@ -282,7 +282,7 @@ IsaBusControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { // // Close opened protocol // @@ -306,7 +306,7 @@ IsaBusControllerDriverStart ( (VOID **) &GenMemoryTest ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = GenMemoryTest->CompatibleRangeTest ( GenMemoryTest, 0x100000, @@ -342,7 +342,7 @@ IsaBusControllerDriverStart ( IsaDevice = NULL; do { Status = IsaAcpi->DeviceEnumerate (IsaAcpi, &IsaDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } // @@ -350,7 +350,7 @@ IsaBusControllerDriverStart ( // ResourceList = NULL; Status = IsaAcpi->GetCurResource (IsaAcpi, IsaDevice, &ResourceList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -370,7 +370,7 @@ IsaBusControllerDriverStart ( &DevicePathData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } // @@ -386,7 +386,7 @@ IsaBusControllerDriverStart ( // // Report Status Code here when failed to resource conflicts // - if (EFI_ERROR (Status) && (Status != EFI_UNSUPPORTED)) { + if (EFI_ERROR(Status) && (Status != EFI_UNSUPPORTED)) { // // It's hard to tell which resource conflicts // @@ -463,7 +463,7 @@ IsaBusControllerDriverStop ( This->DriverBindingHandle, Controller ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -473,7 +473,7 @@ IsaBusControllerDriverStop ( This->DriverBindingHandle, Controller ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -500,7 +500,7 @@ IsaBusControllerDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { IsaIoDevice = ISA_IO_DEVICE_FROM_ISA_IO_THIS (IsaIo); @@ -523,9 +523,9 @@ IsaBusControllerDriverStop ( NULL ); - if (!EFI_ERROR (Status)) { - FreePool (IsaIoDevice->DevicePath); - FreePool (IsaIoDevice); + if (!EFI_ERROR(Status)) { + FreePool(IsaIoDevice->DevicePath); + FreePool(IsaIoDevice); } else { // // Re-open PCI IO Protocol on behalf of the child device @@ -542,7 +542,7 @@ IsaBusControllerDriverStop ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -635,7 +635,7 @@ IsaCreateDevice ( &IsaIoDevice->IsaIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -647,7 +647,7 @@ IsaCreateDevice ( IsaIoDevice->Handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( IsaIoDevice->Handle, &gEfiDevicePathProtocolGuid, @@ -660,12 +660,12 @@ IsaCreateDevice ( Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (IsaIoDevice->DevicePath != NULL) { - FreePool (IsaIoDevice->DevicePath); + FreePool(IsaIoDevice->DevicePath); } - FreePool (IsaIoDevice); + FreePool(IsaIoDevice); } return Status; diff --git a/Drivers/Isa/IsaBusDxe/IsaIo.c b/Drivers/Isa/IsaBusDxe/IsaIo.c index 6f1cd1b8b..9587f4dc5 100644 --- a/Drivers/Isa/IsaBusDxe/IsaIo.c +++ b/Drivers/Isa/IsaBusDxe/IsaIo.c @@ -144,7 +144,7 @@ IsaIoIoRead ( Count, Offset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -157,7 +157,7 @@ IsaIoIoRead ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -206,7 +206,7 @@ IsaIoIoWrite ( Count, Offset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -219,7 +219,7 @@ IsaIoIoWrite ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -261,7 +261,7 @@ WritePort ( 1, &Value ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -302,22 +302,22 @@ WriteDmaPort ( EFI_STATUS Status; Status = WritePort (This, AddrOffset, (UINT8) (BaseAddress & 0xff)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, AddrOffset, (UINT8) ((BaseAddress >> 8) & 0xff)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, PageOffset, (UINT8) ((BaseAddress >> 16) & 0xff)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, CountOffset, (UINT8) (Count & 0xff)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -377,7 +377,7 @@ IsaIoUnmap ( // Free the mapped buffer and the MAP_INFO structure. // gBS->FreePages (IsaMapInfo->MappedHostAddress, IsaMapInfo->NumberOfPages); - FreePool (IsaMapInfo); + FreePool(IsaMapInfo); } return EFI_SUCCESS; @@ -404,7 +404,7 @@ IsaIoFlush ( Status = IsaIoDevice->PciIo->Flush (IsaIoDevice->PciIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -523,7 +523,7 @@ IsaIoMemRead ( Count, Offset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -536,7 +536,7 @@ IsaIoMemRead ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -592,7 +592,7 @@ IsaIoMemWrite ( Count, Offset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -605,7 +605,7 @@ IsaIoMemWrite ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -661,7 +661,7 @@ IsaIoCopyMem ( Count, DestOffset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -672,7 +672,7 @@ IsaIoCopyMem ( Count, SrcOffset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -686,7 +686,7 @@ IsaIoCopyMem ( Count ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -819,8 +819,8 @@ IsaIoMapOnlySupportSlaveReadWrite ( IsaMapInfo->NumberOfPages, &IsaMapInfo->MappedHostAddress ); - if (EFI_ERROR (Status)) { - FreePool (IsaMapInfo); + if (EFI_ERROR(Status)) { + FreePool(IsaMapInfo); *NumberOfBytes = 0; *Mapping = NULL; return Status; @@ -890,7 +890,7 @@ IsaIoMapOnlySupportSlaveReadWrite ( DmaMask, (UINT8) (B_8237_DMA_WRSMSK_CMS | (ChannelNumber & 0x03)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -899,12 +899,12 @@ IsaIoMapOnlySupportSlaveReadWrite ( DmaClear, (UINT8) (B_8237_DMA_WRSMSK_CMS | (ChannelNumber & 0x03)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, DmaChannelMode, DmaMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -916,7 +916,7 @@ IsaIoMapOnlySupportSlaveReadWrite ( BaseAddress, Count ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -925,7 +925,7 @@ IsaIoMapOnlySupportSlaveReadWrite ( DmaMask, (UINT8) (ChannelNumber & 0x03) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1122,8 +1122,8 @@ IsaIoMapFullSupport ( IsaMapInfo->NumberOfPages, &IsaMapInfo->MappedHostAddress ); - if (EFI_ERROR (Status)) { - FreePool (IsaMapInfo); + if (EFI_ERROR(Status)) { + FreePool(IsaMapInfo); *NumberOfBytes = 0; *Mapping = NULL; return Status; @@ -1216,7 +1216,7 @@ IsaIoMapFullSupport ( DmaMask, (UINT8) (B_8237_DMA_WRSMSK_CMS | (ChannelNumber & 0x03)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1225,12 +1225,12 @@ IsaIoMapFullSupport ( DmaClear, (UINT8) (B_8237_DMA_WRSMSK_CMS | (ChannelNumber & 0x03)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, DmaChannelMode, DmaMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1242,7 +1242,7 @@ IsaIoMapFullSupport ( BaseAddress, Count ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1251,7 +1251,7 @@ IsaIoMapFullSupport ( DmaMask, (UINT8) (ChannelNumber & 0x03) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1405,7 +1405,7 @@ IsaIoAllocateBuffer ( } Status = gBS->AllocatePages (Type, MemoryType, Pages, &PhysicalAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -1451,7 +1451,7 @@ IsaIoFreeBuffer ( (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress, Pages ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR diff --git a/Drivers/Isa/IsaIoDxe/IsaDriver.c b/Drivers/Isa/IsaIoDxe/IsaDriver.c index 8c58b318c..2d567c9f8 100644 --- a/Drivers/Isa/IsaIoDxe/IsaDriver.c +++ b/Drivers/Isa/IsaIoDxe/IsaDriver.c @@ -57,7 +57,7 @@ InitializeIsaIo ( &gIsaIoComponentName, &gIsaIoComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -101,14 +101,14 @@ IsaIoDriverSupported ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get the PciIo protocol from its parent controller. // Status = gBS->LocateDevicePath (&gEfiPciIoProtocolGuid, &DevicePath, &PciHandle); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -123,7 +123,7 @@ IsaIoDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiSioProtocolGuid, @@ -192,7 +192,7 @@ IsaIoDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -201,9 +201,9 @@ IsaIoDriverStart ( // TempDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiPciIoProtocolGuid, &TempDevicePath, &PciHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (PciHandle, &gEfiPciIoProtocolGuid, (VOID **) &PciIo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Open Super IO Protocol @@ -218,7 +218,7 @@ IsaIoDriverStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Fail due to LocateDevicePath(...) or OpenProtocol(Sio, BY_DRIVER) // @@ -226,7 +226,7 @@ IsaIoDriverStart ( } Status = Sio->GetResources (Sio, &Resources); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); IsaIoDevice = AllocatePool (sizeof (ISA_IO_DEVICE)); ASSERT (IsaIoDevice != NULL); @@ -248,7 +248,7 @@ IsaIoDriverStart ( &IsaIoDevice->IsaIo, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -299,7 +299,7 @@ IsaIoDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -311,15 +311,15 @@ IsaIoDriverStop ( &IsaIoDevice->IsaIo, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->CloseProtocol ( Controller, &gEfiSioProtocolGuid, This->DriverBindingHandle, Controller ); - FreePool (IsaIoDevice->IsaIo.ResourceList); - FreePool (IsaIoDevice); + FreePool(IsaIoDevice->IsaIo.ResourceList); + FreePool(IsaIoDevice); } return Status; diff --git a/Drivers/Isa/IsaIoDxe/IsaIo.c b/Drivers/Isa/IsaIoDxe/IsaIo.c index 2e4361fc0..1201d237d 100644 --- a/Drivers/Isa/IsaIoDxe/IsaIo.c +++ b/Drivers/Isa/IsaIoDxe/IsaIo.c @@ -544,7 +544,7 @@ IsaIoIoRead ( Count, Offset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -557,7 +557,7 @@ IsaIoIoRead ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -606,7 +606,7 @@ IsaIoIoWrite ( Count, Offset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -619,7 +619,7 @@ IsaIoIoWrite ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -661,7 +661,7 @@ WritePort ( 1, &Value ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -705,22 +705,22 @@ WriteDmaPort ( EFI_STATUS Status; Status = WritePort (This, AddrOffset, (UINT8) (BaseAddress & 0xff)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, AddrOffset, (UINT8) ((BaseAddress >> 8) & 0xff)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, PageOffset, (UINT8) ((BaseAddress >> 16) & 0xff)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, CountOffset, (UINT8) (Count & 0xff)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -780,7 +780,7 @@ IsaIoUnmap ( // Free the mapped buffer and the MAP_INFO structure. // gBS->FreePages (IsaMapInfo->MappedHostAddress, IsaMapInfo->NumberOfPages); - FreePool (IsaMapInfo); + FreePool(IsaMapInfo); } return EFI_SUCCESS; @@ -807,7 +807,7 @@ IsaIoFlush ( Status = IsaIoDevice->PciIo->Flush (IsaIoDevice->PciIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -863,7 +863,7 @@ IsaIoMemRead ( Count, Offset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -876,7 +876,7 @@ IsaIoMemRead ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -932,7 +932,7 @@ IsaIoMemWrite ( Count, Offset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -945,7 +945,7 @@ IsaIoMemWrite ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -1001,7 +1001,7 @@ IsaIoCopyMem ( Count, DestOffset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1012,7 +1012,7 @@ IsaIoCopyMem ( Count, SrcOffset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1026,7 +1026,7 @@ IsaIoCopyMem ( Count ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -1159,8 +1159,8 @@ IsaIoMapOnlySupportSlaveReadWrite ( IsaMapInfo->NumberOfPages, &IsaMapInfo->MappedHostAddress ); - if (EFI_ERROR (Status)) { - FreePool (IsaMapInfo); + if (EFI_ERROR(Status)) { + FreePool(IsaMapInfo); *NumberOfBytes = 0; *Mapping = NULL; return Status; @@ -1230,7 +1230,7 @@ IsaIoMapOnlySupportSlaveReadWrite ( DmaMask, (UINT8) (B_8237_DMA_WRSMSK_CMS | (ChannelNumber & 0x03)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1239,12 +1239,12 @@ IsaIoMapOnlySupportSlaveReadWrite ( DmaClear, (UINT8) (B_8237_DMA_WRSMSK_CMS | (ChannelNumber & 0x03)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, DmaChannelMode, DmaMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1256,7 +1256,7 @@ IsaIoMapOnlySupportSlaveReadWrite ( BaseAddress, Count ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1265,7 +1265,7 @@ IsaIoMapOnlySupportSlaveReadWrite ( DmaMask, (UINT8) (ChannelNumber & 0x03) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1462,8 +1462,8 @@ IsaIoMapFullSupport ( IsaMapInfo->NumberOfPages, &IsaMapInfo->MappedHostAddress ); - if (EFI_ERROR (Status)) { - FreePool (IsaMapInfo); + if (EFI_ERROR(Status)) { + FreePool(IsaMapInfo); *NumberOfBytes = 0; *Mapping = NULL; return Status; @@ -1556,7 +1556,7 @@ IsaIoMapFullSupport ( DmaMask, (UINT8) (B_8237_DMA_WRSMSK_CMS | (ChannelNumber & 0x03)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1565,12 +1565,12 @@ IsaIoMapFullSupport ( DmaClear, (UINT8) (B_8237_DMA_WRSMSK_CMS | (ChannelNumber & 0x03)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = WritePort (This, DmaChannelMode, DmaMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1582,7 +1582,7 @@ IsaIoMapFullSupport ( BaseAddress, Count ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1591,7 +1591,7 @@ IsaIoMapFullSupport ( DmaMask, (UINT8) (ChannelNumber & 0x03) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1745,7 +1745,7 @@ IsaIoAllocateBuffer ( } Status = gBS->AllocatePages (Type, MemoryType, Pages, &PhysicalAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR @@ -1791,7 +1791,7 @@ IsaIoFreeBuffer ( (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress, Pages ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR diff --git a/Drivers/Isa/IsaSerialDxe/ComponentName.c b/Drivers/Isa/IsaSerialDxe/ComponentName.c index ef24008f6..501a4dbc3 100644 --- a/Drivers/Isa/IsaSerialDxe/ComponentName.c +++ b/Drivers/Isa/IsaSerialDxe/ComponentName.c @@ -193,7 +193,7 @@ IsaSerialComponentNameGetControllerName ( gSerialControllerDriver.DriverBindingHandle, &gEfiIsaIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -204,7 +204,7 @@ IsaSerialComponentNameGetControllerName ( ChildHandle, &gEfiIsaIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -219,7 +219,7 @@ IsaSerialComponentNameGetControllerName ( ChildHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/Isa/IsaSerialDxe/Serial.c b/Drivers/Isa/IsaSerialDxe/Serial.c index 57ee669d1..ea01ded63 100644 --- a/Drivers/Isa/IsaSerialDxe/Serial.c +++ b/Drivers/Isa/IsaSerialDxe/Serial.c @@ -161,7 +161,7 @@ InitializeIsaSerial ( &gIsaSerialComponentName, &gIsaSerialComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Initialize UART default setting in gSerialDevTempate @@ -296,7 +296,7 @@ SerialControllerDriverSupported ( &OpenInfoBuffer, &EntryCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -310,7 +310,7 @@ SerialControllerDriverSupported ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { HasFlowControl = ContainsFlowControl (RemainingDevicePath); if (HasFlowControl ^ ContainsFlowControl (DevicePath)) { Status = EFI_UNSUPPORTED; @@ -319,11 +319,11 @@ SerialControllerDriverSupported ( break; } } - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); return Status; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -352,7 +352,7 @@ SerialControllerDriverSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -424,7 +424,7 @@ SerialControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { return Status; } // @@ -447,7 +447,7 @@ SerialControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { goto Error; } @@ -470,7 +470,7 @@ SerialControllerDriverStart ( &OpenInfoBuffer, &EntryCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -485,7 +485,7 @@ SerialControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Uart = (UART_DEVICE_PATH *) RemainingDevicePath; Status = SerialIo->SetAttributes ( SerialIo, @@ -498,9 +498,9 @@ SerialControllerDriverStart ( ); FlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (Uart); - if (!EFI_ERROR (Status) && IsUartFlowControlNode (FlowControl)) { + if (!EFI_ERROR(Status) && IsUartFlowControlNode (FlowControl)) { Status = SerialIo->GetControl (SerialIo, &Control); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (ReadUnaligned32 (&FlowControl->FlowControlMap) == UART_FLOW_CONTROL_HARDWARE) { Control |= EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE; } else { @@ -520,7 +520,7 @@ SerialControllerDriverStart ( } } - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); return Status; } @@ -618,7 +618,7 @@ SerialControllerDriverStart ( TempDevicePath, (EFI_DEVICE_PATH_PROTOCOL *) FlowControl ); - FreePool (TempDevicePath); + FreePool(TempDevicePath); } } if (SerialDevice->DevicePath == NULL) { @@ -638,7 +638,7 @@ SerialControllerDriverStart ( // Issue a reset to initialize the COM port // Status = SerialDevice->SerialIo.Reset (&SerialDevice->SerialIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE, EFI_P_EC_CONTROLLER_ERROR | EFI_PERIPHERAL_SERIAL_PORT, @@ -657,7 +657,7 @@ SerialControllerDriverStart ( &SerialDevice->SerialIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } // @@ -673,7 +673,7 @@ SerialControllerDriverStart ( ); Error: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -688,11 +688,11 @@ Error: ); if (SerialDevice != NULL) { if (SerialDevice->DevicePath != NULL) { - gBS->FreePool (SerialDevice->DevicePath); + gBS->FreePool(SerialDevice->DevicePath); } FreeUnicodeStringTable (SerialDevice->ControllerNameTable); - gBS->FreePool (SerialDevice); + gBS->FreePool(SerialDevice); } } @@ -780,7 +780,7 @@ SerialControllerDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SerialDevice = SERIAL_DEV_FROM_THIS (SerialIo); @@ -799,7 +799,7 @@ SerialControllerDriverStop ( &SerialDevice->SerialIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiIsaIoProtocolGuid, @@ -810,15 +810,15 @@ SerialControllerDriverStop ( ); } else { if (SerialDevice->DevicePath != NULL) { - gBS->FreePool (SerialDevice->DevicePath); + gBS->FreePool(SerialDevice->DevicePath); } FreeUnicodeStringTable (SerialDevice->ControllerNameTable); - gBS->FreePool (SerialDevice); + gBS->FreePool(SerialDevice); } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -1191,7 +1191,7 @@ IsaSerialReset ( (EFI_STOP_BITS_TYPE) This->Mode->StopBits ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->RestoreTPL (Tpl); return EFI_DEVICE_ERROR; } @@ -1210,7 +1210,7 @@ IsaSerialReset ( Control ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->RestoreTPL (Tpl); return EFI_DEVICE_ERROR; } @@ -1884,7 +1884,7 @@ IsaSerialRead ( Status = IsaSerialReceiveTransmit (SerialDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *BufferSize = 0; REPORT_STATUS_CODE_WITH_DEVICE_PATH ( diff --git a/Drivers/Isa/Ps2KeyboardDxe/ComponentName.c b/Drivers/Isa/Ps2KeyboardDxe/ComponentName.c index e6c739e2b..1d61f7425 100644 --- a/Drivers/Isa/Ps2KeyboardDxe/ComponentName.c +++ b/Drivers/Isa/Ps2KeyboardDxe/ComponentName.c @@ -331,7 +331,7 @@ Ps2KeyboardComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiIsaIoProtocolGuid, @@ -356,7 +356,7 @@ Ps2KeyboardComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c index 48d8efd51..b9258a2d0 100644 --- a/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c +++ b/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c @@ -1108,7 +1108,7 @@ UpdateStatusLights ( // Send keyboard command // Status = KeyboardWrite (ConsoleIn, 0xed); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1132,7 +1132,7 @@ UpdateStatusLights ( Status = KeyboardWrite (ConsoleIn, Command); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1208,7 +1208,7 @@ KeyGetchar ( Extend1 = FALSE; ScancodeArrPos = 0; Status = GetScancodeBufHead (&ConsoleIn->ScancodeQueue, ScancodeArrPos + 1, ScancodeArr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -1219,7 +1219,7 @@ KeyGetchar ( Extend0 = TRUE; ScancodeArrPos = 1; Status = GetScancodeBufHead (&ConsoleIn->ScancodeQueue, ScancodeArrPos + 1, ScancodeArr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } } else if (ScancodeArr[ScancodeArrPos] == SCANCODE_EXTENDED1) { @@ -1229,7 +1229,7 @@ KeyGetchar ( Extend1 = TRUE; ScancodeArrPos = 2; Status = GetScancodeBufHead (&ConsoleIn->ScancodeQueue, ScancodeArrPos + 1, ScancodeArr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } } @@ -1237,7 +1237,7 @@ KeyGetchar ( // if we reach this position, scancodes for a key is in buffer now,pop them // Status = PopScancodeBufHead (&ConsoleIn->ScancodeQueue, ScancodeArrPos + 1, ScancodeArr); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // store the last available byte, this byte of scancode will be checked @@ -1540,7 +1540,7 @@ InitKeyboard ( // output buffer full bits within MAX TRY times // if ((KeyReadStatusRegister (ConsoleIn) & KEYBOARD_STATUS_REGISTER_HAS_OUTPUT_DATA) != 0) { - while (!EFI_ERROR (Status) && TryTime < KEYBOARD_MAX_TRY) { + while (!EFI_ERROR(Status) && TryTime < KEYBOARD_MAX_TRY) { Status = KeyboardRead (ConsoleIn, &CommandByte); TryTime ++; } @@ -1575,13 +1575,13 @@ InitKeyboard ( // Read the command byte of 8042 controller // Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_READ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"\n\r"); goto Done; } Status = KeyboardRead (ConsoleIn, &CommandByte); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"\n\r"); goto Done; } @@ -1607,13 +1607,13 @@ InitKeyboard ( // if (!PcdGetBool (PcdFastPS2Detection)) { Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"\n\r"); goto Done; } Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_MOUSE_INTERFACE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"\n\r"); goto Done; } @@ -1627,13 +1627,13 @@ InitKeyboard ( // 8042 Controller Self Test // Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_CONTROLLER_SELF_TEST); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, 0x55); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller self test failed!\n\r"); goto Done; } @@ -1667,13 +1667,13 @@ InitKeyboard ( // 0: Enable Keyboard interrupt ) // Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_WRITE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r"); goto Done; } Status = KeyboardWrite (ConsoleIn, 0x67); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!\n\r"); goto Done; } @@ -1720,13 +1720,13 @@ InitKeyboard ( // Keyboard Interface Test // Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_KEYBOARD_INTERFACE_SELF_TEST); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, 0x00); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError ( ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r" @@ -1737,13 +1737,13 @@ InitKeyboard ( // Keyboard reset with a BAT(Basic Assurance Test) // Status = KeyboardWrite (ConsoleIn, KEYBOARD_8048_COMMAND_RESET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_ACK); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r"); goto Done; } @@ -1753,7 +1753,7 @@ InitKeyboard ( mWaitForValueTimeOut = KEYBOARD_BAT_TIMEOUT; Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_BAT_SUCCESS); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Keyboard self test failed!\n\r"); goto Done; } @@ -1764,25 +1764,25 @@ InitKeyboard ( // Set Keyboard to use Scan Code Set 2 // Status = KeyboardWrite (ConsoleIn, KEYBOARD_8048_COMMAND_SELECT_SCAN_CODE_SET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_ACK); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r"); goto Done; } Status = KeyboardWrite (ConsoleIn, 0x02); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_ACK); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r"); goto Done; } @@ -1791,13 +1791,13 @@ InitKeyboard ( // Clear Keyboard Scancode Buffer // Status = KeyboardWrite (ConsoleIn, KEYBOARD_8048_COMMAND_CLEAR_OUTPUT_DATA); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_ACK); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r"); goto Done; } @@ -1819,7 +1819,7 @@ InitKeyboard ( // Update Keyboard Lights // Status = UpdateStatusLights (ConsoleIn); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Update keyboard status lights error!\n\r"); goto Done; } @@ -1834,13 +1834,13 @@ Done: // Enable mouse interface // Status1 = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_ENABLE_MOUSE_INTERFACE); - if (EFI_ERROR (Status1)) { + if (EFI_ERROR(Status1)) { KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r"); return EFI_DEVICE_ERROR; } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } else { return EFI_DEVICE_ERROR; @@ -1867,7 +1867,7 @@ DisableKeyboard ( // Disable keyboard interface // Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"\n\r"); return EFI_DEVICE_ERROR; } @@ -1904,7 +1904,7 @@ CheckKeyboardConnect ( KEYBOARD_KBEN ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } // @@ -1918,7 +1918,7 @@ CheckKeyboardConnect ( ); mWaitForValueTimeOut = WaitForValueTimeOutBcakup; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } diff --git a/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c b/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c index 401b0e8c2..9ead5a8ce 100644 --- a/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c +++ b/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c @@ -215,7 +215,7 @@ KeyboardEfiReset ( // Call InitKeyboard to initialize the keyboard // Status = InitKeyboard (ConsoleIn, ExtendedVerification); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Leave critical section and return // @@ -283,7 +283,7 @@ KeyboardReadKeyStroke ( // If there is no pending key, then return. // Status = KeyboardReadKeyStrokeWorker (ConsoleIn, &KeyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -518,7 +518,7 @@ KeyboardSetState ( } Status = UpdateStatusLights (ConsoleInDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -671,7 +671,7 @@ KeyboardUnregisterKeyNotify ( // RemoveEntryList (&CurrentNotify->NotifyEntry); - gBS->FreePool (CurrentNotify); + gBS->FreePool(CurrentNotify); Status = EFI_SUCCESS; goto Exit; } @@ -726,7 +726,7 @@ KeyNotifyProcessHandler ( // Leave critical section // gBS->RestoreTPL (OldTpl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList, Link); Link = GetNextNode (NotifyList, Link)) { diff --git a/Drivers/Isa/Ps2KeyboardDxe/Ps2Keyboard.c b/Drivers/Isa/Ps2KeyboardDxe/Ps2Keyboard.c index ff562b269..a7e36b9af 100644 --- a/Drivers/Isa/Ps2KeyboardDxe/Ps2Keyboard.c +++ b/Drivers/Isa/Ps2KeyboardDxe/Ps2Keyboard.c @@ -134,7 +134,7 @@ KbdControllerDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -191,7 +191,7 @@ KbdControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -214,7 +214,7 @@ KbdControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -286,7 +286,7 @@ KbdControllerDriverStart ( ConsoleIn, &((ConsoleIn->ConIn).WaitForKey) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -301,7 +301,7 @@ KbdControllerDriverStart ( ConsoleIn, &(ConsoleIn->ConInEx.WaitForKeyEx) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -316,7 +316,7 @@ KbdControllerDriverStart ( ConsoleIn, &ConsoleIn->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -327,7 +327,7 @@ KbdControllerDriverStart ( TimerPeriodic, KEYBOARD_TIMER_INTERVAL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -340,7 +340,7 @@ KbdControllerDriverStart ( ConsoleIn, &ConsoleIn->KeyNotifyProcessEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -356,7 +356,7 @@ KbdControllerDriverStart ( // Reset the keyboard device // Status = ConsoleIn->ConInEx.Reset (&ConsoleIn->ConInEx, FeaturePcdGet (PcdPs2KbdExtendedVerification)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED; goto ErrorExit; @@ -396,7 +396,7 @@ KbdControllerDriverStart ( &ConsoleIn->ConInEx, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; } @@ -438,13 +438,13 @@ ErrorExit: // if (ConsoleIn != NULL) { Status1 = EFI_SUCCESS; - while (!EFI_ERROR (Status1) && (Status != EFI_DEVICE_ERROR)) { + while (!EFI_ERROR(Status1) && (Status != EFI_DEVICE_ERROR)) { Status1 = KeyboardRead (ConsoleIn, &Data);; } } if (ConsoleIn != NULL) { - gBS->FreePool (ConsoleIn); + gBS->FreePool(ConsoleIn); } gBS->CloseProtocol ( @@ -503,7 +503,7 @@ KbdControllerDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->OpenProtocol ( @@ -514,7 +514,7 @@ KbdControllerDriverStop ( Controller, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -539,7 +539,7 @@ KbdControllerDriverStop ( // exhaust input data just in case there is still keyboard data left // Status = EFI_SUCCESS; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = KeyboardRead (ConsoleIn, &Data);; } // @@ -553,7 +553,7 @@ KbdControllerDriverStop ( &ConsoleIn->ConInEx, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -588,7 +588,7 @@ KbdControllerDriverStop ( } KbdFreeNotifyList (&ConsoleIn->NotifyList); FreeUnicodeStringTable (ConsoleIn->ControllerNameTable); - gBS->FreePool (ConsoleIn); + gBS->FreePool(ConsoleIn); return EFI_SUCCESS; } @@ -619,7 +619,7 @@ KbdFreeNotifyList ( KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE ); RemoveEntryList (ListHead->ForwardLink); - gBS->FreePool (NotifyNode); + gBS->FreePool(NotifyNode); } return EFI_SUCCESS; @@ -655,7 +655,7 @@ InitializePs2Keyboard( &gPs2KeyboardComponentName, &gPs2KeyboardComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; diff --git a/Drivers/Isa/Ps2MouseAbsolutePointerDxe/CommPs2.c b/Drivers/Isa/Ps2MouseAbsolutePointerDxe/CommPs2.c index 5aa17059a..f356da7bc 100644 --- a/Drivers/Isa/Ps2MouseAbsolutePointerDxe/CommPs2.c +++ b/Drivers/Isa/Ps2MouseAbsolutePointerDxe/CommPs2.c @@ -39,14 +39,14 @@ KbcSelfTest ( // Keyboard controller self test // Status = Out8042Command (IsaIo, SELF_TEST); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // Read return code // Status = In8042Data (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -57,23 +57,23 @@ KbcSelfTest ( // Set system flag // Status = Out8042Command (IsaIo, READ_CMD_BYTE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = In8042Data (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = Out8042Command (IsaIo, WRITE_CMD_BYTE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Data |= CMD_SYS_FLAG; Status = Out8042Data (IsaIo, Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -173,12 +173,12 @@ CheckKbStatus ( // Send command to read KBC command byte // Status = Out8042Command (IsaIo, READ_CMD_BYTE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = In8042Data (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -209,12 +209,12 @@ PS2MouseReset ( UINT8 Data; Status = Out8042AuxCommand (IsaIo, RESET_CMD, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = In8042AuxData (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -225,7 +225,7 @@ PS2MouseReset ( } Status = In8042AuxData (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -258,7 +258,7 @@ PS2MouseSetSampleRate ( // Send auxiliary command to set mouse sample rate // Status = Out8042AuxCommand (IsaIo, SETSR_CMD, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -287,7 +287,7 @@ PS2MouseSetResolution ( // Send auxiliary command to set mouse resolution // Status = Out8042AuxCommand (IsaIo, SETRE_CMD, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -380,7 +380,7 @@ PS2MouseGetPacket ( // KbcDisableAux (MouseAbsolutePointerDev->IsaIo); Status = PS2MouseRead (MouseAbsolutePointerDev->IsaIo, &Data, &Count, State); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KbcEnableAux (MouseAbsolutePointerDev->IsaIo); return EFI_NOT_READY; } @@ -403,7 +403,7 @@ PS2MouseGetPacket ( case PS2_READ_DATA_BYTE: Count = 2; Status = PS2MouseRead (MouseAbsolutePointerDev->IsaIo, (Packet + 1), &Count, State); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (KeyboardEnable) { KbcEnableKb (MouseAbsolutePointerDev->IsaIo); } @@ -503,7 +503,7 @@ PS2MouseRead ( // Status = CheckForInput (IsaIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -511,7 +511,7 @@ PS2MouseRead ( while (BytesRead < *BufSize) { Status = WaitOutputFull (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -556,7 +556,7 @@ Out8042Command ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -566,7 +566,7 @@ Out8042Command ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -594,7 +594,7 @@ Out8042Data ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -602,7 +602,7 @@ Out8042Data ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Temp); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -676,7 +676,7 @@ Out8042AuxCommand ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -686,7 +686,7 @@ Out8042AuxCommand ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -698,7 +698,7 @@ Out8042AuxCommand ( // Read return code // Status = In8042AuxData (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -719,7 +719,7 @@ Out8042AuxCommand ( // Resend command // Status = Out8042AuxCommand (IsaIo, Command, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -755,7 +755,7 @@ Out8042AuxData ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -765,7 +765,7 @@ Out8042AuxData ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Temp); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -773,7 +773,7 @@ Out8042AuxData ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Temp); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -801,7 +801,7 @@ In8042AuxData ( // wait for output data // Status = WaitOutputFull (IsaIo, BAT_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/Isa/Ps2MouseAbsolutePointerDxe/ComponentName.c b/Drivers/Isa/Ps2MouseAbsolutePointerDxe/ComponentName.c index 8fbef2898..78c734e6b 100644 --- a/Drivers/Isa/Ps2MouseAbsolutePointerDxe/ComponentName.c +++ b/Drivers/Isa/Ps2MouseAbsolutePointerDxe/ComponentName.c @@ -200,7 +200,7 @@ Ps2MouseAbsolutePointerComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiIsaIoProtocolGuid, @@ -225,7 +225,7 @@ Ps2MouseAbsolutePointerComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.c b/Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.c index bf8adfcb2..c2db87318 100644 --- a/Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.c +++ b/Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.c @@ -66,7 +66,7 @@ PS2MouseAbsolutePointerDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -155,7 +155,7 @@ PS2MouseAbsolutePointerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -178,7 +178,7 @@ PS2MouseAbsolutePointerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -239,7 +239,7 @@ PS2MouseAbsolutePointerDriverStart ( IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data); if ((Data & KBC_SYSF) != KBC_SYSF) { Status = KbcSelfTest (IsaIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { StatusCode = EFI_PERIPHERAL_MOUSE | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; } @@ -260,7 +260,7 @@ PS2MouseAbsolutePointerDriverStart ( &MouseAbsolutePointerDev->AbsolutePointerProtocol, FeaturePcdGet (PcdPs2MouseExtendedVerification) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // mouse not connected // @@ -285,7 +285,7 @@ PS2MouseAbsolutePointerDriverStart ( MouseAbsolutePointerDev, &((MouseAbsolutePointerDev->AbsolutePointerProtocol).WaitForInput) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -299,7 +299,7 @@ PS2MouseAbsolutePointerDriverStart ( MouseAbsolutePointerDev, &MouseAbsolutePointerDev->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -307,7 +307,7 @@ PS2MouseAbsolutePointerDriverStart ( // Start timer to poll mouse (100 samples per second) // Status = gBS->SetTimer (MouseAbsolutePointerDev->TimerEvent, TimerPeriodic, 100000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -338,7 +338,7 @@ PS2MouseAbsolutePointerDriverStart ( &MouseAbsolutePointerDev->AbsolutePointerProtocol, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -374,12 +374,12 @@ ErrorExit: // exhaust input data just in case there is still mouse data left // EmptyStatus = EFI_SUCCESS; - while (!EFI_ERROR (EmptyStatus)) { + while (!EFI_ERROR(EmptyStatus)) { EmptyStatus = In8042Data (IsaIo, &Data); } if (MouseAbsolutePointerDev != NULL) { - FreePool (MouseAbsolutePointerDev); + FreePool(MouseAbsolutePointerDev); } gBS->CloseProtocol ( @@ -437,7 +437,7 @@ PS2MouseAbsolutePointerDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -457,7 +457,7 @@ PS2MouseAbsolutePointerDriverStop ( &gEfiAbsolutePointerProtocolGuid, &MouseAbsolutePointerDev->AbsolutePointerProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -472,13 +472,13 @@ PS2MouseAbsolutePointerDriverStop ( // exhaust input data just in case there is still mouse data left // Status = EFI_SUCCESS; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = In8042Data (MouseAbsolutePointerDev->IsaIo, &Data); } gBS->CloseEvent (MouseAbsolutePointerDev->AbsolutePointerProtocol.WaitForInput); FreeUnicodeStringTable (MouseAbsolutePointerDev->ControllerNameTable); - FreePool (MouseAbsolutePointerDev); + FreePool(MouseAbsolutePointerDev); gBS->CloseProtocol ( Controller, @@ -546,7 +546,7 @@ MouseAbsolutePointerReset ( // Exhaust input data // Status = EFI_SUCCESS; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = In8042Data (MouseAbsolutePointerDev->IsaIo, &Data); } @@ -574,31 +574,31 @@ MouseAbsolutePointerReset ( // Send mouse reset command and set mouse default configure // Status = PS2MouseReset (MouseAbsolutePointerDev->IsaIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseSetSampleRate (MouseAbsolutePointerDev->IsaIo, MouseAbsolutePointerDev->SampleRate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseSetResolution (MouseAbsolutePointerDev->IsaIo, MouseAbsolutePointerDev->Resolution); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseSetScaling (MouseAbsolutePointerDev->IsaIo, MouseAbsolutePointerDev->Scaling); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseEnable (MouseAbsolutePointerDev->IsaIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -631,7 +631,7 @@ CheckMouseAbsolutePointerConnect ( EFI_STATUS Status; Status = PS2MouseEnable (MouseAbsolutePointerDev->IsaIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return TRUE; } @@ -770,7 +770,7 @@ InitializePs2MouseAbsolutePointer( &gPs2MouseAbsolutePointerComponentName, &gPs2MouseAbsolutePointerComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; diff --git a/Drivers/Isa/Ps2MouseDxe/CommPs2.c b/Drivers/Isa/Ps2MouseDxe/CommPs2.c index 1c763e97f..65b68829a 100644 --- a/Drivers/Isa/Ps2MouseDxe/CommPs2.c +++ b/Drivers/Isa/Ps2MouseDxe/CommPs2.c @@ -39,14 +39,14 @@ KbcSelfTest ( // Keyboard controller self test // Status = Out8042Command (IsaIo, SELF_TEST); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // Read return code // Status = In8042Data (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -57,23 +57,23 @@ KbcSelfTest ( // Set system flag // Status = Out8042Command (IsaIo, READ_CMD_BYTE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = In8042Data (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = Out8042Command (IsaIo, WRITE_CMD_BYTE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Data |= CMD_SYS_FLAG; Status = Out8042Data (IsaIo, Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -173,12 +173,12 @@ CheckKbStatus ( // Send command to read KBC command byte // Status = Out8042Command (IsaIo, READ_CMD_BYTE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = In8042Data (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -209,12 +209,12 @@ PS2MouseReset ( UINT8 Data; Status = Out8042AuxCommand (IsaIo, RESET_CMD, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = In8042AuxData (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -225,7 +225,7 @@ PS2MouseReset ( } Status = In8042AuxData (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -258,7 +258,7 @@ PS2MouseSetSampleRate ( // Send auxiliary command to set mouse sample rate // Status = Out8042AuxCommand (IsaIo, SETSR_CMD, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -287,7 +287,7 @@ PS2MouseSetResolution ( // Send auxiliary command to set mouse resolution // Status = Out8042AuxCommand (IsaIo, SETRE_CMD, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -380,7 +380,7 @@ PS2MouseGetPacket ( // KbcDisableAux (MouseDev->IsaIo); Status = PS2MouseRead (MouseDev->IsaIo, &Data, &Count, State); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KbcEnableAux (MouseDev->IsaIo); return EFI_NOT_READY; } @@ -403,7 +403,7 @@ PS2MouseGetPacket ( case PS2_READ_DATA_BYTE: Count = 2; Status = PS2MouseRead (MouseDev->IsaIo, (Packet + 1), &Count, State); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (KeyboardEnable) { KbcEnableKb (MouseDev->IsaIo); } @@ -503,7 +503,7 @@ PS2MouseRead ( // Status = CheckForInput (IsaIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -511,7 +511,7 @@ PS2MouseRead ( while (BytesRead < *BufSize) { Status = WaitOutputFull (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -555,7 +555,7 @@ Out8042Command ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -565,7 +565,7 @@ Out8042Command ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -593,7 +593,7 @@ Out8042Data ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -601,7 +601,7 @@ Out8042Data ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Temp); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -675,7 +675,7 @@ Out8042AuxCommand ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -685,7 +685,7 @@ Out8042AuxCommand ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -697,7 +697,7 @@ Out8042AuxCommand ( // Read return code // Status = In8042AuxData (IsaIo, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -718,7 +718,7 @@ Out8042AuxCommand ( // Resend command // Status = Out8042AuxCommand (IsaIo, Command, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -754,7 +754,7 @@ Out8042AuxData ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -764,7 +764,7 @@ Out8042AuxData ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Temp); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -772,7 +772,7 @@ Out8042AuxData ( IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Temp); Status = WaitInputEmpty (IsaIo, TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -800,7 +800,7 @@ In8042AuxData ( // wait for output data // Status = WaitOutputFull (IsaIo, BAT_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/Isa/Ps2MouseDxe/ComponentName.c b/Drivers/Isa/Ps2MouseDxe/ComponentName.c index 1c3e84ec6..775658cdc 100644 --- a/Drivers/Isa/Ps2MouseDxe/ComponentName.c +++ b/Drivers/Isa/Ps2MouseDxe/ComponentName.c @@ -200,7 +200,7 @@ Ps2MouseComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiIsaIoProtocolGuid, @@ -225,7 +225,7 @@ Ps2MouseComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/Isa/Ps2MouseDxe/Ps2Mouse.c b/Drivers/Isa/Ps2MouseDxe/Ps2Mouse.c index 27f72f77b..2830fb80f 100644 --- a/Drivers/Isa/Ps2MouseDxe/Ps2Mouse.c +++ b/Drivers/Isa/Ps2MouseDxe/Ps2Mouse.c @@ -69,7 +69,7 @@ PS2MouseDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -158,7 +158,7 @@ PS2MouseDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -181,7 +181,7 @@ PS2MouseDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -254,7 +254,7 @@ PS2MouseDriverStart ( */ if ((Data & KBC_SYSF) != KBC_SYSF) { Status = KbcSelfTest (IsaIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { StatusCode = EFI_PERIPHERAL_MOUSE | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; } @@ -275,7 +275,7 @@ PS2MouseDriverStart ( &MouseDev->SimplePointerProtocol, FeaturePcdGet (PcdPs2MouseExtendedVerification) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // mouse not connected // @@ -293,7 +293,7 @@ PS2MouseDriverStart ( MouseDev, &((MouseDev->SimplePointerProtocol).WaitForInput) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -307,7 +307,7 @@ PS2MouseDriverStart ( MouseDev, &MouseDev->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -315,7 +315,7 @@ PS2MouseDriverStart ( // Start timer to poll mouse (100 samples per second) // Status = gBS->SetTimer (MouseDev->TimerEvent, TimerPeriodic, 100000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -346,7 +346,7 @@ PS2MouseDriverStart ( &MouseDev->SimplePointerProtocol, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -386,13 +386,13 @@ ErrorExit: // exhaust input data just in case there is still mouse data left // EmptyStatus = EFI_SUCCESS; - while (!EFI_ERROR (EmptyStatus)) { + while (!EFI_ERROR(EmptyStatus)) { EmptyStatus = In8042Data (IsaIo, &Data); } } if (MouseDev != NULL) { - FreePool (MouseDev); + FreePool(MouseDev); } gBS->CloseProtocol ( @@ -450,7 +450,7 @@ PS2MouseDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -470,7 +470,7 @@ PS2MouseDriverStop ( &gEfiSimplePointerProtocolGuid, &MouseDev->SimplePointerProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -485,13 +485,13 @@ PS2MouseDriverStop ( // exhaust input data just in case there is still mouse data left // Status = EFI_SUCCESS; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = In8042Data (MouseDev->IsaIo, &Data); } gBS->CloseEvent (MouseDev->SimplePointerProtocol.WaitForInput); FreeUnicodeStringTable (MouseDev->ControllerNameTable); - FreePool (MouseDev); + FreePool(MouseDev); gBS->CloseProtocol ( Controller, @@ -559,7 +559,7 @@ MouseReset ( // Exhaust input data // Status = EFI_SUCCESS; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = In8042Data (MouseDev->IsaIo, &Data); } @@ -587,31 +587,31 @@ MouseReset ( // Send mouse reset command and set mouse default configure // Status = PS2MouseReset (MouseDev->IsaIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseSetSampleRate (MouseDev->IsaIo, MouseDev->SampleRate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseSetResolution (MouseDev->IsaIo, MouseDev->Resolution); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseSetScaling (MouseDev->IsaIo, MouseDev->Scaling); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseEnable (MouseDev->IsaIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -644,7 +644,7 @@ CheckMouseConnect ( EFI_STATUS Status; Status = PS2MouseEnable (MouseDev->IsaIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return TRUE; } @@ -782,7 +782,7 @@ InitializePs2Mouse( &gPs2MouseComponentName, &gPs2MouseComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; diff --git a/Drivers/OhciDxe/Ohci.c b/Drivers/OhciDxe/Ohci.c index 8da0b2042..57cab264b 100644 --- a/Drivers/OhciDxe/Ohci.c +++ b/Drivers/OhciDxe/Ohci.c @@ -72,7 +72,7 @@ OhciReset ( if ((Attributes & EFI_USB_HC_RESET_HOST_CONTROLLER) != 0) { gBS->Stall (50 * 1000); Status = OhciSetHcCommandStatus (Ohc, HC_RESET, HC_RESET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } gBS->Stall (50 * 1000); @@ -83,7 +83,7 @@ OhciReset ( do { gBS->Stall (1 * 1000); Data32 = OhciGetOperationalReg (Ohc->PciIo, HC_COMMAND_STATUS ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } if ((Data32 & HC_RESET) == 0) { @@ -100,7 +100,7 @@ OhciReset ( OhciSetFrameInterval (Ohc, FRAME_INTERVAL, 0x2edf); if ((Attributes & EFI_USB_HC_RESET_GLOBAL) != 0) { Status = OhciSetHcControl (Ohc, HC_FUNCTIONAL_STATE, HC_STATE_RESET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } gBS->Stall (50 * 1000); @@ -124,7 +124,7 @@ OhciReset ( OhciSetRootHubPortStatus (Ohc, 0, RH_SET_PORT_POWER); OhciGetRootHubNumOfPorts (This, &NumOfPorts); for (Index = 0; Index < NumOfPorts; Index++) { - if (!EFI_ERROR (OhciSetRootHubPortFeature (This, Index, EfiUsbPortReset))) { + if (!EFI_ERROR(OhciSetRootHubPortFeature (This, Index, EfiUsbPortReset))) { gBS->Stall (200 * 1000); OhciClearRootHubPortFeature (This, Index, EfiUsbPortReset); gBS->Stall (1000); @@ -1006,7 +1006,7 @@ OhciInterruptTransfer ( &MapPyhAddr, &Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "OhciInterruptTransfer: Failt to PciIo->Map buffer \r\n")); goto EXIT; } @@ -1273,7 +1273,7 @@ OhciAsyncInterruptTransfer ( ); if ( UCBuffer ) { // if (EFI_ERROR(Status)) { - gBS->FreePool (UCBuffer); + gBS->FreePool(UCBuffer); // } } return Status; @@ -1370,7 +1370,7 @@ OhciSyncInterruptTransfer ( &HeadTd ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = CheckIfDone (Ohc, INTERRUPT_LIST, Ed, HeadTd, &EdResult); while (Status == EFI_NOT_READY && TimeOut > 0) { gBS->Stall (1000); @@ -1398,7 +1398,7 @@ OhciSyncInterruptTransfer ( NULL, NULL ); - gBS->FreePool (UCBuffer); + gBS->FreePool(UCBuffer); return Status; } /** @@ -1979,7 +1979,7 @@ OHCIDriverBindingSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1991,7 +1991,7 @@ OHCIDriverBindingSupported ( &UsbClassCReg ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto ON_EXIT; } @@ -2093,7 +2093,7 @@ OhciAllocateDev ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_MEM_POOL; } @@ -2106,7 +2106,7 @@ OhciAllocateDev ( &Map ); - if (EFI_ERROR (Status) || (Bytes != 4096)) { + if (EFI_ERROR(Status) || (Bytes != 4096)) { goto FREE_MEM_PAGE; } @@ -2160,7 +2160,7 @@ OhciFreeDev ( FreeUnicodeStringTable (Ohc->ControllerNameTable); } - FreePool (Ohc); + FreePool(Ohc); } /** @@ -2287,7 +2287,7 @@ OHCIDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2302,7 +2302,7 @@ OHCIDriverBindingStart ( &OriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } PciAttributesSaved = TRUE; @@ -2321,7 +2321,7 @@ OHCIDriverBindingStart ( 0, &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -2331,7 +2331,7 @@ OHCIDriverBindingStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } // @@ -2344,7 +2344,7 @@ OHCIDriverBindingStart ( } //Status = OhciInitializeInterruptList ( Uhc ); - //if (EFI_ERROR (Status)) { + //if (EFI_ERROR(Status)) { // goto FREE_OHC; //} @@ -2358,7 +2358,7 @@ OHCIDriverBindingStart ( Ohc, &Ohc->HouseKeeperTimer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_OHC; } @@ -2366,7 +2366,7 @@ OHCIDriverBindingStart ( //Status = gBS->SetTimer (Ohc->HouseKeeperTimer, TimerPeriodic, 100 * 1000 * 10); Status = gBS->SetTimer (Ohc->HouseKeeperTimer, TimerPeriodic, 50 * 1000 * 10); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_OHC; } // @@ -2398,7 +2398,7 @@ OHCIDriverBindingStart ( EFI_NATIVE_INTERFACE, &Ohc->UsbHc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "Install protocol error")); goto FREE_OHC; } @@ -2413,7 +2413,7 @@ OHCIDriverBindingStart ( &gEfiEventExitBootServicesGuid, &Ohc->ExitBootServiceEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "Create exit boot event error")); goto UNINSTALL_USBHC; } @@ -2500,7 +2500,7 @@ OHCIDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/OhciDxe/OhciReg.c b/Drivers/OhciDxe/OhciReg.c index ee088c1bb..6151a1caa 100644 --- a/Drivers/OhciDxe/OhciReg.c +++ b/Drivers/OhciDxe/OhciReg.c @@ -719,7 +719,7 @@ OhciSetMemoryPointer( Status = OhciSetOperationalReg (Ohc->PciIo, (UINT32)PointerType, &Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/PartitionDxe/Apple.c b/Drivers/PartitionDxe/Apple.c index a23cd52cf..4f0e92551 100644 --- a/Drivers/PartitionDxe/Apple.c +++ b/Drivers/PartitionDxe/Apple.c @@ -125,7 +125,7 @@ PartitionInstallAppleChildHandles ( Block ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Found = Status; break; } @@ -169,7 +169,7 @@ PartitionInstallAppleChildHandles ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; goto done; /* would break, but ... */ } @@ -223,7 +223,7 @@ PartitionInstallAppleChildHandles ( FALSE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Found = EFI_SUCCESS; } } @@ -231,7 +231,7 @@ PartitionInstallAppleChildHandles ( } while (0); done: - FreePool (Block); + FreePool(Block); return Found; } diff --git a/Drivers/PartitionDxe/ElTorito.c b/Drivers/PartitionDxe/ElTorito.c index e22ce1591..b4a2c5bc9 100644 --- a/Drivers/PartitionDxe/ElTorito.c +++ b/Drivers/PartitionDxe/ElTorito.c @@ -112,7 +112,7 @@ PartitionInstallElToritoChildHandles ( SIZE_2KB, VolDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Found = Status; break; } @@ -159,7 +159,7 @@ PartitionInstallElToritoChildHandles ( SIZE_2KB, Catalog ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG ("EltCheckDevice: error reading catalog %r\n", Status); continue; } @@ -283,13 +283,13 @@ PartitionInstallElToritoChildHandles ( SubBlockSize, FALSE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Found = EFI_SUCCESS; } } } - FreePool (VolDescriptor); + FreePool(VolDescriptor); return Found; } diff --git a/Drivers/PartitionDxe/Gpt.c b/Drivers/PartitionDxe/Gpt.c index 74ce9d581..23216c304 100644 --- a/Drivers/PartitionDxe/Gpt.c +++ b/Drivers/PartitionDxe/Gpt.c @@ -252,7 +252,7 @@ PartitionInstallGptChildHandles ( BlockSize, ProtectiveMbr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GptValidStatus = Status; goto Done; } @@ -336,7 +336,7 @@ PartitionInstallGptChildHandles ( PrimaryHeader->NumberOfPartitionEntries * (PrimaryHeader->SizeOfPartitionEntry), PartEntry ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GptValidStatus = Status; // DEBUG ((EFI_D_ERROR, " Partition Entry ReadDisk error\n")); goto Done; @@ -418,19 +418,19 @@ PartitionInstallGptChildHandles ( Done: if (ProtectiveMbr != NULL) { - FreePool (ProtectiveMbr); + FreePool(ProtectiveMbr); } if (PrimaryHeader != NULL) { - FreePool (PrimaryHeader); + FreePool(PrimaryHeader); } if (BackupHeader != NULL) { - FreePool (BackupHeader); + FreePool(BackupHeader); } if (PartEntry != NULL) { - FreePool (PartEntry); + FreePool(PartEntry); } if (PEntryStatus != NULL) { - FreePool (PEntryStatus); + FreePool(PEntryStatus); } return GptValidStatus; @@ -483,8 +483,8 @@ PartitionValidGptTable ( BlockSize, PartHdr ); - if (EFI_ERROR (Status)) { - FreePool (PartHdr); + if (EFI_ERROR(Status)) { + FreePool(PartHdr); return FALSE; } @@ -494,7 +494,7 @@ PartitionValidGptTable ( (PartHdr->SizeOfPartitionEntry < sizeof (EFI_PARTITION_ENTRY)) ) { DEBUG ((EFI_D_INFO, "Invalid efi partition table header\n")); - FreePool (PartHdr); + FreePool(PartHdr); return FALSE; } @@ -502,18 +502,18 @@ PartitionValidGptTable ( // Ensure the NumberOfPartitionEntries * SizeOfPartitionEntry doesn't overflow. // if (PartHdr->NumberOfPartitionEntries > DivU64x32 (MAX_UINTN, PartHdr->SizeOfPartitionEntry)) { - FreePool (PartHdr); + FreePool(PartHdr); return FALSE; } CopyMem (PartHeader, PartHdr, sizeof (EFI_PARTITION_TABLE_HEADER)); if (!PartitionCheckGptEntryArrayCRC (BlockIo, DiskIo, PartHeader)) { - FreePool (PartHdr); + FreePool(PartHdr); return FALSE; } DEBUG ((EFI_D_INFO, " Valid efi partition table header\n")); - FreePool (PartHdr); + FreePool(PartHdr); return TRUE; } @@ -557,21 +557,21 @@ PartitionCheckGptEntryArrayCRC ( PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (Ptr); + if (EFI_ERROR(Status)) { + FreePool(Ptr); return FALSE; } Size = PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry; Status = gBS->CalculateCrc32 (Ptr, Size, &Crc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "CheckPEntryArrayCRC: Crc calculation failed\n")); - FreePool (Ptr); + FreePool(Ptr); return FALSE; } - FreePool (Ptr); + FreePool(Ptr); return (BOOLEAN) (PartHeader->PartitionEntryArrayCRC32 == Crc); } @@ -634,7 +634,7 @@ PartitionRestoreGptTable ( BlockSize, PartHdr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -652,7 +652,7 @@ PartitionRestoreGptTable ( PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry, Ptr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -665,13 +665,13 @@ PartitionRestoreGptTable ( ); Done: - FreePool (PartHdr); + FreePool(PartHdr); if (Ptr != NULL) { - FreePool (Ptr); + FreePool(Ptr); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -849,7 +849,7 @@ PartitionCheckCrcAltSize ( Hdr->CRC32 = 0; Status = gBS->CalculateCrc32 ((UINT8 *) Hdr, Size, &Crc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "CheckCrc32: Crc calculation failed\n")); return FALSE; } diff --git a/Drivers/PartitionDxe/Mbr.c b/Drivers/PartitionDxe/Mbr.c index ee18ad2f8..34e772143 100644 --- a/Drivers/PartitionDxe/Mbr.c +++ b/Drivers/PartitionDxe/Mbr.c @@ -157,7 +157,7 @@ PartitionInstallMbrChildHandles ( BlockSize, Mbr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Found = Status; goto Done; } @@ -242,7 +242,7 @@ PartitionInstallMbrChildHandles ( (BOOLEAN) (Mbr->Partition[Index].OSIndicator == EFI_PARTITION) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Found = EFI_SUCCESS; } } @@ -262,7 +262,7 @@ PartitionInstallMbrChildHandles ( BlockSize, Mbr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Found = Status; goto Done; } @@ -303,7 +303,7 @@ PartitionInstallMbrChildHandles ( MBR_SIZE, (BOOLEAN) (Mbr->Partition[0].OSIndicator == EFI_PARTITION) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Found = EFI_SUCCESS; } @@ -324,7 +324,7 @@ PartitionInstallMbrChildHandles ( } Done: - FreePool (Mbr); + FreePool(Mbr); return Found; } diff --git a/Drivers/PartitionDxe/Partition.c b/Drivers/PartitionDxe/Partition.c index 4fb68edc2..0eb4f3025 100644 --- a/Drivers/PartitionDxe/Partition.c +++ b/Drivers/PartitionDxe/Partition.c @@ -135,7 +135,7 @@ PartitionDriverBindingSupported ( if (Status == EFI_ALREADY_STARTED) { return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -163,7 +163,7 @@ PartitionDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -265,7 +265,7 @@ PartitionDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -277,7 +277,7 @@ PartitionDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BlockIo2 = NULL; } @@ -292,7 +292,7 @@ PartitionDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { goto Exit; } @@ -308,7 +308,7 @@ PartitionDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); //Slice - DiskIo already started, what else? - if (EFI_ERROR (Status) /* && Status != EFI_ALREADY_STARTED*/) { + if (EFI_ERROR(Status) /* && Status != EFI_ALREADY_STARTED*/) { gBS->CloseProtocol ( ControllerHandle, &gEfiDevicePathProtocolGuid, @@ -329,7 +329,7 @@ PartitionDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { DiskIo2 = NULL; } @@ -356,7 +356,7 @@ PartitionDriverBindingStart ( BlockIo2, ParentDevicePath ); - if (!EFI_ERROR (Status) || (Status == EFI_MEDIA_CHANGED)|| (Status == EFI_NO_MEDIA)) { + if (!EFI_ERROR(Status) || (Status == EFI_MEDIA_CHANGED)|| (Status == EFI_NO_MEDIA)) { DBG("Handle %x check partition Status=%r\n", ControllerHandle, Status); /*if (Status != EFI_NO_MEDIA) { DBG("Parent=%s\n", DevicePathToStr(ParentDevicePath)); //have no function @@ -378,8 +378,8 @@ PartitionDriverBindingStart ( // when this happen. The "media change" case includes either the status is // EFI_MEDIA_CHANGED or it is a "media" to "no media" change. // - if (EFI_ERROR (Status) && - !EFI_ERROR (OpenStatus) && + if (EFI_ERROR(Status) && + !EFI_ERROR(OpenStatus) && (Status != EFI_MEDIA_CHANGED) && !(MediaPresent && (Status == EFI_NO_MEDIA))) { gBS->CloseProtocol ( @@ -540,7 +540,7 @@ PartitionDriverBindingStop ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( ControllerHandle, &gEfiDiskIoProtocolGuid, @@ -550,11 +550,11 @@ PartitionDriverBindingStop ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); } else { - FreePool (Private->DevicePath); - FreePool (Private); + FreePool(Private->DevicePath); + FreePool(Private); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -834,7 +834,7 @@ PartitionOnAccessComplete ( Task->BlockIo2Token->TransactionStatus = Task->DiskIo2Token.TransactionStatus; gBS->SignalEvent (Task->BlockIo2Token->Event); - FreePool (Task); + FreePool(Task); } /** @@ -864,8 +864,8 @@ PartitionCreateAccessTask ( Task, &Task->DiskIo2Token.Event ); - if (EFI_ERROR (Status)) { - FreePool (Task); + if (EFI_ERROR(Status)) { + FreePool(Task); return NULL; } @@ -941,9 +941,9 @@ PartitionReadBlocksEx ( } Status = Private->DiskIo2->ReadDiskEx (Private->DiskIo2, MediaId, Offset, &Task->DiskIo2Token, BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (Task->DiskIo2Token.Event); - FreePool (Task); + FreePool(Task); } } else { Status = Private->DiskIo2->ReadDiskEx (Private->DiskIo2, MediaId, Offset, NULL, BufferSize, Buffer); @@ -1017,9 +1017,9 @@ PartitionWriteBlocksEx ( } Status = Private->DiskIo2->WriteDiskEx (Private->DiskIo2, MediaId, Offset, &Task->DiskIo2Token, BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (Task->DiskIo2Token.Event); - FreePool (Task); + FreePool(Task); } } else { Status = Private->DiskIo2->WriteDiskEx (Private->DiskIo2, MediaId, Offset, NULL, BufferSize, Buffer); @@ -1069,9 +1069,9 @@ PartitionFlushBlocksEx ( } Status = Private->DiskIo2->FlushDiskEx (Private->DiskIo2, &Task->DiskIo2Token); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (Task->DiskIo2Token.Event); - FreePool (Task); + FreePool(Task); } } else { Status = Private->DiskIo2->FlushDiskEx (Private->DiskIo2, NULL); @@ -1199,7 +1199,7 @@ PartitionInstallChildHandle ( Private->DevicePath = AppendDevicePathNode (ParentDevicePath, DevicePathNode); if (Private->DevicePath == NULL) { - FreePool (Private); + FreePool(Private); return EFI_OUT_OF_RESOURCES; } @@ -1242,7 +1242,7 @@ PartitionInstallChildHandle ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Open the Parent Handle for the child // @@ -1255,8 +1255,8 @@ PartitionInstallChildHandle ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); } else { - FreePool (Private->DevicePath); - FreePool (Private); + FreePool(Private->DevicePath); + FreePool(Private); } return Status; @@ -1293,7 +1293,7 @@ InitializePartition ( &gPartitionComponentName, &gPartitionComponentName2 ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; diff --git a/Drivers/SataControllerDxe/ComponentName.c b/Drivers/SataControllerDxe/ComponentName.c index 57cd3c88d..6721fd258 100644 --- a/Drivers/SataControllerDxe/ComponentName.c +++ b/Drivers/SataControllerDxe/ComponentName.c @@ -158,7 +158,7 @@ SataControllerComponentNameGetControllerName ( gSataControllerDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/SataControllerDxe/SataController.c b/Drivers/SataControllerDxe/SataController.c index 78ea3e243..73f5b331e 100644 --- a/Drivers/SataControllerDxe/SataController.c +++ b/Drivers/SataControllerDxe/SataController.c @@ -325,7 +325,7 @@ InitializeSataControllerDriver ( &gSataControllerComponentName, &gSataControllerComponentName2 ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } @@ -367,7 +367,7 @@ SataControllerSupported ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -382,7 +382,7 @@ SataControllerSupported ( sizeof (PciData.Hdr.ClassCode), PciData.Hdr.ClassCode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -438,7 +438,7 @@ SataControllerStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG(L"SataControllerStart error return status = %r\n", Status); return Status; } @@ -472,8 +472,8 @@ SataControllerStart ( sizeof (PciData.Hdr.ClassCode), PciData.Hdr.ClassCode ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { goto Done; } @@ -549,7 +549,7 @@ SataControllerStart ( ); Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, @@ -560,16 +560,16 @@ Done: if (SataPrivateData != NULL) { /* if (SataPrivateData->DisqulifiedModes != NULL) { - FreePool (SataPrivateData->DisqulifiedModes); + FreePool(SataPrivateData->DisqulifiedModes); } if (SataPrivateData->IdentifyData != NULL) { - FreePool (SataPrivateData->IdentifyData); + FreePool(SataPrivateData->IdentifyData); } if (SataPrivateData->IdentifyValid != NULL) { - FreePool (SataPrivateData->IdentifyValid); + FreePool(SataPrivateData->IdentifyValid); } */ - FreePool (SataPrivateData); + FreePool(SataPrivateData); } } @@ -614,7 +614,7 @@ SataControllerStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -631,20 +631,20 @@ SataControllerStop ( &(SataPrivateData->IdeInit), NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (SataPrivateData->DisqulifiedModes != NULL) { - FreePool (SataPrivateData->DisqulifiedModes); + FreePool(SataPrivateData->DisqulifiedModes); } if (SataPrivateData->IdentifyData != NULL) { - FreePool (SataPrivateData->IdentifyData); + FreePool(SataPrivateData->IdentifyData); } if (SataPrivateData->IdentifyValid != NULL) { - FreePool (SataPrivateData->IdentifyValid); + FreePool(SataPrivateData->IdentifyValid); } - FreePool (SataPrivateData); + FreePool(SataPrivateData); } // @@ -791,7 +791,7 @@ IdeInitNotifyPhase ( sizeof (PciData.Hdr.ClassCode), PciData.Hdr.ClassCode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -846,15 +846,15 @@ IdeInitNotifyPhase ( } Done: - if (EFI_ERROR (Status) && SataPrivateData != NULL) { + if (EFI_ERROR(Status) && SataPrivateData != NULL) { if (SataPrivateData->DisqulifiedModes != NULL) { - FreePool (SataPrivateData->DisqulifiedModes); + FreePool(SataPrivateData->DisqulifiedModes); } if (SataPrivateData->IdentifyData != NULL) { - FreePool (SataPrivateData->IdentifyData); + FreePool(SataPrivateData->IdentifyData); } if (SataPrivateData->IdentifyValid != NULL) { - FreePool (SataPrivateData->IdentifyValid); + FreePool(SataPrivateData->IdentifyValid); } } } @@ -1109,7 +1109,7 @@ IdeInitCalculateMode ( // Make sure we've got the valid identify data of the device from SubmitData() // if (!IdentifyValid) { - FreePool (*SupportedModes); + FreePool(*SupportedModes); return EFI_NOT_READY; } @@ -1118,7 +1118,7 @@ IdeInitCalculateMode ( (DisqulifiedModes->PioMode.Valid ? ((UINT16 *) &(DisqulifiedModes->PioMode.Mode)) : NULL), &SelectedMode ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { (*SupportedModes)->PioMode.Valid = TRUE; (*SupportedModes)->PioMode.Mode = SelectedMode; //Slice -> 3 @@ -1135,7 +1135,7 @@ IdeInitCalculateMode ( (DisqulifiedModes->UdmaMode.Valid ? ((UINT16 *) &(DisqulifiedModes->UdmaMode.Mode)) : NULL), &SelectedMode ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { (*SupportedModes)->UdmaMode.Valid = TRUE; (*SupportedModes)->UdmaMode.Mode = SelectedMode; } else { diff --git a/Drivers/UsbBusDxe/UsbBus.c b/Drivers/UsbBusDxe/UsbBus.c index 72c173e99..8a57421c5 100644 --- a/Drivers/UsbBusDxe/UsbBus.c +++ b/Drivers/UsbBusDxe/UsbBus.c @@ -119,7 +119,7 @@ UsbIoControlTransfer ( UsbStatus ); - if (EFI_ERROR (Status) || (*UsbStatus != EFI_USB_NOERROR)) { + if (EFI_ERROR(Status) || (*UsbStatus != EFI_USB_NOERROR)) { // // Clear TT buffer when CTRL/BULK split transaction failes // Clear the TRANSLATOR TT buffer, not parent's buffer @@ -208,7 +208,7 @@ UsbIoControlTransfer ( Status = UsbSelectSetting (UsbIf->IfDesc, (UINT8) Request->Value); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (UsbIf->IfDesc->ActiveIndex < USB_MAX_INTERFACE_SETTING); UsbIf->IfSetting = UsbIf->IfDesc->Settings[UsbIf->IfDesc->ActiveIndex]; } @@ -292,7 +292,7 @@ UsbIoBulkTransfer ( EpDesc->Toggle = Toggle; - if (EFI_ERROR (Status) || (*UsbStatus != EFI_USB_NOERROR)) { + if (EFI_ERROR(Status) || (*UsbStatus != EFI_USB_NOERROR)) { // // Clear TT buffer when CTRL/BULK split transaction failes. // Clear the TRANSLATOR TT buffer, not parent's buffer @@ -803,7 +803,7 @@ UsbIoGetStringDescriptor ( Status = EFI_SUCCESS; FREE_STR: - gBS->FreePool (StrDesc); + gBS->FreePool(StrDesc); ON_EXIT: gBS->RestoreTPL (OldTpl); @@ -847,7 +847,7 @@ UsbIoPortReset ( HubIf = Dev->ParentIf; Status = HubIf->HubApi->ResetPort (HubIf, Dev->ParentPort); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG (( EFI_D_ERROR, "UsbIoPortReset: failed to reset hub port %d@hub %d, %r \n", // Dev->ParentPort, Dev->ParentAddr, Status)); DBG("UsbIoPortReset: failed to reset hub port %d@hub %d, %r \n", @@ -869,7 +869,7 @@ UsbIoPortReset ( DBG("USB_SET_DEVICE_ADDRESS_STALL\n"); gBS->Stall (USB_SET_DEVICE_ADDRESS_STALL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // It may fail due to device disconnection or other reasons. // @@ -889,7 +889,7 @@ UsbIoPortReset ( if (Dev->ActiveConfig != NULL) { Status = UsbSetConfig (Dev, Dev->ActiveConfig->Desc.ConfigurationValue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG (( EFI_D_ERROR, "UsbIoPortReset: failed to set configure for device %d - %r\n", // Dev->Address, Status)); DBG( "UsbIoPortReset: failed to set configure for device %d - %r\n", @@ -948,10 +948,10 @@ UsbBusBuildProtocol ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to open device path %r\n", Status)); DBG("UsbBusStart: Failed to open device path %r\n", Status); - FreePool (UsbBus); + FreePool(UsbBus); return Status; } @@ -981,14 +981,14 @@ UsbBusBuildProtocol ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && EFI_ERROR (Status2)) { + if (EFI_ERROR(Status) && EFI_ERROR(Status2)) { // DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to open USB_HC/USB2_HC %r\n", Status)); DBG("UsbBusStart: Failed to open USB_HC/USB2_HC %r\n", Status); Status = EFI_DEVICE_ERROR; goto CLOSE_HC; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The EFI_USB2_HC_PROTOCOL is produced for XHCI support. // Then its max supported devices are 256. Otherwise it's 128. @@ -1012,7 +1012,7 @@ UsbBusBuildProtocol ( &UsbBus->BusId ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to install bus protocol %r\n", Status)); DBG("UsbBusStart: Failed to install bus protocol %r\n", Status); goto CLOSE_HC; @@ -1023,8 +1023,8 @@ UsbBusBuildProtocol ( // InitializeListHead (&UsbBus->WantedUsbIoDPList); Status = UsbBusAddWantedUsbIoDP (&UsbBus->BusId, RemainingDevicePath); -// ASSERT (!EFI_ERROR (Status)); - if (EFI_ERROR (Status)) { +// ASSERT (!EFI_ERROR(Status)); + if (EFI_ERROR(Status)) { goto UNINSTALL_USBBUS; } // @@ -1040,7 +1040,7 @@ UsbBusBuildProtocol ( RootIf = AllocateZeroPool (sizeof (USB_INTERFACE)); if (RootIf == NULL) { - FreePool (RootHub); + FreePool(RootHub); Status = EFI_OUT_OF_RESOURCES; goto FREE_ROOTHUB; } @@ -1064,7 +1064,7 @@ UsbBusBuildProtocol ( DBG("Start init USB\n"); Status = mUsbRootHubApi.Init (RootIf); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to init root hub %r\n", Status)); DBG("UsbBusStart: Failed to init root hub %r\n", Status); goto FREE_ROOTHUB; @@ -1078,10 +1078,10 @@ UsbBusBuildProtocol ( FREE_ROOTHUB: if (RootIf != NULL) { - FreePool (RootIf); + FreePool(RootIf); } if (RootHub != NULL) { - FreePool (RootHub); + FreePool(RootHub); } UNINSTALL_USBBUS: @@ -1110,7 +1110,7 @@ CLOSE_HC: This->DriverBindingHandle, Controller ); - FreePool (UsbBus); + FreePool(UsbBus); // DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to start bus driver %r\n", Status)); return Status; @@ -1211,7 +1211,7 @@ UsbBusControllerDriverSupported ( return EFI_SUCCESS; } // DBG("1\n"); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If failed to open USB_HC2, fall back to USB_HC // @@ -1227,7 +1227,7 @@ UsbBusControllerDriverSupported ( return EFI_SUCCESS; } // DBG("2\n"); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1269,7 +1269,7 @@ UsbBusControllerDriverSupported ( return EFI_SUCCESS; } // DBG("5\n"); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Close protocol, don't use device path protocol in the Support() function // @@ -1320,8 +1320,8 @@ UsbBusControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { DBG("Error started UsbBus status=%r\n", Status); return EFI_UNSUPPORTED; } @@ -1349,14 +1349,14 @@ UsbBusControllerDriverStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If first start, build the bus execute environment and install bus protocol // DBG("Report build protocol\n"); // REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_IO_BUS_USB | EFI_P_PC_ENABLE)); Status = UsbBusBuildProtocol (This, Controller, RemainingDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1370,8 +1370,8 @@ UsbBusControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); -// ASSERT (!EFI_ERROR (Status)); - if (EFI_ERROR (Status)) { +// ASSERT (!EFI_ERROR(Status)); + if (EFI_ERROR(Status)) { return Status; } } else { @@ -1395,14 +1395,14 @@ UsbBusControllerDriverStart ( } /* Status = */UsbBusAddWantedUsbIoDP (UsbBusId, RemainingDevicePath); - // ASSERT (!EFI_ERROR (Status)); + // ASSERT (!EFI_ERROR(Status)); // DBG("AddWanted status=%r\n", Status); // // Ensure all wanted child usb devices are fully recursively connected // /* Status = */UsbBusRecursivelyConnectWantedUsbIo (UsbBusId); // DBG("RecursivelyConnect status=%r\n", Status); -// ASSERT (!EFI_ERROR (Status)); +// ASSERT (!EFI_ERROR(Status)); } // DBG("UsbBus started!\n"); @@ -1463,7 +1463,7 @@ UsbBusControllerDriverStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // It is possible that the child has already been released: // 1. For combo device, free one device will release others. @@ -1497,7 +1497,7 @@ UsbBusControllerDriverStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1523,7 +1523,7 @@ UsbBusControllerDriverStop ( for (Index = 1; Index < Bus->MaxDevices; Index++) { if (Bus->Devices[Index] != NULL) { Status = UsbRemoveDevice (Bus->Devices[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -1531,12 +1531,12 @@ UsbBusControllerDriverStop ( gBS->RestoreTPL (OldTpl); - if (!EFI_ERROR (ReturnStatus)) { + if (!EFI_ERROR(ReturnStatus)) { mUsbRootHubApi.Release (RootIf); gBS->FreePool (RootIf); gBS->FreePool (RootHub); Status = UsbBusFreeUsbDPList (&Bus->WantedUsbIoDPList); -// ASSERT (!EFI_ERROR (Status)); +// ASSERT (!EFI_ERROR(Status)); // // Uninstall the bus identifier and close USB_HC/USB2_HC protocols @@ -1561,7 +1561,7 @@ UsbBusControllerDriverStop ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -1569,7 +1569,7 @@ UsbBusControllerDriverStop ( Controller ); - gBS->FreePool (Bus); + gBS->FreePool(Bus); } } return Status; diff --git a/Drivers/UsbBusDxe/UsbDesc.c b/Drivers/UsbBusDxe/UsbDesc.c index c47205d7a..6ac9c1f28 100644 --- a/Drivers/UsbBusDxe/UsbDesc.c +++ b/Drivers/UsbBusDxe/UsbDesc.c @@ -38,7 +38,7 @@ UsbFreeInterfaceDesc ( Ep = Setting->Endpoints[Index]; if (Ep != NULL) { - FreePool (Ep); + FreePool(Ep); } } @@ -46,11 +46,11 @@ UsbFreeInterfaceDesc ( // Only call FreePool() if NumEndpoints > 0. // if (Setting->Desc.NumEndpoints > 0) { - FreePool (Setting->Endpoints); + FreePool(Setting->Endpoints); } } - FreePool (Setting); + FreePool(Setting); } @@ -90,13 +90,13 @@ UsbFreeConfigDesc ( } } - FreePool (Interface); + FreePool(Interface); } - FreePool (Config->Interfaces); + FreePool(Config->Interfaces); } - FreePool (Config); + FreePool(Config); } @@ -121,10 +121,10 @@ UsbFreeDevDesc ( } } - FreePool (DevDesc->Configs); + FreePool(DevDesc->Configs); } - FreePool (DevDesc); + FreePool(DevDesc); } @@ -541,7 +541,7 @@ UsbGetMaxPacketSize0 ( for (Index = 0; Index < 3; Index++) { Status = UsbCtrlGetDesc (UsbDev, USB_DESC_TYPE_DEVICE, 0, 0, &DevDesc, 8); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((DevDesc.BcdUSB >= 0x0300) && (DevDesc.MaxPacketSize0 == 9)) { UsbDev->MaxPacket0 = 1 << 9; return EFI_SUCCESS; @@ -589,8 +589,8 @@ UsbGetDevDesc ( sizeof (EFI_USB_DEVICE_DESCRIPTOR) ); - if (EFI_ERROR (Status)) { - gBS->FreePool (DevDesc); + if (EFI_ERROR(Status)) { + gBS->FreePool(DevDesc); } else { UsbDev->DevDesc = DevDesc; } @@ -627,7 +627,7 @@ UsbGetOneString ( // Status = UsbCtrlGetDesc (UsbDev, USB_DESC_TYPE_STRING, Index, LangId, &Desc, 2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -646,8 +646,8 @@ UsbGetOneString ( Desc.Length ); - if (EFI_ERROR (Status)) { - FreePool (Buf); + if (EFI_ERROR(Status)) { + FreePool(Buf); return NULL; } @@ -702,7 +702,7 @@ UsbBuildLangTable ( UsbDev->TotalLangId = (UINT16)Max; ON_EXIT: - gBS->FreePool (Desc); + gBS->FreePool(Desc); return Status; } @@ -735,7 +735,7 @@ UsbGetOneConfig ( // Status = UsbCtrlGetDesc (UsbDev, USB_DESC_TYPE_CONFIG, Index, 0, &Desc, 8); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbGetOneConfig: failed to get descript length(%d) %r\n", Desc.TotalLength, Status)); @@ -752,10 +752,10 @@ UsbGetOneConfig ( Status = UsbCtrlGetDesc (UsbDev, USB_DESC_TYPE_CONFIG, Index, 0, Buf, Desc.TotalLength); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbGetOneConfig: failed to get full descript %r\n", Status)); - FreePool (Buf); + FreePool(Buf); return NULL; } @@ -792,7 +792,7 @@ UsbBuildDescTable ( // Status = UsbGetDevDesc (UsbDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbBuildDescTable: failed to get device descriptor - %r\n", Status)); return Status; } @@ -832,7 +832,7 @@ UsbBuildDescTable ( ConfigDesc = UsbParseConfigDesc ((UINT8 *) Config, Config->TotalLength); - FreePool (Config); + FreePool(Config); if (ConfigDesc == NULL) { DEBUG (( EFI_D_ERROR, "UsbBuildDescTable: failed to parse configure (index %d)\n", Index)); @@ -857,7 +857,7 @@ UsbBuildDescTable ( // Status = UsbBuildLangTable (UsbDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_INFO, "UsbBuildDescTable: get language ID table %r\n", Status)); } diff --git a/Drivers/UsbBusDxe/UsbEnumer.c b/Drivers/UsbBusDxe/UsbEnumer.c index 9806f37e2..34b7cd62e 100644 --- a/Drivers/UsbBusDxe/UsbEnumer.c +++ b/Drivers/UsbBusDxe/UsbEnumer.c @@ -89,10 +89,10 @@ UsbFreeInterface ( ); if (UsbIf->DevicePath != NULL) { - FreePool (UsbIf->DevicePath); + FreePool(UsbIf->DevicePath); } - FreePool (UsbIf); + FreePool(UsbIf); } @@ -173,7 +173,7 @@ UsbCreateInterface ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbCreateInterface: failed to install UsbIo - %r\n", Status)); goto ON_ERROR; } @@ -183,7 +183,7 @@ UsbCreateInterface ( // Status = UsbOpenHostProtoByChild (Device->Bus, UsbIf->Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( &UsbIf->Handle, &gEfiDevicePathProtocolGuid, @@ -202,10 +202,10 @@ UsbCreateInterface ( ON_ERROR: if (UsbIf->DevicePath != NULL) { - FreePool (UsbIf->DevicePath); + FreePool(UsbIf->DevicePath); } - FreePool (UsbIf); + FreePool(UsbIf); return NULL; } @@ -225,7 +225,7 @@ UsbFreeDevice ( UsbFreeDevDesc (Device->DevDesc); } - gBS->FreePool (Device); + gBS->FreePool(Device); } @@ -315,7 +315,7 @@ UsbConnectDriver ( gBS->RestoreTPL (TPL_CALLBACK); Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE); - UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR (Status); + UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR(Status); // DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl())); // ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK); @@ -468,7 +468,7 @@ UsbSelectConfig ( // Status = UsbConnectDriver (UsbIf); DBG("UsbSelect[%d]:%r\n", Index, Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbSelectConfig: failed to connect driver %r, ignored\n", Status)); } } @@ -516,7 +516,7 @@ UsbDisconnectDriver ( gBS->RestoreTPL (TPL_CALLBACK); Status = gBS->DisconnectController (UsbIf->Handle, NULL, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UsbIf->IsManaged = FALSE; } @@ -559,7 +559,7 @@ UsbRemoveConfig ( } Status = UsbDisconnectDriver (UsbIf); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UsbFreeInterface (UsbIf); Device->Interfaces[Index] = NULL; } else { @@ -607,7 +607,7 @@ UsbRemoveDevice ( DBG("Remove child %d\n", Index); Status = UsbRemoveDevice (Child); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Bus->Devices[Index] = NULL; } else { Bus->Devices[Index]->DisconnectFail = TRUE; @@ -617,13 +617,13 @@ UsbRemoveDevice ( } } - if (EFI_ERROR (ReturnStatus)) { + if (EFI_ERROR(ReturnStatus)) { return ReturnStatus; } Status = UsbRemoveConfig (Device); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // DEBUG (( EFI_D_INFO, "UsbRemoveDevice: device %d removed\n", Device->Address)); DBG("UsbRemoveDevice: device %d removed\n", Device->Address); @@ -720,7 +720,7 @@ UsbEnumerateNewDev ( // Status = HubApi->ResetPort (HubIf, Port); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to reset port %d - %r\n", Port, Status)); return Status; @@ -741,7 +741,7 @@ UsbEnumerateNewDev ( DBG("GetPortStatus\n"); Status = HubApi->GetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to get speed of port %d\n", Port)); goto ON_ERROR; } @@ -813,7 +813,7 @@ UsbEnumerateNewDev ( Child->Address = (UINT8)Address; Bus->Devices[Address] = Child; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to set device address - %r\n", Status)); goto ON_ERROR; } @@ -828,7 +828,7 @@ UsbEnumerateNewDev ( // Status = UsbGetMaxPacketSize0 (Child); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to get max packet for EP 0 - %r\n", Status)); DBG("UsbEnumerateNewDev: failed to get max packet for EP 0 - %r\n", Status); goto ON_ERROR; @@ -842,7 +842,7 @@ UsbEnumerateNewDev ( // Status = UsbBuildDescTable (Child); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to build descriptor table - %r\n", Status)); DBG("UsbEnumerateNewDev: failed to build descriptor table - %r\n", Status); goto ON_ERROR; @@ -855,7 +855,7 @@ UsbEnumerateNewDev ( Config = Child->DevDesc->Configs[0]->Desc.ConfigurationValue; Status = UsbSetConfig (Child, Config); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to set configure %d - %r\n", Config, Status)); DBG("UsbEnumerateNewDev: failed to set configure %d - %r\n", Config, Status); goto ON_ERROR; @@ -868,7 +868,7 @@ UsbEnumerateNewDev ( // Status = UsbSelectConfig (Child, Config); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to create interfaces - %r\n", Status)); DBG("UsbEnumerateNewDev: failed to create interfaces - %r\n", Status); goto ON_ERROR; @@ -942,7 +942,7 @@ UsbEnumeratePort ( // Status = HubApi->GetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "UsbEnumeratePort: failed to get state of port %d\n", Port)); DBG("UsbEnumeratePort: failed to get state of port %d\n", Port); return Status; @@ -1097,7 +1097,7 @@ UsbHubEnumeration ( UsbHubAckHubStatus (HubIf->Device); - gBS->FreePool (HubIf->ChangeMap); + gBS->FreePool(HubIf->ChangeMap); HubIf->ChangeMap = NULL; return ; } diff --git a/Drivers/UsbBusDxe/UsbHub.c b/Drivers/UsbBusDxe/UsbHub.c index d0de934fa..33aaddb93 100644 --- a/Drivers/UsbBusDxe/UsbHub.c +++ b/Drivers/UsbBusDxe/UsbHub.c @@ -504,7 +504,7 @@ UsbHubReadDesc ( // Status = UsbHubCtrlGetHubDesc (HubDev, HubDesc, 2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -539,7 +539,7 @@ UsbHubAckHubStatus ( Status = UsbHubCtrlGetHubStatus (HubDev, (UINT32 *) &HubState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -646,7 +646,7 @@ UsbOnHubInterrupt ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG (( EFI_D_ERROR, "UsbOnHubInterrupt: failed to remove async transfer - %r\n", Status)); return Status; } @@ -661,7 +661,7 @@ UsbOnHubInterrupt ( HubIf ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbOnHubInterrupt: failed to submit new async transfer - %r\n", Status)); } @@ -750,7 +750,7 @@ UsbHubInit ( Status = UsbHubReadDesc (HubDev, &HubDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG (( EFI_D_ERROR, "UsbHubInit: failed to read HUB descriptor %r\n", Status)); DBG("UsbHubInit: failed to read HUB descriptor %r\n", Status); return Status; @@ -809,7 +809,7 @@ UsbHubInit ( &HubIf->HubNotify ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG( "UsbHubInit: failed to create signal for hub %d - %r\n", HubDev->Address, Status); @@ -834,7 +834,7 @@ UsbHubInit ( HubIf ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG (( EFI_D_ERROR, "UsbHubInit: failed to queue interrupt transfer for hub %d - %r\n", // HubDev->Address, Status)); DBG("UsbHubInit: failed to queue interrupt transfer for hub %d - %r\n", @@ -902,7 +902,7 @@ UsbHubClearPortChange ( Status = UsbHubGetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -998,7 +998,7 @@ UsbHubResetPort ( Status = UsbHubGetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } else if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)) { // DEBUG (( EFI_D_INFO, "UsbHubResetPort: skip reset on hub %p port %d\n", HubIf, Port)); @@ -1007,7 +1007,7 @@ UsbHubResetPort ( Status = UsbHubSetPortFeature (HubIf, Port, (EFI_USB_PORT_FEATURE) USB_HUB_PORT_RESET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1025,11 +1025,11 @@ UsbHubResetPort ( for (Index = 0; Index < USB_WAIT_PORT_STS_CHANGE_LOOP; Index++) { Status = UsbHubGetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)) { gBS->Stall (USB_SET_PORT_RECOVERY_STALL); return EFI_SUCCESS; @@ -1069,7 +1069,7 @@ UsbHubRelease ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1107,7 +1107,7 @@ UsbRootHubInit ( Status = UsbHcGetCapability (HubIf->Device->Bus, &MaxSpeed, &NumOfPort, &Support64); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1133,7 +1133,7 @@ UsbRootHubInit ( &HubIf->HubNotify ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1149,7 +1149,7 @@ UsbRootHubInit ( USB_ROOTHUB_POLL_INTERVAL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (HubIf->HubNotify); } @@ -1208,7 +1208,7 @@ UsbRootHubClearPortChange ( Status = UsbRootHubGetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -1313,7 +1313,7 @@ UsbRootHubResetPort ( Status = UsbHcGetRootHubPortStatus (Bus, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } else if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)) { // DEBUG (( EFI_D_INFO, "UsbRootHubResetPort: skip reset on root port %d\n", Port)); @@ -1322,7 +1322,7 @@ UsbRootHubResetPort ( Status = UsbHcSetRootHubPortFeature (Bus, Port, EfiUsbPortReset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG (( EFI_D_ERROR, "UsbRootHubResetPort: failed to start reset on port %d\n", Port)); DBG("UsbRootHubResetPort: failed to start reset on port %d\n", Port); return Status; @@ -1336,7 +1336,7 @@ UsbRootHubResetPort ( Status = UsbHcClearRootHubPortFeature (Bus, Port, EfiUsbPortReset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG (( EFI_D_ERROR, "UsbRootHubResetPort: failed to clear reset on port %d\n", Port)); DBG("UsbRootHubResetPort: failed to clear reset on port %d\n", Port); return Status; @@ -1353,7 +1353,7 @@ UsbRootHubResetPort ( for (Index = 0; Index < USB_WAIT_PORT_STS_CHANGE_LOOP; Index++) { Status = UsbHcGetRootHubPortStatus (Bus, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1388,7 +1388,7 @@ UsbRootHubResetPort ( Status = UsbRootHubSetPortFeature (RootIf, Port, EfiUsbPortEnable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG (( EFI_D_ERROR, "UsbRootHubResetPort: failed to enable port %d for UHCI\n", Port)); DBG("UsbRootHubResetPort: failed to enable port %d for UHCI\n", Port); return Status; diff --git a/Drivers/UsbBusDxe/UsbUtility.c b/Drivers/UsbBusDxe/UsbUtility.c index ebd6ad68b..6fe1150cf 100644 --- a/Drivers/UsbBusDxe/UsbUtility.c +++ b/Drivers/UsbBusDxe/UsbUtility.c @@ -1133,7 +1133,7 @@ UsbBusFreeUsbDPList ( // ListIndex = ListIndex->ForwardLink; RemoveEntryList (&ListItem->Link); - FreePool (ListItem); + FreePool(ListItem); } InitializeListHead (UsbIoDPList); @@ -1189,8 +1189,8 @@ UsbBusAddWantedUsbIoDP ( // // DBG("UsbBusFreeUsbDPList\n"); Status = UsbBusFreeUsbDPList (&Bus->WantedUsbIoDPList); -// ASSERT (!EFI_ERROR (Status)); - if (EFI_ERROR (Status)) { +// ASSERT (!EFI_ERROR(Status)); + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -1215,9 +1215,9 @@ UsbBusAddWantedUsbIoDP ( return EFI_INVALID_PARAMETER; } Status = AddUsbDPToList (DevicePathPtr, &Bus->WantedUsbIoDPList); -// ASSERT (!EFI_ERROR (Status)); - FreePool (DevicePathPtr); - if (EFI_ERROR (Status)) { +// ASSERT (!EFI_ERROR(Status)); + FreePool(DevicePathPtr); + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -1330,7 +1330,7 @@ UsbBusIsWantedUsbIO ( WantedListIndex = WantedListIndex->ForwardLink; } - gBS->FreePool (DevicePathPtr); + gBS->FreePool(DevicePathPtr); // // Check whether the new Usb device path is wanted @@ -1381,8 +1381,8 @@ UsbBusRecursivelyConnectWantedUsbIo ( if (Status == EFI_NOT_FOUND || UsbIoHandleCount == 0) { return EFI_SUCCESS; } -// ASSERT (!EFI_ERROR (Status)); - if (EFI_ERROR (Status)) { +// ASSERT (!EFI_ERROR(Status)); + if (EFI_ERROR(Status)) { return Status; } @@ -1393,7 +1393,7 @@ UsbBusRecursivelyConnectWantedUsbIo ( // UsbIoDevicePath = NULL; Status = gBS->HandleProtocol (UsbIoBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID *) &UsbIoDevicePath); - if (EFI_ERROR (Status) || UsbIoDevicePath == NULL) { + if (EFI_ERROR(Status) || UsbIoDevicePath == NULL) { continue; } if (CompareMem ( @@ -1412,7 +1412,7 @@ UsbBusRecursivelyConnectWantedUsbIo ( &gEfiUsbIoProtocolGuid, (VOID **) &UsbIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } UsbIf = USB_INTERFACE_FROM_USBIO (UsbIo); @@ -1424,7 +1424,7 @@ UsbBusRecursivelyConnectWantedUsbIo ( // // DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL before connect is %d\n", (UINT32)UsbGetCurrentTpl ())); Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE); - UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR (Status); + UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR(Status); // DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl())); } } diff --git a/Drivers/UsbKbDxe/AppleKey.c b/Drivers/UsbKbDxe/AppleKey.c index 7fe36cf2e..9081404f3 100644 --- a/Drivers/UsbKbDxe/AppleKey.c +++ b/Drivers/UsbKbDxe/AppleKey.c @@ -49,7 +49,7 @@ UsbKbSetAppleKeyMapDb ( &UsbKeyboardDevice->KeyMapDbIndex ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UsbKeyboardDevice->KeyMapDb = AppleKeyMapDb; } return Status; @@ -81,7 +81,7 @@ UsbKbAppleKeyMapDbInstallNotify ( mAppleKeyMapDbRegistration, (VOID **)&mAppleKeyMapDb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UsbKbSetAppleKeyMapDb ((USB_KB_DEV *)Context, mAppleKeyMapDb); gBS->CloseEvent (Event); } @@ -105,7 +105,7 @@ UsbKbLocateAppleKeyMapDb ( NULL, (VOID **)&mAppleKeyMapDb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UsbKbSetAppleKeyMapDb (UsbKeyboardDevice, mAppleKeyMapDb); } else /*if (PcdGetBool (PcdNotifyAppleKeyMapDbInUsbKbDriver))*/ { //true diff --git a/Drivers/UsbKbDxe/ComponentName.c b/Drivers/UsbKbDxe/ComponentName.c index 186bdbe95..f17567a57 100644 --- a/Drivers/UsbKbDxe/ComponentName.c +++ b/Drivers/UsbKbDxe/ComponentName.c @@ -180,7 +180,7 @@ UsbKeyboardComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiUsbIoProtocolGuid, @@ -206,7 +206,7 @@ UsbKeyboardComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/UsbKbDxe/EfiKey.c b/Drivers/UsbKbDxe/EfiKey.c index 36a3f2cd7..e0df7c292 100644 --- a/Drivers/UsbKbDxe/EfiKey.c +++ b/Drivers/UsbKbDxe/EfiKey.c @@ -66,7 +66,7 @@ USBKeyboardDriverBindingEntryPoint ( if (EFI_ERROR(Status)) { // Discuss - we can't return Status? We have to always return SUCCESS? // This handle is clean, the installation on it is successful if EFI system is good enough. - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); return Status; } @@ -114,7 +114,7 @@ USBKeyboardDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -193,7 +193,7 @@ USBKeyboardDriverBindingStart ( NULL, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit1; } @@ -206,7 +206,7 @@ USBKeyboardDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit1; } @@ -228,7 +228,7 @@ USBKeyboardDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -259,7 +259,7 @@ USBKeyboardDriverBindingStart ( &UsbKeyboardDevice->DeviceDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -274,7 +274,7 @@ USBKeyboardDriverBindingStart ( EndpointNumber = UsbKeyboardDevice->InterfaceDescriptor.NumEndpoints; if (EndpointNumber == 0) { - gBS->FreePool (UsbKeyboardDevice); + gBS->FreePool(UsbKeyboardDevice); gBS->CloseProtocol ( Controller, &gEfiUsbIoProtocolGuid, @@ -348,10 +348,10 @@ USBKeyboardDriverBindingStart ( UsbKeyboardDevice, &UsbKeyboardDevice->TimerEvent ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->SetTimer (UsbKeyboardDevice->TimerEvent, TimerPeriodic, KEYBOARD_TIMER_INTERVAL); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -363,7 +363,7 @@ USBKeyboardDriverBindingStart ( &(UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -374,7 +374,7 @@ USBKeyboardDriverBindingStart ( UsbKeyboardDevice, &(UsbKeyboardDevice->SimpleInput.WaitForKey) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -385,7 +385,7 @@ USBKeyboardDriverBindingStart ( UsbKeyboardDevice, &UsbKeyboardDevice->KeyNotifyProcessEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -404,13 +404,13 @@ USBKeyboardDriverBindingStart ( &UsbKeyboardDevice->SimpleInputEx, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } UsbKeyboardDevice->ControllerHandle = Controller; Status = InitKeyboardLayout (UsbKeyboardDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Controller, &gEfiSimpleTextInProtocolGuid, @@ -430,7 +430,7 @@ USBKeyboardDriverBindingStart ( &UsbKeyboardDevice->SimpleInputEx, TRUE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Controller, &gEfiSimpleTextInProtocolGuid, @@ -459,7 +459,7 @@ USBKeyboardDriverBindingStart ( UsbKeyboardDevice ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Controller, &gEfiSimpleTextInProtocolGuid, @@ -532,7 +532,7 @@ ErrorExit: gBS->CloseEvent (UsbKeyboardDevice->ExitBootServicesEvent); } #endif - FreePool (UsbKeyboardDevice); + FreePool(UsbKeyboardDevice); UsbKeyboardDevice = NULL; } gBS->CloseProtocol ( @@ -586,7 +586,7 @@ USBKeyboardDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -598,7 +598,7 @@ USBKeyboardDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -675,7 +675,7 @@ USBKeyboardDriverBindingStop ( DestroyQueue (&UsbKeyboardDevice->EfiKeyQueue); DestroyQueue (&UsbKeyboardDevice->EfiKeyQueueForNotify); - FreePool (UsbKeyboardDevice); + FreePool(UsbKeyboardDevice); } return Status; @@ -772,7 +772,7 @@ USBKeyboardReset ( // Exhaustive reset // Status = InitUSBKeyboard (UsbKeyboardDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -813,7 +813,7 @@ USBKeyboardReadKeyStroke ( // while (1) { Status = USBKeyboardReadKeyStrokeWorker (UsbKeyboardDevice, &KeyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -919,7 +919,7 @@ USBKeyboardTimerHandler ( // and translate it into USB keycode. // Status = USBParseKey (UsbKeyboardDevice, &KeyCode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -927,7 +927,7 @@ USBKeyboardTimerHandler ( // Translate saved USB keycode into EFI_INPUT_KEY // Status = UsbKeyCodeToEfiInputKey (UsbKeyboardDevice, KeyCode, &KeyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -1033,7 +1033,7 @@ KbdFreeNotifyList ( Link = GetFirstNode (NotifyList); NotifyNode = CR (Link, KEYBOARD_CONSOLE_IN_EX_NOTIFY, NotifyEntry, USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE); RemoveEntryList (Link); - FreePool (NotifyNode); + FreePool(NotifyNode); } return EFI_SUCCESS; @@ -1118,7 +1118,7 @@ USBKeyboardResetEx ( UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This); Status = UsbKeyboardDevice->SimpleInput.Reset (&UsbKeyboardDevice->SimpleInput, ExtendedVerification); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1351,7 +1351,7 @@ USBKeyboardUnregisterKeyNotify ( // RemoveEntryList (&CurrentNotify->NotifyEntry); - FreePool (CurrentNotify); + FreePool(CurrentNotify); return EFI_SUCCESS; } } @@ -1399,7 +1399,7 @@ KeyNotifyProcessHandler ( // Leave critical section // gBS->RestoreTPL (OldTpl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList, Link); Link = GetNextNode (NotifyList, Link)) { diff --git a/Drivers/UsbKbDxe/KeyBoard.c b/Drivers/UsbKbDxe/KeyBoard.c index 42b6f4c54..c0c36d84e 100644 --- a/Drivers/UsbKbDxe/KeyBoard.c +++ b/Drivers/UsbKbDxe/KeyBoard.c @@ -337,7 +337,7 @@ InstallDefaultKeyboardLayout ( NULL, (VOID **) &HiiDatabase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -388,7 +388,7 @@ IsUSBKeyboard ( &InterfaceDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -427,7 +427,7 @@ GetCurrentKeyboardLayout ( NULL, (VOID **) &HiiDatabase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -452,8 +452,8 @@ GetCurrentKeyboardLayout ( &Length, KeyboardLayout ); - if (EFI_ERROR (Status)) { - FreePool (KeyboardLayout); + if (EFI_ERROR(Status)) { + FreePool(KeyboardLayout); KeyboardLayout = NULL; } } @@ -639,7 +639,7 @@ SetKeyboardLayoutEvent ( TableEntry = GetKeyDescriptor (UsbKeyboardDevice, KeyCode); if (TableEntry == NULL) { ReleaseKeyboardLayoutResources (UsbKeyboardDevice); - FreePool (KeyboardLayout); + FreePool(KeyboardLayout); return; } CopyMem (TableEntry, KeyDescriptor, sizeof (EFI_KEY_DESCRIPTOR)); @@ -691,7 +691,7 @@ SetKeyboardLayoutEvent ( KeyDescriptor = GetKeyDescriptor (UsbKeyboardDevice, 0x28); CopyMem (TableEntry, KeyDescriptor, sizeof (EFI_KEY_DESCRIPTOR)); - FreePool (KeyboardLayout); + FreePool(KeyboardLayout); } /** @@ -709,7 +709,7 @@ ReleaseKeyboardLayoutResources ( LIST_ENTRY *Link; if (UsbKeyboardDevice->KeyConvertionTable != NULL) { - FreePool (UsbKeyboardDevice->KeyConvertionTable); + FreePool(UsbKeyboardDevice->KeyConvertionTable); } UsbKeyboardDevice->KeyConvertionTable = NULL; @@ -718,8 +718,8 @@ ReleaseKeyboardLayoutResources ( UsbNsKey = USB_NS_KEY_FORM_FROM_LINK (Link); RemoveEntryList (&UsbNsKey->Link); - FreePool (UsbNsKey->NsKey); - FreePool (UsbNsKey); + FreePool(UsbNsKey->NsKey); + FreePool(UsbNsKey); } } @@ -765,7 +765,7 @@ InitKeyboardLayout ( &gEfiHiiKeyBoardLayoutGuid, &UsbKeyboardDevice->KeyboardLayoutEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -833,7 +833,7 @@ InitUSBKeyboard ( &ConfigValue, &TransferResult ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ConfigValue = 0x01; // // Uses default configuration to configure the USB Keyboard device. @@ -843,7 +843,7 @@ InitUSBKeyboard ( ConfigValue, &TransferResult ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If configuration could not be set here, it means // the keyboard interface has some errors and could @@ -1732,7 +1732,7 @@ InitQueue ( Queue->Tail = 0; if (Queue->Buffer[0] != NULL) { - FreePool (Queue->Buffer[0]); + FreePool(Queue->Buffer[0]); } Queue->Buffer[0] = AllocatePool (sizeof (Queue->Buffer) / sizeof (Queue->Buffer[0]) * ItemSize); @@ -1753,7 +1753,7 @@ DestroyQueue ( IN OUT USB_SIMPLE_QUEUE *Queue ) { - FreePool (Queue->Buffer[0]); + FreePool(Queue->Buffer[0]); } diff --git a/Drivers/UsbMouseDxe/ComponentName.c b/Drivers/UsbMouseDxe/ComponentName.c index a7df52221..df472fe58 100644 --- a/Drivers/UsbMouseDxe/ComponentName.c +++ b/Drivers/UsbMouseDxe/ComponentName.c @@ -181,7 +181,7 @@ UsbMouseComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiUsbIoProtocolGuid, @@ -207,7 +207,7 @@ UsbMouseComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/UsbMouseDxe/UsbMouse.c b/Drivers/UsbMouseDxe/UsbMouse.c index 8e258cc0e..d941104f3 100644 --- a/Drivers/UsbMouseDxe/UsbMouse.c +++ b/Drivers/UsbMouseDxe/UsbMouse.c @@ -74,7 +74,7 @@ USBMouseDriverBindingEntryPoint ( &gUsbMouseComponentName, &gUsbMouseComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -110,7 +110,7 @@ USBMouseDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -186,7 +186,7 @@ USBMouseDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("no UsbIo to start mouse\n"); goto ErrorExit1; } @@ -211,7 +211,7 @@ USBMouseDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("no DevicePath to start mouse\n"); goto ErrorExit; } @@ -282,7 +282,7 @@ USBMouseDriverBindingStart ( ); Status = InitializeUsbMouseDevice (UsbMouseDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Fail to initialize USB mouse device. // @@ -309,7 +309,7 @@ USBMouseDriverBindingStart ( UsbMouseDevice, &((UsbMouseDevice->SimplePointerProtocol).WaitForInput) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -320,7 +320,7 @@ USBMouseDriverBindingStart ( &UsbMouseDevice->SimplePointerProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -363,7 +363,7 @@ USBMouseDriverBindingStart ( UsbMouseDevice ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If submit error, uninstall that interface // @@ -399,7 +399,7 @@ USBMouseDriverBindingStart ( // Error handler // ErrorExit: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiUsbIoProtocolGuid, @@ -412,7 +412,7 @@ ErrorExit: gBS->CloseEvent ((UsbMouseDevice->SimplePointerProtocol).WaitForInput); } - FreePool (UsbMouseDevice); + FreePool(UsbMouseDevice); UsbMouseDevice = NULL; } } @@ -459,7 +459,7 @@ USBMouseDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -494,7 +494,7 @@ USBMouseDriverBindingStop ( &gEfiSimplePointerProtocolGuid, &UsbMouseDevice->SimplePointerProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -519,7 +519,7 @@ USBMouseDriverBindingStop ( FreeUnicodeStringTable (UsbMouseDevice->ControllerNameTable); } - FreePool (UsbMouseDevice); + FreePool(UsbMouseDevice); return EFI_SUCCESS; @@ -551,7 +551,7 @@ IsUsbMouse ( &InterfaceDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("UsbGetInterfaceDescriptor status=%r\n", Status); return FALSE; } @@ -611,7 +611,7 @@ InitializeUsbMouseDevice ( UsbIo, &ConfigDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("UsbGetConfigDescriptor status=%r\n", Status); return Status; } @@ -633,8 +633,8 @@ InitializeUsbMouseDevice ( Buf, &TransferResult ); - if (EFI_ERROR (Status)) { - FreePool (Buf); + if (EFI_ERROR(Status)) { + FreePool(Buf); DBG("error getting mouse descriptor\n"); return Status; } @@ -669,7 +669,7 @@ InitializeUsbMouseDevice ( } if (MouseHidDesc == NULL) { - FreePool (Buf); + FreePool(Buf); return EFI_UNSUPPORTED; } @@ -677,7 +677,7 @@ InitializeUsbMouseDevice ( // Get report descriptor // if (MouseHidDesc->HidClassDesc[0].DescriptorType != USB_DESC_TYPE_REPORT) { - FreePool (Buf); + FreePool(Buf); return EFI_UNSUPPORTED; } @@ -691,9 +691,9 @@ InitializeUsbMouseDevice ( ReportDesc ); - if (EFI_ERROR (Status)) { - FreePool (Buf); - FreePool (ReportDesc); + if (EFI_ERROR(Status)) { + FreePool(Buf); + FreePool(ReportDesc); return Status; } DBG("report descriptor of length %d\n", MouseHidDesc->HidClassDesc[0].DescriptorLength); @@ -706,9 +706,9 @@ InitializeUsbMouseDevice ( MouseHidDesc->HidClassDesc[0].DescriptorLength ); - if (EFI_ERROR (Status)) { - FreePool (Buf); - FreePool (ReportDesc); + if (EFI_ERROR(Status)) { + FreePool(Buf); + FreePool(ReportDesc); return Status; } DBG("number of buttons=%d\n", UsbMouseDev->NumberOfButtons); @@ -742,15 +742,15 @@ InitializeUsbMouseDevice ( BOOT_PROTOCOL ); - if (EFI_ERROR (Status)) { - FreePool (Buf); - FreePool (ReportDesc); + if (EFI_ERROR(Status)) { + FreePool(Buf); + FreePool(ReportDesc); return Status; } } - FreePool (Buf); - FreePool (ReportDesc); + FreePool(Buf); + FreePool(ReportDesc); // // Create event for delayed recovery, which deals with device error. diff --git a/Drivers/XhciDxe/ComponentName.c b/Drivers/XhciDxe/ComponentName.c index 706aa292c..53f702d6e 100644 --- a/Drivers/XhciDxe/ComponentName.c +++ b/Drivers/XhciDxe/ComponentName.c @@ -192,7 +192,7 @@ XhciComponentNameGetControllerName ( gXhciDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -207,7 +207,7 @@ XhciComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/Drivers/XhciDxe/UsbHcMem.c b/Drivers/XhciDxe/UsbHcMem.c index e39ac4bb0..a34d96a3e 100644 --- a/Drivers/XhciDxe/UsbHcMem.c +++ b/Drivers/XhciDxe/UsbHcMem.c @@ -58,7 +58,7 @@ UsbHcAllocMemBlock ( Block->Bits = AllocateZeroPool (Block->BitsLen); if (Block->Bits == NULL) { - gBS->FreePool (Block); + gBS->FreePool(Block); return NULL; } @@ -75,7 +75,7 @@ UsbHcAllocMemBlock ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_BITARRAY; } @@ -89,7 +89,7 @@ UsbHcAllocMemBlock ( &Mapping ); - if (EFI_ERROR (Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { + if (EFI_ERROR(Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { goto FREE_BUFFER; } @@ -103,8 +103,8 @@ FREE_BUFFER: PciIo->FreeBuffer (PciIo, Pages, BufHost); FREE_BITARRAY: - gBS->FreePool (Block->Bits); - gBS->FreePool (Block); + gBS->FreePool(Block->Bits); + gBS->FreePool(Block); return NULL; } @@ -134,8 +134,8 @@ UsbHcFreeMemBlock ( PciIo->Unmap (PciIo, Block->Mapping); PciIo->FreeBuffer (PciIo, EFI_SIZE_TO_PAGES (Block->BufLen), Block->BufHost); - gBS->FreePool (Block->Bits); - gBS->FreePool (Block); + gBS->FreePool(Block->Bits); + gBS->FreePool(Block); } @@ -429,7 +429,7 @@ UsbHcInitMemPool ( Pool->Head = UsbHcAllocMemBlock (Pool, USBHC_MEM_DEFAULT_PAGES); if (Pool->Head == NULL) { - gBS->FreePool (Pool); + gBS->FreePool(Pool); Pool = NULL; } @@ -469,7 +469,7 @@ UsbHcFreeMemPool ( } UsbHcFreeMemBlock (Pool, Pool->Head); - gBS->FreePool (Pool); + gBS->FreePool(Pool); return EFI_SUCCESS; } @@ -710,7 +710,7 @@ UsbHcAllocateAlignedPages ( &Memory, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -720,8 +720,8 @@ UsbHcAllocateAlignedPages ( // Free first unaligned page(s). // Status = PciIo->FreeBuffer (PciIo, UnalignedPages, Memory); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -732,8 +732,8 @@ UsbHcAllocateAlignedPages ( // Free last unaligned page(s). // Status = PciIo->FreeBuffer (PciIo, UnalignedPages, Memory); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -749,7 +749,7 @@ UsbHcAllocateAlignedPages ( &Memory, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } AlignedMemory = (UINTN) Memory; @@ -765,7 +765,7 @@ UsbHcAllocateAlignedPages ( Mapping ); - if (EFI_ERROR (Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { + if (EFI_ERROR(Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { /*Status = */PciIo->FreeBuffer (PciIo, Pages, (VOID *) AlignedMemory); return EFI_OUT_OF_RESOURCES; } @@ -800,8 +800,8 @@ UsbHcFreeAlignedPages ( } Status = PciIo->Unmap (PciIo, Mapping); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -810,8 +810,8 @@ UsbHcFreeAlignedPages ( Pages, HostAddress ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } diff --git a/Drivers/XhciDxe/Xhci.c b/Drivers/XhciDxe/Xhci.c index a74dc2f54..be204bc3b 100644 --- a/Drivers/XhciDxe/Xhci.c +++ b/Drivers/XhciDxe/Xhci.c @@ -210,7 +210,7 @@ XhcReset ( if (!XhcIsHalt (Xhc)) { Status = XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto ON_EXIT; } @@ -219,7 +219,7 @@ XhcReset ( Status = XhcResetHC (Xhc, XHC_RESET_TIMEOUT); // ASSERT (!(XHC_REG_BIT_IS_SET (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_CNR))); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } // @@ -320,7 +320,7 @@ XhcSetState ( Status = XhcGetState (This, &CurState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -566,7 +566,7 @@ XhcSetRootHubPortFeature ( if (XhcIsHalt (Xhc)) { Status = XhcRunHC (Xhc, XHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_INFO, "XhcSetRootHubPortFeature :failed to start HC - %r\n", Status)); DBG("XhcSetRootHubPortFeature :failed to start HC - %r\n", Status); break; @@ -846,7 +846,7 @@ XhcTransfer ( if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) { ASSERT (Status == EFI_DEVICE_ERROR); RecoveryStatus = XhcRecoverHaltedEndpoint(Xhc, Urb); - if (EFI_ERROR (RecoveryStatus)) { + if (EFI_ERROR(RecoveryStatus)) { DEBUG ((DEBUG_ERROR, "XhcTransfer[Type=%d]: XhcRecoverHaltedEndpoint failed!\n", Type)); } } @@ -1028,7 +1028,7 @@ XhcControlTransfer ( TransferResult ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("XHC transfer failed\n"); goto ON_EXIT; } @@ -1235,7 +1235,7 @@ XhcControlTransfer ( } ON_EXIT: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "XhcControlTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); DBG("XhcControlTransfer: error - %r, transfer - %x\n", Status, *TransferResult); } @@ -1357,7 +1357,7 @@ XhcBulkTransfer ( ); ON_EXIT: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "XhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); DBG("XhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult); } @@ -1512,7 +1512,7 @@ XhcAsyncInterruptTransfer ( if (Urb == NULL) { // DEBUG ((EFI_D_ERROR, "XhcAsyncInterruptTransfer: failed to create URB\n")); DBG("XhcAsyncInterruptTransfer: failed to create URB\n"); - FreePool (Data); + FreePool(Data); Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } @@ -1633,7 +1633,7 @@ XhcSyncInterruptTransfer ( ); ON_EXIT: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "XhcSyncInterruptTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); DBG("XhcSyncInterruptTransfer: error - %r, transfer - %x\n", Status, *TransferResult); } @@ -1793,7 +1793,7 @@ XhcDriverBindingSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1805,7 +1805,7 @@ XhcDriverBindingSupported ( &UsbClassCReg ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto ON_EXIT; } @@ -1921,14 +1921,14 @@ XhcCreateUsbHc ( &Xhc->PollTimer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } return Xhc; ON_ERROR: - FreePool (Xhc); + FreePool(Xhc); return NULL; } @@ -2019,7 +2019,7 @@ XhcDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DBG("PciIo started\n"); @@ -2049,7 +2049,7 @@ XhcDriverBindingStart ( &OriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } PciAttributesSaved = TRUE; @@ -2062,7 +2062,7 @@ XhcDriverBindingStart ( &Supports ); DBG("attribute supports=%x Status=%r\n", Supports, Status); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -2073,7 +2073,7 @@ XhcDriverBindingStart ( DBG("device enable status=%r\n", Status); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("XhcDriverBindingStart: failed to enable controller\n"); // DEBUG ((EFI_D_ERROR, "XhcDriverBindingStart: failed to enable controller\n")); goto CLOSE_PCIIO; @@ -2102,7 +2102,7 @@ XhcDriverBindingStart ( EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Xhc->Support64BitDma = TRUE; } else { DEBUG ((EFI_D_WARN, @@ -2149,7 +2149,7 @@ DBG("XhcResetHC\n"); // Start the asynchronous interrupt monitor // Status = gBS->SetTimer (Xhc->PollTimer, TimerPeriodic, XHC_ASYNC_TIMER_INTERVAL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("XhcDriverBindingStart: failed to start async interrupt monitor\n"); // DEBUG ((EFI_D_ERROR, "XhcDriverBindingStart: failed to start async interrupt monitor\n")); XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT); @@ -2167,7 +2167,7 @@ DBG("XhcResetHC\n"); &gEfiEventExitBootServicesGuid, &Xhc->ExitBootServiceEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_POOL; } @@ -2196,7 +2196,7 @@ DBG("XhcResetHC\n"); EFI_NATIVE_INTERFACE, &Xhc->Usb2Hc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("XhcDriverBindingStart: failed to install USB2_HC Protocol\n"); // DEBUG ((EFI_D_ERROR, "XhcDriverBindingStart: failed to install USB2_HC Protocol\n")); goto FREE_POOL; @@ -2208,7 +2208,7 @@ DBG("XhcResetHC\n"); FREE_POOL: gBS->CloseEvent (Xhc->PollTimer); XhcFreeSched (Xhc); - FreePool (Xhc); + FreePool(Xhc); CLOSE_PCIIO: if (PciAttributesSaved) { @@ -2276,7 +2276,7 @@ XhcDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2286,7 +2286,7 @@ XhcDriverBindingStop ( Usb2Hc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2349,7 +2349,7 @@ XhcDriverBindingStop ( Controller ); - FreePool (Xhc); + FreePool(Xhc); return EFI_SUCCESS; } diff --git a/Drivers/XhciDxe/XhciReg.c b/Drivers/XhciDxe/XhciReg.c index 6cf581b71..625dcca13 100644 --- a/Drivers/XhciDxe/XhciReg.c +++ b/Drivers/XhciDxe/XhciReg.c @@ -43,7 +43,7 @@ XhcReadCapReg8 ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadCapReg: Pci Io read error - %r at %d\n", Status, Offset)); Data = 0xFF; } @@ -79,7 +79,7 @@ XhcReadCapReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadCapReg: Pci Io read error - %r at %d\n", Status, Offset)); Data = 0xFFFFFFFF; } @@ -120,7 +120,7 @@ XhcReadOpReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadOpReg: Pci Io Read error - %r at %d\n", Status, Offset)); Data = 0xFFFFFFFF; } @@ -159,7 +159,7 @@ XhcWriteOpReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -195,7 +195,7 @@ XhcWriteOpReg16 ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcWriteOpReg16: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -232,7 +232,7 @@ XhcReadDoorBellReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadDoorBellReg: Pci Io Read error - %r at %d\n", Status, Offset)); Data = 0xFFFFFFFF; } @@ -271,7 +271,7 @@ XhcWriteDoorBellReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -308,7 +308,7 @@ XhcReadRuntimeReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadRuntimeReg: Pci Io Read error - %r at %d\n", Status, Offset)); Data = 0xFFFFFFFF; } @@ -347,7 +347,7 @@ XhcWriteRuntimeReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcWriteRuntimeReg: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -384,7 +384,7 @@ XhcReadExtCapReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadExtCapReg: Pci Io Read error - %r at %d\n", Status, Offset)); Data = 0xFFFFFFFF; } @@ -423,7 +423,7 @@ XhcWriteExtCapReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcWriteExtCapReg: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -737,7 +737,7 @@ XhcResetHC ( if (!XHC_REG_BIT_IS_SET (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_HALT)) { Status = XhcHaltHC (Xhc, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } diff --git a/Drivers/XhciDxe/XhciSched.c b/Drivers/XhciDxe/XhciSched.c index c6f168d08..77ca884aa 100644 --- a/Drivers/XhciDxe/XhciSched.c +++ b/Drivers/XhciDxe/XhciSched.c @@ -175,10 +175,10 @@ XhcCreateUrb ( Urb->Context = Context; Status = XhcCreateTransferTrb (Xhc, Urb); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcCreateUrb: XhcCreateTransferTrb Failed, Status = %r\n", Status)); - FreePool (Urb); + FreePool(Urb); Urb = NULL; } @@ -206,7 +206,7 @@ XhcFreeUrb ( Xhc->PciIo->Unmap (Xhc->PciIo, Urb->DataMap); } - FreePool (Urb); + FreePool(Urb); } /** @@ -276,7 +276,7 @@ XhcCreateTransferTrb ( Len = Urb->DataLen; Status = Xhc->PciIo->Map (Xhc->PciIo, MapOp, Urb->Data, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != Urb->DataLen)) { + if (EFI_ERROR(Status) || (Len != Urb->DataLen)) { DEBUG ((EFI_D_ERROR, "XhcCreateTransferTrb: Fail to map Urb->Data.\n")); return EFI_OUT_OF_RESOURCES; } @@ -561,8 +561,8 @@ XhcInitSched ( &ScratchPhy, &Xhc->ScratchMap ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -582,8 +582,8 @@ XhcInitSched ( &ScratchEntryPhy, (VOID **) &ScratchEntryMap[Index] ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } ZeroMem ((VOID *)(UINTN)ScratchEntry[Index], Xhc->PageSize); @@ -1020,8 +1020,8 @@ XhcFreeSched ( // Free Scratchpad Buffer Array // UsbHcFreeAlignedPages (Xhc->PciIo, Xhc->ScratchBuf, EFI_SIZE_TO_PAGES (Xhc->MaxScratchpadBufs * sizeof (UINT64)), Xhc->ScratchMap); - FreePool (Xhc->ScratchEntryMap); - FreePool (Xhc->ScratchEntry); + FreePool(Xhc->ScratchEntryMap); + FreePool(Xhc->ScratchEntry); } if (Xhc->CmdRing.RingSeg0 != NULL) { @@ -1423,12 +1423,12 @@ XhciDelAsyncIntTransfer ( // So the TRB should be removed as well. // Status = XhcDequeueTrbFromEndpoint (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhciDelAsyncIntTransfer: XhcDequeueTrbFromEndpoint failed\n")); } RemoveEntryList (&Urb->UrbList); - FreePool (Urb->Data); + FreePool(Urb->Data); XhcFreeUrb (Xhc, Urb); return EFI_SUCCESS; } @@ -1461,12 +1461,12 @@ XhciDelAllAsyncIntTransfers ( // So the TRB should be removed as well. // Status = XhcDequeueTrbFromEndpoint (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhciDelAllAsyncIntTransfers: XhcDequeueTrbFromEndpoint failed\n")); } RemoveEntryList (&Urb->UrbList); - FreePool (Urb->Data); + FreePool(Urb->Data); XhcFreeUrb (Xhc, Urb); } } @@ -1488,11 +1488,11 @@ XhcUpdateAsyncRequest ( if (Urb->Result == EFI_USB_NOERROR) { Status = XhcCreateTransferTrb (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } Status = RingIntTransferDoorBell (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } } @@ -1533,7 +1533,7 @@ XhcFlushAsyncIntMap ( if (Urb->DataMap != NULL) { Status = PciIo->Unmap (PciIo, Urb->DataMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } } @@ -1541,7 +1541,7 @@ XhcFlushAsyncIntMap ( Urb->DataMap = NULL; Status = PciIo->Map (PciIo, MapOp, Urb->Data, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != Urb->DataLen)) { + if (EFI_ERROR(Status) || (Len != Urb->DataLen)) { goto ON_ERROR; } @@ -1606,7 +1606,7 @@ XhcMonitorAsyncRequests ( // bridge to system memory. // Status = XhcFlushAsyncIntMap (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcMonitorAsyncRequests: Fail to Flush AsyncInt Mapped Memeory\n")); } @@ -1653,7 +1653,7 @@ XhcMonitorAsyncRequests ( } if (ProcBuf != NULL) { - gBS->FreePool (ProcBuf); + gBS->FreePool(ProcBuf); } XhcUpdateAsyncRequest (Xhc, Urb); @@ -2106,7 +2106,7 @@ XhcInitializeDeviceSlot ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcInitializeDeviceSlot: Enable Slot Failed, Status = %r\n", Status)); return Status; } @@ -2277,7 +2277,7 @@ XhcInitializeDeviceSlot ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DeviceAddress = (UINT8) ((DEVICE_CONTEXT *) OutputContext)->Slot.DeviceAddress; DEBUG ((EFI_D_INFO, " Address %d assigned successfully\n", DeviceAddress)); Xhc->UsbDevContext[SlotId].XhciDevAddr = DeviceAddress; @@ -2331,7 +2331,7 @@ XhcInitializeDeviceSlot64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcInitializeDeviceSlot64: Enable Slot Failed, Status = %r\n", Status)); return Status; } @@ -2502,7 +2502,7 @@ XhcInitializeDeviceSlot64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DeviceAddress = (UINT8) ((DEVICE_CONTEXT_64 *) OutputContext)->Slot.DeviceAddress; DEBUG ((EFI_D_INFO, " Address %d assigned successfully\n", DeviceAddress)); Xhc->UsbDevContext[SlotId].XhciDevAddr = DeviceAddress; @@ -2546,7 +2546,7 @@ XhcDisableSlotCmd ( Status = XhcDisableSlotCmd (Xhc, Xhc->UsbDevContext[Index + 1].SlotId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDisableSlotCmd: failed to disable child, ignore error\n")); Xhc->UsbDevContext[Index + 1].SlotId = 0; } @@ -2567,7 +2567,7 @@ XhcDisableSlotCmd ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDisableSlotCmd: Disable Slot Command Failed, Status = %r\n", Status)); return Status; } @@ -2585,19 +2585,19 @@ XhcDisableSlotCmd ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL; } } for (Index = 0; Index < Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations; Index++) { if (Xhc->UsbDevContext[SlotId].ConfDesc[Index] != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ConfDesc[Index]); + FreePool(Xhc->UsbDevContext[SlotId].ConfDesc[Index]); } } if (Xhc->UsbDevContext[SlotId].ActiveAlternateSetting != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ActiveAlternateSetting); + FreePool(Xhc->UsbDevContext[SlotId].ActiveAlternateSetting); } if (Xhc->UsbDevContext[SlotId].InputContext != NULL) { @@ -2653,7 +2653,7 @@ XhcDisableSlotCmd64 ( Status = XhcDisableSlotCmd64 (Xhc, Xhc->UsbDevContext[Index + 1].SlotId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDisableSlotCmd: failed to disable child, ignore error\n")); Xhc->UsbDevContext[Index + 1].SlotId = 0; } @@ -2674,7 +2674,7 @@ XhcDisableSlotCmd64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDisableSlotCmd: Disable Slot Command Failed, Status = %r\n", Status)); return Status; } @@ -2692,19 +2692,19 @@ XhcDisableSlotCmd64 ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL; } } for (Index = 0; Index < Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations; Index++) { if (Xhc->UsbDevContext[SlotId].ConfDesc[Index] != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ConfDesc[Index]); + FreePool(Xhc->UsbDevContext[SlotId].ConfDesc[Index]); } } if (Xhc->UsbDevContext[SlotId].ActiveAlternateSetting != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ActiveAlternateSetting); + FreePool(Xhc->UsbDevContext[SlotId].ActiveAlternateSetting); } if (Xhc->UsbDevContext[SlotId].InputContext != NULL) { @@ -3193,7 +3193,7 @@ XhcSetConfigCmd ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcSetConfigCmd: Config Endpoint Failed, Status = %r\n", Status)); } else { Xhc->UsbDevContext[SlotId].ActiveConfiguration = ConfigDesc->ConfigurationValue; @@ -3286,7 +3286,7 @@ XhcSetConfigCmd64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcSetConfigCmd64: Config Endpoint Failed, Status = %r\n", Status)); } else { Xhc->UsbDevContext[SlotId].ActiveConfiguration = ConfigDesc->ConfigurationValue; @@ -3592,7 +3592,7 @@ XhcSetInterface ( // 1) Stop any Running Transfer Rings affected by the Alternate Interface setting. // Status = XhcStopEndpoint (Xhc, SlotId, Dci, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -3604,7 +3604,7 @@ XhcSetInterface ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1] = NULL; } @@ -3656,7 +3656,7 @@ XhcSetInterface ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SetInterface: Config Endpoint Failed, Status = %r\n", Status)); } else { // @@ -3794,7 +3794,7 @@ XhcSetInterface64 ( // 1) Stop any Running Transfer Rings affected by the Alternate Interface setting. // Status = XhcStopEndpoint (Xhc, SlotId, Dci, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -3806,7 +3806,7 @@ XhcSetInterface64 ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1] = NULL; } @@ -3858,7 +3858,7 @@ XhcSetInterface64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SetInterface64: Config Endpoint Failed, Status = %r\n", Status)); } else { // @@ -3923,7 +3923,7 @@ XhcEvaluateContext ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcEvaluateContext: Evaluate Context Failed, Status = %r\n", Status)); } return Status; @@ -3981,7 +3981,7 @@ XhcEvaluateContext64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcEvaluateContext64: Evaluate Context Failed, Status = %r\n", Status)); } return Status; @@ -4053,7 +4053,7 @@ XhcConfigHubContext ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcConfigHubContext: Config Endpoint Failed, Status = %r\n", Status)); } return Status; @@ -4124,7 +4124,7 @@ XhcConfigHubContext64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcConfigHubContext64: Config Endpoint Failed, Status = %r\n", Status)); } return Status; diff --git a/FileSystems/ApfsDriverLoader/ApfsDriverLoader.c b/FileSystems/ApfsDriverLoader/ApfsDriverLoader.c index 545312f15..cb84bfa54 100644 --- a/FileSystems/ApfsDriverLoader/ApfsDriverLoader.c +++ b/FileSystems/ApfsDriverLoader/ApfsDriverLoader.c @@ -104,7 +104,7 @@ StartApfsDriver ( (VOID **) &ParentDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ParentDevicePath = NULL; DEBUG ((DEBUG_WARN, "ApfsDriver DevicePath not present\n")); } @@ -125,7 +125,7 @@ StartApfsDriver ( DEBUG ((DEBUG_WARN, "New ImageSize after verification: %lu\n", EfiFileSize)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { */ Status = gBS->LoadImage ( FALSE, @@ -135,7 +135,7 @@ StartApfsDriver ( EfiFileSize, &ImageHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "Load image failed with Status: %r\n", Status)); return Status; } @@ -153,7 +153,7 @@ StartApfsDriver ( (VOID *) &LoadedApfsDrvImage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "Failed to Handle LoadedImage Protool with Status: %r\n", Status)); gBS->UnloadImage (ImageHandle); return Status; @@ -179,9 +179,9 @@ StartApfsDriver ( &NewSystemTable->Hdr.CRC32 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "Failed to calculated new system table CRC32 with Status: %r\n", Status)); - FreePool (NewSystemTable); + FreePool(NewSystemTable); gBS->UnloadImage (ImageHandle); return Status; } @@ -194,14 +194,14 @@ StartApfsDriver ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "Failed to start ApfsDriver with Status: %r\n", Status)); // // Unload ApfsDriver image from memory // gBS->UnloadImage (ImageHandle); - FreePool (NewSystemTable); + FreePool(NewSystemTable); return Status; } @@ -287,7 +287,7 @@ LegacyApfsContainerScan ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BlockIo2 = NULL; Status = gBS->OpenProtocol ( @@ -299,7 +299,7 @@ LegacyApfsContainerScan ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } } @@ -313,7 +313,7 @@ LegacyApfsContainerScan ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DiskIo2 = NULL; Status = gBS->OpenProtocol ( ControllerHandle, @@ -324,7 +324,7 @@ LegacyApfsContainerScan ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ return EFI_UNSUPPORTED; } } @@ -357,8 +357,8 @@ LegacyApfsContainerScan ( Block ); - if (EFI_ERROR (Status)) { - FreePool (Block); + if (EFI_ERROR(Status)) { + FreePool(Block); return EFI_DEVICE_ERROR; } @@ -380,13 +380,13 @@ LegacyApfsContainerScan ( // // Reallocate Block size to contain all of partition entries. // - FreePool (Block); + FreePool(Block); Block = AllocateZeroPool ((UINTN)PartitionNumber * PartitionEntrySize); if (Block == NULL) { return EFI_OUT_OF_RESOURCES; } } else { - FreePool (Block); + FreePool(Block); return EFI_UNSUPPORTED; } @@ -399,8 +399,8 @@ LegacyApfsContainerScan ( Block ); - if (EFI_ERROR (Status)) { - FreePool (Block); + if (EFI_ERROR(Status)) { + FreePool(Block); return EFI_DEVICE_ERROR; } @@ -420,7 +420,7 @@ LegacyApfsContainerScan ( } if (ApfsGptEntry == NULL) { - FreePool (Block); + FreePool(Block); return EFI_UNSUPPORTED; } LegacyBaseOffset = MultU64x32 (ApfsGptEntry->StartingLBA, BlockSize); @@ -471,7 +471,7 @@ ApfsDriverLoaderSupported ( EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -489,7 +489,7 @@ ApfsDriverLoaderSupported ( EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( ControllerHandle, &gEfiDiskIoProtocolGuid, @@ -500,7 +500,7 @@ ApfsDriverLoaderSupported ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -513,7 +513,7 @@ ApfsDriverLoaderSupported ( EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol( ControllerHandle, &gEfiBlockIoProtocolGuid, @@ -545,7 +545,7 @@ ApfsDriverLoaderSupported ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( ControllerHandle, &gEfiPartitionInfoProtocolGuid, @@ -555,7 +555,7 @@ ApfsDriverLoaderSupported ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( ControllerHandle, &gApplePartitionInfoProtocolGuid, @@ -565,7 +565,7 @@ ApfsDriverLoaderSupported ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ApplePartitionInfo = NULL; return Status; } @@ -659,7 +659,7 @@ ApfsDriverLoaderStart ( EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -677,7 +677,7 @@ ApfsDriverLoaderStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BlockIo2 = NULL; Status = gBS->OpenProtocol ( @@ -689,7 +689,7 @@ ApfsDriverLoaderStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } } @@ -703,7 +703,7 @@ ApfsDriverLoaderStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DiskIo2 = NULL; Status = gBS->OpenProtocol ( ControllerHandle, @@ -714,7 +714,7 @@ ApfsDriverLoaderStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } } @@ -742,8 +742,8 @@ ApfsDriverLoaderStart ( ApfsBlock ); - if (EFI_ERROR (Status)) { - FreePool (ApfsBlock); + if (EFI_ERROR(Status)) { + FreePool(ApfsBlock); return EFI_DEVICE_ERROR; } @@ -767,7 +767,7 @@ ApfsDriverLoaderStart ( DEBUG ((DEBUG_VERBOSE, "Should be: %08x\n", APFS_CSB_SIGNATURE)); if (ContainerSuperBlock->Magic != APFS_CSB_SIGNATURE) { - FreePool (ApfsBlock); + FreePool(ApfsBlock); return EFI_UNSUPPORTED; } @@ -802,7 +802,7 @@ ApfsDriverLoaderStart ( // Free ApfsBlock and allocate one of a correct size. // ContainerSuperBlock (& EfiBootRecordBlockPtr ?) will not valid now // - FreePool (ApfsBlock); + FreePool(ApfsBlock); ApfsBlock = AllocateZeroPool (ApfsBlockSize); if (ApfsBlock == NULL) { return EFI_OUT_OF_RESOURCES; @@ -820,8 +820,8 @@ ApfsDriverLoaderStart ( ApfsBlock ); - if (EFI_ERROR (Status)) { - FreePool (ApfsBlock); + if (EFI_ERROR(Status)) { + FreePool(ApfsBlock); return EFI_DEVICE_ERROR; } @@ -829,7 +829,7 @@ ApfsDriverLoaderStart ( // Verify ContainerSuperblock checksum. // if (!ApfsBlockChecksumVerify ((UINT8 *) ApfsBlock, ApfsBlockSize)) { - FreePool (ApfsBlock); + FreePool(ApfsBlock); return EFI_UNSUPPORTED; } @@ -864,8 +864,8 @@ ApfsDriverLoaderStart ( ApfsBlock ); - if (EFI_ERROR (Status)) { - FreePool (ApfsBlock); + if (EFI_ERROR(Status)) { + FreePool(ApfsBlock); return EFI_DEVICE_ERROR; } @@ -873,13 +873,13 @@ ApfsDriverLoaderStart ( // Verify EfiBootRecordBlock checksum. // if (!ApfsBlockChecksumVerify (ApfsBlock, ApfsBlockSize)) { - FreePool (ApfsBlock); + FreePool(ApfsBlock); return EFI_UNSUPPORTED; } EfiBootRecordBlock = (APFS_EFI_BOOT_RECORD *) ApfsBlock; if (EfiBootRecordBlock->Magic != APFS_EFIBOOTRECORD_SIGNATURE) { - FreePool (ApfsBlock); + FreePool(ApfsBlock); return EFI_UNSUPPORTED; } @@ -933,7 +933,7 @@ ApfsDriverLoaderStart ( ); if (EfiFileBuffer == NULL) { - FreePool (ApfsBlock); + FreePool(ApfsBlock); return EFI_OUT_OF_RESOURCES; } @@ -949,9 +949,9 @@ ApfsDriverLoaderStart ( (UINT8*)EfiFileBuffer + CurPos ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreePool(EfiFileBuffer); - FreePool (ApfsBlock); + FreePool(ApfsBlock); return EFI_DEVICE_ERROR; } // @@ -989,7 +989,7 @@ ApfsDriverLoaderStart ( // Private = AllocatePool (sizeof (APFS_DRIVER_INFO_PRIVATE_DATA)); if (Private == NULL) { - FreePool (ApfsBlock); + FreePool(ApfsBlock); if (EfiFileBuffer) { FreePool(EfiFileBuffer); } @@ -1008,19 +1008,19 @@ ApfsDriverLoaderStart ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_WARN, "ApfsEfiBootRecordInfoProtocol install failed with Status %r\n", Status )); if (EfiFileBuffer != NULL) { - FreePool (EfiFileBuffer); + FreePool(EfiFileBuffer); } if (Private != NULL) { - FreePool (Private); + FreePool(Private); } - FreePool (ApfsBlock); + FreePool(ApfsBlock); return Status; } @@ -1031,9 +1031,9 @@ ApfsDriverLoaderStart ( EfiBootRecordBlock->EfiFileLen ); - FreePool (ApfsBlock); + FreePool(ApfsBlock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallProtocolInterface ( ControllerHandle, &gApfsEfiBootRecordInfoProtocolGuid, @@ -1041,10 +1041,10 @@ ApfsDriverLoaderStart ( ); if (EfiFileBuffer != NULL) { - FreePool (EfiFileBuffer); + FreePool(EfiFileBuffer); } if (Private != NULL) { - FreePool (Private); + FreePool(Private); } return EFI_UNSUPPORTED; @@ -1054,10 +1054,10 @@ ApfsDriverLoaderStart ( // Free memory and close DiskIo protocol // if (EfiFileBuffer != NULL) { - FreePool (EfiFileBuffer); + FreePool(EfiFileBuffer); } if (Private != NULL) { - FreePool (Private); + FreePool(Private); } if (DiskIo2 != NULL) { gBS->CloseProtocol ( @@ -1115,7 +1115,7 @@ ApfsDriverLoaderStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->CloseProtocol ( ControllerHandle, &gEfiDiskIoProtocolGuid, diff --git a/FileSystems/FatPkg/EnhancedFatDxe/ComponentName.c b/FileSystems/FatPkg/EnhancedFatDxe/ComponentName.c index 6b8ec47b4..c834dc531 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/ComponentName.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/ComponentName.c @@ -337,7 +337,7 @@ FatComponentNameGetControllerName ( gFatDriverBinding.DriverBindingHandle, &gEfiDiskIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Delete.c b/FileSystems/FatPkg/EnhancedFatDxe/Delete.c index 3becf8e29..61e5fa593 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Delete.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Delete.c @@ -76,7 +76,7 @@ Returns: // If the file has a permanant error, skip the delete // Status = OFile->Error; - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If this is a directory, make sure it's empty before // allowing it to be deleted @@ -88,7 +88,7 @@ Returns: FatResetODirCursor (OFile); for (Round = 0; Round < 3; Round++) { Status = FatGetNextDirEnt (OFile, &DirEnt); - if ((EFI_ERROR (Status)) || + if ((EFI_ERROR(Status)) || ((Round < 2) && (DirEnt == NULL || !FatIsDotDirEnt (DirEnt))) || ((Round == 2) && (DirEnt != NULL)) ) { @@ -105,7 +105,7 @@ Returns: // Free the directory entry for this file // Status = FatRemoveDirEnt (OFile->Parent, OFile->DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -128,7 +128,7 @@ Done: Status = FatCleanupVolume (OFile->Volume, NULL, Status, NULL); FatReleaseLock (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_WARN_DELETE_FAILURE; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/DirectoryCache.c b/FileSystems/FatPkg/EnhancedFatDxe/DirectoryCache.c index 488ea2283..5c9020e19 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/DirectoryCache.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/DirectoryCache.c @@ -56,7 +56,7 @@ Returns: FatFreeDirEnt (DirEnt); } - FreePool (ODir); + FreePool(ODir); } STATIC diff --git a/FileSystems/FatPkg/EnhancedFatDxe/DirectoryManage.c b/FileSystems/FatPkg/EnhancedFatDxe/DirectoryManage.c index f7fa0b571..a092e38dc 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/DirectoryManage.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/DirectoryManage.c @@ -103,7 +103,7 @@ Returns: // Write directory entry // Status = FatAccessEntry (OFile, WRITE_DATA, EntryPos, &DirEnt->Entry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -117,7 +117,7 @@ Returns: sizeof (LfnBuffer) / sizeof (LfnBuffer[0]), DirEnt->FileString ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -144,7 +144,7 @@ Returns: } Status = FatAccessEntry (OFile, WRITE_DATA, EntryPos, &LfnEntry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -319,7 +319,7 @@ Returns: EntryPos--; Status = FatAccessEntry (Parent, READ_DATA, EntryPos, &LfnEntry); - if (EFI_ERROR (Status) || + if (EFI_ERROR(Status) || LfnEntry.Attributes != FAT_ATTRIBUTE_LFN || LfnEntry.MustBeZero != 0 || LfnEntry.Checksum != LfnChecksum || @@ -439,7 +439,7 @@ Returns: // Read the next directory entry until we find a valid directory entry (excluding lfn entry) // Status = FatAccessEntry (OFile, READ_DATA, ODir->CurrentEndPos, &Entry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -623,7 +623,7 @@ Returns: // while (!ODir->EndOfDir) { Status = FatLoadNextDirEnt (OFile, &DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -709,7 +709,7 @@ Returns: // Read directory from disk // Status = FatLoadNextDirEnt (OFile, &DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -854,7 +854,7 @@ Returns: DirEnt->Invalid = TRUE; do { Status = FatAccessEntry (Root, READ_DATA, EntryPos, Entry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -911,7 +911,7 @@ Returns: LabelPos = 0; if (OFile->Parent == NULL) { Status = FatSeekVolumeId (OFile, &LabelDirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -989,7 +989,7 @@ Returns: // while (!ODir->EndOfDir) { Status = FatLoadNextDirEnt (OFile, &TempDirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1011,7 +1011,7 @@ Returns: // We should allocate a new cluster for this directory // Status = FatExpandODir (OFile); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1051,7 +1051,7 @@ Returns: *Name = 0; Status = FatSeekVolumeId (Volume->Root, &LabelDirEnt); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (!LabelDirEnt.Invalid) { FatNameToStr (LabelDirEnt.Entry.FileName, FAT_NAME_LEN, FALSE, Name); } @@ -1090,7 +1090,7 @@ Returns: Root = Volume->Root; Status = FatSeekVolumeId (Volume->Root, &LabelDirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1101,7 +1101,7 @@ Returns: ZeroMem (&LabelDirEnt, sizeof (FAT_DIRENT)); LabelDirEnt.EntryCount = 1; Status = FatNewEntryPos (Root, &LabelDirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1142,7 +1142,7 @@ Returns: FAT_DIRENT *DirEnt; Status = FatExpandODir (OFile); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1151,7 +1151,7 @@ Returns: // Create "." // Status = FatCreateDirEnt (OFile, L".", FAT_ATTRIBUTE_DIRECTORY, &DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1216,7 +1216,7 @@ Returns: // Determine the file's directory entry position // Status = FatNewEntryPos (OFile, DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1399,7 +1399,7 @@ Returns: RemoveEntryList (&OFile->ChildLink); } - FreePool (OFile); + FreePool(OFile); DirEnt->OFile = NULL; if (DirEnt->Invalid == TRUE) { // @@ -1540,7 +1540,7 @@ Returns: // Search the compName in the directory // Status = FatSearchODir (OFile, NewFileName, &DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1563,7 +1563,7 @@ Returns: } Status = FatOpenDirEnt (OFile, DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/DiskCache.c b/FileSystems/FatPkg/EnhancedFatDxe/DiskCache.c index fc116a9e5..2b52b8584 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/DiskCache.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/DiskCache.c @@ -165,7 +165,7 @@ Returns: // Only fat table writing will execute more than once // Status = FatDiskIo (Volume, IoMode, EntryPos, RealSize, PageAddress, Task); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -221,7 +221,7 @@ Returns: // if (CacheTag->RealSize > 0 && CacheTag->Dirty) { Status = FatExchangeCachePage (Volume, CacheDataType, WRITE_DISK, CacheTag, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -279,7 +279,7 @@ Returns: GroupNo = PageNo & DiskCache->GroupMask; CacheTag = &DiskCache->CacheTag[GroupNo]; Status = FatGetCachePage (Volume, CacheDataType, PageNo, CacheTag); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Source = DiskCache->CacheBase + (GroupNo << DiskCache->PageAlignment) + Offset; Destination = Buffer; if (IoMode != READ_DISK) { @@ -369,7 +369,7 @@ Returns: } Status = FatAccessUnalignedCachePage (Volume, CacheDataType, IoMode, PageNo, UnderRun, Length, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -392,7 +392,7 @@ Returns: EntryPos = Volume->RootPos + LShiftU64 (PageNo, PageAlignment); AlignedSize = AlignedPageCount << PageAlignment; Status = FatDiskIo (Volume, IoMode, EntryPos, AlignedSize, Buffer, Task); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -460,7 +460,7 @@ Returns: // Write back all Dirty Data Cache Page to disk // Status = FatExchangeCachePage (Volume, CacheDataType, WRITE_DISK, CacheTag, Task); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Fat.c b/FileSystems/FatPkg/EnhancedFatDxe/Fat.c index efb15c9d5..07da4beb0 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Fat.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Fat.c @@ -105,7 +105,7 @@ Returns: &gFatComponentName, &gFatComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -146,19 +146,19 @@ Returns: &DeviceHandleCount, &DeviceHandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } for (Index = 0; Index < DeviceHandleCount; Index++) { Status = EfiTestManagedDevice (DeviceHandleBuffer[Index], ImageHandle, &gEfiDiskIoProtocolGuid); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->DisconnectController ( DeviceHandleBuffer[Index], ImageHandle, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -169,12 +169,12 @@ Returns: // Driver is stopped successfully. // Status = gBS->HandleProtocol (ImageHandle, &gEfiComponentNameProtocolGuid, &ComponentName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ComponentName = NULL; } Status = gBS->HandleProtocol (ImageHandle, &gEfiComponentName2ProtocolGuid, &ComponentName2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ComponentName2 = NULL; } @@ -214,7 +214,7 @@ Returns: } if (DeviceHandleBuffer != NULL) { - FreePool (DeviceHandleBuffer); + FreePool(DeviceHandleBuffer); } return Status; @@ -263,7 +263,7 @@ Returns: EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -333,12 +333,12 @@ Returns: // If caller has already acquired the lock, cannot lock it again. // Status = FatAcquireLockOrFail (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { LockedByMe = TRUE; } Status = InitializeUnicodeCollationSupport (This->DriverBindingHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } // @@ -352,7 +352,7 @@ Returns: ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -364,7 +364,7 @@ Returns: ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -376,7 +376,7 @@ Returns: ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DiskIo2 = NULL; } @@ -391,7 +391,7 @@ Returns: // This will cause a call to our Stop(), and a subsequent reentrant call to our // Start() successfully. We should leave the device open when this happen. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( ControllerHandle, &gEfiSimpleFileSystemProtocolGuid, @@ -400,7 +400,7 @@ Returns: ControllerHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiDiskIoProtocolGuid, @@ -469,13 +469,13 @@ Returns: EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Volume = VOLUME_FROM_VOL_INTERFACE (FileSystem); DiskIo2 = Volume->DiskIo2; Status = FatAbandonVolume (Volume); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (DiskIo2 != NULL) { Status = gBS->CloseProtocol ( ControllerHandle, @@ -483,7 +483,7 @@ Returns: This->DriverBindingHandle, ControllerHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -493,7 +493,7 @@ Returns: This->DriverBindingHandle, ControllerHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/FileSpace.c b/FileSystems/FatPkg/EnhancedFatDxe/FileSpace.c index 461f961a8..998efd780 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/FileSpace.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/FileSpace.c @@ -78,7 +78,7 @@ Returns: &Volume->FatEntryBuffer, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Volume->FatEntryBuffer = (UINT32) -1; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Flush.c b/FileSystems/FatPkg/EnhancedFatDxe/Flush.c index 1bb4c3db9..047a65ede 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Flush.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Flush.c @@ -60,7 +60,7 @@ Returns: // // If the file has a permanent error, return it // - if (EFI_ERROR (OFile->Error)) { + if (EFI_ERROR(OFile->Error)) { return OFile->Error; } @@ -99,7 +99,7 @@ Returns: FatReleaseLock (); if (Token != NULL) { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = FatQueueTask (IFile, Task); } else { FatDestroyTask (Task); @@ -231,7 +231,7 @@ Returns: // // Done. Free the open instance structure // - FreePool (IFile); + FreePool(IFile); return EFI_SUCCESS; } @@ -270,7 +270,7 @@ Returns: // If the file has a permanant error, then don't write any // of its data to the device (may be from different media) // - if (EFI_ERROR (OFile->Error)) { + if (EFI_ERROR(OFile->Error)) { return OFile->Error; } @@ -299,7 +299,7 @@ Returns: // Write the OFile's directory entry // Status = FatStoreDirEnt (Parent, DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -459,7 +459,7 @@ Returns: // if (Volume->FreeInfoValid && Volume->FatDirty && Volume->FreeInfoPos) { Status = FatDiskIo (Volume, WRITE_DISK, Volume->FreeInfoPos, sizeof (FAT_INFO_SECTOR), &Volume->FatInfoSector, Task); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -469,7 +469,7 @@ Returns: if (Volume->FatDirty && Volume->FatType != FAT12) { Volume->FatDirty = FALSE; Status = FatAccessVolumeDirty (Volume, WRITE_FAT, &Volume->NotDirtyValue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -477,7 +477,7 @@ Returns: // Flush all dirty cache entries to disk // Status = FatVolumeFlushCache (Volume, Task); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -523,7 +523,7 @@ Returns: // // If this OFile doesn't already have an error, set one // - if (!EFI_ERROR (OFile->Error)) { + if (!EFI_ERROR(OFile->Error)) { OFile->Error = Status; } // diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Info.c b/FileSystems/FatPkg/EnhancedFatDxe/Info.c index 7ce4d88c0..b225a14d7 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Info.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Info.c @@ -378,7 +378,7 @@ Returns: // Open the filename and see if it refers to an existing file // Status = FatLocateOFile (&Parent, NewInfo->FileName, DirEnt->Entry.Attributes, NewFileName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -396,14 +396,14 @@ Returns: } Status = FatRemoveDirEnt (OFile->Parent, DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // Create new dirent // Status = FatCreateDirEnt (Parent, NewFileName, DirEnt->Entry.Attributes, &TempDirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -426,13 +426,13 @@ Returns: ASSERT (OFile->Parent != NULL); for (DotOFile = OFile; DotOFile != OFile->Parent->Parent; DotOFile = DotOFile->Parent) { Status = FatGetNextDirEnt (OFile, &DirEnt); - if (EFI_ERROR (Status) || DirEnt == NULL || !FatIsDotDirEnt (DirEnt)) { + if (EFI_ERROR(Status) || DirEnt == NULL || !FatIsDotDirEnt (DirEnt)) { return EFI_VOLUME_CORRUPTED; } FatCloneDirEnt (DirEnt, DotOFile->DirEnt); Status = FatStoreDirEnt (OFile, DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -464,7 +464,7 @@ Returns: Status = FatTruncateOFile (OFile, (UINTN) NewInfo->FileSize); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -525,7 +525,7 @@ Returns: // // Verify the file handle isn't in an error state // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get the proper information based on the request // diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Init.c b/FileSystems/FatPkg/EnhancedFatDxe/Init.c index 0958f95a1..7ead389e0 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Init.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Init.c @@ -80,14 +80,14 @@ Returns: // Check to see if there's a file system on the volume // Status = FatOpenDevice (Volume); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // // Initialize cache // Status = FatInitializeDiskCache (Volume); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -99,7 +99,7 @@ Returns: &Volume->VolumeInterface, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -109,7 +109,7 @@ Returns: Volume->Valid = TRUE; Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FatFreeVolume (Volume); } @@ -150,7 +150,7 @@ Returns: &Volume->VolumeInterface, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -164,7 +164,7 @@ Returns: // we can not acquire again. // Status = FatAcquireLockOrFail (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { LockedByMe = TRUE; } // @@ -243,7 +243,7 @@ Returns: DiskIo = Volume->DiskIo; Status = DiskIo->ReadDisk (DiskIo, Volume->MediaId, 0, sizeof (FatBs), &FatBs); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INIT, "FatOpenDevice: read of part_lba failed %r\n", Status)); return Status; } @@ -374,7 +374,7 @@ Returns: // if (FatType != FAT12) { Status = FatAccessVolumeDirty (Volume, READ_DISK, &Volume->NotDirtyValue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Misc.c b/FileSystems/FatPkg/EnhancedFatDxe/Misc.c index 17de53bf5..e696e05cd 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Misc.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Misc.c @@ -76,7 +76,7 @@ Arguments: Subtask = CR (Link, FAT_SUBTASK, Link, FAT_SUBTASK_SIGNATURE); Link = FatDestroySubtask (Subtask); } - FreePool (Task); + FreePool(Task); } VOID @@ -128,7 +128,7 @@ Returns: gBS->CloseEvent (Subtask->DiskIo2Token.Event); Link = RemoveEntryList (&Subtask->Link); - FreePool (Subtask); + FreePool(Subtask); return Link; } @@ -166,7 +166,7 @@ Returns: if (IsListEmpty (&Task->Subtasks)) { Task->FileIoToken->Status = EFI_SUCCESS; gBS->SignalEvent (Task->FileIoToken->Event); - FreePool (Task); + FreePool(Task); return EFI_SUCCESS; } @@ -200,12 +200,12 @@ Returns: Subtask->Buffer ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiAcquireLock (&FatTaskLock); // // Remove all the remaining subtasks when failure. @@ -219,7 +219,7 @@ Returns: if (IsListEmpty (&Task->Subtasks)) { RemoveEntryList (&Task->Link); - FreePool (Task); + FreePool(Task); } else { // // If one or more subtasks have been already submitted, set FileIoToken @@ -321,7 +321,7 @@ Arguments: // Task->FileIoToken is NULL which means the task will be ignored (just recycle the subtask and task memory). // if (Task->FileIoToken != NULL) { - if (IsListEmpty (&Task->Subtasks) || EFI_ERROR (Status)) { + if (IsListEmpty (&Task->Subtasks) || EFI_ERROR(Status)) { Task->FileIoToken->Status = Status; gBS->SignalEvent (Task->FileIoToken->Event); // @@ -333,7 +333,7 @@ Arguments: if (IsListEmpty (&Task->Subtasks)) { RemoveEntryList (&Task->Link); - FreePool (Task); + FreePool(Task); } } @@ -415,17 +415,17 @@ Returns: Subtask, &Subtask->DiskIo2Token.Event ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { InsertTailList (&Task->Subtasks, &Subtask->Link); } else { - FreePool (Subtask); + FreePool(Subtask); } } } } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Volume->DiskError = TRUE; // DEBUG ((EFI_D_ERROR, "FatDiskIo: error %r\n", Status)); } @@ -526,10 +526,10 @@ Returns: --*/ { if (DirEnt->FileString != NULL) { - FreePool (DirEnt->FileString); + FreePool(DirEnt->FileString); } - FreePool (DirEnt); + FreePool(DirEnt); } VOID @@ -556,13 +556,13 @@ Returns: // Free disk cache // if (Volume->CacheBuffer != NULL) { - FreePool (Volume->CacheBuffer); + FreePool(Volume->CacheBuffer); } // // Free directory cache // FatCleanupODirCache (Volume); - FreePool (Volume); + FreePool(Volume); } VOID @@ -662,7 +662,7 @@ Returns: EFI_TIME Now; Status = gRT->GetTime (&Now, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FatEfiTimeToFatTime (&Now, FatNow); } else { ZeroMem (&Now, sizeof (EFI_TIME)); diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Open.c b/FileSystems/FatPkg/EnhancedFatDxe/Open.c index b92e08a26..03a5092fa 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Open.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Open.c @@ -131,14 +131,14 @@ Returns: // Verify the source file handle isn't in an error state // Status = OFile->Error; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // Get new OFile for the file // Status = FatLocateOFile (&OFile, FileName, Attributes, NewFileName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -152,13 +152,13 @@ Returns: } Status = FatCreateDirEnt (OFile, NewFileName, Attributes, &DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT (DirEnt != NULL); Status = FatOpenDirEnt (OFile, DirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -168,7 +168,7 @@ Returns: // If we just created a directory, we need to create "." and ".." // Status = FatCreateDotDirEnts (OFile); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -185,7 +185,7 @@ Returns: // Create an open instance of the OFile // Status = FatAllocateIFile (OFile, NewIFile); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -295,7 +295,7 @@ Returns: // // If the file was opened, return the handle to the caller // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *NewHandle = &NewIFile->Handle; } // @@ -305,7 +305,7 @@ Returns: FatReleaseLock (); if (Token != NULL) { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = FatQueueTask (IFile, Task); } else { FatDestroyTask (Task); diff --git a/FileSystems/FatPkg/EnhancedFatDxe/OpenVolume.c b/FileSystems/FatPkg/EnhancedFatDxe/OpenVolume.c index 556b9674e..80195d4c1 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/OpenVolume.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/OpenVolume.c @@ -56,14 +56,14 @@ Returns: // Open Root file // Status = FatOpenDirEnt (NULL, &Volume->RootDirEnt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // // Open a new instance to the root // Status = FatAllocateIFile (Volume->Root, &IFile); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *File = &IFile->Handle; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/ReadWrite.c b/FileSystems/FatPkg/EnhancedFatDxe/ReadWrite.c index fff2025fa..86de5f8ab 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/ReadWrite.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/ReadWrite.c @@ -175,7 +175,7 @@ Returns: // do { Status = FatGetNextDirEnt (OFile, &DirEnt); - if (EFI_ERROR (Status) || DirEnt == NULL) { + if (EFI_ERROR(Status) || DirEnt == NULL) { // // Something error occurred or reach the end of directory, // return 0 buffersize @@ -190,7 +190,7 @@ Done: // // Update IFile's Position // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update IFile->Position, if everything is all right // @@ -296,7 +296,7 @@ Returns: FatAcquireLock (); Status = OFile->Error; - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (OFile->ODir != NULL) { // // Read a directory is supported @@ -323,7 +323,7 @@ Returns: // We expand the file size of OFile // Status = FatGrowEof (OFile, EndPosition); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Must update the file's info into the file's Directory Entry // and then flush the dirty cache info into disk. @@ -344,7 +344,7 @@ Returns: } if (Token != NULL) { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = FatQueueTask (IFile, Task); } else { FatDestroyTask (Task); @@ -361,7 +361,7 @@ Done: // 3) Write operation doesn't affect OFile/IFile structure, so // Reference checking is not necessary. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = FatCleanupVolume (Volume, OFile, Status, NULL); } @@ -538,7 +538,7 @@ Returns: // Seek the OFile to the file position // Status = FatOFilePosition (OFile, Position, BufferSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } // @@ -550,7 +550,7 @@ Returns: // Write the data // Status = FatDiskIo (Volume, IoMode, OFile->PosDisk, Len, UserBuffer, Task); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } // @@ -603,7 +603,7 @@ Returns: WritePos = OFile->FileSize; Status = FatGrowEof (OFile, ExpandedSize); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = FatWriteZeroPool (OFile, WritePos); } @@ -661,14 +661,14 @@ Returns: WriteSize = AppendedSize > BufferSize ? BufferSize : (UINTN) AppendedSize; AppendedSize -= WriteSize; Status = FatAccessOFile (OFile, WRITE_DATA, WritePos, &WriteSize, ZeroBuffer, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } WritePos += WriteSize; } while (AppendedSize > 0); - FreePool (ZeroBuffer); + FreePool(ZeroBuffer); return Status; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/UnicodeCollation.c b/FileSystems/FatPkg/EnhancedFatDxe/UnicodeCollation.c index d537cd58e..ec30ddbb7 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/UnicodeCollation.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/UnicodeCollation.c @@ -53,7 +53,7 @@ InitializeUnicodeCollationSupportWorker ( &NumHandles, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -73,7 +73,7 @@ InitializeUnicodeCollationSupportWorker ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -90,7 +90,7 @@ InitializeUnicodeCollationSupportWorker ( NULL ); if (BestLanguage != NULL) { - FreePool (BestLanguage); + FreePool(BestLanguage); mUnicodeCollationInterface = Uci; ReturnStatus = EFI_SUCCESS; break; @@ -98,10 +98,10 @@ InitializeUnicodeCollationSupportWorker ( } if (Language != NULL) { - FreePool (Language); + FreePool(Language); } - FreePool (Handles); + FreePool(Handles); return ReturnStatus; } @@ -140,7 +140,7 @@ InitializeUnicodeCollationSupport ( // If the attempt to use Unicode Collation 2 Protocol fails, then we fall back // on the ISO 639-2 Unicode Collation Protocol. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = InitializeUnicodeCollationSupportWorker ( AgentHandle, &gEfiUnicodeCollationProtocolGuid, diff --git a/FileSystems/VBoxFsDxe/OverrideFunctions-kabyl.edk2.c.include b/FileSystems/VBoxFsDxe/OverrideFunctions-kabyl.edk2.c.include index c4fece0c1..9001a7293 100644 --- a/FileSystems/VBoxFsDxe/OverrideFunctions-kabyl.edk2.c.include +++ b/FileSystems/VBoxFsDxe/OverrideFunctions-kabyl.edk2.c.include @@ -69,7 +69,7 @@ EFI_STATUS EFIAPI ovrLoadImage( */ FilePathNode = (FILEPATH_DEVICE_PATH *) FilePath; Status = BS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, (EFI_DEVICE_PATH_PROTOCOL **)&FilePathNode, &DeviceHandle); - if (!EFI_ERROR (Status)) + if (!EFI_ERROR(Status)) { Status = BS->HandleProtocol (DeviceHandle, &gEfiSimpleFileSystemProtocolGuid, (VOID**)&Volume); @@ -79,7 +79,7 @@ EFI_STATUS EFIAPI ovrLoadImage( * Open the Volume to get the File System handle */ Status = Volume->OpenVolume(Volume, &FileHandle); - if (!EFI_ERROR (Status)) + if (!EFI_ERROR(Status)) { /* * Duplicate the device path to avoid the access to unaligned device path node. @@ -106,7 +106,7 @@ EFI_STATUS EFIAPI ovrLoadImage( || DevicePathSubType (&FilePathNode->Header) != MEDIA_FILEPATH_DP) Status = EFI_UNSUPPORTED; - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) /* * Exit loop on Error */ @@ -151,7 +151,7 @@ EFI_STATUS EFIAPI ovrLoadImage( } } - if (!EFI_ERROR (Status)) + if (!EFI_ERROR(Status)) { /* * Allocate space for the file @@ -190,7 +190,7 @@ EFI_STATUS EFIAPI ovrLoadImage( TempFilePath = FilePath; Status = BS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, (EFI_DEVICE_PATH_PROTOCOL **) &TempFilePath, &DeviceHandle); - if (!EFI_ERROR (Status)) + if (!EFI_ERROR(Status)) { Status = BS->HandleProtocol (DeviceHandle, &gEfiSimpleFileSystemProtocolGuid, (VOID**)&LoadFile); diff --git a/FileSystems/VBoxFsDxe/fsw_efi.c b/FileSystems/VBoxFsDxe/fsw_efi.c index a6d8626ac..859f5667c 100644 --- a/FileSystems/VBoxFsDxe/fsw_efi.c +++ b/FileSystems/VBoxFsDxe/fsw_efi.c @@ -223,7 +223,7 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE ImageHandle, fsw_efi_DriverBinding_table.DriverBindingHandle = ImageHandle; // install Driver Binding protocol Status = BS->InstallProtocolInterface(&fsw_efi_DriverBinding_table.DriverBindingHandle, &PROTO_NAME(DriverBindingProtocol), EFI_NATIVE_INTERFACE, &fsw_efi_DriverBinding_table); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -236,7 +236,7 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE ImageHandle, // install Component Name protocol Status = BS->InstallProtocolInterface(&fsw_efi_DriverBinding_table.DriverBindingHandle, &PROTO_NAME(ComponentNameProtocol), EFI_NATIVE_INTERFACE, &fsw_efi_ComponentName_table); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1196,13 +1196,13 @@ EFI_STATUS fsw_efi_dnode_fill_FileInfo(IN FSW_VOLUME_DATA *Volume, // if the node is a symlink, resolve it Status = fsw_efi_map_status (fsw_dnode_resolve (dno, &target_dno), Volume); fsw_dnode_release (dno); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; dno = target_dno; // make sure the dnode has complete info Status = fsw_efi_map_status (fsw_dnode_fill (dno), Volume); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; FileInfo->Size = RequiredSize; diff --git a/Include/IndustryStandard/AppleFeatures.h b/Include/IndustryStandard/AppleFeatures.h index 21b936eb8..b8c75c628 100644 --- a/Include/IndustryStandard/AppleFeatures.h +++ b/Include/IndustryStandard/AppleFeatures.h @@ -50,17 +50,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // UINT64 Features = 0xFC07E136U; /* Model dependent */ // UINT32 SecurityPolicy; // APPLE_PLATFORM_SECURITY_POLICY_PROTOCOL *Policy; -// if (!EFI_ERROR (gBS->LocateProtocol(&gApplePlatformSecurityPolicyProtocolGuid, NULL, (VOID **) &Policy)) -// && (!EFI_ERROR (Policy->GetSecurityPolicy(Policy, &SecurityPolicy)))) { +// if (!EFI_ERROR(gBS->LocateProtocol(&gApplePlatformSecurityPolicyProtocolGuid, NULL, (VOID **) &Policy)) +// && (!EFI_ERROR(Policy->GetSecurityPolicy(Policy, &SecurityPolicy)))) { // if (SecurityPolicy & 1) Features |= 0x400U; // if (SecurityPolicy & 2) Features |= 0x800U; // Features |= 0x1000000U; // } // Features = ((*(UINT64 *)(0xFFFFFF80) != 0x4E15E2F599858AC6ULL) << 12U) | Features & 0xFFFFFFFFFFFFEFFFULL; -// if (!EFI_ERROR (gRT->SetVariable(L"FirmwareFeaturesMask", &gEfiAppleNvramGuid, 6, sizeof (UINT32), &Mask))) +// if (!EFI_ERROR(gRT->SetVariable(L"FirmwareFeaturesMask", &gEfiAppleNvramGuid, 6, sizeof (UINT32), &Mask))) // gRT->SetVariable(L"FirmwareFeatures", &gEfiAppleNvramGuid, 6, sizeof (UINT32), &Features); // if ((Features & 0x2000000U) -// && !EFI_ERROR (gRT->SetVariable(L"ExtendedFirmwareFeaturesMask", &gEfiAppleNvramGuid, 6, sizeof (UINT64), &Mask))) +// && !EFI_ERROR(gRT->SetVariable(L"ExtendedFirmwareFeaturesMask", &gEfiAppleNvramGuid, 6, sizeof (UINT64), &Mask))) // gRT->SetVariable(L"ExtendedFirmwareFeatures", &gEfiAppleNvramGuid, 6, sizeof (UINT64), &Features); // } // diff --git a/Include/Library/DeviceTreeLib.h b/Include/Library/DeviceTreeLib.h index c84c22e64..59869196f 100644 --- a/Include/Library/DeviceTreeLib.h +++ b/Include/Library/DeviceTreeLib.h @@ -208,7 +208,7 @@ DTRestartEntryIteration ( Get the value of the specified property for the specified entry. **/ EFI_STATUS -DTGetProperty ( +DTGetProperty( IN CONST DTEntry Entry, IN CHAR8 *PropertyName, IN VOID **PropertyValue, diff --git a/IntelFrameworkPkg/Include/Protocol/LegacyBios.h b/IntelFrameworkPkg/Include/Protocol/LegacyBios.h index 00a149e38..b7ec0cc43 100644 --- a/IntelFrameworkPkg/Include/Protocol/LegacyBios.h +++ b/IntelFrameworkPkg/Include/Protocol/LegacyBios.h @@ -1530,14 +1530,14 @@ struct _EFI_LEGACY_BIOS_PROTOCOL { \ Desc_.Attributes = 0; \ Status_ = gDS->GetMemorySpaceDescriptor (0, &Desc_); \ - ASSERT_EFI_ERROR (Status_); \ + ASSERT_EFI_ERROR(Status_); \ if ((Desc_.Attributes & EFI_MEMORY_RP) != 0) { \ Status_ = gDS->SetMemorySpaceAttributes ( \ 0, \ EFI_PAGES_TO_SIZE(1), \ Desc_.Attributes & ~(UINT64)EFI_MEMORY_RP \ ); \ - ASSERT_EFI_ERROR (Status_); \ + ASSERT_EFI_ERROR(Status_); \ } \ \ { \ @@ -1550,7 +1550,7 @@ struct _EFI_LEGACY_BIOS_PROTOCOL { EFI_PAGES_TO_SIZE(1), \ Desc_.Attributes \ ); \ - ASSERT_EFI_ERROR (Status_); \ + ASSERT_EFI_ERROR(Status_); \ } \ } while (FALSE) diff --git a/LegacyBios/BlockIoDxe/BiosBlkIo.c b/LegacyBios/BlockIoDxe/BiosBlkIo.c index ab9365598..cdc6f3ee9 100644 --- a/LegacyBios/BlockIoDxe/BiosBlkIo.c +++ b/LegacyBios/BlockIoDxe/BiosBlkIo.c @@ -118,7 +118,7 @@ BiosBlockIoDriverEntryPoint ( &gBiosBlockIoComponentName, &gBiosBlockIoComponentName2 ); - // if (EFI_ERROR (Status)) { + // if (EFI_ERROR(Status)) { return Status; // } // @@ -169,11 +169,11 @@ BiosBlockIoDriverBindingSupported ( // See if the Legacy BIOS Protocol is available // /* Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } */ Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &Legacy8259); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -186,7 +186,7 @@ BiosBlockIoDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -208,7 +208,7 @@ BiosBlockIoDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -216,7 +216,7 @@ BiosBlockIoDriverBindingSupported ( // Class Code Register // Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, 0, sizeof (Pci) / sizeof (UINT32), &Pci); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto Done; } @@ -284,12 +284,12 @@ BiosBlockIoDriverBindingStart ( // See if the Legacy BIOS Protocol is available // /* Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } */ if (mLegacy8259 == NULL) { Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &mLegacy8259); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -308,7 +308,7 @@ BiosBlockIoDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -321,7 +321,7 @@ BiosBlockIoDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } // @@ -333,7 +333,7 @@ BiosBlockIoDriverBindingStart ( EFI_PCI_DEVICE_ENABLE, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -350,7 +350,7 @@ BiosBlockIoDriverBindingStart ( NULL, &Flags ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } // @@ -366,7 +366,7 @@ BiosBlockIoDriverBindingStart ( NULL, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } */ @@ -403,11 +403,11 @@ BiosBlockIoDriverBindingStart ( // // Check memory allocation success // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // In checked builds we want to assert if the allocate failed. // - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); Status = EFI_OUT_OF_RESOURCES; mBufferUnder1Mb = 0; goto Error; @@ -441,7 +441,7 @@ BiosBlockIoDriverBindingStart ( sizeof (BIOS_BLOCK_IO_DEV), (VOID **) &BiosBlockIoPrivate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } // @@ -480,8 +480,8 @@ BiosBlockIoDriverBindingStart ( BiosBlockIoPrivate->DevicePath, NULL ); - if (EFI_ERROR (Status)) { - gBS->FreePool (BiosBlockIoPrivate); + if (EFI_ERROR(Status)) { + gBS->FreePool(BiosBlockIoPrivate); } // // Open For Child Device @@ -496,14 +496,14 @@ BiosBlockIoDriverBindingStart ( ); } else { - gBS->FreePool (BiosBlockIoPrivate); + gBS->FreePool(BiosBlockIoPrivate); } } mBiosDrivesEnumerated = TRUE; Error: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (PciIo != NULL) { if (DeviceEnable) { PciIo->Attributes ( @@ -595,8 +595,8 @@ BiosBlockIoDriverBindingStop ( // Free our global buffer // Status = gBS->FreePages (mBufferUnder1Mb, BLOCK_IO_BUFFER_PAGE_SIZE); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } EfiAcquireLock (&mGlobalDataLock); @@ -615,7 +615,7 @@ BiosBlockIoDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -632,7 +632,7 @@ BiosBlockIoDriverBindingStop ( BiosBlockIoPrivate->DevicePath, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } // @@ -652,7 +652,7 @@ BiosBlockIoDriverBindingStop ( ChildHandleBuffer[Index] ); - gBS->FreePool (BiosBlockIoPrivate); + gBS->FreePool(BiosBlockIoPrivate); } if (!AllChildrenStopped) { @@ -706,7 +706,7 @@ SetBiosInitBlockIoDevicePath ( Status = BuildEdd30DevicePath (BaseDevicePath, Drive, DevicePath); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EDD 1.1 device case or it is unrecognized EDD 3.0 device // diff --git a/LegacyBios/BlockIoDxe/LegacyBiosThunk.c b/LegacyBios/BlockIoDxe/LegacyBiosThunk.c index 3411e8f9a..b82e3ed8d 100644 --- a/LegacyBios/BlockIoDxe/LegacyBiosThunk.c +++ b/LegacyBios/BlockIoDxe/LegacyBiosThunk.c @@ -43,8 +43,8 @@ InitializeBiosIntCaller ( EFI_SIZE_TO_PAGES(LegacyRegionSize), &LegacyRegionBase ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -99,8 +99,8 @@ InitializeInterruptRedirection ( EFI_SIZE_TO_PAGES(LegacyRegionLength), &LegacyRegionBase ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } // @@ -112,8 +112,8 @@ InitializeInterruptRedirection ( // Get VectorBase, it should be 0x68 // Status = Legacy8259->GetVector (Legacy8259, Efi8259Irq0, &ProtectedModeBaseVector); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } @@ -189,7 +189,7 @@ LegacyBiosInt86 ( // Set Legacy16 state. 0x08, 0x70 is legacy 8259 vector bases. // Status = BiosDev->Legacy8259->SetMode (BiosDev->Legacy8259, Efi8259LegacyMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); Stack16 = (UINT16 *)((UINT8 *) BiosDev->ThunkContext->RealModeBuffer + BiosDev->ThunkContext->RealModeBufferSize - sizeof (UINT16)); @@ -205,7 +205,7 @@ LegacyBiosInt86 ( // Restore protected mode interrupt state // Status = BiosDev->Legacy8259->SetMode (BiosDev->Legacy8259, Efi8259ProtectedMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // End critical section diff --git a/LegacyBios/KeyboardDxe/AppleKey.c b/LegacyBios/KeyboardDxe/AppleKey.c index 4fc77035c..d7aa45fbb 100644 --- a/LegacyBios/KeyboardDxe/AppleKey.c +++ b/LegacyBios/KeyboardDxe/AppleKey.c @@ -43,7 +43,7 @@ BiosKbSetAppleKeyMapDb ( &BiosKeyboardDevice->KeyMapDbIndex ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosKeyboardDevice->KeyMapDb = AppleKeyMapDb; } return Status; @@ -74,7 +74,7 @@ BiosKbAppleKeyMapDbInstallNotify ( mAppleKeyMapDbRegistration, (VOID **)&AppleKeyMapDb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosKbSetAppleKeyMapDb ((BIOS_KEYBOARD_DEV *)Context, AppleKeyMapDb); gBS->CloseEvent (Event); } @@ -98,7 +98,7 @@ BiosKbLocateAppleKeyMapDb ( NULL, (VOID **)&AppleKeyMapDb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosKbSetAppleKeyMapDb (BiosKeyboardDevice, AppleKeyMapDb); } else { diff --git a/LegacyBios/KeyboardDxe/BiosKeyboard.c b/LegacyBios/KeyboardDxe/BiosKeyboard.c index afadeebed..f77df091a 100644 --- a/LegacyBios/KeyboardDxe/BiosKeyboard.c +++ b/LegacyBios/KeyboardDxe/BiosKeyboard.c @@ -142,7 +142,7 @@ BiosKeyboardDriverBindingSupported ( (VOID **) &LegacyBios ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -157,7 +157,7 @@ BiosKeyboardDriverBindingSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -229,7 +229,7 @@ BiosKeyboardDriverBindingStart ( (VOID **) &LegacyBios ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -243,7 +243,7 @@ BiosKeyboardDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -301,7 +301,7 @@ BiosKeyboardDriverBindingStart ( &(BiosKeyboardPrivate->SimpleTextIn), &((BiosKeyboardPrivate->SimpleTextIn).WaitForKey) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { (BiosKeyboardPrivate->SimpleTextIn).WaitForKey = NULL; goto Done; } @@ -312,7 +312,7 @@ BiosKeyboardDriverBindingStart ( &(BiosKeyboardPrivate->SimpleTextInputEx), &(BiosKeyboardPrivate->SimpleTextInputEx.WaitForKeyEx) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BiosKeyboardPrivate->SimpleTextInputEx.WaitForKeyEx = NULL; goto Done; } @@ -327,7 +327,7 @@ BiosKeyboardDriverBindingStart ( BiosKeyboardPrivate, &BiosKeyboardPrivate->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto Done; @@ -338,7 +338,7 @@ BiosKeyboardDriverBindingStart ( TimerPeriodic, KEYBOARD_TIMER_INTERVAL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto Done; @@ -359,7 +359,7 @@ BiosKeyboardDriverBindingStart ( &BiosKeyboardPrivate->SimpleTextInputEx, FeaturePcdGet (PcdPs2KbdExtendedVerification) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "[KBD]Reset Failed. Status - %r\n", Status)); StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED; goto Done; @@ -456,7 +456,7 @@ Done: ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosKeyboardPrivate != NULL) { if ((BiosKeyboardPrivate->SimpleTextIn).WaitForKey != NULL) { @@ -472,7 +472,7 @@ Done: gBS->CloseEvent (BiosKeyboardPrivate->TimerEvent); } - FreePool (BiosKeyboardPrivate); + FreePool(BiosKeyboardPrivate); } if (IsaIo != NULL) { @@ -525,7 +525,7 @@ BiosKeyboardDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -537,7 +537,7 @@ BiosKeyboardDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -553,7 +553,7 @@ BiosKeyboardDriverBindingStop ( &BiosKeyboardPrivate->SimpleTextInputEx, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -574,7 +574,7 @@ BiosKeyboardDriverBindingStop ( gBS->CloseEvent (BiosKeyboardPrivate->SimpleTextInputEx.WaitForKeyEx); BiosKeyboardFreeNotifyList (&BiosKeyboardPrivate->NotifyList); - FreePool (BiosKeyboardPrivate); + FreePool(BiosKeyboardPrivate); return EFI_SUCCESS; } @@ -962,7 +962,7 @@ KeyboardReadKeyStrokeWorker ( // If there's no key, just return // Status = CheckQueue (&BiosKeyboardPrivate->Queue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->RestoreTPL (OldTpl); return EFI_NOT_READY; } @@ -1036,7 +1036,7 @@ BiosKeyboardReset ( This, &Key ); - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); // // 3 // check for KBC itself firstly for setted-up already or not by reading SYSF (bit2) of status register via 64H @@ -1056,7 +1056,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_CMDBYTE_R ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1066,7 +1066,7 @@ BiosKeyboardReset ( &CommandByte ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1087,7 +1087,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_AUX_DISABLE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1097,7 +1097,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_KB_DISABLE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1119,7 +1119,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_CMDREG_VIA64_KBC_SLFTEST ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1129,7 +1129,7 @@ BiosKeyboardReset ( KBC_CMDECHO_KBCSLFTEST_OK, KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1145,7 +1145,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_CMDBYTE_W ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1196,7 +1196,7 @@ BiosKeyboardReset ( KBC_INPBUF_VIA60_KBRESET ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1207,7 +1207,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1221,7 +1221,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1233,7 +1233,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_INPBUF_VIA60_KBSCODE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1244,7 +1244,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1253,7 +1253,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_INPBUF_VIA60_SCODESET2 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1264,7 +1264,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1276,7 +1276,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_INPBUF_VIA60_KBEN ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1287,7 +1287,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1306,7 +1306,7 @@ BiosKeyboardReset ( BiosKeyboardPrivate, KBC_CMDREG_VIA64_KB_CKECK ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1317,7 +1317,7 @@ BiosKeyboardReset ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1332,7 +1332,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_KB_ENABLE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1347,7 +1347,7 @@ BiosKeyboardReset ( KBC_CMDREG_VIA64_AUX_ENABLE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -1388,7 +1388,7 @@ BiosKeyboardReadKeyStroke ( BiosKeyboardPrivate = BIOS_KEYBOARD_DEV_FROM_THIS (This); Status = KeyboardReadKeyStrokeWorker (BiosKeyboardPrivate, &KeyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1438,7 +1438,7 @@ BiosKeyboardWaitForKey ( // BiosKeyboardTimerHandler (NULL, BIOS_KEYBOARD_DEV_FROM_THIS (Context)); - if (!EFI_ERROR (BiosKeyboardCheckForKey (Context))) { + if (!EFI_ERROR(BiosKeyboardCheckForKey (Context))) { gBS->SignalEvent (Event); } } @@ -1684,7 +1684,7 @@ CheckKeyboardConnect ( BiosKeyboardPrivate, KBC_INPBUF_VIA60_KBEN ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Keyboard enable failed!\n")); REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -1699,7 +1699,7 @@ CheckKeyboardConnect ( KEYBOARD_WAITFORVALUE_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Timeout!\n")); REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -2028,7 +2028,7 @@ BiosKeyboardFreeNotifyList ( BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE ); RemoveEntryList (ListHead->ForwardLink); - gBS->FreePool (NotifyNode); + gBS->FreePool(NotifyNode); } return EFI_SUCCESS; @@ -2127,7 +2127,7 @@ BiosKeyboardResetEx ( &BiosKeyboardPrivate->SimpleTextIn, ExtendedVerification ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -2223,8 +2223,8 @@ BiosKeyboardSetState ( (VOID **) &LegacyBios ); - // ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + // ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } // @@ -2244,17 +2244,17 @@ BiosKeyboardSetState ( } Status = KeyboardWrite (BiosKeyboardPrivate, 0xed); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } Status = KeyboardWaitForValue (BiosKeyboardPrivate, 0xfa, KEYBOARD_WAITFORVALUE_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } Status = KeyboardWrite (BiosKeyboardPrivate, Command); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -2466,7 +2466,7 @@ InitializeBiosKeyboard( &gBiosKeyboardComponentName, &gBiosKeyboardComponentName2 ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return Status; } diff --git a/LegacyBios/LegacyBios.c b/LegacyBios/LegacyBios.c index d26659632..e004356db 100644 --- a/LegacyBios/LegacyBios.c +++ b/LegacyBios/LegacyBios.c @@ -67,7 +67,7 @@ AllocateLegacyMemory ( // Do not ASSERT on Status error but let caller decide since some cases // memory is already taken but that is ok. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *Result = (EFI_PHYSICAL_ADDRESS) (UINTN) MemPage; } // @@ -218,7 +218,7 @@ ShadowAndStartLegacy16 ( 0x40000/EFI_PAGE_SIZE, &Address ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Bugbug: need to figure out whether C/D/E/F segment should be marked as reserved memory. // @@ -310,7 +310,7 @@ ShadowAndStartLegacy16 ( 0, 0 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Private->Legacy16Table->PciExpressBase = (UINT32)Location; Location = 0; } @@ -329,7 +329,7 @@ ShadowAndStartLegacy16 ( 0, 0 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // Table->TpmSegment = (UINT16)(Location >> 4) & 0xFFFF; // Table->TpmOffset = (UINT16)(Location & 0xFFFF); } @@ -470,7 +470,7 @@ LegacyBiosInstall ( // Load this driver's image to memory // Status = RelocateImageUnder4GIfNeeded (ImageHandle, SystemTable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -482,22 +482,22 @@ LegacyBiosInstall ( // be a dispatcher bug!. // Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &Private->Cpu); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->LocateProtocol (&gEfiTimerArchProtocolGuid, NULL, (VOID **) &Private->Timer); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->LocateProtocol (&gEfiLegacyRegion2ProtocolGuid, NULL, (VOID **) &Private->LegacyRegion); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->LocateProtocol (&gEfiLegacyBiosPlatformProtocolGuid, NULL, (VOID **) &Private->LegacyBiosPlatform); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &Private->Legacy8259); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->LocateProtocol (&gEfiLegacyInterruptProtocolGuid, NULL, (VOID **) &Private->LegacyInterrupt); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Locate Memory Test Protocol if exists @@ -507,7 +507,7 @@ LegacyBiosInstall ( NULL, (VOID **) &Private->GenericMemoryTest ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Make sure all memory from 0-640K is tested @@ -625,14 +625,14 @@ LegacyBiosInstall ( (sizeof (LOW_MEMORY_THUNK) / EFI_PAGE_SIZE) + 2, &MemoryAddress ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Private->IntThunk = (LOW_MEMORY_THUNK *) (UINTN) MemoryAddress; EfiToLegacy16InitTable = &Private->IntThunk->EfiToLegacy16InitTable; EfiToLegacy16InitTable->ThunkStart = (UINT32) (EFI_PHYSICAL_ADDRESS) (UINTN) MemoryAddress; EfiToLegacy16InitTable->ThunkSizeInBytes = (UINT32) (sizeof (LOW_MEMORY_THUNK)); Status = LegacyBiosInitializeThunk (Private); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Init the legacy memory map in memory < 1 MB. @@ -652,7 +652,7 @@ LegacyBiosInstall ( EFI_SIZE_TO_PAGES (MemorySize), &MemoryAddress ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { EfiToLegacy16InitTable->HiPmmMemory = (UINT32) (EFI_PHYSICAL_ADDRESS) (UINTN) MemoryAddress; EfiToLegacy16InitTable->HiPmmMemorySizeInBytes = MemorySize; } diff --git a/LegacyBios/Platform/LegacyPlatform.c b/LegacyBios/Platform/LegacyPlatform.c index af8896ae9..0ab7bbbed 100644 --- a/LegacyBios/Platform/LegacyPlatform.c +++ b/LegacyBios/Platform/LegacyPlatform.c @@ -134,7 +134,7 @@ FindAllDeviceTypes ( NULL, (VOID**)&LegacyBios ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Get all PCI handles and check them to generate a list of matching devices. @@ -195,7 +195,7 @@ FindAllDeviceTypes ( // // Free any allocated buffers // - gBS->FreePool (HandleBuffer); + gBS->FreePool(HandleBuffer); if (*DeviceIndex != StartIndex) { return EFI_SUCCESS; @@ -280,13 +280,13 @@ GetSelectedVgaDeviceInfo ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } for (Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID**)&PciIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Detemine if this is in the correct bus range. // @@ -305,7 +305,7 @@ GetSelectedVgaDeviceInfo ( sizeof (Pci) / sizeof (UINT32), &Pci ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -333,7 +333,7 @@ GetSelectedVgaDeviceInfo ( } } - FreePool (HandleBuffer); + FreePool(HandleBuffer); } @@ -496,7 +496,7 @@ GetPlatformHandle ( sizeof (PciConfigHeader) / sizeof (UINT32), &PciConfigHeader ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIo->GetLocation ( PciIo, &Segment, @@ -707,7 +707,7 @@ GetRoutingTable ( NULL, (VOID**)&LegacyInterrupt ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); LegacyInterrupt->GetLocation ( LegacyInterrupt, &Bus, @@ -799,7 +799,7 @@ GetPlatformInfo ( Table, (UINTN *) TableSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } return EFI_SUCCESS; @@ -857,7 +857,7 @@ TranslatePirq ( NULL, (VOID**)&LegacyInterrupt ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); LocalPirq = (UINT8) (*Pirq); for (Index = 0; Index < MAX_IRQ_ROUTING_ENTRIES; Index++) { diff --git a/LegacyBios/Platform/LegacyRegion.c b/LegacyBios/Platform/LegacyRegion.c index 44d340be6..c0f014fa9 100644 --- a/LegacyBios/Platform/LegacyRegion.c +++ b/LegacyBios/Platform/LegacyRegion.c @@ -459,7 +459,7 @@ LegacyRegionInit ( &gEfiLegacyRegion2ProtocolGuid, &mLegacyRegion2, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/LegacyBios/Thunk/Thunk.c b/LegacyBios/Thunk/Thunk.c index 2016f5c7e..1683afae0 100644 --- a/LegacyBios/Thunk/Thunk.c +++ b/LegacyBios/Thunk/Thunk.c @@ -282,7 +282,7 @@ InternalLegacyBiosFarCall ( // Set Legacy16 state. 0x08, 0x70 is legacy 8259 vector bases. // Status = Private->Legacy8259->SetMode (Private->Legacy8259, Efi8259LegacyMode, NULL, NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); AsmThunk16 (&mThunkContext); @@ -314,7 +314,7 @@ InternalLegacyBiosFarCall ( // Restore protected mode interrupt state // Status = Private->Legacy8259->SetMode (Private->Legacy8259, Efi8259ProtectedMode, NULL, NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mThunkContext.RealModeState = NULL; @@ -381,7 +381,7 @@ LegacyBiosInitializeThunk ( // TimerVector = 0; Status = Private->Legacy8259->GetVector (Private->Legacy8259, Efi8259Irq0, &TimerVector); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Check to see if the Timer AP has hooked the IRQ0 from the 8254 PIT diff --git a/LegacyBios/VideoDxe/BiosVideo.c b/LegacyBios/VideoDxe/BiosVideo.c index 851a9faf3..c4e3402ed 100644 --- a/LegacyBios/VideoDxe/BiosVideo.c +++ b/LegacyBios/VideoDxe/BiosVideo.c @@ -156,7 +156,7 @@ BiosVideoDriverBindingSupported ( // See if the Legacy BIOS Protocol is available // Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG("LegacyBios not found\n"); return Status; } @@ -172,7 +172,7 @@ BiosVideoDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) /* && (Status != EFI_ALREADY_STARTED) */) { + if (EFI_ERROR(Status) /* && (Status != EFI_ALREADY_STARTED) */) { // DBG("PciIo not found\n"); return Status; } @@ -191,7 +191,7 @@ BiosVideoDriverBindingSupported ( NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_ALREADY_STARTED; } } @@ -206,7 +206,7 @@ BiosVideoDriverBindingSupported ( sizeof (Pci) / sizeof (UINT32), &Pci ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("PciIo->Pci.Read status=%r\n", Status); Status = EFI_UNSUPPORTED; goto Done; @@ -295,7 +295,7 @@ BiosVideoDriverBindingStart ( // Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("Legacy BIOS Protocol status=%r\n", Status); return Status; } @@ -308,7 +308,7 @@ BiosVideoDriverBindingStart ( &gEfiDevicePathProtocolGuid, (VOID **) &ParentDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("ParentDevicePath status=%r\n", Status); return Status; } @@ -324,7 +324,7 @@ BiosVideoDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) /* && (Status != EFI_ALREADY_STARTED) */) { + if (EFI_ERROR(Status) /* && (Status != EFI_ALREADY_STARTED) */) { DBG("OpenProtocol PCI status=%r\n", Status); return Status; } @@ -339,7 +339,7 @@ BiosVideoDriverBindingStart ( 0, &mOriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("Save original PCI attributes status=%r\n", Status); goto Done; } @@ -356,7 +356,7 @@ BiosVideoDriverBindingStart ( &Supports ); // Status = EFI_UNSUPPORTED; //temporary - remove it - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("PCI attribute=%x Status=%r\n", Supports, Status); goto Done; } @@ -384,7 +384,7 @@ BiosVideoDriverBindingStart ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("Enable the device status=%r\n", Status); /* REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -404,7 +404,7 @@ BiosVideoDriverBindingStart ( &Flags ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("Check PCI ROM status=%r\n", Status); goto Done; } @@ -427,7 +427,7 @@ BiosVideoDriverBindingStart ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("InstallPciRom status=%r\n", Status); /* REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -449,7 +449,7 @@ BiosVideoDriverBindingStart ( } } // Status = EFI_UNSUPPORTED; //temporary - remove it - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -467,7 +467,7 @@ BiosVideoDriverBindingStart ( // DBG("Child installed\n"); Done: // Status = EFI_UNSUPPORTED; //temporary - remove it - if ((EFI_ERROR (Status)) && (Status != EFI_ALREADY_STARTED)) { + if ((EFI_ERROR(Status)) && (Status != EFI_ALREADY_STARTED)) { /* REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_PROGRESS_CODE, EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_PC_DISABLE, @@ -563,7 +563,7 @@ BiosVideoDriverBindingStop ( for (Index = 0; Index < NumberOfChildren; Index++) { Status = BiosVideoChildHandleUninstall (This, Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -579,8 +579,8 @@ BiosVideoDriverBindingStop ( &gEfiPciIoProtocolGuid, (VOID **) &PciIo ); -// ASSERT_EFI_ERROR (Status); //Slice - I hate ASSERT - if (!EFI_ERROR (Status)){ +// ASSERT_EFI_ERROR(Status); //Slice - I hate ASSERT + if (!EFI_ERROR(Status)){ // // Restore original PCI attributes // @@ -648,7 +648,7 @@ BiosVideoChildHandleInstall ( sizeof (Pci) / sizeof (UINT32), &Pci ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("ParentPciIo->Pci.Read=%r\n", Status); goto Done; } @@ -673,7 +673,7 @@ BiosVideoChildHandleInstall ( &gEfiEventExitBootServicesGuid, &BiosVideoPrivate->ExitBootServicesEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -742,7 +742,7 @@ BiosVideoChildHandleInstall ( // DBG("GopDevicePath OK\n"); // Status = EFI_UNSUPPORTED; /* - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } */ @@ -758,7 +758,7 @@ BiosVideoChildHandleInstall ( DBG("!BiosVideoPrivate->GopDevicePath\n"); Status = EFI_UNSUPPORTED; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -773,7 +773,7 @@ BiosVideoChildHandleInstall ( // DBG("Creat child handle %r\n", Status); // Status = EFI_UNSUPPORTED; - /* if (EFI_ERROR (Status)) { + /* if (EFI_ERROR(Status)) { goto Done; }*/ } @@ -810,7 +810,7 @@ BiosVideoChildHandleInstall ( } else { Status = EFI_UNSUPPORTED; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The VESA BIOS Extensions are not compatible with Graphics Output, so check for support // for the standard 640x480 16 color VGA mode @@ -827,17 +827,17 @@ BiosVideoChildHandleInstall ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free GOP mode structure if it is not freed before // VgaMiniPort does not need this structure any more // if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); BiosVideoPrivate->GraphicsOutput.Mode->Info = NULL; } - FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode); BiosVideoPrivate->GraphicsOutput.Mode = NULL; } @@ -871,7 +871,7 @@ BiosVideoChildHandleInstall ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Open the Parent Handle for the child // @@ -883,7 +883,7 @@ BiosVideoChildHandleInstall ( BiosVideoPrivate->Handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ProtocolInstalled = TRUE; @@ -904,7 +904,7 @@ BiosVideoChildHandleInstall ( } Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if ((BiosVideoPrivate != NULL) && (BiosVideoPrivate->ExitBootServicesEvent != NULL)) { gBS->CloseEvent (BiosVideoPrivate->ExitBootServicesEvent); } @@ -954,11 +954,11 @@ BiosVideoChildHandleUninstall ( Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (GraphicsOutput); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( Handle, &gEfiVgaMiniPortProtocolGuid, @@ -967,7 +967,7 @@ BiosVideoChildHandleUninstall ( Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_VGA_MINI_PORT_THIS (VgaMiniPort); } } @@ -1024,7 +1024,7 @@ BiosVideoChildHandleUninstall ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiPciIoProtocolGuid, @@ -1075,25 +1075,25 @@ BiosVideoDeviceReleaseResource ( // Free VGA Frame Buffer // if (BiosVideoPrivate->VgaFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VgaFrameBuffer); + FreePool(BiosVideoPrivate->VgaFrameBuffer); } // // Free VBE Frame Buffer // if (BiosVideoPrivate->VbeFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VbeFrameBuffer); + FreePool(BiosVideoPrivate->VbeFrameBuffer); } // // Free line buffer // if (BiosVideoPrivate->LineBuffer != NULL) { - FreePool (BiosVideoPrivate->LineBuffer); + FreePool(BiosVideoPrivate->LineBuffer); } // // Free mode data // if (BiosVideoPrivate->ModeData != NULL) { - FreePool (BiosVideoPrivate->ModeData); + FreePool(BiosVideoPrivate->ModeData); } // // Free memory allocated below 1MB @@ -1111,30 +1111,30 @@ BiosVideoDeviceReleaseResource ( // if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); BiosVideoPrivate->GraphicsOutput.Mode->Info = NULL; } - FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode); BiosVideoPrivate->GraphicsOutput.Mode = NULL; } // // Free EDID discovered protocol occupied resource // if (BiosVideoPrivate->EdidDiscovered.Edid != NULL) { - FreePool (BiosVideoPrivate->EdidDiscovered.Edid); + FreePool(BiosVideoPrivate->EdidDiscovered.Edid); } // // Free EDID active protocol occupied resource // if (BiosVideoPrivate->EdidActive.Edid != NULL) { - FreePool (BiosVideoPrivate->EdidActive.Edid); + FreePool(BiosVideoPrivate->EdidActive.Edid); } if (BiosVideoPrivate->GopDevicePath!= NULL) { - FreePool (BiosVideoPrivate->GopDevicePath); + FreePool(BiosVideoPrivate->GopDevicePath); } - FreePool (BiosVideoPrivate); + FreePool(BiosVideoPrivate); return ; } @@ -1486,7 +1486,7 @@ BiosVideoCheckForVbe ( BiosVideoPrivate->NumberOfPagesBelow1MB, &BiosVideoPrivate->PagesBelow1MB ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1563,7 +1563,7 @@ BiosVideoCheckForVbe ( NULL, (VOID **) &EdidOverride ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Allocate double size of VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE to avoid overflow // @@ -1581,7 +1581,7 @@ BiosVideoCheckForVbe ( &EdidOverrideDataSize, (UINT8 **) &EdidOverrideDataBlock ); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && EdidAttributes == 0 && EdidOverrideDataSize != 0) { // @@ -1885,7 +1885,7 @@ BiosVideoCheckForVbe ( } if (BiosVideoPrivate->ModeData != NULL) { - FreePool (BiosVideoPrivate->ModeData); + FreePool(BiosVideoPrivate->ModeData); } CurrentModeData = &ModeBuffer[ModeNumber - 1]; @@ -1971,14 +1971,14 @@ BiosVideoCheckForVbe ( // PreferMode = HighestResolutionMode; Status = BiosVideoGraphicsOutputSetMode (&BiosVideoPrivate->GraphicsOutput, (UINT32) PreferMode); DBG(" - SetMode pref %d (%d) = %r\n", PreferMode, (UINT32) PreferMode, Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { for (PreferMode = 0; PreferMode < ModeNumber; PreferMode ++) { Status = BiosVideoGraphicsOutputSetMode ( &BiosVideoPrivate->GraphicsOutput, (UINT32) PreferMode ); DBG(" - SetMode pref %d (%d) = %r\n", PreferMode, (UINT32) PreferMode, Status); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } } @@ -1994,14 +1994,14 @@ Done: // // If there was an error, then free the mode structure // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosVideoPrivate->ModeData != NULL) { - FreePool (BiosVideoPrivate->ModeData); + FreePool(BiosVideoPrivate->ModeData); BiosVideoPrivate->ModeData = NULL; BiosVideoPrivate->MaxMode = 0; } if (EdidOverrideDataBlock != NULL) { - FreePool (EdidOverrideDataBlock); + FreePool(EdidOverrideDataBlock); } } @@ -2072,17 +2072,17 @@ Done: // // If there was an error, then free the mode structure // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosVideoPrivate->ModeData != NULL) { - FreePool (BiosVideoPrivate->ModeData); + FreePool(BiosVideoPrivate->ModeData); BiosVideoPrivate->ModeData = NULL; } if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); BiosVideoPrivate->GraphicsOutput.Mode->Info = NULL; } - FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode); BiosVideoPrivate->GraphicsOutput.Mode = NULL; } } @@ -2180,15 +2180,15 @@ BiosVideoSetModeWorker ( EFI_IA32_REGISTER_SET Regs; if (BiosVideoPrivate->LineBuffer != NULL) { - FreePool (BiosVideoPrivate->LineBuffer); + FreePool(BiosVideoPrivate->LineBuffer); } if (BiosVideoPrivate->VgaFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VgaFrameBuffer); + FreePool(BiosVideoPrivate->VgaFrameBuffer); } if (BiosVideoPrivate->VbeFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VbeFrameBuffer); + FreePool(BiosVideoPrivate->VbeFrameBuffer); } BiosVideoPrivate->LineBuffer = (UINT8 *) AllocatePool (ModeData->BytesPerScanLine); @@ -2250,7 +2250,7 @@ BiosVideoSetModeWorker ( (ModeData->BytesPerScanLine * ModeData->VerticalResolution) >> 2, BiosVideoPrivate->VbeFrameBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; }*/ } @@ -2337,7 +2337,7 @@ BiosVideoGraphicsOutputSetMode ( } Status = BiosVideoSetModeWorker (BiosVideoPrivate, ModeData, BiosVideoPrivate->GopDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG(" - %r\n", Status); return Status; } @@ -2408,7 +2408,7 @@ CopyVideoBuffer ( TotalBytes, VbeBuffer ); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); return; } @@ -2426,8 +2426,8 @@ CopyVideoBuffer ( UnalignedBytes, VbeBuffer ); - // ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + // ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } FrameBufferAddr += UnalignedBytes; @@ -2452,8 +2452,8 @@ CopyVideoBuffer ( CopyBlockNum, VbeBuffer ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } @@ -2469,8 +2469,8 @@ CopyVideoBuffer ( RemainingBytes, VbeBuffer ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } @@ -3550,8 +3550,8 @@ BiosVideoEntryPoint( &gBiosVideoComponentName, &gBiosVideoComponentName2 ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } diff --git a/LegacyBios/VideoDxe/BiosVideo2.c b/LegacyBios/VideoDxe/BiosVideo2.c index f94811686..03a34796e 100644 --- a/LegacyBios/VideoDxe/BiosVideo2.c +++ b/LegacyBios/VideoDxe/BiosVideo2.c @@ -156,7 +156,7 @@ BiosVideoDriverBindingSupported ( // See if the Legacy BIOS Protocol is available // Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG("LegacyBios not found\n"); return Status; } @@ -172,7 +172,7 @@ BiosVideoDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) /* && (Status != EFI_ALREADY_STARTED) */) { + if (EFI_ERROR(Status) /* && (Status != EFI_ALREADY_STARTED) */) { // DBG("PciIo not found\n"); return Status; } @@ -191,7 +191,7 @@ BiosVideoDriverBindingSupported ( NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_ALREADY_STARTED; } } @@ -206,7 +206,7 @@ BiosVideoDriverBindingSupported ( sizeof (Pci) / sizeof (UINT32), &Pci ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("PciIo->Pci.Read status=%r\n", Status); Status = EFI_UNSUPPORTED; goto Done; @@ -295,7 +295,7 @@ BiosVideoDriverBindingStart ( // Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("Legacy BIOS Protocol status=%r\n", Status); return Status; } @@ -308,7 +308,7 @@ BiosVideoDriverBindingStart ( &gEfiDevicePathProtocolGuid, (VOID **) &ParentDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("ParentDevicePath status=%r\n", Status); return Status; } @@ -324,7 +324,7 @@ BiosVideoDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) /* && (Status != EFI_ALREADY_STARTED) */) { + if (EFI_ERROR(Status) /* && (Status != EFI_ALREADY_STARTED) */) { DBG("OpenProtocol PCI status=%r\n", Status); return Status; } @@ -340,7 +340,7 @@ BiosVideoDriverBindingStart ( 0, &mOriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("Save original PCI attributes status=%r\n", Status); goto Done; } @@ -357,7 +357,7 @@ BiosVideoDriverBindingStart ( &Supports ); // Status = EFI_UNSUPPORTED; //temporary - remove it - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("PCI attribute=%x Status=%r\n", Supports, Status); goto Done; } @@ -386,7 +386,7 @@ BiosVideoDriverBindingStart ( NULL ); */ - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("Enable the device status=%r\n", Status); REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -406,7 +406,7 @@ BiosVideoDriverBindingStart ( &Flags ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("Check PCI ROM status=%r\n", Status); goto Done; } @@ -429,7 +429,7 @@ BiosVideoDriverBindingStart ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("InstallPciRom status=%r\n", Status); REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -451,7 +451,7 @@ BiosVideoDriverBindingStart ( } } // Status = EFI_UNSUPPORTED; //temporary - remove it - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -469,7 +469,7 @@ BiosVideoDriverBindingStart ( // DBG("Child installed\n"); Done: // Status = EFI_UNSUPPORTED; //temporary - remove it - if ((EFI_ERROR (Status)) && (Status != EFI_ALREADY_STARTED)) { + if ((EFI_ERROR(Status)) && (Status != EFI_ALREADY_STARTED)) { /* REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_PROGRESS_CODE, EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_PC_DISABLE, @@ -566,7 +566,7 @@ BiosVideoDriverBindingStop ( for (Index = 0; Index < NumberOfChildren; Index++) { Status = BiosVideoChildHandleUninstall (This, Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -582,8 +582,8 @@ BiosVideoDriverBindingStop ( &gEfiPciIoProtocolGuid, (VOID **) &PciIo ); -// ASSERT_EFI_ERROR (Status); //Slice - I hate ASSERT - if (!EFI_ERROR (Status)){ +// ASSERT_EFI_ERROR(Status); //Slice - I hate ASSERT + if (!EFI_ERROR(Status)){ // // Restore original PCI attributes // @@ -653,7 +653,7 @@ BiosVideoChildHandleInstall ( sizeof (Pci) / sizeof (UINT32), &Pci ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("ParentPciIo->Pci.Read=%r\n", Status); goto Done; } @@ -678,7 +678,7 @@ BiosVideoChildHandleInstall ( &gEfiEventExitBootServicesGuid, &BiosVideoPrivate->ExitBootServicesEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -747,7 +747,7 @@ BiosVideoChildHandleInstall ( // DBG("GopDevicePath OK\n"); // Status = EFI_UNSUPPORTED; /* - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } */ @@ -763,7 +763,7 @@ BiosVideoChildHandleInstall ( DBG("!BiosVideoPrivate->GopDevicePath\n"); Status = EFI_UNSUPPORTED; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -778,7 +778,7 @@ BiosVideoChildHandleInstall ( // DBG("Creat child handle %r\n", Status); // Status = EFI_UNSUPPORTED; - /* if (EFI_ERROR (Status)) { + /* if (EFI_ERROR(Status)) { goto Done; }*/ } @@ -815,7 +815,7 @@ BiosVideoChildHandleInstall ( } else { Status = EFI_UNSUPPORTED; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The VESA BIOS Extensions are not compatible with Graphics Output, so check for support // for the standard 640x480 16 color VGA mode @@ -832,17 +832,17 @@ BiosVideoChildHandleInstall ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free GOP mode structure if it is not freed before // VgaMiniPort does not need this structure any more // if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); BiosVideoPrivate->GraphicsOutput.Mode->Info = NULL; } - FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode); BiosVideoPrivate->GraphicsOutput.Mode = NULL; } @@ -876,7 +876,7 @@ BiosVideoChildHandleInstall ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Open the Parent Handle for the child // @@ -888,7 +888,7 @@ BiosVideoChildHandleInstall ( BiosVideoPrivate->Handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ProtocolInstalled = TRUE; @@ -909,7 +909,7 @@ BiosVideoChildHandleInstall ( } Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if ((BiosVideoPrivate != NULL) && (BiosVideoPrivate->ExitBootServicesEvent != NULL)) { gBS->CloseEvent (BiosVideoPrivate->ExitBootServicesEvent); } @@ -959,11 +959,11 @@ BiosVideoChildHandleUninstall ( Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (GraphicsOutput); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( Handle, &gEfiVgaMiniPortProtocolGuid, @@ -972,7 +972,7 @@ BiosVideoChildHandleUninstall ( Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_VGA_MINI_PORT_THIS (VgaMiniPort); } } @@ -1029,7 +1029,7 @@ BiosVideoChildHandleUninstall ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiPciIoProtocolGuid, @@ -1080,25 +1080,25 @@ BiosVideoDeviceReleaseResource ( // Free VGA Frame Buffer // if (BiosVideoPrivate->VgaFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VgaFrameBuffer); + FreePool(BiosVideoPrivate->VgaFrameBuffer); } // // Free VBE Frame Buffer // if (BiosVideoPrivate->VbeFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VbeFrameBuffer); + FreePool(BiosVideoPrivate->VbeFrameBuffer); } // // Free line buffer // if (BiosVideoPrivate->LineBuffer != NULL) { - FreePool (BiosVideoPrivate->LineBuffer); + FreePool(BiosVideoPrivate->LineBuffer); } // // Free mode data // if (BiosVideoPrivate->ModeData != NULL) { - FreePool (BiosVideoPrivate->ModeData); + FreePool(BiosVideoPrivate->ModeData); } // // Free memory allocated below 1MB @@ -1116,30 +1116,30 @@ BiosVideoDeviceReleaseResource ( // if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); BiosVideoPrivate->GraphicsOutput.Mode->Info = NULL; } - FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode); BiosVideoPrivate->GraphicsOutput.Mode = NULL; } // // Free EDID discovered protocol occupied resource // if (BiosVideoPrivate->EdidDiscovered.Edid != NULL) { - FreePool (BiosVideoPrivate->EdidDiscovered.Edid); + FreePool(BiosVideoPrivate->EdidDiscovered.Edid); } // // Free EDID active protocol occupied resource // if (BiosVideoPrivate->EdidActive.Edid != NULL) { - FreePool (BiosVideoPrivate->EdidActive.Edid); + FreePool(BiosVideoPrivate->EdidActive.Edid); } if (BiosVideoPrivate->GopDevicePath!= NULL) { - FreePool (BiosVideoPrivate->GopDevicePath); + FreePool(BiosVideoPrivate->GopDevicePath); } - FreePool (BiosVideoPrivate); + FreePool(BiosVideoPrivate); return ; } @@ -1491,7 +1491,7 @@ BiosVideoCheckForVbe ( BiosVideoPrivate->NumberOfPagesBelow1MB, &BiosVideoPrivate->PagesBelow1MB ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1568,7 +1568,7 @@ BiosVideoCheckForVbe ( NULL, (VOID **) &EdidOverride ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Allocate double size of VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE to avoid overflow // @@ -1586,7 +1586,7 @@ BiosVideoCheckForVbe ( &EdidOverrideDataSize, (UINT8 **) &EdidOverrideDataBlock ); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && EdidAttributes == 0 && EdidOverrideDataSize != 0) { // @@ -1890,7 +1890,7 @@ BiosVideoCheckForVbe ( } if (BiosVideoPrivate->ModeData != NULL) { - FreePool (BiosVideoPrivate->ModeData); + FreePool(BiosVideoPrivate->ModeData); } CurrentModeData = &ModeBuffer[ModeNumber - 1]; @@ -1976,14 +1976,14 @@ BiosVideoCheckForVbe ( // PreferMode = HighestResolutionMode; Status = BiosVideoGraphicsOutputSetMode (&BiosVideoPrivate->GraphicsOutput, (UINT32) PreferMode); DBG(" - SetMode pref %d (%d) = %r\n", PreferMode, (UINT32) PreferMode, Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { for (PreferMode = 0; PreferMode < ModeNumber; PreferMode ++) { Status = BiosVideoGraphicsOutputSetMode ( &BiosVideoPrivate->GraphicsOutput, (UINT32) PreferMode ); DBG(" - SetMode pref %d (%d) = %r\n", PreferMode, (UINT32) PreferMode, Status); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } } @@ -1999,14 +1999,14 @@ Done: // // If there was an error, then free the mode structure // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosVideoPrivate->ModeData != NULL) { - FreePool (BiosVideoPrivate->ModeData); + FreePool(BiosVideoPrivate->ModeData); BiosVideoPrivate->ModeData = NULL; BiosVideoPrivate->MaxMode = 0; } if (EdidOverrideDataBlock != NULL) { - FreePool (EdidOverrideDataBlock); + FreePool(EdidOverrideDataBlock); } } @@ -2077,17 +2077,17 @@ Done: // // If there was an error, then free the mode structure // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (BiosVideoPrivate->ModeData != NULL) { - FreePool (BiosVideoPrivate->ModeData); + FreePool(BiosVideoPrivate->ModeData); BiosVideoPrivate->ModeData = NULL; } if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) { if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) { - FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode->Info); BiosVideoPrivate->GraphicsOutput.Mode->Info = NULL; } - FreePool (BiosVideoPrivate->GraphicsOutput.Mode); + FreePool(BiosVideoPrivate->GraphicsOutput.Mode); BiosVideoPrivate->GraphicsOutput.Mode = NULL; } } @@ -2185,15 +2185,15 @@ BiosVideoSetModeWorker ( EFI_IA32_REGISTER_SET Regs; if (BiosVideoPrivate->LineBuffer != NULL) { - FreePool (BiosVideoPrivate->LineBuffer); + FreePool(BiosVideoPrivate->LineBuffer); } if (BiosVideoPrivate->VgaFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VgaFrameBuffer); + FreePool(BiosVideoPrivate->VgaFrameBuffer); } if (BiosVideoPrivate->VbeFrameBuffer != NULL) { - FreePool (BiosVideoPrivate->VbeFrameBuffer); + FreePool(BiosVideoPrivate->VbeFrameBuffer); } BiosVideoPrivate->LineBuffer = (UINT8 *) AllocatePool (ModeData->BytesPerScanLine); @@ -2255,7 +2255,7 @@ BiosVideoSetModeWorker ( (ModeData->BytesPerScanLine * ModeData->VerticalResolution) >> 2, BiosVideoPrivate->VbeFrameBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; }*/ } @@ -2342,7 +2342,7 @@ BiosVideoGraphicsOutputSetMode ( } Status = BiosVideoSetModeWorker (BiosVideoPrivate, ModeData, BiosVideoPrivate->GopDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG(" - %r\n", Status); return Status; } @@ -2413,7 +2413,7 @@ CopyVideoBuffer ( TotalBytes, VbeBuffer ); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); return; } @@ -2431,8 +2431,8 @@ CopyVideoBuffer ( UnalignedBytes, VbeBuffer ); - // ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + // ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } FrameBufferAddr += UnalignedBytes; @@ -2457,8 +2457,8 @@ CopyVideoBuffer ( CopyBlockNum, VbeBuffer ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } @@ -2474,8 +2474,8 @@ CopyVideoBuffer ( RemainingBytes, VbeBuffer ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } @@ -3555,8 +3555,8 @@ CsmVideoEntryPoint( &gBiosVideoComponentName, &gBiosVideoComponentName2 ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } diff --git a/Library/DeviceTreeLib/DeviceTreeLib.c b/Library/DeviceTreeLib/DeviceTreeLib.c index b1263d4a4..92d40c9b6 100755 --- a/Library/DeviceTreeLib/DeviceTreeLib.c +++ b/Library/DeviceTreeLib/DeviceTreeLib.c @@ -148,11 +148,11 @@ FindChild ( Index = 1; Child = GetFirstChild (Cur); while (1) { - if (EFI_ERROR (DTGetProperty (Child, "name", (VOID **)&Str, &Dummy))) { + if (EFI_ERROR(DTGetProperty(Child, "name", (VOID **)&Str, &Dummy))) { break; } - if (AsciiStrCmp (Str, Buf) == 0) { + if (AsciiStrCmp(Str, Buf) == 0) { return Child; } @@ -264,10 +264,10 @@ DTDisposeEntryIterator ( while ((Scope = Iterator->SavedScope) != NULL) { Iterator->SavedScope = Scope->NextScope; - FreePool (Scope); + FreePool(Scope); } - FreePool (Iterator); + FreePool(Iterator); return EFI_SUCCESS; } @@ -323,7 +323,7 @@ DTExitEntry ( *CurrentPosition = Iterator->CurrentEntry; - FreePool (NewScope); + FreePool(NewScope); return EFI_SUCCESS; } @@ -360,7 +360,7 @@ DTRestartEntryIteration ( } EFI_STATUS -DTGetProperty ( +DTGetProperty( IN CONST DTEntry Entry, IN CHAR8 *PropertyName, IN VOID **PropertyValue, @@ -376,7 +376,7 @@ DTGetProperty ( Prop = (DTProperty *) (Entry + 1); for (Count = 0; Count < Entry->NumProperties; Count++) { - if (AsciiStrCmp (Prop->Name, PropertyName) == 0) { + if (AsciiStrCmp(Prop->Name, PropertyName) == 0) { *PropertyValue = (VOID *) (((UINT8 *)Prop) + sizeof (DTProperty)); *PropertySize = Prop->Length; return EFI_SUCCESS; @@ -465,11 +465,11 @@ DumpDeviceTreeNodeRecusively ( Status = DTCreatePropertyIterator (Entry, PropIter); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PropertyParent = "/"; while (!EFI_ERROR(DTIterateProperties (PropIter, &PropertyName))) { - if ((Status = DTGetProperty (Entry, (CHAR8 *)PropertyName, (void *)&PropertyValue, &PropertySize)) != EFI_SUCCESS) { + if ((Status = DTGetProperty(Entry, (CHAR8 *)PropertyName, (void *)&PropertyValue, &PropertySize)) != EFI_SUCCESS) { DEBUG ((DEBUG_WARN, "DeviceTree is probably invalid - %r\n", Status)); break; } @@ -527,14 +527,14 @@ DumpDeviceTreeNodeRecusively ( Status = DTCreateEntryIterator (Root, &EntryIterator); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { while (!EFI_ERROR(DTIterateEntries (EntryIterator, &Root))) { DumpDeviceTreeNodeRecusively (Root); mDTNodeDepth--; } } - return !EFI_ERROR (Status) ? EFI_SUCCESS : EFI_NOT_FOUND; + return !EFI_ERROR(Status) ? EFI_SUCCESS : EFI_NOT_FOUND; } VOID @@ -544,7 +544,7 @@ DumpDeviceTree ( { DTEntry DTRoot = NULL; - if (!EFI_ERROR (DTLookupEntry (NULL, "/", &DTRoot))) { + if (!EFI_ERROR(DTLookupEntry (NULL, "/", &DTRoot))) { DumpDeviceTreeNodeRecusively (DTRoot); } } @@ -593,9 +593,9 @@ DTDeleteProperty ( DeviceTreeEnd = (CHAR8 *) mDTRootNode + *mDTLength; DeleteLength = 0; - if (!EFI_ERROR (DTLookupEntry (NULL, NodeName, &Node))) { - if (!EFI_ERROR (DTCreatePropertyIterator (Node, PropIter))) { - while (!EFI_ERROR (DTIterateProperties (PropIter, &DeletePosition))) { + if (!EFI_ERROR(DTLookupEntry (NULL, NodeName, &Node))) { + if (!EFI_ERROR(DTCreatePropertyIterator (Node, PropIter))) { + while (!EFI_ERROR(DTIterateProperties (PropIter, &DeletePosition))) { if (AsciiStrStr (DeletePosition, DeletePropertyName) != NULL) { Property = (DTProperty *)DeletePosition; DeleteLength = sizeof (DTProperty) + ALIGN_VALUE (Property->Length, sizeof (UINT32)); @@ -662,9 +662,9 @@ DTInsertProperty ( DeviceTreeEnd = (CHAR8 *)mDTRootNode + *mDTLength; InsertPosition = NULL; - if (!EFI_ERROR (DTLookupEntry (NULL, NodeName, &Node))) { - if (!EFI_ERROR (DTCreatePropertyIterator (Node, PropIter))) { - while (!EFI_ERROR (DTIterateProperties (PropIter, &DeviceTree))) { + if (!EFI_ERROR(DTLookupEntry (NULL, NodeName, &Node))) { + if (!EFI_ERROR(DTCreatePropertyIterator (Node, PropIter))) { + while (!EFI_ERROR(DTIterateProperties (PropIter, &DeviceTree))) { InsertPosition = DeviceTree; if (AsciiStrStr (InsertPosition, InsertPropertyName) != NULL) { break; diff --git a/Library/GenericBdsLib/BdsBoot.c b/Library/GenericBdsLib/BdsBoot.c index af5e86f1b..bbcc955fb 100644 --- a/Library/GenericBdsLib/BdsBoot.c +++ b/Library/GenericBdsLib/BdsBoot.c @@ -368,7 +368,7 @@ BdsCreateLegacyBootOption ( (EFI_DEVICE_PATH_PROTOCOL *) NewBbsDevPathNode ); if (CurrentBbsDevPath == NULL) { - FreePool (NewBbsDevPathNode); + FreePool(NewBbsDevPathNode); return EFI_OUT_OF_RESOURCES; } @@ -383,8 +383,8 @@ BdsCreateLegacyBootOption ( Buffer = AllocateZeroPool (BufferSize); if (Buffer == NULL) { - FreePool (NewBbsDevPathNode); - FreePool (CurrentBbsDevPath); + FreePool(NewBbsDevPathNode); + FreePool(CurrentBbsDevPath); return EFI_OUT_OF_RESOURCES; } @@ -427,20 +427,20 @@ BdsCreateLegacyBootOption ( Buffer ); - FreePool (Buffer); + FreePool(Buffer); Buffer = NULL; NewBootOrderList = AllocateZeroPool (*BootOrderListSize + sizeof (UINT16)); if (NULL == NewBootOrderList) { - FreePool (NewBbsDevPathNode); - FreePool (CurrentBbsDevPath); + FreePool(NewBbsDevPathNode); + FreePool(CurrentBbsDevPath); return EFI_OUT_OF_RESOURCES; } if (*BootOrderList != NULL) { CopyMem (NewBootOrderList, *BootOrderList, *BootOrderListSize); - FreePool (*BootOrderList); + FreePool(*BootOrderList); } BootOrderLastIndex = (UINTN) (*BootOrderListSize / sizeof (UINT16)); @@ -448,8 +448,8 @@ BdsCreateLegacyBootOption ( *BootOrderListSize += sizeof (UINT16); *BootOrderList = NewBootOrderList; - FreePool (NewBbsDevPathNode); - FreePool (CurrentBbsDevPath); + FreePool(NewBbsDevPathNode); + FreePool(CurrentBbsDevPath); return Status; } @@ -536,7 +536,7 @@ BdsDeleteAllInvalidLegacyBootOptions ( BbsEntry = NULL; Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -585,7 +585,7 @@ BdsDeleteAllInvalidLegacyBootOptions ( ); continue; } else { - FreePool (BootOrder); + FreePool(BootOrder); return EFI_OUT_OF_RESOURCES; } } @@ -595,7 +595,7 @@ BdsDeleteAllInvalidLegacyBootOptions ( // if (!BdsIsLegacyBootOption (BootOptionVar, &BbsEntry, &BbsIndex)) { if (BootOptionVar!= NULL) { - FreePool (BootOptionVar); + FreePool(BootOptionVar); } Index++; continue; @@ -627,7 +627,7 @@ BdsDeleteAllInvalidLegacyBootOptions ( } if (BootOptionVar != NULL) { - FreePool (BootOptionVar); + FreePool(BootOptionVar); } // // should delete @@ -650,7 +650,7 @@ BdsDeleteAllInvalidLegacyBootOptions ( BootOrder ); if (BootOrder != NULL) { - FreePool (BootOrder); + FreePool(BootOrder); } return Status; @@ -714,7 +714,7 @@ BdsFindLegacyBootOptionByDevTypeAndName ( // Skip Non-legacy boot option // if (!BdsIsLegacyBootOption (BootOptionVar, &BbsEntry, BbsIndex)) { - FreePool (BootOptionVar); + FreePool(BootOptionVar); continue; } @@ -722,14 +722,14 @@ BdsFindLegacyBootOptionByDevTypeAndName ( (BbsEntry->DeviceType != DevType) || (StrCmp (DevName, (CHAR16*)(BootOptionVar + sizeof (UINT32) + sizeof (UINT16))) != 0) ) { - FreePool (BootOptionVar); + FreePool(BootOptionVar); continue; } *Attribute = *(UINT32 *) BootOptionVar; *OptionNumber = BootOrder[Index]; Found = TRUE; - FreePool (BootOptionVar); + FreePool(BootOptionVar); break; } @@ -789,7 +789,7 @@ BdsCreateOneLegacyBootOption ( ); BbsItem->BootPriority = 0x00; - FreePool (DevPath); + FreePool(DevPath); return Status; } @@ -830,7 +830,7 @@ BdsAddNonExistingLegacyBootOptions ( LocalBbsTable = NULL; Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -880,7 +880,7 @@ BdsAddNonExistingLegacyBootOptions ( &BootOrder, &BootOrderSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } BbsIndex = Index; @@ -898,7 +898,7 @@ BdsAddNonExistingLegacyBootOptions ( BootOrder ); if (BootOrder != NULL) { - FreePool (BootOrder); + FreePool(BootOrder); } return Status; @@ -1063,7 +1063,7 @@ BdsCreateDevOrder ( TotalSize, DevOrder ); - FreePool (DevOrder); + FreePool(DevOrder); return Status; } @@ -1133,7 +1133,7 @@ BdsUpdateLegacyDevOrder ( NewDevPtr = NULL; Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1144,7 +1144,7 @@ BdsUpdateLegacyDevOrder ( &BbsCount, &LocalBbsTable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1375,7 +1375,7 @@ BdsUpdateLegacyDevOrder ( } } - FreePool (DevOrder); + FreePool(DevOrder); Status = gRT->SetVariable ( VAR_LEGACY_DEV_ORDER, @@ -1384,7 +1384,7 @@ BdsUpdateLegacyDevOrder ( TotalSize, NewDevOrder ); - FreePool (NewDevOrder); + FreePool(NewDevOrder); return Status; } @@ -1434,7 +1434,7 @@ BdsSetBootPriority4SameTypeDev ( } if ((UINT8 *) DevOrderPtr >= (UINT8 *) DevOrder + DevOrderSize) { - FreePool (DevOrder); + FreePool(DevOrder); return EFI_NOT_FOUND; } @@ -1456,7 +1456,7 @@ BdsSetBootPriority4SameTypeDev ( } } - FreePool (DevOrder); + FreePool(DevOrder); return EFI_SUCCESS; } @@ -1551,7 +1551,7 @@ BdsRefreshBbsTableForBoot ( DevType = BBS_UNKNOWN; Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1589,7 +1589,7 @@ BdsRefreshBbsTableForBoot ( LocalBbsTable, &Priority ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1628,7 +1628,7 @@ BdsRefreshBbsTableForBoot ( Ptr += StrSize ((UINT16 *) Ptr); DevPath = (EFI_DEVICE_PATH_PROTOCOL *) Ptr; if (BBS_DEVICE_PATH != DevPath->Type || BBS_BBS_DP != DevPath->SubType) { - FreePool (BootOptionVar); + FreePool(BootOptionVar); continue; } @@ -1643,7 +1643,7 @@ BdsRefreshBbsTableForBoot ( // // We don't want to process twice for a device type // - FreePool (BootOptionVar); + FreePool(BootOptionVar); continue; } @@ -1656,16 +1656,16 @@ BdsRefreshBbsTableForBoot ( LocalBbsTable, &Priority ); - FreePool (BootOptionVar); - if (EFI_ERROR (Status)) { + FreePool(BootOptionVar); + if (EFI_ERROR(Status)) { break; } } - FreePool (DeviceType); + FreePool(DeviceType); if (BootOrder != NULL) { - FreePool (BootOrder); + FreePool(BootOrder); } DEBUG_CODE_BEGIN(); @@ -1695,7 +1695,7 @@ BdsLibDoLegacyBoot ( // EFI_EVENT LegacyBootEvent; Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If no LegacyBios protocol we do not support legacy boot // @@ -1719,7 +1719,7 @@ BdsLibDoLegacyBoot ( NULL, &LegacyBootEvent ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); */ //); @@ -1771,7 +1771,7 @@ IsBootOptionValidNVVarialbe ( Valid = TRUE; } - FreePool (BootOption); + FreePool(BootOption); return Valid; } @@ -1809,7 +1809,7 @@ BdsMatchUsbClass ( // Check Vendor Id and Product Id. // Status = UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -1832,7 +1832,7 @@ BdsMatchUsbClass ( // Protocol in Interface Descriptor instead. // Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -1899,7 +1899,7 @@ BdsMatchUsbWwid ( // Check Vendor Id and Product Id. // Status = UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } if ((DevDesc.IdVendor != UsbWwid->VendorId) || @@ -1911,7 +1911,7 @@ BdsMatchUsbWwid ( // Check Interface Number. // Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } if (IfDesc.InterfaceNumber != UsbWwid->InterfaceNumber) { @@ -1931,7 +1931,7 @@ BdsMatchUsbWwid ( TableSize = 0; LangIdTable = NULL; Status = UsbIo->UsbGetSupportedLanguages (UsbIo, &LangIdTable, &TableSize); - if (EFI_ERROR (Status) || (TableSize == 0) || (LangIdTable == NULL)) { + if (EFI_ERROR(Status) || (TableSize == 0) || (LangIdTable == NULL)) { return FALSE; } @@ -1955,18 +1955,18 @@ BdsMatchUsbWwid ( DevDesc.StrSerialNumber, &SerialNumberStr ); - if (EFI_ERROR (Status) || (SerialNumberStr == NULL)) { + if (EFI_ERROR(Status) || (SerialNumberStr == NULL)) { continue; } Length = StrLen (SerialNumberStr); if ((Length >= CompareLen) && (CompareMem (SerialNumberStr + Length - CompareLen, CompareStr, CompareLen * sizeof (CHAR16)) == 0)) { - FreePool (SerialNumberStr); + FreePool(SerialNumberStr); return TRUE; } - FreePool (SerialNumberStr); + FreePool(SerialNumberStr); } return FALSE; @@ -2020,7 +2020,7 @@ BdsFindUsbDevice ( &UsbIoHandleCount, &UsbIoHandleBuffer ); - if (EFI_ERROR (Status) || (UsbIoHandleCount == 0) || (UsbIoHandleBuffer == NULL)) { + if (EFI_ERROR(Status) || (UsbIoHandleCount == 0) || (UsbIoHandleBuffer == NULL)) { return NULL; } @@ -2034,7 +2034,7 @@ BdsFindUsbDevice ( &gEfiUsbIoProtocolGuid, (VOID **) &UsbIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2076,7 +2076,7 @@ BdsFindUsbDevice ( 0, &ImageHandle ); - FreePool (FullDevicePath); + FreePool(FullDevicePath); } else { FullDevicePath = UsbIoDevicePath; Status = EFI_NOT_FOUND; @@ -2086,7 +2086,7 @@ BdsFindUsbDevice ( // If we didn't find an image directly, we need to try as if it is a removable device boot option // and load the image according to the default boot behavior for removable device. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // check if there is a bootable removable media could be found in this device path , // and get the bootable media handle @@ -2110,7 +2110,7 @@ BdsFindUsbDevice ( 0, &ImageHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The DevicePath failed, and it's not a valid // removable media device. @@ -2125,7 +2125,7 @@ BdsFindUsbDevice ( } } - FreePool (UsbIoHandleBuffer); + FreePool(UsbIoHandleBuffer); return ImageHandle; } @@ -2220,7 +2220,7 @@ BdsExpandUsbShortFormDevicePath ( // doesn't perform ConnectController here. // ImageHandle = BdsFindUsbDevice (TempDevicePath, ShortFormDevicePath); - FreePool (TempDevicePath); + FreePool(TempDevicePath); } return ImageHandle; @@ -2270,7 +2270,7 @@ BdsLibBootViaBootOption ( // EVT_SIGNAL_LEGACY_BOOT // Status = gBS->LocateProtocol (&gEfiAcpiS3SaveProtocolGuid, NULL, (VOID **) &AcpiS3Save); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AcpiS3Save->S3Save (AcpiS3Save, NULL); } // @@ -2371,7 +2371,7 @@ BdsLibBootViaBootOption ( // // free the temporary device path created by BdsLibUpdateFvFileDevicePath() // - FreePool (DevicePath); + FreePool(DevicePath); DevicePath = Option->DevicePath; } @@ -2402,7 +2402,7 @@ BdsLibBootViaBootOption ( // If we didn't find an image directly, we need to try as if it is a removable device boot option // and load the image according to the default boot behavior for removable device. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // check if there is a bootable removable media could be found in this device path , // and get the bootable media handle @@ -2443,8 +2443,8 @@ BdsLibBootViaBootOption ( } Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &ImageInfo); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -2478,7 +2478,7 @@ BdsLibBootViaBootOption ( Status = gBS->StartImage (ImageHandle, ExitDataSize, ExitData); // DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Image Return Status = %r\n", Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Report Status Code to indicate that boot failure // @@ -2499,7 +2499,7 @@ Done: // BootLogo = NULL; StatusLogo = gBS->LocateProtocol (&gEfiBootLogoProtocolGuid, NULL, (VOID **) &BootLogo); - if (!EFI_ERROR (StatusLogo) && (BootLogo != NULL)) { + if (!EFI_ERROR(StatusLogo) && (BootLogo != NULL)) { BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0); } @@ -2572,7 +2572,7 @@ BdsExpandPartitionPartialDevicePathToFull ( // Delete the invalid HD_BOOT_DEVICE_PATH_VARIABLE_NAME variable. // if ((CachedDevicePath != NULL) && !IsDevicePathValid (CachedDevicePath, CachedDevicePathSize)) { - FreePool (CachedDevicePath); + FreePool(CachedDevicePath); CachedDevicePath = NULL; Status = gRT->SetVariable ( HD_BOOT_DEVICE_PATH_VARIABLE_NAME, @@ -2581,8 +2581,8 @@ BdsExpandPartitionPartialDevicePathToFull ( 0, NULL ); - // ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + // ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return NULL; } } @@ -2604,7 +2604,7 @@ BdsExpandPartitionPartialDevicePathToFull ( // e.g. ACPI() /PCI()/ATA()/Partition() // Status = BdsLibConnectDevicePath (Instance); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DeviceExist = TRUE; break; } @@ -2634,14 +2634,14 @@ BdsExpandPartitionPartialDevicePathToFull ( // TempNewDevicePath = CachedDevicePath; CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, Instance ); - FreePool (TempNewDevicePath); + FreePool(TempNewDevicePath); // // Second, append the remaining path after the matched instance // TempNewDevicePath = CachedDevicePath; CachedDevicePath = AppendDevicePathInstance (Instance, CachedDevicePath ); - FreePool (TempNewDevicePath); + FreePool(TempNewDevicePath); // // Save the matching Device Path so we don't need to do a connect all next time // Failure to set the variable only impacts the performance when next time expanding the short-form device path. @@ -2656,9 +2656,9 @@ BdsExpandPartitionPartialDevicePathToFull ( } if (Instance) { - FreePool (Instance); + FreePool(Instance); } - FreePool (CachedDevicePath); + FreePool(CachedDevicePath); return FullDevicePath; } } @@ -2669,7 +2669,7 @@ BdsExpandPartitionPartialDevicePathToFull ( // BdsLibConnectAllDriversToAllControllers (); Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &BlockIoHandleCount, &BlockIoBuffer); - if (EFI_ERROR (Status) || BlockIoHandleCount == 0 || BlockIoBuffer == NULL) { + if (EFI_ERROR(Status) || BlockIoHandleCount == 0 || BlockIoBuffer == NULL) { // // If there was an error or there are no device handles that support // the BLOCK_IO Protocol, then return. @@ -2682,7 +2682,7 @@ BdsExpandPartitionPartialDevicePathToFull ( for (Index = 0; Index < BlockIoHandleCount; Index++) { Status = gBS->HandleProtocol (BlockIoBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID *) &BlockIoDevicePath); - if (EFI_ERROR (Status) || BlockIoDevicePath == NULL) { + if (EFI_ERROR(Status) || BlockIoDevicePath == NULL) { continue; } @@ -2763,10 +2763,10 @@ BdsExpandPartitionPartialDevicePathToFull ( } if (CachedDevicePath != NULL) { - FreePool (CachedDevicePath); + FreePool(CachedDevicePath); } if (BlockIoBuffer != NULL) { - FreePool (BlockIoBuffer); + FreePool(BlockIoBuffer); } return FullDevicePath; } @@ -2919,13 +2919,13 @@ BdsLibDeleteOptionFromHandle ( ); if (BootOptionVar == NULL) { - FreePool (BootOrder); + FreePool(BootOrder); return EFI_OUT_OF_RESOURCES; } if (!ValidateOption(BootOptionVar, BootOptionSize)) { BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize); - FreePool (BootOptionVar); + FreePool(BootOptionVar); Index++; continue; } @@ -2942,11 +2942,11 @@ BdsLibDeleteOptionFromHandle ( if ((OptionDevicePathSize == DevicePathSize) && (CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) { BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize); - FreePool (BootOptionVar); + FreePool(BootOptionVar); break; } - FreePool (BootOptionVar); + FreePool(BootOptionVar); Index++; } @@ -2961,7 +2961,7 @@ BdsLibDeleteOptionFromHandle ( BootOrder ); - FreePool (BootOrder); + FreePool(BootOrder); return Status; } @@ -3022,7 +3022,7 @@ BdsDeleteAllInvalidEfiBootOption ( &BootOptionSize ); if (NULL == BootOptionVar) { - FreePool (BootOrder); + FreePool(BootOrder); return EFI_OUT_OF_RESOURCES; } @@ -3040,7 +3040,7 @@ BdsDeleteAllInvalidEfiBootOption ( // if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) && (DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) { - FreePool (BootOptionVar); + FreePool(BootOptionVar); Index++; continue; } @@ -3060,9 +3060,9 @@ BdsDeleteAllInvalidEfiBootOption ( // // Deleting variable with current variable implementation shouldn't fail. // - // ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { - FreePool (BootOptionVar); + // ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { + FreePool(BootOptionVar); break; } // @@ -3072,7 +3072,7 @@ BdsDeleteAllInvalidEfiBootOption ( Corrupted = FALSE; } - FreePool (BootOptionVar); + FreePool(BootOptionVar); Index++; } @@ -3094,7 +3094,7 @@ BdsDeleteAllInvalidEfiBootOption ( BootOrder ); - FreePool (BootOrder); + FreePool(BootOrder); return Status; } @@ -3208,10 +3208,10 @@ BdsLibEnumerateAllBootOption ( if (!PlatLang) { return EFI_NOT_FOUND; } - if ((LastLang != NULL) && (AsciiStrCmp (LastLang, PlatLang) == 0)) { + if ((LastLang != NULL) && (AsciiStrCmp(LastLang, PlatLang) == 0)) { Status = BdsLibBuildOptionFromVar (BdsBootOptionList, L"BootOrder"); - FreePool (LastLang); - FreePool (PlatLang); + FreePool(LastLang); + FreePool(PlatLang); return Status; } else { Status = gRT->SetVariable ( @@ -3226,9 +3226,9 @@ BdsLibEnumerateAllBootOption ( // if (LastLang != NULL) { - FreePool (LastLang); + FreePool(LastLang); } - FreePool (PlatLang); + FreePool(PlatLang); } } @@ -3270,7 +3270,7 @@ BdsLibEnumerateAllBootOption ( // // skip the logical partition // - if (EFI_ERROR (Status) || BlkIo->Media->LogicalPartition) { + if (EFI_ERROR(Status) || BlkIo->Media->LogicalPartition) { continue; } // @@ -3363,7 +3363,7 @@ BdsLibEnumerateAllBootOption ( } if (NumberBlockIoHandles != 0) { - FreePool (BlockIoHandles); + FreePool(BlockIoHandles); } // @@ -3383,7 +3383,7 @@ BdsLibEnumerateAllBootOption ( &gEfiBlockIoProtocolGuid, (VOID **) &BlkIo ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Skip if the file system handle supports a BlkIo protocol, // @@ -3402,7 +3402,7 @@ BdsLibEnumerateAllBootOption ( &DosHeader, Hdr ); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Hdr.Pe32->FileHeader.Machine) && Hdr.Pe32->OptionalHeader.Subsystem == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) { NeedDelete = FALSE; @@ -3425,7 +3425,7 @@ BdsLibEnumerateAllBootOption ( } if (NumberFileSystemHandles != 0) { - FreePool (FileSystemHandles); + FreePool(FileSystemHandles); } // @@ -3453,7 +3453,7 @@ BdsLibEnumerateAllBootOption ( } if (NumOfLoadFileHandles != 0) { - FreePool (LoadFileHandles); + FreePool(LoadFileHandles); } // @@ -3482,7 +3482,7 @@ BdsLibEnumerateAllBootOption ( &Attributes, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Skip if no shell file in the FV // @@ -3495,7 +3495,7 @@ BdsLibEnumerateAllBootOption ( } if (FvHandleCount != 0) { - FreePool (FvHandleBuffer); + FreePool(FvHandleBuffer); } // // Make sure every boot only have one time @@ -3615,7 +3615,7 @@ BdsLibBootNext ( // // Deleting variable with current variable implementation shouldn't fail. // - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); // // Start to build the boot option and try to boot @@ -3682,12 +3682,12 @@ BdsLibGetBootableHandle ( // Check whether the device is connected // Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &UpdatedDevicePath, &Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Skip the case that the boot option point to a simple file protocol which does not consume block Io protocol, // Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &UpdatedDevicePath, &Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Fail to find the proper BlockIo and simple file protocol, maybe because device not present, we need to connect it firstly // @@ -3705,8 +3705,8 @@ BdsLibGetBootableHandle ( // Get BlockIo protocol and check removable attribute // Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo); - // ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + // ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { gBS->RestoreTPL (OldTpl); return NULL; } @@ -3796,7 +3796,7 @@ BdsLibGetBootableHandle ( &DosHeader, Hdr ); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Hdr.Pe32->FileHeader.Machine) && Hdr.Pe32->OptionalHeader.Subsystem == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) { ReturnHandle = SimpleFileSystemHandles[Index]; @@ -3845,12 +3845,12 @@ BdsLibNetworkBootWithMediaPresent ( // Locate Load File Protocol for PXE boot option first // Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &UpdatedDevicePath, &Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Device not present so see if we need to connect it // Status = BdsLibConnectDevicePath (DevicePath); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // This one should work after we did the connect // @@ -3858,16 +3858,16 @@ BdsLibNetworkBootWithMediaPresent ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (Handle, &gEfiSimpleNetworkProtocolGuid, (VOID **)&Snp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Failed to open SNP from this handle, try to get SNP from parent handle // UpdatedDevicePath = DevicePathFromHandle (Handle); if (UpdatedDevicePath != NULL) { Status = gBS->LocateDevicePath (&gEfiSimpleNetworkProtocolGuid, &UpdatedDevicePath, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // SNP handle found, get SNP from it // @@ -3876,7 +3876,7 @@ BdsLibNetworkBootWithMediaPresent ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Snp->Mode->MediaPresentSupported) { if (Snp->Mode->State == EfiSimpleNetworkInitialized) { // @@ -3894,9 +3894,9 @@ BdsLibNetworkBootWithMediaPresent ( // MediaPresent will be valid. // Status = Snp->Start (Snp); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Snp->Initialize (Snp, 0, 0); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { MediaPresent = Snp->Mode->MediaPresent; Snp->Shutdown (Snp); } @@ -4118,7 +4118,7 @@ BdsLibIsValidEFIBootOptDevicePathExt ( &TempDevicePath, &Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Device not present so see if we need to connect it // @@ -4131,7 +4131,7 @@ BdsLibIsValidEFIBootOptDevicePathExt ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (!IsDevicePathEnd (TempDevicePath)) { // // LoadFile protocol is not installed on handle with exactly the same DevPath @@ -4191,7 +4191,7 @@ BdsLibIsValidEFIBootOptDevicePathExt ( return TRUE; } else { if (Status == EFI_SUCCESS) { - FreePool (TempDevicePath); + FreePool(TempDevicePath); } return FALSE; } @@ -4204,12 +4204,12 @@ BdsLibIsValidEFIBootOptDevicePathExt ( // TempDevicePath = DevPath; Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &TempDevicePath, &Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Device not present so see if we need to connect it // Status = BdsLibConnectDevicePath (DevPath); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Try again to get the Block Io protocol after we did the connect // @@ -4218,9 +4218,9 @@ BdsLibIsValidEFIBootOptDevicePathExt ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (CheckMedia) { // // Test if it is ready to boot now @@ -4237,7 +4237,7 @@ BdsLibIsValidEFIBootOptDevicePathExt ( // if the boot option point to a simple file protocol which does not consume block Io protocol, it is also a valid EFI boot option, // Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &TempDevicePath, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (CheckMedia) { // // Test if it is ready to boot now @@ -4342,13 +4342,13 @@ BdsLibUpdateFvFileDevicePath ( &TempDevicePath, &FoundFvHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol ( FoundFvHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **) &Fv ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Set FV ReadFile Buffer as NULL, only need to check whether input Fv file exist there // @@ -4361,7 +4361,7 @@ BdsLibUpdateFvFileDevicePath ( &Attributes, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_ALREADY_STARTED; } } @@ -4378,13 +4378,13 @@ BdsLibUpdateFvFileDevicePath ( &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol ( LoadedImage->DeviceHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **) &Fv ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Fv->ReadFile ( Fv, FileGuid, @@ -4394,7 +4394,7 @@ BdsLibUpdateFvFileDevicePath ( &Attributes, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FindFvFile = TRUE; FoundFvHandle = LoadedImage->DeviceHandle; } @@ -4428,7 +4428,7 @@ BdsLibUpdateFvFileDevicePath ( &Attributes, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Skip if input Fv file not in the FV // @@ -4440,7 +4440,7 @@ BdsLibUpdateFvFileDevicePath ( } if (FvHandleBuffer != NULL) { - FreePool (FvHandleBuffer); + FreePool(FvHandleBuffer); } } diff --git a/Library/GenericBdsLib/BdsConnect.c b/Library/GenericBdsLib/BdsConnect.c index 81fc9353e..87dee4a34 100644 --- a/Library/GenericBdsLib/BdsConnect.c +++ b/Library/GenericBdsLib/BdsConnect.c @@ -119,7 +119,7 @@ BdsLibConnectDevicePath ( // Instance = GetNextDevicePathInstance (&DevicePath, &Size); if (Instance == NULL) { - FreePool (CopyOfDevicePath); + FreePool(CopyOfDevicePath); return EFI_OUT_OF_RESOURCES; } @@ -143,7 +143,7 @@ BdsLibConnectDevicePath ( RemainingDevicePath = Instance; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Handle == PreviousHandle) { // // If no forward progress is made try invoking the Dispatcher. @@ -166,7 +166,7 @@ BdsLibConnectDevicePath ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PreviousHandle = Handle; // // Connect all drivers that apply to Handle and RemainingDevicePath, @@ -189,12 +189,12 @@ BdsLibConnectDevicePath ( // // Loop until RemainingDevicePath is an empty device path // - } while (!EFI_ERROR (Status) && !IsDevicePathEnd (RemainingDevicePath)); + } while (!EFI_ERROR(Status) && !IsDevicePathEnd (RemainingDevicePath)); } while (DevicePath != NULL); if (CopyOfDevicePath != NULL) { - FreePool (CopyOfDevicePath); + FreePool(CopyOfDevicePath); } // // All handle with DevicePath exists in the handle database @@ -231,7 +231,7 @@ BdsLibConnectAllEfi ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -241,7 +241,7 @@ BdsLibConnectAllEfi ( } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } return EFI_SUCCESS; @@ -279,7 +279,7 @@ BdsLibDisconnectAllEfi ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -289,7 +289,7 @@ BdsLibDisconnectAllEfi ( } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } return EFI_SUCCESS; @@ -318,7 +318,7 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, // Retrieve the list of all handles from the handle database // Status = gBS->LocateHandleBuffer (AllHandles, NULL, NULL, HandleCount, HandleBuffer); - if (EFI_ERROR (Status)) goto Error; + if (EFI_ERROR(Status)) goto Error; *HandleType = AllocatePool (*HandleCount * sizeof (UINT32)); if (*HandleType == NULL) goto Error; @@ -333,7 +333,7 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, &ProtocolGuidArray, &ArrayCount ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) { if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiLoadedImageProtocolGuid)) { @@ -373,7 +373,7 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, &OpenInfo, &OpenInfoCount ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { @@ -397,11 +397,11 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, } } - FreePool (OpenInfo); + FreePool(OpenInfo); } } - FreePool (ProtocolGuidArray); + FreePool(ProtocolGuidArray); } } @@ -409,11 +409,11 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, Error: if (*HandleType != NULL) { - FreePool (*HandleType); + FreePool(*HandleType); } if (*HandleBuffer != NULL) { - FreePool (*HandleBuffer); + FreePool(*HandleBuffer); } *HandleCount = 0; @@ -442,14 +442,14 @@ EFI_STATUS BdsLibConnectMostlyAllEfi() Status = gBS->LocateHandleBuffer (AllHandles, NULL, NULL, &AllHandleCount, &AllHandleBuffer); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; for (Index = 0; Index < AllHandleCount; Index++) { // for (Index = AllHandleCount - 1; Index >= 0; --Index) { Status = ScanDeviceHandles(AllHandleBuffer[Index], &HandleCount, &HandleBuffer, &HandleType); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) goto Done; Device = TRUE; @@ -471,9 +471,9 @@ EFI_STATUS BdsLibConnectMostlyAllEfi() if (!Parent) { if (HandleType[Index] & EFI_HANDLE_TYPE_DEVICE_HANDLE) { Status = gBS->HandleProtocol (AllHandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID*)&PciIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PciIo->Pci.Read (PciIo,EfiPciIoWidthUint32, 0, sizeof (Pci) / sizeof (UINT32), &Pci); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if(IS_PCI_VGA(&Pci)==TRUE) { gBS->DisconnectController(AllHandleBuffer[Index], NULL, NULL); } @@ -484,12 +484,12 @@ EFI_STATUS BdsLibConnectMostlyAllEfi() } } - FreePool (HandleBuffer); - FreePool (HandleType); + FreePool(HandleBuffer); + FreePool(HandleType); } Done: - FreePool (AllHandleBuffer); + FreePool(AllHandleBuffer); return Status; } @@ -524,7 +524,7 @@ BdsLibConnectAllDriversToAllControllers ( // Status = gDS->Dispatch (); - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); } @@ -594,19 +594,19 @@ BdsLibConnectUsbDevByShortFormDP( &HandleArrayCount, &HandleArray ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleArrayCount; Index++) { Status = gBS->HandleProtocol ( HandleArray[Index], &gEfiPciIoProtocolGuid, (VOID **)&PciIo ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Check whether the Pci device is the wanted usb host controller // Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((PCI_CLASS_SERIAL == Class[2]) && (PCI_CLASS_SERIAL_USB == Class[1])) { if (HostControllerPI == Class[0] || HostControllerPI == 0xFF) { @@ -626,7 +626,7 @@ BdsLibConnectUsbDevByShortFormDP( } if (HandleArray != NULL) { - FreePool (HandleArray); + FreePool(HandleArray); } if (AtLeastOneConnected) { diff --git a/Library/GenericBdsLib/BdsConsole.c b/Library/GenericBdsLib/BdsConsole.c index ae627b182..578e17ead 100644 --- a/Library/GenericBdsLib/BdsConsole.c +++ b/Library/GenericBdsLib/BdsConsole.c @@ -139,7 +139,7 @@ UpdateSystemTableConsole ( // Instance = GetNextDevicePathInstance (&VarConsole, &DevicePathSize); if (Instance == NULL) { - FreePool (FullDevicePath); + FreePool(FullDevicePath); // ASSERT (FALSE); return FALSE; } @@ -152,7 +152,7 @@ UpdateSystemTableConsole ( &Instance, &NewHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get the console protocol on this console device handle // @@ -161,7 +161,7 @@ UpdateSystemTableConsole ( ConsoleGuid, &Interface ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update new console handle in System Table. // @@ -302,8 +302,8 @@ BdsLibUpdateConsoleVariable ( if ((DevicePathSize == 0) && (Status == EFI_NOT_FOUND)) { Status = EFI_SUCCESS; } -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -380,7 +380,7 @@ BdsLibConnectConsoleVariable ( // Instance = GetNextDevicePathInstance (&CopyOfDevicePath, &Size); if (Instance == NULL) { - FreePool (StartDevicePath); + FreePool(StartDevicePath); return EFI_UNSUPPORTED; } @@ -401,7 +401,7 @@ BdsLibConnectConsoleVariable ( || (DevicePathSubType (Instance) == MSG_USB_WWID_DP) )) { Status = BdsLibConnectUsbDevByShortFormDP (0xFF, Instance); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DeviceExist = TRUE; } } else { @@ -410,7 +410,7 @@ BdsLibConnectConsoleVariable ( // Status = BdsLibConnectDevicePath (Instance); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Delete the instance from the console variable // @@ -422,7 +422,7 @@ BdsLibConnectConsoleVariable ( FreePool(Instance); } while (CopyOfDevicePath != NULL); - FreePool (StartDevicePath); + FreePool(StartDevicePath); if (!DeviceExist) { return EFI_NOT_FOUND; @@ -532,7 +532,7 @@ BdsLibConnectAllDefaultConsoles ( // so we check the status here. // Status = BdsLibConnectConsoleVariable (L"ConOut"); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -611,7 +611,7 @@ BdsLibConnectAllDefaultConsolesWithOutConIn ( // so we check the status here. // Status = BdsLibConnectConsoleVariable (L"ConOut"); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -877,7 +877,7 @@ ConvertBmpToGopBlt ( // Other bit format BMP is not supported. // if (IsAllocated) { - FreePool (*GopBlt); + FreePool(*GopBlt); *GopBlt = NULL; } return EFI_UNSUPPORTED; @@ -953,14 +953,14 @@ EnableQuietBoot ( // Try to open GOP first // Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput); - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { + if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { GraphicsOutput = NULL; // // Open GOP failed, try to open UGA // Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **) &UgaDraw); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -984,7 +984,7 @@ EnableQuietBoot ( } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) { Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } } else { @@ -1020,7 +1020,7 @@ EnableQuietBoot ( &CoordinateX, &CoordinateY ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1029,7 +1029,7 @@ EnableQuietBoot ( // if (Format != EfiBadgingFormatBMP) { if (ImageData != NULL) { - FreePool (ImageData); + FreePool(ImageData); } continue; } @@ -1038,7 +1038,7 @@ EnableQuietBoot ( // Get the specified image from FV. // Status = GetSectionFromAnyFv (LogoFile, EFI_SECTION_RAW, 0, (VOID **) &ImageData, &ImageSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1052,7 +1052,7 @@ EnableQuietBoot ( } if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); } Blt = NULL; Status = ConvertBmpToGopBlt ( @@ -1063,8 +1063,8 @@ EnableQuietBoot ( &Height, &Width ); - if (EFI_ERROR (Status)) { - FreePool (ImageData); + if (EFI_ERROR(Status)) { + FreePool(ImageData); if (Badging == NULL) { return Status; @@ -1167,7 +1167,7 @@ EnableQuietBoot ( // // Report displayed Logo information. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { NumberOfLogos++; if (LogoWidth == 0) { @@ -1195,7 +1195,7 @@ EnableQuietBoot ( } } - FreePool (ImageData); + FreePool(ImageData); if (Badging == NULL) { break; @@ -1208,7 +1208,7 @@ Done: // No logo displayed. // if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); } return Status; @@ -1228,7 +1228,7 @@ Done: // More than one Logo displayed, get merged BltBuffer using VideoToBuffer operation. // if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); } // @@ -1282,10 +1282,10 @@ Done: } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight); } - FreePool (LogoBlt); + FreePool(LogoBlt); return Status; } diff --git a/Library/GenericBdsLib/BdsMisc.c b/Library/GenericBdsLib/BdsMisc.c index ec41eb42e..a40423105 100644 --- a/Library/GenericBdsLib/BdsMisc.c +++ b/Library/GenericBdsLib/BdsMisc.c @@ -86,7 +86,7 @@ BdsLibLoadDrivers ( &ImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &ImageInfo); // @@ -287,20 +287,20 @@ BdsLibRegisterNewOption ( // // Got the option, so just return // - FreePool (OptionPtr); - FreePool (TempOptionPtr); + FreePool(OptionPtr); + FreePool(TempOptionPtr); return EFI_SUCCESS; } else { // // Option description changed, need update. // UpdateDescription = TRUE; - FreePool (OptionPtr); + FreePool(OptionPtr); break; } } - FreePool (OptionPtr); + FreePool(OptionPtr); } OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String); @@ -353,15 +353,15 @@ BdsLibRegisterNewOption ( // // Return if only need to update a changed description or fail to set option. // - if (EFI_ERROR (Status) || UpdateDescription) { - FreePool (OptionPtr); + if (EFI_ERROR(Status) || UpdateDescription) { + FreePool(OptionPtr); if (TempOptionPtr != NULL) { - FreePool (TempOptionPtr); + FreePool(TempOptionPtr); } return Status; } - FreePool (OptionPtr); + FreePool(OptionPtr); // // Update the option order variable @@ -380,7 +380,7 @@ BdsLibRegisterNewOption ( &BootOrderEntry ); if (TempOptionPtr != NULL) { - FreePool (TempOptionPtr); + FreePool(TempOptionPtr); } return Status; } @@ -412,8 +412,8 @@ BdsLibRegisterNewOption ( OrderItemNum * sizeof (UINT16), OptionOrderPtr ); - FreePool (TempOptionPtr); - FreePool (OptionOrderPtr); + FreePool(TempOptionPtr); + FreePool(OptionOrderPtr); return Status; } @@ -646,7 +646,7 @@ BdsLibVariableToOption ( // Validate Boot#### variable data. // if (!ValidateOption(Variable, VariableSize)) { - FreePool (Variable); + FreePool(Variable); return NULL; } @@ -695,7 +695,7 @@ BdsLibVariableToOption ( // Option = AllocateZeroPool (sizeof (BDS_COMMON_OPTION)); if (Option == NULL) { - FreePool (Variable); + FreePool(Variable); return NULL; } @@ -703,7 +703,7 @@ BdsLibVariableToOption ( Option->DevicePath = AllocateCopyPool (GetDevicePathSize (DevicePath), DevicePath); // ASSERT(Option->DevicePath != NULL); if (!Option->DevicePath) { - FreePool (Option); + FreePool(Option); return NULL; } // CopyMem (Option->DevicePath, DevicePath, GetDevicePathSize (DevicePath)); @@ -712,7 +712,7 @@ BdsLibVariableToOption ( Option->Description = AllocateCopyPool (StrSize (Description), Description); // ASSERT(Option->Description != NULL); if (!Option->Description) { - FreePool (Option); + FreePool(Option); return NULL; } // CopyMem (Option->Description, Description, StrSize (Description)); @@ -720,7 +720,7 @@ BdsLibVariableToOption ( Option->LoadOptions = AllocateCopyPool (LoadOptionsSize, LoadOptions); // ASSERT(Option->LoadOptions != NULL); if (!Option->LoadOptions) { - FreePool (Option); + FreePool(Option); return NULL; } // CopyMem (Option->LoadOptions, LoadOptions, LoadOptionsSize); @@ -739,7 +739,7 @@ BdsLibVariableToOption ( + (UINT16) (CharToUint (VariableName[NumOff+3]) * 0x1); } InsertTailList (BdsCommonOptionList, &Option->Link); - FreePool (Variable); + FreePool(Variable); return Option; } @@ -800,7 +800,7 @@ BdsLibBuildOptionFromVar ( } } - FreePool (OptionOrder); + FreePool(OptionOrder); return EFI_SUCCESS; } @@ -869,8 +869,8 @@ BdsLibGetVariableAndSize ( // Read variable into the allocated buffer. // Status = gRT->GetVariable (Name, VendorGuid, NULL, &BufferSize, Buffer); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); BufferSize = 0; Buffer = NULL; } @@ -983,11 +983,11 @@ BdsLibMatchDevicePaths ( // return success // if (CompareMem (Single, DevicePathInst, Size) == 0) { - FreePool (DevicePathInst); + FreePool(DevicePathInst); return TRUE; } - FreePool (DevicePathInst); + FreePool(DevicePathInst); DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size); } @@ -1019,7 +1019,7 @@ BdsLibOutputStrings ( Status = EFI_SUCCESS; VA_START (Args, ConOut); - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { // // If String is NULL, then it's the end of the list // @@ -1030,7 +1030,7 @@ BdsLibOutputStrings ( Status = ConOut->OutputString (ConOut, String); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -1165,7 +1165,7 @@ SetupResetReminder ( StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); // ASSERT (StringBuffer2 != NULL); if (!StringBuffer2) { - FreePool (StringBuffer1); + FreePool(StringBuffer1); return; } StrCpyS (StringBuffer1, MAX_STRING_LEN, L"Configuration changed. Reset to apply it Now."); @@ -1177,8 +1177,8 @@ SetupResetReminder ( CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, StringBuffer1, StringBuffer2, NULL); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); - FreePool (StringBuffer1); - FreePool (StringBuffer2); + FreePool(StringBuffer1); + FreePool(StringBuffer2); gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); } @@ -1225,7 +1225,7 @@ BdsLibGetImageHeader ( &gEfiSimpleFileSystemProtocolGuid, (VOID *) &Volume ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1233,13 +1233,13 @@ BdsLibGetImageHeader ( Volume, &Root ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Root = NULL; goto Done; } // ASSERT (Root != NULL); Status = Root->Open (Root, &ThisFile, FileName, EFI_FILE_MODE_READ, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // ASSERT (ThisFile != NULL); @@ -1251,7 +1251,7 @@ BdsLibGetImageHeader ( do { Info = NULL; Status = gBS->AllocatePool (EfiBootServicesData, BufferSize, (VOID **) &Info); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = ThisFile->GetInfo ( @@ -1260,25 +1260,25 @@ BdsLibGetImageHeader ( &BufferSize, Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } if (Status != EFI_BUFFER_TOO_SMALL) { - gBS->FreePool (Info); + gBS->FreePool(Info); goto Done; } - gBS->FreePool (Info); + gBS->FreePool(Info); } while (TRUE); FileSize = Info->FileSize; - gBS->FreePool (Info); + gBS->FreePool(Info); // // Read dos header // BufferSize = sizeof (EFI_IMAGE_DOS_HEADER); Status = ThisFile->Read (ThisFile, &BufferSize, DosHeader); - if (EFI_ERROR (Status) || + if (EFI_ERROR(Status) || BufferSize < sizeof (EFI_IMAGE_DOS_HEADER) || FileSize <= DosHeader->e_lfanew || DosHeader->e_magic != EFI_IMAGE_DOS_SIGNATURE) { @@ -1290,7 +1290,7 @@ BdsLibGetImageHeader ( // Move to PE signature // Status = ThisFile->SetPosition (ThisFile, DosHeader->e_lfanew); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_LOAD_ERROR; goto Done; } @@ -1300,7 +1300,7 @@ BdsLibGetImageHeader ( // BufferSize = sizeof (EFI_IMAGE_OPTIONAL_HEADER_UNION); Status = ThisFile->Read (ThisFile, &BufferSize, Hdr.Pe32); - if (EFI_ERROR (Status) || + if (EFI_ERROR(Status) || BufferSize < sizeof (EFI_IMAGE_OPTIONAL_HEADER_UNION) || Hdr.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) { Status = EFI_LOAD_ERROR; @@ -1388,7 +1388,7 @@ BdsSetMemoryTypeInformationVariable ( &gEfiMemoryTypeInformationGuid, (VOID **) &CurrentMemoryTypeInformation ); - if (EFI_ERROR (Status) || CurrentMemoryTypeInformation == NULL) { + if (EFI_ERROR(Status) || CurrentMemoryTypeInformation == NULL) { return; } @@ -1473,7 +1473,7 @@ BdsSetMemoryTypeInformationVariable ( PreviousMemoryTypeInformation ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If the Memory Type Information settings have been modified, then reset the platform // so the new Memory Type Information setting will be used to guarantee that an S4 @@ -1525,7 +1525,7 @@ BdsLibUserIdentify ( NULL, (VOID **) &Manager ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -1587,7 +1587,7 @@ SetVariableAndReportStatusCodeOnError ( DataSize, Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { NameSize = StrSize (VariableName); SetVariableStatus = AllocatePool (sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize); if (SetVariableStatus != NULL) { @@ -1611,7 +1611,7 @@ SetVariableAndReportStatusCodeOnError ( sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize ); - FreePool (SetVariableStatus); + FreePool(SetVariableStatus); } } diff --git a/Library/GenericBdsLib/DevicePath.c b/Library/GenericBdsLib/DevicePath.c index 4a2bf706d..d27c71d82 100644 --- a/Library/GenericBdsLib/DevicePath.c +++ b/Library/GenericBdsLib/DevicePath.c @@ -120,7 +120,7 @@ CatPrint ( Str->Len = StringSize - sizeof (UINT16); } - FreePool (AppendStr); + FreePool(AppendStr); return Str->Str; } @@ -1563,7 +1563,7 @@ DevicePathToStr ( NULL, (VOID **) &DevPathToText ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ToText = DevPathToText->ConvertDevicePathToText ( DevPath, FALSE, diff --git a/Library/GenericBdsLib/Performance.c b/Library/GenericBdsLib/Performance.c index d76e8c5bc..1989284f4 100644 --- a/Library/GenericBdsLib/Performance.c +++ b/Library/GenericBdsLib/Performance.c @@ -107,7 +107,7 @@ GetNameFromHandle ( (VOID **) &Image ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( Handle, &gEfiDriverBindingProtocolGuid, @@ -116,7 +116,7 @@ GetNameFromHandle ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } // @@ -161,7 +161,7 @@ AllocateMemoryForPerformanceData ( EFI_SIZE_TO_PAGES (mAcpiLowMemoryLength), &mAcpiLowMemoryBase ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gRT->SetVariable ( L"PerfDataMemAddr", &gPerformanceProtocolGuid, @@ -252,7 +252,7 @@ WriteBootToOsPerformanceData ( &VarSize, &mAcpiLowMemoryBase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Fail to get the variable, return. // @@ -271,7 +271,7 @@ WriteBootToOsPerformanceData ( &NoHandles, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -380,8 +380,8 @@ WriteBootToOsPerformanceData ( Done: - FreePool (Handles); - FreePool (PerfEntriesAsDxeHandle); + FreePool(Handles); + FreePool(PerfEntriesAsDxeHandle); mPerfHeader.Signiture = PERFORMANCE_SIGNATURE; diff --git a/Library/MachoLib/CxxSymbols.c b/Library/MachoLib/CxxSymbols.c index 78fb393fc..09bafa5b0 100644 --- a/Library/MachoLib/CxxSymbols.c +++ b/Library/MachoLib/CxxSymbols.c @@ -52,7 +52,7 @@ MachoSymbolNameIsPureVirtual ( ) { ASSERT (Name != NULL); - return (AsciiStrCmp (Name, CXX_PURE_VIRTUAL) == 0); + return (AsciiStrCmp(Name, CXX_PURE_VIRTUAL) == 0); } /** diff --git a/Library/MachoLib/Symbols.c b/Library/MachoLib/Symbols.c index fa098145e..c6cf50cd5 100644 --- a/Library/MachoLib/Symbols.c +++ b/Library/MachoLib/Symbols.c @@ -462,7 +462,7 @@ InternalGetLocalDefinedSymbolByNameWorker ( } TmpName = MachoGetSymbolName64 (Context, &SymbolTable[Index]); - if (AsciiStrCmp (Name, TmpName) == 0) { + if (AsciiStrCmp(Name, TmpName) == 0) { return &SymbolTable[Index]; } } diff --git a/Library/MemLogLibDefault/MemLogLib.c b/Library/MemLogLibDefault/MemLogLib.c index 6d21dfb66..260ef3d06 100644 --- a/Library/MemLogLibDefault/MemLogLib.c +++ b/Library/MemLogLibDefault/MemLogLib.c @@ -244,7 +244,7 @@ MemLogVA ( if (mMemLog == NULL) { Status = MemLogInit (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } } @@ -351,7 +351,7 @@ GetMemLogBuffer ( if (mMemLog == NULL) { Status = MemLogInit (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } } @@ -373,7 +373,7 @@ GetMemLogLen ( if (mMemLog == NULL) { Status = MemLogInit (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return 0; } } @@ -394,7 +394,7 @@ SetMemLogCallback ( if (mMemLog == NULL) { Status = MemLogInit (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } } @@ -412,7 +412,7 @@ GetMemLogTscTicksPerSecond (VOID) if (mMemLog == NULL) { Status = MemLogInit (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return 0; } } @@ -459,7 +459,7 @@ MemLogfVA ( if (mMemLog == NULL) { Status = MemLogInit (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } } diff --git a/Library/OsxBdsPlatformLib/BdsPlatform.c b/Library/OsxBdsPlatformLib/BdsPlatform.c index 60932c406..4f4a412df 100644 --- a/Library/OsxBdsPlatformLib/BdsPlatform.c +++ b/Library/OsxBdsPlatformLib/BdsPlatform.c @@ -141,7 +141,7 @@ PrintMemoryMap ( MemMap = (EFI_MEMORY_DESCRIPTOR *)((UINTN)MemMap + DescriptorSize); } - gBS->FreePool (MemMapPtr); + gBS->FreePool(MemMapPtr); } #endif @@ -204,7 +204,7 @@ UpdateMemoryMap ( // The memory type is assigned in EfiLdr // Status = gDS->GetMemorySpaceDescriptor (MemoryDescHob.MemDesc[Index].PhysicalStart, &Descriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } if (Descriptor.GcdMemoryType != EfiGcdMemoryTypeReserved) { @@ -220,7 +220,7 @@ UpdateMemoryMap ( MemoryDescHob.MemDesc[Index].PhysicalStart, LShiftU64 (MemoryDescHob.MemDesc[Index].NumberOfPages, EFI_PAGE_SHIFT) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "FreeMemorySpace fail - %r!\n", Status)); continue; } @@ -228,7 +228,7 @@ UpdateMemoryMap ( MemoryDescHob.MemDesc[Index].PhysicalStart, LShiftU64 (MemoryDescHob.MemDesc[Index].NumberOfPages, EFI_PAGE_SHIFT) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "RemoveMemorySpace fail - %r!\n", Status)); continue; } @@ -255,7 +255,7 @@ UpdateMemoryMap ( LShiftU64 (MemoryDescHob.MemDesc[Index].NumberOfPages, EFI_PAGE_SHIFT), MemoryDescHob.MemDesc[Index].Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "AddMemorySpace fail - %r!\n", Status)); /* if ((MemoryDescHob.MemDesc[Index].Type == EfiACPIReclaimMemory) || (MemoryDescHob.MemDesc[Index].Type == EfiACPIMemoryNVS)) { @@ -263,7 +263,7 @@ UpdateMemoryMap ( // For EfiACPIReclaimMemory and EfiACPIMemoryNVS, it must success. // For EfiReservedMemoryType, there maybe overlap. So skip check here. // -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } */ continue; } @@ -275,12 +275,12 @@ UpdateMemoryMap ( (UINTN)MemoryDescHob.MemDesc[Index].NumberOfPages, &Memory ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DEBUG ((EFI_D_ERROR, "AllocatePages fail - %r!\n", Status)); // // For the page added, it must be allocated. // -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); continue; } } @@ -356,19 +356,19 @@ Returns: &HandleArrayCount, &HandleArray ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleArrayCount; Index++) { Status = gBS->HandleProtocol ( HandleArray[Index], &gEfiPciIoProtocolGuid, (VOID **)&PciIo ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Find the USB host controller controller // Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((PCI_CLASS_SERIAL == Class[2]) && (PCI_CLASS_SERIAL_USB == Class[1])) { if (PCI_IF_UHCI == Class[0]) { @@ -436,7 +436,7 @@ Returns: return Status; } if (HandleArray) { - gBS->FreePool (HandleArray); + gBS->FreePool(HandleArray); } return EFI_SUCCESS; } @@ -590,12 +590,12 @@ Returns: ); // DEBUG ((EFI_D_INFO, "Pci Root bridge handle is 0x%X\n", RootHandle)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->ConnectController (RootHandle, NULL, NULL, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -637,7 +637,7 @@ Returns: &gEfiDevicePathProtocolGuid, (VOID*)&DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } #if NOSERIAL @@ -710,7 +710,7 @@ GetGopDevicePath ( &TempPciDevicePath, &PciDeviceHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -729,13 +729,13 @@ GetGopDevicePath ( &GopHandleCount, &GopHandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Add all the child handles as possible Console Device // for (Index = 0; Index < GopHandleCount; Index++) { Status = gBS->HandleProtocol (GopHandleBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID*)&TempDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } if (CompareMem ( @@ -760,7 +760,7 @@ GetGopDevicePath ( BdsLibUpdateConsoleVariable (VarConsoleOutDev, TempDevicePath, NULL); } } - gBS->FreePool (GopHandleBuffer); + gBS->FreePool(GopHandleBuffer); } return EFI_SUCCESS; @@ -798,7 +798,7 @@ Returns: &gEfiDevicePathProtocolGuid, (VOID*)&DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -841,7 +841,7 @@ Returns: &gEfiDevicePathProtocolGuid, (VOID*)&DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -895,13 +895,13 @@ Returns: &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } for (Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID*)&PciIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -915,7 +915,7 @@ Returns: sizeof (Pci) / sizeof (UINT32), &Pci ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -961,7 +961,7 @@ Returns: } } - gBS->FreePool (HandleBuffer); + gBS->FreePool(HandleBuffer); return EFI_SUCCESS; } @@ -1062,7 +1062,7 @@ Returns: // Connect the all the default console with current console variable // Status = BdsLibConnectAllDefaultConsoles (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1184,7 +1184,7 @@ Returns: // if (QuietBoot) { Status = EnableQuietBoot (PcdGetPtr(PcdLogoFile)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DisableQuietBoot (); return; } @@ -1193,7 +1193,7 @@ Returns: // Perform system diagnostic // Status = BaseMemoryTest (MemoryTestLevel); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DisableQuietBoot (); } @@ -1265,7 +1265,7 @@ Returns: // Connect platform console // Status = PlatformBdsConnectConsole (gPlatformConsole); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Here OEM/IBV can customize with defined action // @@ -1282,7 +1282,7 @@ Returns: &UserInputDurationTime ); // ASSERT (Status == EFI_SUCCESS); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { /*Status = */gBS->SetTimer (UserInputDurationTime, TimerRelative, 3000000); } @@ -1343,7 +1343,7 @@ Returns: gBS->CloseEvent (UserInputDurationTime); Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Enter Setup if user input // @@ -1388,7 +1388,7 @@ Returns: TmpStr = Option->StatusString; if (TmpStr != NULL) { BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL); - gBS->FreePool (TmpStr); + gBS->FreePool(TmpStr); } } @@ -1431,7 +1431,7 @@ Returns: TmpStr = Option->StatusString; if (TmpStr != NULL) { BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL); - gBS->FreePool (TmpStr); + gBS->FreePool(TmpStr); } } @@ -1577,8 +1577,8 @@ Returns: EFI_SIZE_TO_PAGES(TableLen), &BufferPtr ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } AcpiTableNew = (VOID *)(UINTN)BufferPtr; @@ -1655,8 +1655,8 @@ Returns: EFI_SIZE_TO_PAGES(BufferLen), &BufferPtr ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -1755,8 +1755,8 @@ Returns: EFI_SIZE_TO_PAGES(Data32), &BufferPtr ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } MpsFloatingPointerNew = (EFI_LEGACY_MP_TABLE_FLOATING_POINTER *)(UINTN)BufferPtr; diff --git a/Library/UefiHiiServicesLib/UefiHiiServicesLib.c b/Library/UefiHiiServicesLib/UefiHiiServicesLib.c index 2242d0b0f..c6111f731 100644 --- a/Library/UefiHiiServicesLib/UefiHiiServicesLib.c +++ b/Library/UefiHiiServicesLib/UefiHiiServicesLib.c @@ -85,19 +85,19 @@ UefiHiiServicesLibConstructor ( // Retrieve the pointer to the UEFI HII String Protocol // /*Status = */gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &gHiiString); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // Retrieve the pointer to the UEFI HII Database Protocol // /*Status = */gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &gHiiDatabase); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // Retrieve the pointer to the UEFI HII Config Routing Protocol // /*Status = */gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &gHiiConfigRouting); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // Retrieve the pointer to the optional UEFI HII Font Protocol diff --git a/Library/VideoBiosPatchLib/915resolution.c b/Library/VideoBiosPatchLib/915resolution.c index 6b691caaa..ed6023e81 100644 --- a/Library/VideoBiosPatchLib/915resolution.c +++ b/Library/VideoBiosPatchLib/915resolution.c @@ -203,7 +203,7 @@ vbios_map * open_vbios(chipset_type forced_chipset) */ map->ati_tables.base = map->bios_ptr; map->ati_tables.AtomRomHeader = (ATOM_ROM_HEADER *) (map->bios_ptr + *(UINT16 *) (map->bios_ptr + OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER)); - if (AsciiStrCmp ((CHAR8 *) map->ati_tables.AtomRomHeader->uaFirmWareSignature, "ATOM") == 0) + if (AsciiStrCmp((CHAR8 *) map->ati_tables.AtomRomHeader->uaFirmWareSignature, "ATOM") == 0) { UINT16 std_vesa_offset; ATOM_STANDARD_VESA_TIMING * std_vesa; diff --git a/Library/VideoBiosPatchLib/VideoBiosPatchLib.c b/Library/VideoBiosPatchLib/VideoBiosPatchLib.c index bf7e1d13b..b0a53b7f6 100644 --- a/Library/VideoBiosPatchLib/VideoBiosPatchLib.c +++ b/Library/VideoBiosPatchLib/VideoBiosPatchLib.c @@ -89,11 +89,11 @@ VideoBiosPatchInit ( // Status = gBS->LocateProtocol (&gEfiLegacyRegionProtocolGuid, NULL, (VOID **) &mLegacyRegion); DBG ("LegacyRegion = %r", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mLegacyRegion = NULL; Status = gBS->LocateProtocol (&gEfiLegacyRegion2ProtocolGuid, NULL, (VOID **) &mLegacyRegion2); DBG (", LegacyRegion2 = %r", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mLegacyRegion2 = NULL; } } @@ -122,7 +122,7 @@ VideoBiosUnlock ( UINT8 TstVar; Status = VideoBiosPatchInit (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -171,7 +171,7 @@ VideoBiosLock ( UINT32 Granularity; Status = VideoBiosPatchInit (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -217,7 +217,7 @@ VideoBiosPatchBytes ( DBG ("VideoBiosPatchBytes(%d patches):\n", FindAndReplaceCount); Status = VideoBiosUnlock (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG (" = not done.\n"); return Status; } @@ -261,7 +261,7 @@ UINT8* VideoBiosPatchGetEdid (VOID) DBG (" Edid:"); Edid = NULL; Status = gBS->LocateProtocol (&gEfiEdidActiveProtocolGuid, NULL, (VOID**)&EdidProtocol); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DBG(" size=%d", EdidProtocol->SizeOfEdid); if (EdidProtocol->SizeOfEdid > 0) { Edid = AllocateCopyPool (EdidProtocol->SizeOfEdid, EdidProtocol->Edid); @@ -308,13 +308,13 @@ VideoBiosPatchNativeFromEdid ( if (map == NULL) { DBG (" = unknown video bios.\n"); if (ReleaseEdid) { - FreePool (Edid); + FreePool(Edid); } return EFI_UNSUPPORTED; } Status = VideoBiosUnlock (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG (" = not done.\n"); return Status; } @@ -323,7 +323,7 @@ VideoBiosPatchNativeFromEdid ( set_mode (map, 0, 0, 0, 0, 0); mEdid = NULL; if (ReleaseEdid) { - FreePool (Edid); + FreePool(Edid); } VideoBiosLock (); diff --git a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c index 34d4089a5..c98ea0aa2 100644 --- a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c +++ b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c @@ -132,7 +132,7 @@ GetLineWidth ( IncrementValue = 2; } } while (String[Index] != 0); - FreePool (String); + FreePool(String); } return LineWidth; @@ -230,11 +230,11 @@ IsBootManagerMenu ( EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu; Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { EfiBootManagerFreeLoadOption (&BootManagerMenu); } - return (BOOLEAN) (!EFI_ERROR (Status) && (BootOption->OptionNumber == BootManagerMenu.OptionNumber)); + return (BOOLEAN) (!EFI_ERROR(Status) && (BootOption->OptionNumber == BootManagerMenu.OptionNumber)); } /** @@ -257,7 +257,7 @@ IgnoreBootOption ( // Ignore myself. // Status = gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &ImageDevicePath); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (CompareMem (BootOption->FilePath, ImageDevicePath, GetDevicePathSize (ImageDevicePath)) == 0) { return TRUE; } @@ -438,14 +438,14 @@ BootMenuSelectItem ( for (Index = 0; Index < ItemCountPerScreen; Index++) { PrintStringAt (PrintCol, PrintRow + Index, String); } - FreePool (String); + FreePool(String); // // print selectable items // for (Index = 0; Index < ItemCountPerScreen; Index++, PrintRow++) { String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[Index + FirstItem], NULL); PrintStringAt (PrintCol, PrintRow, String); - FreePool (String); + FreePool(String); } RePaintItems = TRUE; } @@ -459,7 +459,7 @@ BootMenuSelectItem ( PrintCol = StartCol + 1; PrintRow = StartRow + TITLE_TOKEN_COUNT + 2 + WantSelectItem - FirstItem; PrintStringAt (PrintCol, PrintRow, String); - FreePool (String); + FreePool(String); // // if Want Select and selected item isn't the same and doesn't re-draw selectable @@ -471,7 +471,7 @@ BootMenuSelectItem ( PrintCol = StartCol + 1; PrintRow = StartRow + 3 + BootMenuData->SelectItem - FirstItem; PrintStringAt (PrintCol, PrintRow, String); - FreePool (String); + FreePool(String); } gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute); @@ -572,7 +572,7 @@ DrawBootPopupMenu ( PrintStringAt (StartCol + 1, PrintRow, String); PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL); } - FreePool (String); + FreePool(String); PrintRow++; PrintCharAt (StartCol, PrintRow, BOXDRAW_UP_RIGHT); @@ -591,7 +591,7 @@ DrawBootPopupMenu ( LineWidth = GetLineWidth (BootMenuData->TitleToken[Index]); PrintCol = StartCol + (Width - LineWidth) / 2; PrintStringAt (PrintCol, PrintRow, String); - FreePool (String); + FreePool(String); } // @@ -602,7 +602,7 @@ DrawBootPopupMenu ( for (Index = 0; Index < ItemCountPerScreen; Index++, PrintRow++) { String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[Index], NULL); PrintStringAt (PrintCol, PrintRow, String); - FreePool (String); + FreePool(String); } // @@ -614,7 +614,7 @@ DrawBootPopupMenu ( LineWidth = GetLineWidth (BootMenuData->HelpToken[Index]); PrintCol = StartCol + (Width - LineWidth) / 2; PrintStringAt (PrintCol, PrintRow, String); - FreePool (String); + FreePool(String); } // @@ -714,7 +714,7 @@ BdsSetConsoleMode ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -723,7 +723,7 @@ BdsSetConsoleMode ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -771,7 +771,7 @@ BdsSetConsoleMode ( &SizeOfInfo, &Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Info->HorizontalResolution == NewHorizontalResolution) && (Info->VerticalResolution == NewVerticalResolution)) { if ((GraphicsOutput->Mode->Info->HorizontalResolution == NewHorizontalResolution) && @@ -780,12 +780,12 @@ BdsSetConsoleMode ( // Current resolution is same with required resolution, check if text mode need be set // Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (CurrentColumn == NewColumns && CurrentRow == NewRows) { // // If current text mode is same with required text mode. Do nothing // - FreePool (Info); + FreePool(Info); return EFI_SUCCESS; } else { // @@ -799,15 +799,15 @@ BdsSetConsoleMode ( // Required text mode is supported, set it. // Status = SimpleTextOut->SetMode (SimpleTextOut, Index); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Update text mode PCD. // Status = PcdSet32S (PcdConOutColumn, mSetupTextModeColumn); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutRow, mSetupTextModeRow); - ASSERT_EFI_ERROR (Status); - FreePool (Info); + ASSERT_EFI_ERROR(Status); + FreePool(Info); return EFI_SUCCESS; } } @@ -816,7 +816,7 @@ BdsSetConsoleMode ( // // If required text mode is not supported, return error. // - FreePool (Info); + FreePool(Info); return EFI_UNSUPPORTED; } } @@ -826,13 +826,13 @@ BdsSetConsoleMode ( // In this case, the driver which produces simple text out need be restarted. // Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber); - if (!EFI_ERROR (Status)) { - FreePool (Info); + if (!EFI_ERROR(Status)) { + FreePool(Info); break; } } } - FreePool (Info); + FreePool(Info); } } @@ -848,13 +848,13 @@ BdsSetConsoleMode ( // Set PCD to Inform Consplitter to change text mode. // Status = PcdSet32S (PcdVideoHorizontalResolution, NewHorizontalResolution); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdVideoVerticalResolution, NewVerticalResolution); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutColumn, NewColumns); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutRow, NewRows); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Video mode is changed, so restart graphics console driver and higher level driver. @@ -868,7 +868,7 @@ BdsSetConsoleMode ( &HandleCount, &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleCount; Index++) { gBS->DisconnectController (HandleBuffer[Index], NULL, NULL); } @@ -876,7 +876,7 @@ BdsSetConsoleMode ( gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } } @@ -919,9 +919,9 @@ BootManagerMenuEntry ( // BootLogo = NULL; Status = gBS->LocateProtocol (&gEfiBootLogoProtocolGuid, NULL, (VOID **) &BootLogo); - if (!EFI_ERROR (Status) && (BootLogo != NULL)) { + if (!EFI_ERROR(Status) && (BootLogo != NULL)) { Status = BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL); @@ -952,7 +952,7 @@ BootManagerMenuEntry ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -961,7 +961,7 @@ BootManagerMenuEntry ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -1015,7 +1015,7 @@ BootManagerMenuEntry ( while (!ExitApplication) { gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index); Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { switch (Key.UnicodeChar) { case CHAR_NULL: @@ -1065,7 +1065,7 @@ BootManagerMenuEntry ( } } EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount); - FreePool (BootMenuData.PtrTokens); + FreePool(BootMenuData.PtrTokens); HiiRemovePackages (gStringPackHandle); diff --git a/MdeModulePkg/Application/CapsuleApp/AppSupport.c b/MdeModulePkg/Application/CapsuleApp/AppSupport.c index 8fe70dc3b..ed9bb2e75 100644 --- a/MdeModulePkg/Application/CapsuleApp/AppSupport.c +++ b/MdeModulePkg/Application/CapsuleApp/AppSupport.c @@ -58,7 +58,7 @@ GetShellProtocol ( NULL, (VOID **) &mShellProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mShellProtocol = NULL; } } @@ -104,7 +104,7 @@ ReadFileToBuffer ( &Handle, EFI_FILE_MODE_READ ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -112,7 +112,7 @@ ReadFileToBuffer ( // Get the file size. // Status = ShellProtocol->GetFileSize (Handle, &FileSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ShellProtocol->CloseFile (Handle); return Status; } @@ -132,7 +132,7 @@ ReadFileToBuffer ( &TempBufferSize, TempBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ShellProtocol->CloseFile (Handle); return Status; } @@ -181,7 +181,7 @@ WriteFileFromBuffer ( &Handle, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -203,13 +203,13 @@ WriteFileFromBuffer ( // FileInfo->FileSize = 0; Status = ShellProtocol->SetFileInfo (Handle, FileInfo); - if (EFI_ERROR (Status)) { - FreePool (FileInfo); + if (EFI_ERROR(Status)) { + FreePool(FileInfo); ShellProtocol->CloseFile (Handle); return Status; } } - FreePool (FileInfo); + FreePool(FileInfo); // // Write the file data from the buffer @@ -220,7 +220,7 @@ WriteFileFromBuffer ( &TempBufferSize, Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ShellProtocol->CloseFile (Handle); return Status; } diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c index 3439ce5fe..710425659 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c @@ -90,7 +90,7 @@ CreateBmpFmp ( goto Done; } if (GopBlt != NULL) { - FreePool (GopBlt); + FreePool(GopBlt); } Print(L"BMP image (%s), Width - %d, Height - %d\n", BmpName, Width, Height); @@ -1005,7 +1005,7 @@ UefiMain ( Done: for (Index = 0; Index < CapsuleNum; Index++) { if (CapsuleBuffer[Index] != NULL) { - FreePool (CapsuleBuffer[Index]); + FreePool(CapsuleBuffer[Index]); } } diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c index 58a93568d..3c9099452 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c @@ -706,13 +706,13 @@ DumpCapsuleFromDisk ( NoFile = FALSE; Status = Fs->OpenVolume (Fs, &Root); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Cannot open volume. Status = %r\n", Status); goto Done; } Status = Root->Open (Root, &DirHandle, EFI_CAPSULE_FILE_DIRECTORY, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE , 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Cannot open %s. Status = %r\n", EFI_CAPSULE_FILE_DIRECTORY, Status); goto Done; } @@ -722,7 +722,7 @@ DumpCapsuleFromDisk ( // Status = FileHandleFindFirstFile (DirHandle, &FileInfo); do { - if (EFI_ERROR (Status) || FileInfo == NULL) { + if (EFI_ERROR(Status) || FileInfo == NULL) { Print (L"Get File Info Fail. Status = %r\n", Status); goto Done; } @@ -732,7 +732,7 @@ DumpCapsuleFromDisk ( } Status = FileHandleFindNextFile (DirHandle, FileInfo, &NoFile); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Get Next File Fail. Status = %r\n", Status); goto Done; } @@ -756,7 +756,7 @@ DumpCapsuleFromDisk ( // Status = FileHandleFindFirstFile (DirHandle, &FileInfo); do { - if (EFI_ERROR (Status) || FileInfo == NULL) { + if (EFI_ERROR(Status) || FileInfo == NULL) { Print (L"Get File Info Fail. Status = %r\n", Status); goto Done; } @@ -766,7 +766,7 @@ DumpCapsuleFromDisk ( } Status = FileHandleFindNextFile (DirHandle, FileInfo, &NoFile); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Get Next File Fail. Status = %r\n", Status); goto Done; } @@ -798,12 +798,12 @@ DumpCapsuleFromDisk ( for (Index = 0; Index < FileCount; Index++) { FileHandle = NULL; Status = DirHandle->Open (DirHandle, &FileHandle, FileInfoBuffer[Index]->FileName, EFI_FILE_MODE_READ, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = FileHandleGetSize (FileHandle, (UINT64 *) &FileSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Cannot read file %s. Status = %r\n", FileInfoBuffer[Index]->FileName, Status); FileHandleClose (FileHandle); goto Done; @@ -816,10 +816,10 @@ DumpCapsuleFromDisk ( } Status = FileHandleRead (FileHandle, &FileSize, FileBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Cannot read file %s. Status = %r\n", FileInfoBuffer[Index]->FileName, Status); FileHandleClose (FileHandle); - FreePool (FileBuffer); + FreePool(FileBuffer); goto Done; } @@ -828,17 +828,17 @@ DumpCapsuleFromDisk ( Print (L"**************************\n"); DumpCapsuleFromBuffer ((EFI_CAPSULE_HEADER *) FileBuffer); FileHandleClose (FileHandle); - FreePool (FileBuffer); + FreePool(FileBuffer); } Done: if (FileInfoBuffer != NULL) { for (Index = 0; Index < FileCount; Index++) { if (FileInfoBuffer[Index] != NULL) { - FreePool (FileInfoBuffer[Index]); + FreePool(FileInfoBuffer[Index]); } } - FreePool (FileInfoBuffer); + FreePool(FileInfoBuffer); } return Status; @@ -940,7 +940,7 @@ DumpProvisionedCapsule ( (VOID **) &CapsuleDataPtr64, NULL ); - if (EFI_ERROR (Status) || CapsuleDataPtr64 == NULL) { + if (EFI_ERROR(Status) || CapsuleDataPtr64 == NULL) { if (Index == 0) { Print (L"No data.\n"); } @@ -964,17 +964,17 @@ DumpProvisionedCapsule ( (VOID **) &BootNext, NULL ); - if (EFI_ERROR (Status) || BootNext == NULL) { + if (EFI_ERROR(Status) || BootNext == NULL) { Print (L"Get BootNext Variable Fail. Status = %r\n", Status); } else { UnicodeSPrint (BootOptionName, sizeof (BootOptionName), L"Boot%04x", *BootNext); Status = EfiBootManagerVariableToLoadOption (BootOptionName, &BootNextOptionEntry); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Display description and device path // GetEfiSysPartitionFromBootOptionFilePath (BootNextOptionEntry.FilePath, &DevicePath, &Fs); - if(!EFI_ERROR (Status)) { + if(!EFI_ERROR(Status)) { Print (L"Capsules are provisioned on BootOption: %s\n", BootNextOptionEntry.Description); Print (L" %s %s\n", ShellProtocol->GetMapFromDevicePath (&DevicePath), ConvertDevicePathToText(DevicePath, TRUE, TRUE)); DumpCapsuleFromDisk (Fs, DumpCapsuleInfo); @@ -1421,7 +1421,7 @@ DumpFmpImage ( Status = WriteFileFromBuffer(ImageName, ImageSize, Image); Print(L"CapsuleApp: Dump %g ImageIndex (0x%x) to %s %r\n", ImageTypeId, ImageIndex, ImageName, Status); - FreePool (Image); + FreePool(Image); return ; } diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c b/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c index b161d1a98..590084e2a 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c @@ -41,7 +41,7 @@ GetFileNameFromPath ( &Handle, EFI_FILE_MODE_READ ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -97,7 +97,7 @@ IsEfiSysPartitionDevicePath ( // Search for EFI system partition protocol on full device path in Boot Option // Status = gBS->LocateDevicePath (&gEfiPartTypeSystemPartGuid, &DevicePath, &Handle); - return EFI_ERROR (Status) ? FALSE : TRUE; + return EFI_ERROR(Status) ? FALSE : TRUE; } else { return FALSE; } @@ -175,7 +175,7 @@ IsCapsuleProvisioned ( &DataSize, &OsIndication ); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && (OsIndication & EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED) != 0) { return TRUE; } @@ -213,7 +213,7 @@ GetEfiSysPartition ( &SimpleFileSystemHandles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -221,7 +221,7 @@ GetEfiSysPartition ( DevicePath = DevicePathFromHandle (SimpleFileSystemHandles[Index]); if (IsEfiSysPartitionDevicePath (DevicePath)) { Status = gBS->HandleProtocol (SimpleFileSystemHandles[Index], &gEfiSimpleFileSystemProtocolGuid, (VOID **)Fs); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *FsDevicePath = DevicePath; return EFI_SUCCESS; } @@ -279,9 +279,9 @@ GetEfiSysPartitionFromDevPath ( // // Search for simple file system on this handler // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID **)Fs); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *FsDevicePath = DevicePathFromHandle (Handle); return EFI_SUCCESS; } @@ -325,7 +325,7 @@ GetEfiSysPartitionFromBootOptionFilePath ( CurFullPath = EfiBootManagerGetNextLoadOptionDevicePath (DevicePath, CurFullPath); if (PreFullPath != NULL) { - FreePool (PreFullPath); + FreePool(PreFullPath); } if (CurFullPath == NULL) { @@ -342,12 +342,12 @@ GetEfiSysPartitionFromBootOptionFilePath ( DevicePathStr = ConvertDevicePathToText (CurFullPath, TRUE, TRUE); if (DevicePathStr != NULL){ DEBUG ((DEBUG_INFO, "Full device path %s\n", DevicePathStr)); - FreePool (DevicePathStr); + FreePool(DevicePathStr); } ); Status = GetEfiSysPartitionFromDevPath (CurFullPath, &FsFullPath, Fs); - } while (EFI_ERROR (Status)); + } while (EFI_ERROR(Status)); if (*Fs != NULL) { *FullPath = FsFullPath; @@ -411,16 +411,16 @@ GetUpdateFileSystem ( (VOID **)&BootNextData, NULL ); - if (EFI_ERROR (Status) || BootNextData == NULL) { + if (EFI_ERROR(Status) || BootNextData == NULL) { Print (L"Get Boot Next Data Fail. Status = %r\n", Status); return EFI_NOT_FOUND; } else { UnicodeSPrint (BootOptionName, sizeof (BootOptionName), L"Boot%04x", *BootNextData); Status = EfiBootManagerVariableToLoadOption (BootOptionName, &BootNextOption); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DevicePath = BootNextOption.FilePath; Status = GetEfiSysPartitionFromBootOptionFilePath (DevicePath, &FullPath, Fs); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *UpdateBootNext = FALSE; Print(L"Get EFI system partition from BootNext : %s\n", BootNextOption.Description); Print(L"%s %s\n", ShellProtocol->GetMapFromDevicePath (&FullPath), ConvertDevicePathToText (FullPath, TRUE, TRUE)); @@ -474,14 +474,14 @@ GetUpdateFileSystem ( DevicePathStr = ConvertDevicePathToText (DevicePath, TRUE, TRUE); if (DevicePathStr != NULL){ DEBUG ((DEBUG_INFO, "Try BootOption %s\n", DevicePathStr)); - FreePool (DevicePathStr); + FreePool(DevicePathStr); } else { DEBUG ((DEBUG_INFO, "DevicePathToStr failed\n")); } ); Status = GetEfiSysPartitionFromBootOptionFilePath (DevicePath, &FullPath, Fs); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Map == NULL) { *BootNext = (UINT16) BootOptionBuffer[Index].OptionNumber; *UpdateBootNext = TRUE; @@ -508,14 +508,14 @@ GetUpdateFileSystem ( // DevicePath = DuplicateDevicePath (MappedDevicePath); Status = GetEfiSysPartitionFromDevPath (DevicePath, &FullPath, Fs); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Error: Cannot get EFI system partiion from '%s' - %r\n", Map, Status); return EFI_NOT_FOUND; } Print (L"Warning: Cannot find Boot Option on '%s'!\n", Map); } else { Status = GetEfiSysPartition (&DevicePath, Fs); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Error: Cannot find a EFI system partition!\n"); return EFI_NOT_FOUND; } @@ -532,9 +532,9 @@ GetUpdateFileSystem ( (UINT8 *) &mCapsuleOnDiskBootOptionGuid, sizeof(EFI_GUID) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = EfiBootManagerAddLoadOptionVariable (&NewOption, (UINTN) -1); { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *UpdateBootNext = TRUE; *BootNext = (UINT16) NewOption.OptionNumber; Print (L" Boot%04x: %s\n", *BootNext, ConvertDevicePathToText(DevicePath, TRUE, TRUE)); @@ -588,7 +588,7 @@ WriteUpdateFile ( // Open Root from SFS // Status = Fs->OpenVolume (Fs, &Root); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Cannot open volume. Status = %r\n", Status); return EFI_NOT_FOUND; } @@ -597,17 +597,17 @@ WriteUpdateFile ( // Ensure that efi and updatecapsule directories exist // Status = Root->Open (Root, &DirHandle, L"\\EFI", EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = Root->Open (Root, &DirHandle, L"\\EFI", EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, EFI_FILE_DIRECTORY); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print(L"Unable to create %s directory\n", L"\\EFI"); return EFI_NOT_FOUND; } } Status = Root->Open (Root, &DirHandle, EFI_CAPSULE_FILE_DIRECTORY, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE , 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = Root->Open (Root, &DirHandle, EFI_CAPSULE_FILE_DIRECTORY, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, EFI_FILE_DIRECTORY); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print(L"Unable to create %s directory\n", EFI_CAPSULE_FILE_DIRECTORY); return EFI_NOT_FOUND; } @@ -620,7 +620,7 @@ WriteUpdateFile ( // Open UpdateCapsule file // Status = DirHandle->Open (DirHandle, &FileHandle, FileName[Index], EFI_FILE_MODE_CREATE | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Unable to create %s file\n", FileName[Index]); return EFI_NOT_FOUND; } @@ -629,7 +629,7 @@ WriteUpdateFile ( // Empty the file contents // Status = FileHandleGetSize (FileHandle, &FileInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FileHandleClose (FileHandle); Print (L"Error Reading %s\n", FileName[Index]); return EFI_DEVICE_ERROR; @@ -644,7 +644,7 @@ WriteUpdateFile ( // FileInfo = 0; Status = FileHandleSetSize (FileHandle, FileInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Error Deleting %s\n", FileName[Index]); FileHandleClose (FileHandle); return Status; @@ -657,7 +657,7 @@ WriteUpdateFile ( Filebuffer = Buffer[Index]; FileSize = BufferSize[Index]; Status = FileHandleWrite (FileHandle, &FileSize, Filebuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Unable to write Capsule Update to %s, Status = %r\n", FileName[Index], Status); return EFI_NOT_FOUND; } @@ -696,7 +696,7 @@ SetCapsuleStatusVariable ( &DataSize, &OsIndication ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { OsIndication = 0; } if (SetCap) { @@ -740,7 +740,7 @@ IsCapsuleOnDiskSupported ( &DataSize, &OsIndicationsSupported ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -794,7 +794,7 @@ ProcessCapsuleOnDisk ( Fs = NULL; Status = GetUpdateFileSystem (Map, &BootNext, &Fs, &UpdateBootNext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"CapsuleApp: cannot find a valid file system on boot devies. Status = %r\n", Status); return Status; } @@ -810,7 +810,7 @@ ProcessCapsuleOnDisk ( // Copy capsule image to '\efi\UpdateCapsule\' // Status = WriteUpdateFile (CapsuleBuffer, CapsuleBufferSize, FileName, CapsuleNum, Fs); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"CapsuleApp: capsule image could not be copied for update.\n"); return Status; } @@ -819,7 +819,7 @@ ProcessCapsuleOnDisk ( // Set variable then reset // Status = SetCapsuleStatusVariable (TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"CapsuleApp: unable to set OSIndication variable.\n"); return Status; } @@ -832,7 +832,7 @@ ProcessCapsuleOnDisk ( sizeof(UINT16), &BootNext ); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ Print (L"CapsuleApp: unable to set BootNext variable.\n"); return Status; } diff --git a/MdeModulePkg/Application/DumpDynPcd/DumpDynPcd.c b/MdeModulePkg/Application/DumpDynPcd/DumpDynPcd.c index 96b35d3da..3065544c6 100644 --- a/MdeModulePkg/Application/DumpDynPcd/DumpDynPcd.c +++ b/MdeModulePkg/Application/DumpDynPcd/DumpDynPcd.c @@ -411,7 +411,7 @@ DumpPcdInfo ( } if (RetString != NULL) { - FreePool (RetString); + FreePool(RetString); } Print (L"\n"); } @@ -451,7 +451,7 @@ ProcessPcd ( TokenNumber = 0; do { Status = mPiPcd->GetNextToken (TokenSpace, &TokenNumber); - if (!EFI_ERROR (Status) && TokenNumber != 0) { + if (!EFI_ERROR(Status) && TokenNumber != 0) { if (TokenSpace == NULL) { // // PCD in default Token Space. @@ -491,10 +491,10 @@ ProcessPcd ( DumpPcdInfo (TokenSpace, TokenNumber, &PcdInfo); } } - } while (!EFI_ERROR (Status) && TokenNumber != 0); + } while (!EFI_ERROR(Status) && TokenNumber != 0); Status = mPiPcd->GetNextTokenSpace ((CONST EFI_GUID **) &TokenSpace); - } while (!EFI_ERROR (Status) && TokenSpace != NULL); + } while (!EFI_ERROR(Status) && TokenSpace != NULL); if ((InputPcdName != NULL) && !Found) { // @@ -532,30 +532,30 @@ DumpDynPcdMain ( InputPcdName = NULL; Status = gBS->LocateProtocol(&gEfiUnicodeCollation2ProtocolGuid, NULL, (VOID **) &mUnicodeCollation); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mUnicodeCollation = NULL; } Status = gBS->LocateProtocol (&gEfiPcdProtocolGuid, NULL, (VOID **) &mPiPcd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"DumpDynPcd: %EError. %NPI PCD protocol is not present.\n"); return Status; } Status = gBS->LocateProtocol (&gEfiGetPcdInfoProtocolGuid, NULL, (VOID **) &mPiPcdInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"DumpDynPcd: %EError. %NPI PCD info protocol is not present.\n"); return Status; } Status = gBS->LocateProtocol (&gPcdProtocolGuid, NULL, (VOID **) &mPcd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"DumpDynPcd: %EError. %NPCD protocol is not present.\n"); return Status; } Status = gBS->LocateProtocol (&gGetPcdInfoProtocolGuid, NULL, (VOID **) &mPcdInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"DumpDynPcd: %EError. %NPCD info protocol is not present.\n"); return Status; } @@ -602,7 +602,7 @@ DumpDynPcdMain ( Done: if (mTempPcdNameBuffer != NULL) { - FreePool (mTempPcdNameBuffer); + FreePool(mTempPcdNameBuffer); } return Status; diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c index 148607db7..46923842e 100644 --- a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c +++ b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c @@ -261,7 +261,7 @@ GetDriverNameString ( (VOID **) &NameString, &StringSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Method 2: Get the name string from FFS UI section // @@ -269,7 +269,7 @@ GetDriverNameString ( NameString[PROFILE_NAME_STRING_LENGTH] = 0; } UnicodeStrToAsciiStrS (NameString, mNameString, sizeof (mNameString)); - FreePool (NameString); + FreePool(NameString); return mNameString; } } @@ -997,11 +997,11 @@ DestroyContextSummaryData ( AllocSummaryLink = AllocSummaryLink->ForwardLink; RemoveEntryList (&AllocSummaryInfoData->Link); - FreePool (AllocSummaryInfoData); + FreePool(AllocSummaryInfoData); } RemoveEntryList (&DriverSummaryInfoData->Link); - FreePool (DriverSummaryInfoData); + FreePool(DriverSummaryInfoData); } return ; } @@ -1026,7 +1026,7 @@ GetUefiMemoryProfileData ( BOOLEAN RecordingState; Status = gBS->LocateProtocol (&gEdkiiMemoryProfileGuid, NULL, (VOID **) &ProfileProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UefiMemoryProfile: Locate MemoryProfile protocol - %r\n", Status)); return Status; } @@ -1064,7 +1064,7 @@ GetUefiMemoryProfileData ( &Size, Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"UefiMemoryProfile: GetData - %r\n", Status); goto Done; } @@ -1087,7 +1087,7 @@ GetUefiMemoryProfileData ( Done: if (Data != NULL) { - FreePool (Data); + FreePool(Data); } // @@ -1135,7 +1135,7 @@ GetSmramProfileData ( ProfileBuffer = NULL; Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &SmmCommunication); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SmramProfile: Locate SmmCommunication protocol - %r\n", Status)); return Status; } @@ -1156,7 +1156,7 @@ GetSmramProfileData ( &gEdkiiPiSmmCommunicationRegionTableGuid, (VOID **) &PiSmmCommunicationRegionTable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SmramProfile: Get PiSmmCommunicationRegionTable - %r\n", Status)); return Status; } @@ -1192,7 +1192,7 @@ GetSmramProfileData ( CommSize = sizeof (EFI_GUID) + sizeof (UINTN) + CommHeader->MessageLength; Status = SmmCommunication->Communicate (SmmCommunication, CommBuffer, &CommSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SmramProfile: SmmCommunication - %r\n", Status)); return Status; } @@ -1232,7 +1232,7 @@ GetSmramProfileData ( CommSize = sizeof (EFI_GUID) + sizeof (UINTN) + CommHeader->MessageLength; Status = SmmCommunication->Communicate (SmmCommunication, CommBuffer, &CommSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (CommGetProfileInfo->Header.ReturnStatus != 0) { Status = EFI_SUCCESS; @@ -1275,7 +1275,7 @@ GetSmramProfileData ( CommGetProfileData->ProfileSize = (UINT64) (ProfileSize - CommGetProfileData->ProfileOffset); } Status = SmmCommunication->Communicate (SmmCommunication, CommBuffer, &CommSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (CommGetProfileData->Header.ReturnStatus != 0) { Status = EFI_SUCCESS; @@ -1303,7 +1303,7 @@ GetSmramProfileData ( Done: if (ProfileBuffer != NULL) { - FreePool (ProfileBuffer); + FreePool(ProfileBuffer); } // @@ -1348,12 +1348,12 @@ UefiMain ( EFI_STATUS Status; Status = GetUefiMemoryProfileData (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "GetUefiMemoryProfileData - %r\n", Status)); } Status = GetSmramProfileData (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "GetSmramProfileData - %r\n", Status)); } diff --git a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c index 0f7163160..e2cc9ebb8 100644 --- a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c +++ b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c @@ -277,7 +277,7 @@ GetDriverNameString ( (VOID **) &NameString, &StringSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Method 2: Get the name string from FFS UI section // @@ -285,7 +285,7 @@ GetDriverNameString ( NameString[PROFILE_NAME_STRING_LENGTH] = 0; } UnicodeStrToAsciiStrS (NameString, mNameString, sizeof (mNameString)); - FreePool (NameString); + FreePool(NameString); return mNameString; } } @@ -555,7 +555,7 @@ DumpSmiChildContext ( Str = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL *)(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT *)Context) + 1), TRUE, TRUE); Print(L" UsbDevicePath=\"%s\"", Str); if (Str != NULL) { - FreePool (Str); + FreePool(Str); } } else { Print(L" Context=\""); diff --git a/MdeModulePkg/Application/UiApp/FrontPage.c b/MdeModulePkg/Application/UiApp/FrontPage.c index 4b95cccb5..0973aa3ff 100644 --- a/MdeModulePkg/Application/UiApp/FrontPage.c +++ b/MdeModulePkg/Application/UiApp/FrontPage.c @@ -257,7 +257,7 @@ InitializeFrontPage ( // Locate Hii relative protocols // Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &gFormBrowser2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -273,7 +273,7 @@ InitializeFrontPage ( &gFrontPagePrivate.ConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Publish our HII data @@ -361,14 +361,14 @@ FreeFrontPage( &gFrontPagePrivate.ConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Publish our HII data // HiiRemovePackages (gFrontPagePrivate.HiiHandle); if (gFrontPagePrivate.LanguageToken != NULL) { - FreePool (gFrontPagePrivate.LanguageToken); + FreePool(gFrontPagePrivate.LanguageToken); gFrontPagePrivate.LanguageToken = NULL; } } @@ -526,55 +526,55 @@ UpdateFrontPageBannerStrings ( NewString = HiiGetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_CUSTOMIZE_BANNER_LINE4_LEFT), NULL); UiCustomizeFrontPageBanner (4, TRUE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_CUSTOMIZE_BANNER_LINE4_LEFT), NewString, NULL); - FreePool (NewString); + FreePool(NewString); NewString = HiiGetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_CUSTOMIZE_BANNER_LINE4_RIGHT), NULL); UiCustomizeFrontPageBanner (4, FALSE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_CUSTOMIZE_BANNER_LINE4_RIGHT), NewString, NULL); - FreePool (NewString); + FreePool(NewString); NewString = HiiGetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_CUSTOMIZE_BANNER_LINE5_LEFT), NULL); UiCustomizeFrontPageBanner (5, TRUE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_CUSTOMIZE_BANNER_LINE5_LEFT), NewString, NULL); - FreePool (NewString); + FreePool(NewString); NewString = HiiGetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_CUSTOMIZE_BANNER_LINE5_RIGHT), NULL); UiCustomizeFrontPageBanner (5, FALSE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_CUSTOMIZE_BANNER_LINE5_RIGHT), NewString, NULL); - FreePool (NewString); + FreePool(NewString); // // Update Front Page banner strings base on SmBios Table. // Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **) &Smbios); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Smbios protocol not found, get the default value. // NewString = HiiGetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_COMPUTER_MODEL), NULL); UiCustomizeFrontPageBanner (1, TRUE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_COMPUTER_MODEL), NewString, NULL); - FreePool (NewString); + FreePool(NewString); NewString = HiiGetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_CPU_MODEL), NULL); UiCustomizeFrontPageBanner (2, TRUE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_CPU_MODEL), NewString, NULL); - FreePool (NewString); + FreePool(NewString); NewString = HiiGetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_CPU_SPEED), NULL); UiCustomizeFrontPageBanner (2, FALSE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_CPU_SPEED), NewString, NULL); - FreePool (NewString); + FreePool(NewString); NewString = HiiGetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_BIOS_VERSION), NULL); UiCustomizeFrontPageBanner (3, TRUE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_BIOS_VERSION), NewString, NULL); - FreePool (NewString); + FreePool(NewString); NewString = HiiGetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_MEMORY_SIZE), NULL); UiCustomizeFrontPageBanner (3, FALSE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_MEMORY_SIZE), NewString, NULL); - FreePool (NewString); + FreePool(NewString); return; } @@ -589,14 +589,14 @@ UpdateFrontPageBannerStrings ( FirmwareVersionString = (CHAR16 *) PcdGetPtr (PcdFirmwareVersionString); if (*FirmwareVersionString != 0x0000 ) { - FreePool (NewString); + FreePool(NewString); NewString = (CHAR16 *) PcdGetPtr (PcdFirmwareVersionString); UiCustomizeFrontPageBanner (3, TRUE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_BIOS_VERSION), NewString, NULL); } else { UiCustomizeFrontPageBanner (3, TRUE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_BIOS_VERSION), NewString, NULL); - FreePool (NewString); + FreePool(NewString); } } @@ -606,7 +606,7 @@ UpdateFrontPageBannerStrings ( GetOptionalStringByIndex ((CHAR8*)((UINT8*)Type1Record + Type1Record->Hdr.Length), StrIndex, &NewString); UiCustomizeFrontPageBanner (1, TRUE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_COMPUTER_MODEL), NewString, NULL); - FreePool (NewString); + FreePool(NewString); } if ((Record->Type == SMBIOS_TYPE_PROCESSOR_INFORMATION) && !FoundCpu) { @@ -619,12 +619,12 @@ UpdateFrontPageBannerStrings ( GetOptionalStringByIndex ((CHAR8*)((UINT8*)Type4Record + Type4Record->Hdr.Length), StrIndex, &NewString); UiCustomizeFrontPageBanner (2, TRUE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_CPU_MODEL), NewString, NULL); - FreePool (NewString); + FreePool(NewString); ConvertProcessorToString(Type4Record->CurrentSpeed, 6, &NewString); UiCustomizeFrontPageBanner (2, FALSE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_CPU_SPEED), NewString, NULL); - FreePool (NewString); + FreePool(NewString); FoundCpu = TRUE; } @@ -650,7 +650,7 @@ UpdateFrontPageBannerStrings ( ConvertMemorySizeToString ((UINT32)InstalledMemory, &NewString ); UiCustomizeFrontPageBanner (3, FALSE, &NewString); HiiSetString (gFrontPagePrivate.HiiHandle, STRING_TOKEN (STR_FRONT_PAGE_MEMORY_SIZE), NewString, NULL); - FreePool (NewString); + FreePool(NewString); } /** @@ -697,7 +697,7 @@ UiSetConsoleMode ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -706,7 +706,7 @@ UiSetConsoleMode ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -754,7 +754,7 @@ UiSetConsoleMode ( &SizeOfInfo, &Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Info->HorizontalResolution == NewHorizontalResolution) && (Info->VerticalResolution == NewVerticalResolution)) { if ((GraphicsOutput->Mode->Info->HorizontalResolution == NewHorizontalResolution) && @@ -763,12 +763,12 @@ UiSetConsoleMode ( // Current resolution is same with required resolution, check if text mode need be set // Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (CurrentColumn == NewColumns && CurrentRow == NewRows) { // // If current text mode is same with required text mode. Do nothing // - FreePool (Info); + FreePool(Info); return EFI_SUCCESS; } else { // @@ -782,15 +782,15 @@ UiSetConsoleMode ( // Required text mode is supported, set it. // Status = SimpleTextOut->SetMode (SimpleTextOut, Index); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Update text mode PCD. // Status = PcdSet32S (PcdConOutColumn, mSetupTextModeColumn); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutRow, mSetupTextModeRow); - ASSERT_EFI_ERROR (Status); - FreePool (Info); + ASSERT_EFI_ERROR(Status); + FreePool(Info); return EFI_SUCCESS; } } @@ -799,7 +799,7 @@ UiSetConsoleMode ( // // If required text mode is not supported, return error. // - FreePool (Info); + FreePool(Info); return EFI_UNSUPPORTED; } } @@ -809,13 +809,13 @@ UiSetConsoleMode ( // In this case, the driver which produces simple text out need be restarted. // Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber); - if (!EFI_ERROR (Status)) { - FreePool (Info); + if (!EFI_ERROR(Status)) { + FreePool(Info); break; } } } - FreePool (Info); + FreePool(Info); } } @@ -831,13 +831,13 @@ UiSetConsoleMode ( // Set PCD to Inform Consplitter to change text mode. // Status = PcdSet32S (PcdVideoHorizontalResolution, NewHorizontalResolution); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdVideoVerticalResolution, NewVerticalResolution); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutColumn, NewColumns); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutRow, NewRows); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Video mode is changed, so restart graphics console driver and higher level driver. @@ -851,7 +851,7 @@ UiSetConsoleMode ( &HandleCount, &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleCount; Index++) { gBS->DisconnectController (HandleBuffer[Index], NULL, NULL); } @@ -859,7 +859,7 @@ UiSetConsoleMode ( gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } } @@ -902,7 +902,7 @@ InitializeUserInterface ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -911,7 +911,7 @@ InitializeUserInterface ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -1007,7 +1007,7 @@ UiEntry ( // Boot Logo is corrupted, report it using Boot Logo protocol. // Status = gBS->LocateProtocol (&gEfiBootLogoProtocolGuid, NULL, (VOID **) &BootLogo); - if (!EFI_ERROR (Status) && (BootLogo != NULL)) { + if (!EFI_ERROR(Status) && (BootLogo != NULL)) { BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0); } @@ -1018,7 +1018,7 @@ UiEntry ( FreeFrontPage (); if (mLanguageString != NULL) { - FreePool (mLanguageString); + FreePool(mLanguageString); mLanguageString = NULL; } @@ -1104,8 +1104,8 @@ SetupResetReminder ( CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, StringBuffer1, StringBuffer2, NULL); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); - FreePool (StringBuffer1); - FreePool (StringBuffer2); + FreePool(StringBuffer1); + FreePool(StringBuffer2); gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); } diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c index c9823e565..9f5f29d7e 100644 --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c @@ -141,14 +141,14 @@ LanguageChangeHandler ( AsciiStrSize (Lang), Lang ); - if (EFI_ERROR (Status)) { - FreePool (Lang); + if (EFI_ERROR(Status)) { + FreePool(Lang); return EFI_DEVICE_ERROR; } } else { ASSERT (FALSE); } - FreePool (Lang); + FreePool(Lang); return EFI_SUCCESS; } @@ -307,7 +307,7 @@ UiCreateLanguageMenu ( ASSERT (gLanguageToken != NULL); Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &HiiString); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); LangCode = gLanguageString; OptionCount = 0; @@ -320,10 +320,10 @@ UiCreateLanguageMenu ( StringBuffer = AllocateZeroPool (StringSize); ASSERT (StringBuffer != NULL); Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { LangSize = AsciiStrSize (Lang); StringBuffer = AllocatePool (LangSize * sizeof (CHAR16)); ASSERT (StringBuffer != NULL); @@ -332,7 +332,7 @@ UiCreateLanguageMenu ( ASSERT (StringBuffer != NULL); gLanguageToken[OptionCount] = HiiSetString (HiiHandle, 0, StringBuffer, NULL); - FreePool (StringBuffer); + FreePool(StringBuffer); OptionCount++; } @@ -348,7 +348,7 @@ UiCreateLanguageMenu ( while (*LangCode != 0) { GetNextLanguage (&LangCode, Lang); - if (CurrentLang != NULL && AsciiStrCmp (Lang, CurrentLang) == 0) { + if (CurrentLang != NULL && AsciiStrCmp(Lang, CurrentLang) == 0) { HiiCreateOneOfOptionOpCode ( OptionsOpCodeHandle, gLanguageToken[OptionCount], @@ -371,9 +371,9 @@ UiCreateLanguageMenu ( } if (CurrentLang != NULL) { - FreePool (CurrentLang); + FreePool(CurrentLang); } - FreePool (Lang); + FreePool(Lang); HiiCreateOneOfOpCode ( StartOpCodeHandle, @@ -475,7 +475,7 @@ ExtractDevicePathFromHiiHandle ( } Status = gHiiDatabase->GetPackageListHandle (gHiiDatabase, Handle, &DriverHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -513,7 +513,7 @@ RequiredDriver ( BOOLEAN RetVal; Status = HiiGetFormSetFromHiiHandle(HiiHandle, &Buffer,&BufferSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -543,7 +543,7 @@ RequiredDriver ( } } - FreePool (Buffer); + FreePool(Buffer); return RetVal; } @@ -581,7 +581,7 @@ UiListThirdPartyDrivers ( BOOLEAN EmptyLineAfter; if (gHiiDriverList != NULL) { - FreePool (gHiiDriverList); + FreePool(gHiiDriverList); } HiiHandles = HiiGetHiiHandles (NULL); @@ -607,13 +607,13 @@ UiListThirdPartyDrivers ( // EmptyLineAfter = FALSE; if (SpecialHandlerFn (String, &NewName, &EmptyLineAfter)) { - FreePool (String); + FreePool(String); String = NewName; DriverListPtr[Count].EmptyLineAfter = EmptyLineAfter; } } DriverListPtr[Count].PromptId = HiiSetString (HiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); String = HiiGetString (HiiHandles[Index], TokenHelp, NULL); if (String == NULL) { @@ -621,12 +621,12 @@ UiListThirdPartyDrivers ( ASSERT (String != NULL); } DriverListPtr[Count].HelpId = HiiSetString (HiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); DevicePathStr = ExtractDevicePathFromHiiHandle(HiiHandles[Index]); if (DevicePathStr != NULL){ DriverListPtr[Count].DevicePathId = HiiSetString (HiiHandle, 0, DevicePathStr, NULL); - FreePool (DevicePathStr); + FreePool(DevicePathStr); } else { DriverListPtr[Count].DevicePathId = 0; } @@ -645,7 +645,7 @@ UiListThirdPartyDrivers ( } } - FreePool (HiiHandles); + FreePool(HiiHandles); Index = 0; while (gHiiDriverList[Index].PromptId != 0) { diff --git a/MdeModulePkg/Application/VariableInfo/VariableInfo.c b/MdeModulePkg/Application/VariableInfo/VariableInfo.c index f213471e9..127adfbe1 100644 --- a/MdeModulePkg/Application/VariableInfo/VariableInfo.c +++ b/MdeModulePkg/Application/VariableInfo/VariableInfo.c @@ -55,7 +55,7 @@ GetVariableStatisticsData ( SmmVariableFunctionHeader->Function = SMM_VARIABLE_FUNCTION_GET_STATISTICS; Status = mSmmCommunication->Communicate (mSmmCommunication, SmmCommunicateHeader, SmmCommunicateSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SmmVariableFunctionHeader->ReturnStatus; return Status; @@ -88,12 +88,12 @@ PrintInfoFromSmm ( UINTN MaxSize; Status = gBS->LocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOID **) &Smmvariable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -103,7 +103,7 @@ PrintInfoFromSmm ( &gEdkiiPiSmmCommunicationRegionTableGuid, (VOID **) &PiSmmCommunicationRegionTable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT (PiSmmCommunicationRegionTable != NULL); @@ -135,7 +135,7 @@ PrintInfoFromSmm ( return Status; } - if (EFI_ERROR (Status) || (CommSize <= SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE)) { + if (EFI_ERROR(Status) || (CommSize <= SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE)) { break; } @@ -165,7 +165,7 @@ PrintInfoFromSmm ( return Status; } - if (EFI_ERROR (Status) || (CommSize <= SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE)) { + if (EFI_ERROR(Status) || (CommSize <= SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE)) { break; } @@ -212,18 +212,18 @@ UefiMain ( VARIABLE_INFO_ENTRY *Entry; Status = EfiGetSystemConfigurationTable (&gEfiVariableGuid, (VOID **)&Entry); - if (EFI_ERROR (Status) || (Entry == NULL)) { + if (EFI_ERROR(Status) || (Entry == NULL)) { Status = EfiGetSystemConfigurationTable (&gEfiAuthenticatedVariableGuid, (VOID **)&Entry); } - if (EFI_ERROR (Status) || (Entry == NULL)) { + if (EFI_ERROR(Status) || (Entry == NULL)) { Status = PrintInfoFromSmm (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return Status; } } - if (!EFI_ERROR (Status) && (Entry != NULL)) { + if (!EFI_ERROR(Status) && (Entry != NULL)) { Print (L"Non-Volatile EFI Variables:\n"); VariableInfo = Entry; do { diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c index 8c491bd13..95f7ef128 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c @@ -649,7 +649,7 @@ AhciStartCommand ( Port, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -778,7 +778,7 @@ AhciPioTransfer ( &PhyAddr, &MapData ); - if (EFI_ERROR (Status) || (MapLength != DataCount)) { + if (EFI_ERROR(Status) || (MapLength != DataCount)) { DEBUG ((DEBUG_ERROR, "%a: Fail to map data buffer.\n", __FUNCTION__)); return EFI_OUT_OF_RESOURCES; } @@ -841,7 +841,7 @@ AhciPioTransfer ( 0, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -860,7 +860,7 @@ AhciPioTransfer ( D2hFisReceived = FALSE; Offset = FisBaseAddr + AHCI_PIO_FIS_OFFSET; Status = AhciCheckMemSet (Offset, AHCI_FIS_TYPE_MASK, AHCI_FIS_PIO_SETUP); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "%a: PioFisReceived.\n", __FUNCTION__)); PioFisReceived = TRUE; } @@ -873,7 +873,7 @@ AhciPioTransfer ( // Offset = FisBaseAddr + AHCI_D2H_FIS_OFFSET; Status = AhciCheckMemSet (Offset, AHCI_FIS_TYPE_MASK, AHCI_FIS_REGISTER_D2H); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "%a: D2hFisReceived.\n", __FUNCTION__)); D2hFisReceived = TRUE; } @@ -917,7 +917,7 @@ AhciPioTransfer ( AHCI_FIS_REGISTER_D2H, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: AhciWaitMemSet (%r)\n", __FUNCTION__, Status)); goto Exit; } @@ -1027,7 +1027,7 @@ AhciNonDataTransfer ( 0, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1043,7 +1043,7 @@ AhciNonDataTransfer ( Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1318,7 +1318,7 @@ AhciCreateTransferDescriptor ( &DeviceAddress, &Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } ASSERT (DeviceAddress == ((EFI_PHYSICAL_ADDRESS) (UINTN) Base)); @@ -1339,7 +1339,7 @@ AhciCreateTransferDescriptor ( &DeviceAddress, &Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -1360,7 +1360,7 @@ AhciCreateTransferDescriptor ( &DeviceAddress, &Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -1614,7 +1614,7 @@ CreateNewDevice ( DeviceData->Private = Private; Status = IdentifyAtaDevice (DeviceData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1667,7 +1667,7 @@ AhciModeInitialization ( AhciBar = Private->MmioBase; Status = AhciReset (AhciBar, AHCI_PEI_RESET_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: AHCI HBA reset failed with %r.\n", __FUNCTION__, Status)); return EFI_DEVICE_ERROR; } @@ -1686,7 +1686,7 @@ AhciModeInitialization ( } Status = AhciCreateTransferDescriptor (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: Transfer-related data allocation failed with %r.\n", @@ -1721,7 +1721,7 @@ AhciModeInitialization ( // for (PortIndex = 1; PortIndex <= MaxPortNumber; PortIndex ++) { Status = AhciGetPortFromMap (PortInitializeBitMap, PortIndex, &Port); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No more available port, just break out of the loop. // @@ -1840,7 +1840,7 @@ AhciModeInitialization ( 0x00000101, 160000000 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: Error occured when waiting for the first D2H register FIS - %r\n", @@ -1852,7 +1852,7 @@ AhciModeInitialization ( Data = AhciReadReg (AhciBar, Offset); if ((Data & AHCI_ATAPI_SIG_MASK) == AHCI_ATA_DEVICE_SIG) { Status = AhciIdentify (Private, Port, 0, PortIndex - 1, &IdentifyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: AhciIdentify() failed with %r\n", __FUNCTION__, Status)); continue; } diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c index 31b072c11..100b86233 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c @@ -145,7 +145,7 @@ AtaAhciPeimEntry ( // Get the current boot mode. // Status = PeiServicesGetBootMode (&BootMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: Fail to get the current boot mode.\n", __FUNCTION__)); return Status; } @@ -159,7 +159,7 @@ AtaAhciPeimEntry ( NULL, (VOID **) &AhciHcPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: Failed to locate AtaAhciHostControllerPpi.\n", __FUNCTION__)); return EFI_UNSUPPORTED; } @@ -175,7 +175,7 @@ AtaAhciPeimEntry ( // // When status is error, meant no controller is found. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -185,7 +185,7 @@ AtaAhciPeimEntry ( &DevicePathLength, &DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: Fail to allocate get the device path for Controller %d.\n", __FUNCTION__, Controller @@ -197,7 +197,7 @@ AtaAhciPeimEntry ( // Check validity of the device path of the ATA AHCI controller. // Status = AhciIsHcDevicePathValid (DevicePath, DevicePathLength); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: The device path is invalid for Controller %d.\n", __FUNCTION__, Controller @@ -248,7 +248,7 @@ AtaAhciPeimEntry ( InitializeListHead (&Private->DeviceList); Status = AhciModeInitialization (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: Controller initialization fail for Controller %d with Status - %r.\n", diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c index e7c7a3953..eea829b18 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c @@ -109,7 +109,7 @@ AccessAtaDevice ( (UINT32) TransferBlockNumber, FALSE // Read ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c index bf0489fa6..5509abb13 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c @@ -61,7 +61,7 @@ AhciS3GetEumeratePorts ( } Status = RestoreLockBox (&gS3StorageDeviceInitListGuid, S3InitDevices, &S3InitDevicesLength); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return 0; } } @@ -82,7 +82,7 @@ AhciS3GetEumeratePorts ( &DevicePathInstLength, &EntireEnd ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiStorageSecurity.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiStorageSecurity.c index 1bc25a788..6ddd1943b 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiStorageSecurity.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiStorageSecurity.c @@ -133,7 +133,7 @@ AhciStorageSecurityGetDevicePath ( DevicePathLength, DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Ata/AhciPei/DmaMem.c b/MdeModulePkg/Bus/Ata/AhciPei/DmaMem.c index 3a506d8c2..f84c309e9 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/DmaMem.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/DmaMem.c @@ -30,7 +30,7 @@ GetIoMmu ( NULL, (VOID **) &IoMmu ); - if (!EFI_ERROR (Status) && (IoMmu != NULL)) { + if (!EFI_ERROR(Status) && (IoMmu != NULL)) { return IoMmu; } @@ -80,7 +80,7 @@ IoMmuMap ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } switch (Operation) { @@ -105,7 +105,7 @@ IoMmuMap ( *Mapping, Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -188,7 +188,7 @@ IoMmuAllocateBuffer ( HostAddress, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -201,7 +201,7 @@ IoMmuAllocateBuffer ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } Status = IoMmu->SetAttribute ( @@ -209,7 +209,7 @@ IoMmuAllocateBuffer ( *Mapping, EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -218,7 +218,7 @@ IoMmuAllocateBuffer ( Pages, &HostPhyAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } *HostAddress = (VOID *)(UINTN)HostPhyAddress; diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c index 00aa7e686..da1c10f9c 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c @@ -358,7 +358,7 @@ AhciDumpPortStatus ( Offset = FisBaseAddr + EFI_AHCI_D2H_FIS_OFFSET; Status = AhciCheckMemSet (Offset, EFI_AHCI_FIS_TYPE_MASK, EFI_AHCI_FIS_REGISTER_D2H, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If D2H FIS is received, update StatusBlock with its content. // @@ -705,7 +705,7 @@ AhciPioTransfer ( &Map ); - if (EFI_ERROR (Status) || (DataCount != MapLength)) { + if (EFI_ERROR(Status) || (DataCount != MapLength)) { return EFI_BAD_BUFFER_SIZE; } @@ -739,7 +739,7 @@ AhciPioTransfer ( 0, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -759,7 +759,7 @@ AhciPioTransfer ( D2hFisReceived = FALSE; Offset = FisBaseAddr + EFI_AHCI_PIO_FIS_OFFSET; Status = AhciCheckMemSet (Offset, EFI_AHCI_FIS_TYPE_MASK, EFI_AHCI_FIS_PIO_SETUP, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PioFisReceived = TRUE; } // @@ -771,7 +771,7 @@ AhciPioTransfer ( // Offset = FisBaseAddr + EFI_AHCI_D2H_FIS_OFFSET; Status = AhciCheckMemSet (Offset, EFI_AHCI_FIS_TYPE_MASK, EFI_AHCI_FIS_REGISTER_D2H, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { D2hFisReceived = TRUE; } @@ -815,7 +815,7 @@ AhciPioTransfer ( Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -954,7 +954,7 @@ AhciDmaTransfer ( &Map ); - if (EFI_ERROR (Status) || (DataCount != MapLength)) { + if (EFI_ERROR(Status) || (DataCount != MapLength)) { return EFI_BAD_BUFFER_SIZE; } @@ -991,7 +991,7 @@ AhciDmaTransfer ( 0, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } } @@ -1020,7 +1020,7 @@ AhciDmaTransfer ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1140,7 +1140,7 @@ AhciNonDataTransfer ( 0, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1156,7 +1156,7 @@ AhciNonDataTransfer ( Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1275,7 +1275,7 @@ AhciStartCommand ( Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1430,7 +1430,7 @@ AhciAtaSmartReturnStatusCheck ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_ATA_BUS_SMART_DISABLED) @@ -1548,7 +1548,7 @@ AhciAtaSmartSupport ( ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Send S.M.A.R.T AutoSave command to device // @@ -1573,7 +1573,7 @@ AhciAtaSmartSupport ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = AhciAtaSmartReturnStatusCheck ( PciIo, AhciRegisters, @@ -1920,7 +1920,7 @@ AhciCreateTransferDescriptor ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -1939,7 +1939,7 @@ AhciCreateTransferDescriptor ( &AhciRegisters->MapRFis ); - if (EFI_ERROR (Status) || (Bytes != MaxReceiveFisSize)) { + if (EFI_ERROR(Status) || (Bytes != MaxReceiveFisSize)) { // // Map error or unable to map the whole RFis buffer into a contiguous region. // @@ -1971,7 +1971,7 @@ AhciCreateTransferDescriptor ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free mapped resource. // @@ -1994,7 +1994,7 @@ AhciCreateTransferDescriptor ( &AhciRegisters->MapCmdList ); - if (EFI_ERROR (Status) || (Bytes != MaxCommandListSize)) { + if (EFI_ERROR(Status) || (Bytes != MaxCommandListSize)) { // // Map error or unable to map the whole cmd list buffer into a contiguous region. // @@ -2027,7 +2027,7 @@ AhciCreateTransferDescriptor ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free mapped resource. // @@ -2050,7 +2050,7 @@ AhciCreateTransferDescriptor ( &AhciRegisters->MapCommandTable ); - if (EFI_ERROR (Status) || (Bytes != MaxCommandTableSize)) { + if (EFI_ERROR(Status) || (Bytes != MaxCommandTableSize)) { // // Map error or unable to map the whole cmd list buffer into a contiguous region. // @@ -2246,7 +2246,7 @@ AhciEnableDevSlp ( ); DEBUG ((DEBUG_INFO, "DevSlp set feature for device at port [%d] PortMultiplier [%d] - %r\n", Port, PortMultiplier, Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -2267,7 +2267,7 @@ AhciEnableDevSlp ( PortDevSlp &= ~AHCI_PORT_DEVSLP_MDAT_MASK; AhciWriteReg (PciIo, Offset + AHCI_PORT_DEVSLP, PortDevSlp); DEBUG ((DEBUG_INFO, "Read Log Ext at port [%d] PortMultiplier [%d] - %r\n", Port, PortMultiplier, Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Assume DEVSLP TIMING VARIABLES is not supported if the Identify Device Data log (30h, 8) fails // @@ -2350,7 +2350,7 @@ AhciSpinUpDisk ( ); DEBUG ((DEBUG_INFO, "CMD_PUIS_SET_DEVICE_SPINUP for device at port [%d] PortMultiplier [%d] - %r!\n", Port, PortMultiplier, Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -2384,7 +2384,7 @@ AhciSpinUpDisk ( ); DEBUG ((DEBUG_INFO, "Read LBA 0 for device at port [%d] PortMultiplier [%d] - %r!\n", Port, PortMultiplier, Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -2394,7 +2394,7 @@ AhciSpinUpDisk ( // ZeroMem (IdentifyData, sizeof (*IdentifyData)); Status = AhciIdentify (PciIo, AhciRegisters, Port, PortMultiplier, IdentifyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Read IDD failed for device at port [%d] PortMultiplier [%d] - %r!\n", Port, PortMultiplier, Status)); return Status; @@ -2488,7 +2488,7 @@ AhciModeInitialization ( Status = AhciReset (PciIo, EFI_AHCI_BUS_RESET_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -2517,7 +2517,7 @@ AhciModeInitialization ( EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_WARN, "AhciModeInitialization: failed to enable 64-bit DMA on 64-bit capable controller (%r)\n", Status)); @@ -2538,7 +2538,7 @@ AhciModeInitialization ( AhciRegisters = &Instance->AhciRegisters; Status = AhciCreateTransferDescriptor (PciIo, AhciRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -2666,7 +2666,7 @@ AhciModeInitialization ( 0x00000101, EFI_TIMER_PERIOD_SECONDS(16) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2674,7 +2674,7 @@ AhciModeInitialization ( if ((Data & EFI_AHCI_ATAPI_SIG_MASK) == EFI_AHCI_ATAPI_DEVICE_SIG) { Status = AhciIdentifyPacket (PciIo, AhciRegisters, Port, 0, &Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2682,7 +2682,7 @@ AhciModeInitialization ( } else if ((Data & EFI_AHCI_ATAPI_SIG_MASK) == EFI_AHCI_ATA_DEVICE_SIG) { Status = AhciIdentify (PciIo, AhciRegisters, Port, 0, &Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_NOT_DETECTED)); continue; } @@ -2703,7 +2703,7 @@ AhciModeInitialization ( 0, &Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Spin up standby device failed - %r\n", Status)); continue; } @@ -2744,7 +2744,7 @@ AhciModeInitialization ( 0, &SupportedModes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Calculate Mode Fail, Status = %r\n", Status)); continue; } @@ -2775,7 +2775,7 @@ AhciModeInitialization ( } Status = AhciDeviceSetFeature (PciIo, AhciRegisters, Port, 0, 0x03, (UINT32)(*(UINT8 *)&TransferMode), ATA_ATAPI_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status)); continue; } @@ -2805,7 +2805,7 @@ AhciModeInitialization ( Port, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "PUIS enable/disable failed, Status = %r\n", Status)); continue; } diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index e5b8f40d0..b58142433 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c @@ -204,7 +204,7 @@ AtaPassThruPassThruExecute ( // Status = GetIdeRegisterIoAddr (Instance->PciIo, Instance->IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -441,7 +441,7 @@ AsyncNonBlockingTransferRoutine ( } else { RemoveEntryList (&Task->Link); gBS->SignalEvent (Task->Event); - FreePool (Task); + FreePool(Task); } } } @@ -476,7 +476,7 @@ InitializeAtaAtapiPassThru ( &gAtaAtapiPassThruComponentName, &gAtaAtapiPassThruComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -549,7 +549,7 @@ AtaAtapiPassThruSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EFI_ALREADY_STARTED is also an error // @@ -574,7 +574,7 @@ AtaAtapiPassThruSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EFI_ALREADY_STARTED is also an error // @@ -602,7 +602,7 @@ AtaAtapiPassThruSupported ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -616,7 +616,7 @@ AtaAtapiPassThruSupported ( sizeof (PciData.Hdr.ClassCode), PciData.Hdr.ClassCode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -693,7 +693,7 @@ AtaAtapiPassThruStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Open Ide_Controller_Init Error, Status=%r", Status)); goto ErrorExit; } @@ -706,7 +706,7 @@ AtaAtapiPassThruStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Get Pci_Io Protocol Error, Status=%r", Status)); goto ErrorExit; } @@ -718,7 +718,7 @@ AtaAtapiPassThruStart ( &OriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -728,7 +728,7 @@ AtaAtapiPassThruStart ( 0, &EnabledPciAttributes ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { EnabledPciAttributes &= (UINT64)EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -738,12 +738,12 @@ AtaAtapiPassThruStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } Status = gBS->LocateProtocol (&gEdkiiAtaAtapiPolicyProtocolGuid, NULL, (VOID **)&mAtaAtapiPolicy); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If there is no AtaAtapiPolicy exposed, use the default policy. // @@ -777,7 +777,7 @@ AtaAtapiPassThruStart ( Instance, &Instance->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -785,7 +785,7 @@ AtaAtapiPassThruStart ( // Set 1ms timer. // Status = gBS->SetTimer (Instance->TimerEvent, TimerPeriodic, 10000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -793,7 +793,7 @@ AtaAtapiPassThruStart ( // Enumerate all inserted ATA devices. // Status = EnumerateAttachedDevice (Instance); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -803,7 +803,7 @@ AtaAtapiPassThruStart ( &gEfiExtScsiPassThruProtocolGuid, &(Instance->ExtScsiPassThru), NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; @@ -826,7 +826,7 @@ ErrorExit: // Remove all inserted ATA devices. // DestroyDeviceInfoList (Instance); - FreePool (Instance); + FreePool(Instance); } return EFI_UNSUPPORTED; } @@ -883,7 +883,7 @@ AtaAtapiPassThruStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -896,7 +896,7 @@ AtaAtapiPassThruStop ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -979,9 +979,9 @@ AtaAtapiPassThruStop ( Instance->OriginalPciAttributes, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - FreePool (Instance); + FreePool(Instance); return Status; } @@ -1079,7 +1079,7 @@ CreateNewDeviceInfo ( if (IdentifyData != NULL) { DeviceInfo->IdentifyData = AllocateCopyPool (sizeof (EFI_IDENTIFY_DATA), IdentifyData); if (DeviceInfo->IdentifyData == NULL) { - FreePool (DeviceInfo); + FreePool(DeviceInfo); return EFI_OUT_OF_RESOURCES; } } @@ -1112,9 +1112,9 @@ DestroyDeviceInfoList ( RemoveEntryList (&DeviceInfo->Link); if (DeviceInfo->IdentifyData != NULL) { - FreePool (DeviceInfo->IdentifyData); + FreePool(DeviceInfo->IdentifyData); } - FreePool (DeviceInfo); + FreePool(DeviceInfo); } } @@ -1155,7 +1155,7 @@ DestroyAsynTaskList ( Task->Packet->Asb->AtaStatus = 0x01; gBS->SignalEvent (Task->Event); } - FreePool (Task); + FreePool(Task); } } gBS->RestoreTPL (OldTpl); @@ -1191,7 +1191,7 @@ EnumerateAttachedDevice ( sizeof (PciData.Hdr.ClassCode), PciData.Hdr.ClassCode ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ClassCode = PciData.Hdr.ClassCode[1]; @@ -1203,7 +1203,7 @@ EnumerateAttachedDevice ( Instance->Mode = EfiAtaIdeMode; Status = IdeModeInitialization (Instance); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -1216,7 +1216,7 @@ EnumerateAttachedDevice ( Status = AhciModeInitialization (Instance); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -2074,7 +2074,7 @@ ExtScsiPassThruPassThru ( // Status = GetIdeRegisterIoAddr (Instance->PciIo, Instance->IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2098,7 +2098,7 @@ ExtScsiPassThruPassThru ( // // If the cmd doesn't get executed correctly, then check sense data. // - if (EFI_ERROR (Status) && (Packet->SenseDataLength != 0) && (*((UINT8*)Packet->Cdb) != ATA_CMD_REQUEST_SENSE)) { + if (EFI_ERROR(Status) && (Packet->SenseDataLength != 0) && (*((UINT8*)Packet->Cdb) != ATA_CMD_REQUEST_SENSE)) { PtrSenseData = AllocateAlignedPages (EFI_SIZE_TO_PAGES (sizeof (EFI_SCSI_SENSE_DATA)), This->Mode->IoAlign); if (PtrSenseData == NULL) { return EFI_DEVICE_ERROR; @@ -2113,7 +2113,7 @@ ExtScsiPassThruPassThru ( sizeof (EFI_SCSI_SENSE_DATA), Packet->Timeout ); - if (EFI_ERROR (SenseStatus)) { + if (EFI_ERROR(SenseStatus)) { break; } diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/ComponentName.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/ComponentName.c index 663f777e1..0421590c8 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/ComponentName.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/ComponentName.c @@ -206,7 +206,7 @@ AtaAtapiPassThruComponentNameGetControllerName ( gAtaAtapiPassThruDriverBinding.DriverBindingHandle, &gEfiIdeControllerInitProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -221,7 +221,7 @@ AtaAtapiPassThruComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c index ac055f004..c0cecdac0 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c @@ -751,7 +751,7 @@ GetIdeRegisterIoAddr ( &PciData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -854,7 +854,7 @@ AtaIssueCommand ( AtaCommand = AtaCommandBlock->AtaCommand; Status = WaitForBSYClear (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -868,7 +868,7 @@ AtaIssueCommand ( // Before write to all the following registers, BSY and DRQ must be 0. // Status = DRQClear2 (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -958,7 +958,7 @@ AtaPioDataInOut ( // Issue ATA command // Status = AtaIssueCommand (PciIo, IdeRegisters, AtaCommandBlock, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -992,7 +992,7 @@ AtaPioDataInOut ( // Poll DRQ bit set, data transfer can be performed only when DRQ is ready // Status = DRQReady2 (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1021,7 +1021,7 @@ AtaPioDataInOut ( } Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1031,7 +1031,7 @@ AtaPioDataInOut ( } Status = DRQClear (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1087,7 +1087,7 @@ AtaNonDataCommandIn ( // Issue ATA command // Status = AtaIssueCommand (PciIo, IdeRegisters, AtaCommandBlock, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1096,13 +1096,13 @@ AtaNonDataCommandIn ( // Wait for command completion // Status = WaitForBSYClear (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1154,7 +1154,7 @@ AtaUdmStatusWait ( do { Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; break; } @@ -1209,7 +1209,7 @@ AtaUdmStatusCheck ( Task->RetryTimes--; Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1386,7 +1386,7 @@ AtaUdmaInOut ( (VOID **)&BaseAddr, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -1399,7 +1399,7 @@ AtaUdmaInOut ( &BaseMapAddr, &PrdTableMap ); - if (EFI_ERROR (Status) || (ByteCount != EFI_PAGES_TO_SIZE (RealPageCount))) { + if (EFI_ERROR(Status) || (ByteCount != EFI_PAGES_TO_SIZE (RealPageCount))) { // // If the data length actually mapped is not equal to the requested amount, // it means the DMA operation may be broken into several discontinuous smaller chunks. @@ -1436,7 +1436,7 @@ AtaUdmaInOut ( &BufferMapAddress, &BufferMap ); - if (EFI_ERROR (Status) || (ByteCount != DataLength)) { + if (EFI_ERROR(Status) || (ByteCount != DataLength)) { PciIo->Unmap (PciIo, PrdTableMap); PciIo->FreeBuffer (PciIo, RealPageCount, (VOID*)(UINTN)BaseAddr); return EFI_OUT_OF_RESOURCES; @@ -1518,13 +1518,13 @@ AtaUdmaInOut ( // Status = AtaIssueCommand (PciIo, IdeRegisters, AtaCommandBlock, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -1705,7 +1705,7 @@ AtaPacketReadWrite ( // to see whether indicates device is ready to transfer data. // Status = DRQReady2 (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_READY) { // // Device provided less data than we intended to read, or wanted less @@ -1747,7 +1747,7 @@ AtaPacketReadWrite ( // read status register to check whether error happens. // Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1768,7 +1768,7 @@ AtaPacketReadWrite ( // read status register to check whether error happens. // Status = CheckStatusRegister (PciIo, IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1776,7 +1776,7 @@ AtaPacketReadWrite ( // After data transfer is completed, normally, DRQ bit should clear. // Status = DRQClear (PciIo, IdeRegisters, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1851,12 +1851,12 @@ AtaPacketCommandExecute ( // Issue ATA PACKET command firstly // Status = AtaIssueCommand (PciIo, IdeRegisters, &AtaCommandBlock, Packet->Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = DRQReady (PciIo, IdeRegisters, Packet->Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2057,7 +2057,7 @@ IdeAtaSmartReturnStatusCheck ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_ATA_BUS_SMART_DISABLED) @@ -2163,7 +2163,7 @@ IdeAtaSmartSupport ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Send S.M.A.R.T AutoSave command to device // @@ -2184,7 +2184,7 @@ IdeAtaSmartSupport ( ATA_ATAPI_TIMEOUT, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = IdeAtaSmartReturnStatusCheck ( Instance, Channel, @@ -2391,7 +2391,7 @@ DetectAndConfigIdeDevice ( IdeWritePortB (PciIo, IdeRegisters->CmdOrStatus, ATA_CMD_EXEC_DRIVE_DIAG); Status = WaitForBSYClear (PciIo, IdeRegisters, 350000000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG((EFI_D_ERROR, "New detecting method: Send Execute Diagnostic Command: WaitForBSYClear: Status: %d\n", Status)); continue; } @@ -2429,7 +2429,7 @@ DetectAndConfigIdeDevice ( // // if identifying ata device is failure, then try to send identify packet cmd. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_NOT_DETECTED)); DeviceType = EfiIdeCdrom; @@ -2440,13 +2440,13 @@ DetectAndConfigIdeDevice ( // // if identifying atapi device is failure, then try to send identify cmd. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DeviceType = EfiIdeHarddisk; Status = AtaIdentify (Instance, IdeChannel, IdeDevice, &Buffer, NULL); } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No device is found at this port // @@ -2483,7 +2483,7 @@ DetectAndConfigIdeDevice ( IdeDevice, &SupportedModes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Calculate Mode Fail, Status = %r\n", Status)); continue; } @@ -2502,7 +2502,7 @@ DetectAndConfigIdeDevice ( if (SupportedModes->ExtModeCount == 0){ Status = SetDeviceTransferMode (Instance, IdeChannel, IdeDevice, &TransferMode, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status)); continue; } @@ -2519,7 +2519,7 @@ DetectAndConfigIdeDevice ( TransferMode.ModeNumber = (UINT8) (SupportedModes->UdmaMode.Mode); Status = SetDeviceTransferMode (Instance, IdeChannel, IdeDevice, &TransferMode, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status)); continue; } @@ -2528,7 +2528,7 @@ DetectAndConfigIdeDevice ( TransferMode.ModeNumber = (UINT8) SupportedModes->MultiWordDmaMode.Mode; Status = SetDeviceTransferMode (Instance, IdeChannel, IdeDevice, &TransferMode, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status)); continue; } @@ -2560,7 +2560,7 @@ DetectAndConfigIdeDevice ( // Now insert the device into device list. // Status = CreateNewDeviceInfo (Instance, IdeChannel, IdeDevice, DeviceType, &Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2602,7 +2602,7 @@ IdeModeInitialization ( // Obtain IDE IO port registers' base addresses // Status = GetIdeRegisterIoAddr (PciIo, Instance->IdeRegisters); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -2618,7 +2618,7 @@ IdeModeInitialization ( &ChannelEnabled, &MaxDevices ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "[GetChannel, Status=%x]", Status)); continue; } diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c index f93afab3b..e541e81bb 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c @@ -153,7 +153,7 @@ ReleaseAtaResources ( FreeAlignedBuffer (AtaDevice->Asb, sizeof (EFI_ATA_STATUS_BLOCK)); FreeAlignedBuffer (AtaDevice->IdentifyData, sizeof (ATA_IDENTIFY_DATA)); if (AtaDevice->DevicePath != NULL) { - FreePool (AtaDevice->DevicePath); + FreePool(AtaDevice->DevicePath); } OldTpl = gBS->RaiseTPL (TPL_NOTIFY); if (!IsListEmpty (&AtaDevice->AtaSubTaskList)) { @@ -183,11 +183,11 @@ ReleaseAtaResources ( AtaTask = ATA_ASYN_TASK_FROM_ENTRY (DelEntry); RemoveEntryList (DelEntry); - FreePool (AtaTask); + FreePool(AtaTask); } } gBS->RestoreTPL (OldTpl); - FreePool (AtaDevice); + FreePool(AtaDevice); } @@ -233,7 +233,7 @@ RegisterAtaDevice ( // AtaPassThru = AtaBusDriverData->AtaPassThru; Status = AtaPassThru->BuildDevicePath (AtaPassThru, Port, PortMultiplierPort, &NewDevicePathNode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -246,9 +246,9 @@ RegisterAtaDevice ( DeviceHandle = NULL; RemainingDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { + if (!EFI_ERROR(Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { Status = EFI_ALREADY_STARTED; - FreePool (DevicePath); + FreePool(DevicePath); goto Done; } @@ -300,7 +300,7 @@ RegisterAtaDevice ( // Try to identify the ATA device via the ATA pass through command. // Status = DiscoverAtaDevice (AtaDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -314,7 +314,7 @@ RegisterAtaDevice ( AtaDevice->ModelName, TRUE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -325,7 +325,7 @@ RegisterAtaDevice ( AtaDevice->ModelName, FALSE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -349,7 +349,7 @@ RegisterAtaDevice ( &AtaDevice->DiskInfo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -365,7 +365,7 @@ RegisterAtaDevice ( EFI_NATIVE_INTERFACE, &AtaDevice->StorageSecurity ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } DEBUG ((EFI_D_INFO, "Successfully Install Storage Security Protocol on the ATA device\n")); @@ -382,10 +382,10 @@ RegisterAtaDevice ( Done: if (NewDevicePathNode != NULL) { - FreePool (NewDevicePathNode); + FreePool(NewDevicePathNode); } - if (EFI_ERROR (Status) && (AtaDevice != NULL)) { + if (EFI_ERROR(Status) && (AtaDevice != NULL)) { ReleaseAtaResources (AtaDevice); DEBUG ((EFI_D_ERROR | EFI_D_INIT, "Failed to initialize Port %x PortMultiplierPort %x, status = %r\n", Port, PortMultiplierPort, Status)); } @@ -432,7 +432,7 @@ UnregisterAtaDevice ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Locate BlockIo2 protocol // @@ -444,7 +444,7 @@ UnregisterAtaDevice ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -486,7 +486,7 @@ UnregisterAtaDevice ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiAtaPassThruProtocolGuid, @@ -510,13 +510,13 @@ UnregisterAtaDevice ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->UninstallProtocolInterface ( Handle, &gEfiStorageSecurityCommandProtocolGuid, &AtaDevice->StorageSecurity ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiAtaPassThruProtocolGuid, @@ -607,7 +607,7 @@ AtaBusDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -632,7 +632,7 @@ AtaBusDriverBindingSupported ( // if ((RemainingDevicePath != NULL) && !IsDevicePathEnd (RemainingDevicePath)) { Status = AtaPassThru->GetDevice (AtaPassThru, RemainingDevicePath, &Port, &PortMultiplierPort); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Close the I/O Abstraction(s) used to perform the supported test // @@ -731,7 +731,7 @@ AtaBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -752,7 +752,7 @@ AtaBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if ((EFI_ERROR (Status)) && (Status != EFI_ALREADY_STARTED)) { + if ((EFI_ERROR(Status)) && (Status != EFI_ALREADY_STARTED)) { goto ErrorExit; } @@ -777,7 +777,7 @@ AtaBusDriverBindingStart ( AtaBusDriverData, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -790,7 +790,7 @@ AtaBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AtaBusDriverData = NULL; goto ErrorExit; } @@ -809,7 +809,7 @@ AtaBusDriverBindingStart ( Port = 0xFFFF; while (TRUE) { Status = AtaPassThru->GetNextPort (AtaPassThru, &Port); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // We cannot find more legal port then we are done. // @@ -819,7 +819,7 @@ AtaBusDriverBindingStart ( PortMultiplierPort = 0xFFFF; while (TRUE) { Status = AtaPassThru->GetNextDevice (AtaPassThru, Port, &PortMultiplierPort); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // We cannot find more legal port multiplier port number for ATA device // on the port, then we are done. @@ -832,7 +832,7 @@ AtaBusDriverBindingStart ( Status = EFI_SUCCESS; } else if (!IsDevicePathEnd (RemainingDevicePath)) { Status = AtaPassThru->GetDevice (AtaPassThru, RemainingDevicePath, &Port, &PortMultiplierPort); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = RegisterAtaDevice (AtaBusDriverData,Port, PortMultiplierPort); } } @@ -848,7 +848,7 @@ ErrorExit: AtaBusDriverData, NULL ); - FreePool (AtaBusDriverData); + FreePool(AtaBusDriverData); } gBS->CloseProtocol ( @@ -912,14 +912,14 @@ AtaBusDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Controller, &gEfiCallerIdGuid, AtaBusDriverData, NULL ); - FreePool (AtaBusDriverData); + FreePool(AtaBusDriverData); } gBS->CloseProtocol ( @@ -937,7 +937,7 @@ AtaBusDriverBindingStop ( for (Index = 0; Index < NumberOfChildren; Index++) { Status = UnregisterAtaDevice (This, Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -978,7 +978,7 @@ AtaBlockIoReset ( Status = ResetAtaDevice (AtaDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -1207,7 +1207,7 @@ AtaBlockIoResetEx ( Status = ResetAtaDevice (AtaDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -1705,7 +1705,7 @@ InitializeAtaBus( &gAtaBusComponentName, &gAtaBusComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c index fd483cb9a..ce5ca22d3 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c @@ -423,7 +423,7 @@ DiscoverAtaDevice ( Retry = MAX_RETRY_TIMES; do { Status = AtaDevicePassThru (AtaDevice, NULL, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The command is issued successfully // @@ -571,10 +571,10 @@ FreeAtaSubTask ( FreeAlignedBuffer (Task->Packet.Asb, sizeof (EFI_ATA_STATUS_BLOCK)); } if (Task->Packet.Acb != NULL) { - FreePool (Task->Packet.Acb); + FreePool(Task->Packet.Acb); } - FreePool (Task); + FreePool(Task); } /** @@ -612,7 +612,7 @@ AtaTerminateNonBlockingTask ( gBS->SignalEvent (AtaTask->Token->Event); Entry = RemoveEntryList (Entry); - FreePool (AtaTask); + FreePool(AtaTask); } gBS->RestoreTPL (OldTpl); @@ -699,8 +699,8 @@ AtaNonBlockingCallBack ( DEBUG ((EFI_D_BLKIO, "Signal the upper layer event!\n")); } - FreePool (Task->UnsignalledEventCount); - FreePool (Task->IsError); + FreePool(Task->UnsignalledEventCount); + FreePool(Task->IsError); // @@ -719,12 +719,12 @@ AtaNonBlockingCallBack ( AtaTask->IsWrite, AtaTask->Token ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AtaTask->Token->TransactionStatus = Status; gBS->SignalEvent (AtaTask->Token->Event); } RemoveEntryList (Entry); - FreePool (AtaTask); + FreePool(AtaTask); } } @@ -835,7 +835,7 @@ AccessAtaDevice( IsError = AllocateZeroPool (sizeof (BOOLEAN)); if (IsError == NULL) { - FreePool (EventCount); + FreePool(EventCount); return EFI_OUT_OF_RESOURCES; } DEBUG ((EFI_D_BLKIO, "Allocation IsError Addr=%x\n", IsError)); @@ -896,7 +896,7 @@ AccessAtaDevice( // If resource allocation fail, the un-signalled event count should equal to // the original one minus the unassigned subtasks number. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto EXIT; } @@ -910,7 +910,7 @@ AccessAtaDevice( Status = TransferAtaDevice (AtaDevice, NULL, Buffer, StartLba, (UINT32) TransferBlockNumber, IsWrite, NULL); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -924,15 +924,15 @@ EXIT: // // Release resource at non-blocking mode. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); Token->TransactionStatus = Status; *EventCount = (*EventCount) - (TempCount - Index); *IsError = TRUE; if (*EventCount == 0) { - FreePool (EventCount); - FreePool (IsError); + FreePool(EventCount); + FreePool(IsError); } if (SubTask != NULL) { @@ -1043,7 +1043,7 @@ TrustTransferAtaDevice ( } CopyMem (NewBuffer, Buffer, TransferLength); - FreePool (Buffer); + FreePool(Buffer); Buffer = NewBuffer; } Packet->OutDataBuffer = Buffer; diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/ComponentName.c b/MdeModulePkg/Bus/Ata/AtaBusDxe/ComponentName.c index bb219072f..e814b24aa 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/ComponentName.c @@ -191,7 +191,7 @@ AtaBusComponentNameGetControllerName ( gAtaBusDriverBinding.DriverBindingHandle, &gEfiAtaPassThruProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -202,7 +202,7 @@ AtaBusComponentNameGetControllerName ( ChildHandle, &gEfiAtaPassThruProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -216,7 +216,7 @@ AtaBusComponentNameGetControllerName ( ChildHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } AtaDevice = ATA_DEVICE_FROM_BLOCK_IO (BlockIo); diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c index ed33a51da..d5529644b 100644 --- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c +++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c @@ -271,7 +271,7 @@ CheckRemainingDevicePath ( &OpenInfoBuffer, &EntryCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -285,7 +285,7 @@ CheckRemainingDevicePath ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Find vendor device path node and compare // @@ -320,13 +320,13 @@ CheckRemainingDevicePath ( } SystemDevicePath = NextDevicePathNode (SystemDevicePath); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } } } - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); return Status; } @@ -402,11 +402,11 @@ I2cBusDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if ((EFI_ERROR (Status)) && (Status != EFI_ALREADY_STARTED)) { + if ((EFI_ERROR(Status)) && (Status != EFI_ALREADY_STARTED)) { return Status; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiI2cEnumerateProtocolGuid, @@ -424,11 +424,11 @@ I2cBusDriverSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if ((EFI_ERROR (Status)) && (Status != EFI_ALREADY_STARTED)) { + if ((EFI_ERROR(Status)) && (Status != EFI_ALREADY_STARTED)) { return Status; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -472,7 +472,7 @@ I2cBusDriverSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiI2cHostProtocolGuid, @@ -571,7 +571,7 @@ I2cBusDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { DEBUG ((EFI_D_ERROR, "I2cBus: open I2C host error, Status = %r\n", Status)); return Status; } @@ -585,7 +585,7 @@ I2cBusDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "I2cBus: open private protocol error, Status = %r.\n", Status)); return Status; } @@ -602,7 +602,7 @@ I2cBusDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { DEBUG ((EFI_D_ERROR, "I2cBus: open I2C enumerate error, Status = %r\n", Status)); goto Error; } @@ -615,7 +615,7 @@ I2cBusDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { DEBUG ((EFI_D_ERROR, "I2cBus: open device path error, Status = %r\n", Status)); goto Error; } @@ -675,7 +675,7 @@ I2cBusDriverStart ( I2cBusContext, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "I2cBus: install private protocol error, Status = %r.\n", Status)); goto Error; } @@ -689,7 +689,7 @@ I2cBusDriverStart ( return Status; Error: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "I2cBus: Start() function failed, Status = %r\n", Status)); if (ParentDevicePath != NULL) { gBS->CloseProtocol ( @@ -725,7 +725,7 @@ Error: I2cBusContext, NULL ); - FreePool (I2cBusContext); + FreePool(I2cBusContext); } } @@ -806,7 +806,7 @@ I2cBusDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Controller, &gEfiCallerIdGuid, @@ -816,7 +816,7 @@ I2cBusDriverStop ( // // No more child now, free bus context data. // - FreePool (I2cBusContext); + FreePool(I2cBusContext); } return Status; } @@ -826,7 +826,7 @@ I2cBusDriverStop ( for (Index = 0; Index < NumberOfChildren; Index++) { Status = UnRegisterI2cDevice (This, Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -908,7 +908,7 @@ RegisterI2cDevice ( // Get the next I2C device // Status = I2cBusContext->I2cEnumerate->Enumerate (I2cBusContext->I2cEnumerate, &Device); - if (EFI_ERROR (Status) || Device == NULL) { + if (EFI_ERROR(Status) || Device == NULL) { if (RemainingDevicePath != NULL) { Status = EFI_NOT_FOUND; } else { @@ -937,7 +937,7 @@ RegisterI2cDevice ( // Get the next I2C device // Status = I2cBusContext->I2cEnumerate->Enumerate (I2cBusContext->I2cEnumerate, &TempDevice); - if (EFI_ERROR (Status) || TempDevice == NULL) { + if (EFI_ERROR(Status) || TempDevice == NULL) { Status = EFI_SUCCESS; break; } @@ -987,8 +987,8 @@ RegisterI2cDevice ( // Build the device path // Status = I2cBusDevicePathAppend (I2cDeviceContext, BuildControllerNode); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { continue; } @@ -1002,7 +1002,7 @@ RegisterI2cDevice ( &gEfiDevicePathProtocolGuid, I2cDeviceContext->DevicePath, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free resources for this I2C device // @@ -1021,7 +1021,7 @@ RegisterI2cDevice ( I2cDeviceContext->Handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->UninstallMultipleProtocolInterfaces ( I2cDeviceContext->Handle, &gEfiDevicePathProtocolGuid, @@ -1188,10 +1188,10 @@ ReleaseI2cDeviceContext ( } if (I2cDeviceContext->DevicePath != NULL) { - FreePool (I2cDeviceContext->DevicePath); + FreePool(I2cDeviceContext->DevicePath); } - FreePool (I2cDeviceContext); + FreePool(I2cDeviceContext); } /** @@ -1230,7 +1230,7 @@ UnRegisterI2cDevice ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1262,7 +1262,7 @@ UnRegisterI2cDevice ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Keep parent and child relationship // @@ -1330,7 +1330,7 @@ I2cBusDevicePathAppend ( I2cDeviceContext->DevicePath, (EFI_DEVICE_PATH_PROTOCOL *) &gControllerDevicePathTemplate ); - gBS->FreePool (PreviousDevicePath); + gBS->FreePool(PreviousDevicePath); ASSERT (I2cDeviceContext->DevicePath != NULL); if (I2cDeviceContext->DevicePath == NULL) { return EFI_OUT_OF_RESOURCES; @@ -1371,7 +1371,7 @@ InitializeI2cBus( &gI2cBusComponentName, &gI2cBusComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; @@ -1415,7 +1415,7 @@ I2cBusUnload ( &DeviceHandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Disconnect the driver specified by Driver BindingHandle from all // the devices in the handle database. @@ -1426,7 +1426,7 @@ I2cBusUnload ( gI2cBusDriverBinding.DriverBindingHandle, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -1441,7 +1441,7 @@ I2cBusUnload ( &gI2cBusDriverBinding, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Note we have to one by one uninstall the following protocols. @@ -1457,7 +1457,7 @@ I2cBusUnload ( &gEfiComponentNameProtocolGuid, (VOID **) &ComponentName ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallProtocolInterface ( gI2cBusDriverBinding.DriverBindingHandle, &gEfiComponentNameProtocolGuid, @@ -1470,7 +1470,7 @@ I2cBusUnload ( &gEfiComponentName2ProtocolGuid, (VOID **) &ComponentName2 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallProtocolInterface ( gI2cBusDriverBinding.DriverBindingHandle, &gEfiComponentName2ProtocolGuid, @@ -1485,7 +1485,7 @@ Done: // Free the buffer containing the list of handles from the handle database // if (DeviceHandleBuffer != NULL) { - gBS->FreePool (DeviceHandleBuffer); + gBS->FreePool(DeviceHandleBuffer); } return Status; diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.c index bb5d83927..6c4370306 100644 --- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.c +++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.c @@ -31,7 +31,7 @@ InitializeI2c( // Install driver model protocol(s). // Status = InitializeI2cHost ( ImageHandle, SystemTable ); - if ( !EFI_ERROR ( Status )) + if ( !EFI_ERROR( Status )) { Status = InitializeI2cBus ( ImageHandle, SystemTable ); } @@ -62,7 +62,7 @@ I2cUnload ( // Disconnect the drivers // Status = I2cBusUnload ( ImageHandle ); - if ( !EFI_ERROR ( Status )) { + if ( !EFI_ERROR( Status )) { Status = I2cHostUnload ( ImageHandle ); } return Status; diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c index 79c091694..d6a585bfd 100644 --- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c +++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c @@ -247,7 +247,7 @@ I2cHostDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -272,7 +272,7 @@ I2cHostDriverSupported ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -342,7 +342,7 @@ I2cHostDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "I2cHost: Open I2C bus configuration error, Status = %r\n", Status)); return Status; } @@ -358,7 +358,7 @@ I2cHostDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "I2cHost: Open I2C master error, Status = %r\n", Status)); goto Exit; } @@ -386,7 +386,7 @@ I2cHostDriverStart ( // Reset the controller // Status = I2cMaster->Reset (I2cMaster); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "I2cHost: I2C controller reset failed!\n")); goto Exit; } @@ -401,7 +401,7 @@ I2cHostDriverStart ( I2cHostContext, &I2cHostContext->I2cEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "I2cHost: create complete event error, Status = %r\n", Status)); goto Exit; } @@ -416,7 +416,7 @@ I2cHostDriverStart ( I2cHostContext, &I2cHostContext->I2cBusConfigurationEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "I2cHost: create bus available event error, Status = %r\n", Status)); goto Exit; } @@ -437,7 +437,7 @@ I2cHostDriverStart ( NULL ); Exit: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "I2cHost: Start() function failed, Status = %r\n", Status)); if (I2cBusConfigurationManagement != NULL) { gBS->CloseProtocol ( @@ -462,7 +462,7 @@ Exit: // Release the context structure upon failure // if (I2cHostContext != NULL) { - FreePool (I2cHostContext); + FreePool(I2cHostContext); } } @@ -527,7 +527,7 @@ I2cHostDriverStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -560,7 +560,7 @@ I2cHostDriverStop ( // Leave critical section // gBS->RestoreTPL (TplPrevious); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiI2cBusConfigurationManagementProtocolGuid, @@ -581,7 +581,7 @@ I2cHostDriverStop ( I2cHostContext->I2cEvent = NULL; } - FreePool (I2cHostContext); + FreePool(I2cHostContext); } // @@ -627,7 +627,7 @@ I2cHostI2cBusConfigurationAvailable ( // // Validate the completion status // - if (EFI_ERROR (I2cHostContext->Status)) { + if (EFI_ERROR(I2cHostContext->Status)) { // // Setting I2C bus configuration failed before // @@ -668,7 +668,7 @@ I2cHostI2cBusConfigurationAvailable ( &I2cHostContext->Status ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG((DEBUG_ERROR, "I2cHostI2cBusConfigurationAvailable: Error starting I2C operation, %r\n", Status)); } } @@ -719,8 +719,8 @@ I2cHostRequestComplete ( // Done with this request, remove the current request from list // RemoveEntryList (&I2cRequest->Link); - FreePool (I2cRequest->RequestPacket); - FreePool (I2cRequest); + FreePool(I2cRequest->RequestPacket); + FreePool(I2cRequest); // // If there is more I2C request, start next one @@ -971,7 +971,7 @@ I2cHostQueueRequest ( NULL, &SyncEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1103,7 +1103,7 @@ InitializeI2cHost( &gI2cHostComponentName, &gI2cHostComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -1145,7 +1145,7 @@ I2cHostUnload ( &DeviceHandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Disconnect the driver specified by ImageHandle from all // the devices in the handle database. @@ -1156,7 +1156,7 @@ I2cHostUnload ( ImageHandle, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -1171,7 +1171,7 @@ I2cHostUnload ( &gI2cHostDriverBinding, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Note we have to one by one uninstall the following protocols. @@ -1187,7 +1187,7 @@ I2cHostUnload ( &gEfiComponentNameProtocolGuid, (VOID **) &ComponentName ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallProtocolInterface ( gI2cHostDriverBinding.DriverBindingHandle, &gEfiComponentNameProtocolGuid, @@ -1200,7 +1200,7 @@ I2cHostUnload ( &gEfiComponentName2ProtocolGuid, (VOID **) &ComponentName2 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallProtocolInterface ( gI2cHostDriverBinding.DriverBindingHandle, &gEfiComponentName2ProtocolGuid, @@ -1215,7 +1215,7 @@ Done: // Free the buffer containing the list of handles from the handle database // if (DeviceHandleBuffer != NULL) { - gBS->FreePool (DeviceHandleBuffer); + gBS->FreePool(DeviceHandleBuffer); } return Status; diff --git a/MdeModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.c b/MdeModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.c index af4041081..f1f4703f8 100644 --- a/MdeModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.c +++ b/MdeModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.c @@ -59,7 +59,7 @@ IsaBusDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiIsaHcProtocolGuid, @@ -68,7 +68,7 @@ IsaBusDriverBindingSupported ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -80,7 +80,7 @@ IsaBusDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -141,8 +141,8 @@ IsaBusCreateChild ( &gEfiCallerIdGuid, Child, NULL ); - if (EFI_ERROR (Status)) { - FreePool (Child); + if (EFI_ERROR(Status)) { + FreePool(Child); return Status; } @@ -196,7 +196,7 @@ IsaBusDestroyChild ( ChildHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -213,15 +213,15 @@ IsaBusDestroyChild ( gIsaBusDriverBinding.DriverBindingHandle, ChildHandle ); - ASSERT_EFI_ERROR (Status); - if (!EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (!EFI_ERROR(Status)) { Status = gBS->UninstallMultipleProtocolInterfaces ( ChildHandle, &gEfiIsaHcProtocolGuid, Private->IsaHc, &gEfiCallerIdGuid, Child, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Private->IsaHcHandle, &gEfiIsaHcProtocolGuid, @@ -233,10 +233,10 @@ IsaBusDestroyChild ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Child->InDestroying = FALSE; } else { - FreePool (Child); + FreePool(Child); } return Status; @@ -295,7 +295,7 @@ IsaBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -307,7 +307,7 @@ IsaBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiIsaHcProtocolGuid, @@ -327,7 +327,7 @@ IsaBusDriverBindingStart ( &gEfiIsaHcServiceBindingProtocolGuid, &Private->ServiceBinding, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -370,7 +370,7 @@ IsaBusDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -382,7 +382,7 @@ IsaBusDriverBindingStop ( &gEfiIsaHcServiceBindingProtocolGuid, &Private->ServiceBinding, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -395,7 +395,7 @@ IsaBusDriverBindingStop ( This->DriverBindingHandle, Controller ); - FreePool (Private); + FreePool(Private); } return Status; @@ -404,7 +404,7 @@ IsaBusDriverBindingStop ( AllChildrenStopped = TRUE; for (Index = 0; Index < NumberOfChildren; Index++) { Status = ServiceBinding->DestroyChild (ServiceBinding, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -450,6 +450,6 @@ InitializeIsaBus ( &gIsaBusComponentName, &gIsaBusComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/ComponentName.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/ComponentName.c index 3d2e9de67..b0ea5c850 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/ComponentName.c @@ -316,7 +316,7 @@ Ps2KeyboardComponentNameGetControllerName ( // Check Controller's handle // Status = EfiTestManagedDevice (ControllerHandle, gKeyboardControllerDriver.DriverBindingHandle, &gEfiSioProtocolGuid); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -330,7 +330,7 @@ Ps2KeyboardComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c index 87f6efd8d..0bfb23445 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c @@ -1066,7 +1066,7 @@ UpdateStatusLights ( // Send keyboard command // Status = KeyboardWrite (ConsoleIn, 0xed); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1090,7 +1090,7 @@ UpdateStatusLights ( Status = KeyboardWrite (ConsoleIn, Command); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1166,7 +1166,7 @@ KeyGetchar ( Extend1 = FALSE; ScancodeArrPos = 0; Status = GetScancodeBufHead (&ConsoleIn->ScancodeQueue, ScancodeArrPos + 1, ScancodeArr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -1177,7 +1177,7 @@ KeyGetchar ( Extend0 = TRUE; ScancodeArrPos = 1; Status = GetScancodeBufHead (&ConsoleIn->ScancodeQueue, ScancodeArrPos + 1, ScancodeArr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } } else if (ScancodeArr[ScancodeArrPos] == SCANCODE_EXTENDED1) { @@ -1187,7 +1187,7 @@ KeyGetchar ( Extend1 = TRUE; ScancodeArrPos = 2; Status = GetScancodeBufHead (&ConsoleIn->ScancodeQueue, ScancodeArrPos + 1, ScancodeArr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } } @@ -1195,7 +1195,7 @@ KeyGetchar ( // if we reach this position, scancodes for a key is in buffer now,pop them // Status = PopScancodeBufHead (&ConsoleIn->ScancodeQueue, ScancodeArrPos + 1, ScancodeArr); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // store the last available byte, this byte of scancode will be checked @@ -1499,7 +1499,7 @@ InitKeyboard ( // output buffer full bits within MAX TRY times // if ((KeyReadStatusRegister (ConsoleIn) & KEYBOARD_STATUS_REGISTER_HAS_OUTPUT_DATA) != 0) { - while (!EFI_ERROR (Status) && TryTime < KEYBOARD_MAX_TRY) { + while (!EFI_ERROR(Status) && TryTime < KEYBOARD_MAX_TRY) { Status = KeyboardRead (ConsoleIn, &CommandByte); TryTime ++; } @@ -1534,13 +1534,13 @@ InitKeyboard ( // Read the command byte of 8042 controller // Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_READ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"\n\r"); goto Done; } Status = KeyboardRead (ConsoleIn, &CommandByte); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"\n\r"); goto Done; } @@ -1566,13 +1566,13 @@ InitKeyboard ( // if (!PcdGetBool (PcdFastPS2Detection)) { Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"\n\r"); goto Done; } Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_MOUSE_INTERFACE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"\n\r"); goto Done; } @@ -1586,13 +1586,13 @@ InitKeyboard ( // 8042 Controller Self Test // Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_CONTROLLER_SELF_TEST); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, 0x55); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller self test failed!\n\r"); goto Done; } @@ -1626,13 +1626,13 @@ InitKeyboard ( // 0: Enable Keyboard interrupt ) // Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_WRITE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r"); goto Done; } Status = KeyboardWrite (ConsoleIn, 0x67); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!\n\r"); goto Done; } @@ -1679,13 +1679,13 @@ InitKeyboard ( // Keyboard Interface Test // Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_KEYBOARD_INTERFACE_SELF_TEST); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, 0x00); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError ( ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r" @@ -1696,13 +1696,13 @@ InitKeyboard ( // Keyboard reset with a BAT(Basic Assurance Test) // Status = KeyboardWrite (ConsoleIn, KEYBOARD_8048_COMMAND_RESET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_ACK); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r"); goto Done; } @@ -1712,7 +1712,7 @@ InitKeyboard ( mWaitForValueTimeOut = KEYBOARD_BAT_TIMEOUT; Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_BAT_SUCCESS); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Keyboard self test failed!\n\r"); goto Done; } @@ -1723,25 +1723,25 @@ InitKeyboard ( // Set Keyboard to use Scan Code Set 2 // Status = KeyboardWrite (ConsoleIn, KEYBOARD_8048_COMMAND_SELECT_SCAN_CODE_SET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_ACK); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r"); goto Done; } Status = KeyboardWrite (ConsoleIn, 0x02); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_ACK); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r"); goto Done; } @@ -1750,13 +1750,13 @@ InitKeyboard ( // Clear Keyboard Scancode Buffer // Status = KeyboardWrite (ConsoleIn, KEYBOARD_8048_COMMAND_CLEAR_OUTPUT_DATA); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"8042 controller data write error!\n\r"); goto Done; } Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_ACK); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Some specific value not aquired from 8042 controller!\n\r"); goto Done; } @@ -1778,7 +1778,7 @@ InitKeyboard ( // Update Keyboard Lights // Status = UpdateStatusLights (ConsoleIn); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KeyboardError (ConsoleIn, L"Update keyboard status lights error!\n\r"); goto Done; } @@ -1793,13 +1793,13 @@ Done: // Enable mouse interface // Status1 = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_ENABLE_MOUSE_INTERFACE); - if (EFI_ERROR (Status1)) { + if (EFI_ERROR(Status1)) { KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r"); return EFI_DEVICE_ERROR; } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } else { return EFI_DEVICE_ERROR; @@ -1837,7 +1837,7 @@ CheckKeyboardConnect ( KEYBOARD_KBEN ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } // @@ -1851,7 +1851,7 @@ CheckKeyboardConnect ( ); mWaitForValueTimeOut = WaitForValueTimeOutBcakup; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c index 458519cb7..540dd9b28 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c @@ -209,7 +209,7 @@ KeyboardEfiReset ( // Call InitKeyboard to initialize the keyboard // Status = InitKeyboard (ConsoleIn, ExtendedVerification); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Leave critical section and return // @@ -277,7 +277,7 @@ KeyboardReadKeyStroke ( // If there is no pending key, then return. // Status = KeyboardReadKeyStrokeWorker (ConsoleIn, &KeyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -512,7 +512,7 @@ KeyboardSetState ( } Status = UpdateStatusLights (ConsoleInDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -664,7 +664,7 @@ KeyboardUnregisterKeyNotify ( // RemoveEntryList (&CurrentNotify->NotifyEntry); - gBS->FreePool (CurrentNotify); + gBS->FreePool(CurrentNotify); Status = EFI_SUCCESS; goto Exit; } @@ -719,7 +719,7 @@ KeyNotifyProcessHandler ( // Leave critical section // gBS->RestoreTPL (OldTpl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList, Link); Link = GetNextNode (NotifyList, Link)) { diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c index 2ee3a52ee..7fbf52528 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c @@ -130,7 +130,7 @@ KbdControllerDriverSupported ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -159,7 +159,7 @@ KbdControllerDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -211,7 +211,7 @@ KbdControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -234,7 +234,7 @@ KbdControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -299,7 +299,7 @@ KbdControllerDriverStart ( ConsoleIn, &((ConsoleIn->ConIn).WaitForKey) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -314,7 +314,7 @@ KbdControllerDriverStart ( ConsoleIn, &(ConsoleIn->ConInEx.WaitForKeyEx) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -328,7 +328,7 @@ KbdControllerDriverStart ( ConsoleIn, &ConsoleIn->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -339,7 +339,7 @@ KbdControllerDriverStart ( TimerPeriodic, KEYBOARD_TIMER_INTERVAL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -352,7 +352,7 @@ KbdControllerDriverStart ( ConsoleIn, &ConsoleIn->KeyNotifyProcessEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; @@ -368,7 +368,7 @@ KbdControllerDriverStart ( // Reset the keyboard device // Status = ConsoleIn->ConInEx.Reset (&ConsoleIn->ConInEx, FeaturePcdGet (PcdPs2KbdExtendedVerification)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED; goto ErrorExit; @@ -408,7 +408,7 @@ KbdControllerDriverStart ( &ConsoleIn->ConInEx, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; } @@ -450,13 +450,13 @@ ErrorExit: // if (ConsoleIn != NULL) { Status1 = EFI_SUCCESS; - while (!EFI_ERROR (Status1) && (Status != EFI_DEVICE_ERROR)) { + while (!EFI_ERROR(Status1) && (Status != EFI_DEVICE_ERROR)) { Status1 = KeyboardRead (ConsoleIn, &Data);; } } if (ConsoleIn != NULL) { - gBS->FreePool (ConsoleIn); + gBS->FreePool(ConsoleIn); } gBS->CloseProtocol ( @@ -508,7 +508,7 @@ KbdControllerDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->OpenProtocol ( @@ -519,7 +519,7 @@ KbdControllerDriverStop ( Controller, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -544,7 +544,7 @@ KbdControllerDriverStop ( // exhaust input data just in case there is still keyboard data left // Status = EFI_SUCCESS; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = KeyboardRead (ConsoleIn, &Data);; } // @@ -558,7 +558,7 @@ KbdControllerDriverStop ( &ConsoleIn->ConInEx, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -586,7 +586,7 @@ KbdControllerDriverStop ( } KbdFreeNotifyList (&ConsoleIn->NotifyList); FreeUnicodeStringTable (ConsoleIn->ControllerNameTable); - gBS->FreePool (ConsoleIn); + gBS->FreePool(ConsoleIn); return EFI_SUCCESS; } @@ -617,7 +617,7 @@ KbdFreeNotifyList ( KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE ); RemoveEntryList (ListHead->ForwardLink); - gBS->FreePool (NotifyNode); + gBS->FreePool(NotifyNode); } return EFI_SUCCESS; @@ -653,7 +653,7 @@ InitializePs2Keyboard( &gPs2KeyboardComponentName, &gPs2KeyboardComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; diff --git a/MdeModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.c b/MdeModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.c index 4eb30276c..d0a08cce9 100644 --- a/MdeModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.c +++ b/MdeModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.c @@ -31,14 +31,14 @@ KbcSelfTest ( // Keyboard controller self test // Status = Out8042Command (SELF_TEST); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // Read return code // Status = In8042Data (&Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -49,23 +49,23 @@ KbcSelfTest ( // Set system flag // Status = Out8042Command (READ_CMD_BYTE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = In8042Data (&Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = Out8042Command (WRITE_CMD_BYTE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Data |= CMD_SYS_FLAG; Status = Out8042Data (Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -159,12 +159,12 @@ CheckKbStatus ( // Send command to read KBC command byte // Status = Out8042Command (READ_CMD_BYTE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = In8042Data (&Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -193,12 +193,12 @@ PS2MouseReset ( UINT8 Data; Status = Out8042AuxCommand (RESET_CMD, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = In8042AuxData (&Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -209,7 +209,7 @@ PS2MouseReset ( } Status = In8042AuxData (&Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -240,7 +240,7 @@ PS2MouseSetSampleRate ( // Send auxiliary command to set mouse sample rate // Status = Out8042AuxCommand (SETSR_CMD, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -267,7 +267,7 @@ PS2MouseSetResolution ( // Send auxiliary command to set mouse resolution // Status = Out8042AuxCommand (SETRE_CMD, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -352,7 +352,7 @@ PS2MouseGetPacket ( KbcDisableAux (); Count = 1; Status = PS2MouseRead (&Data, &Count, State); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { KbcEnableAux (); return EFI_NOT_READY; } @@ -375,7 +375,7 @@ PS2MouseGetPacket ( case PS2_READ_DATA_BYTE: Count = 2; Status = PS2MouseRead ((Packet + 1), &Count, State); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (KeyboardEnable) { KbcEnableKb (); } @@ -472,7 +472,7 @@ PS2MouseRead ( // Status = CheckForInput (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -480,7 +480,7 @@ PS2MouseRead ( for (BytesRead = 0; BytesRead < *BufSize; BytesRead++) { Status = WaitOutputFull (TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } Buffer[BytesRead] = IoRead8 (KBC_DATA_PORT); @@ -518,7 +518,7 @@ Out8042Command ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -527,7 +527,7 @@ Out8042Command ( IoWrite8 (KBC_CMD_STS_PORT, Command); Status = WaitInputEmpty (TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -552,7 +552,7 @@ Out8042Data ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -620,7 +620,7 @@ Out8042AuxCommand ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -629,7 +629,7 @@ Out8042AuxCommand ( IoWrite8 (KBC_CMD_STS_PORT, WRITE_AUX_DEV); Status = WaitInputEmpty (TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -641,7 +641,7 @@ Out8042AuxCommand ( // Read return code // Status = In8042AuxData (&Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -662,7 +662,7 @@ Out8042AuxCommand ( // Resend command // Status = Out8042AuxCommand (Command, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -695,7 +695,7 @@ Out8042AuxData ( // Wait keyboard controller input buffer empty // Status = WaitInputEmpty (TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -704,14 +704,14 @@ Out8042AuxData ( IoWrite8 (KBC_CMD_STS_PORT, WRITE_AUX_DEV); Status = WaitInputEmpty (TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } IoWrite8 (KBC_DATA_PORT, Data); Status = WaitInputEmpty (TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -737,7 +737,7 @@ In8042AuxData ( // wait for output data // Status = WaitOutputFull (BAT_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Isa/Ps2MouseDxe/ComponentName.c b/MdeModulePkg/Bus/Isa/Ps2MouseDxe/ComponentName.c index 3dd8efb1d..782c759bc 100644 --- a/MdeModulePkg/Bus/Isa/Ps2MouseDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Isa/Ps2MouseDxe/ComponentName.c @@ -187,7 +187,7 @@ Ps2MouseComponentNameGetControllerName ( // Status = EfiTestManagedDevice (ControllerHandle, gPS2MouseDriver.DriverBindingHandle, &gEfiSioProtocolGuid); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -201,7 +201,7 @@ Ps2MouseComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c b/MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c index fd34e3eaf..05a7c1e2d 100644 --- a/MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c +++ b/MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c @@ -60,7 +60,7 @@ PS2MouseDriverSupported ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -109,7 +109,7 @@ PS2MouseDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -170,7 +170,7 @@ PS2MouseDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -193,7 +193,7 @@ PS2MouseDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -257,7 +257,7 @@ PS2MouseDriverStart ( if ((Data & KBC_SYSF) != KBC_SYSF) { Status = KbcSelfTest (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { StatusCode = EFI_PERIPHERAL_MOUSE | EFI_P_EC_CONTROLLER_ERROR; goto ErrorExit; } @@ -278,7 +278,7 @@ PS2MouseDriverStart ( &MouseDev->SimplePointerProtocol, FeaturePcdGet (PcdPs2MouseExtendedVerification) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // mouse not connected // @@ -303,7 +303,7 @@ PS2MouseDriverStart ( MouseDev, &((MouseDev->SimplePointerProtocol).WaitForInput) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -317,7 +317,7 @@ PS2MouseDriverStart ( MouseDev, &MouseDev->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -325,7 +325,7 @@ PS2MouseDriverStart ( // Start timer to poll mouse (100 samples per second) // Status = gBS->SetTimer (MouseDev->TimerEvent, TimerPeriodic, 100000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } @@ -356,7 +356,7 @@ PS2MouseDriverStart ( &MouseDev->SimplePointerProtocol, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -396,13 +396,13 @@ ErrorExit: // exhaust input data just in case there is still mouse data left // EmptyStatus = EFI_SUCCESS; - while (!EFI_ERROR (EmptyStatus)) { + while (!EFI_ERROR(EmptyStatus)) { EmptyStatus = In8042Data (&Data); } } if (MouseDev != NULL) { - FreePool (MouseDev); + FreePool(MouseDev); } gBS->CloseProtocol ( @@ -460,7 +460,7 @@ PS2MouseDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -480,7 +480,7 @@ PS2MouseDriverStop ( &gEfiSimplePointerProtocolGuid, &MouseDev->SimplePointerProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -495,13 +495,13 @@ PS2MouseDriverStop ( // exhaust input data just in case there is still mouse data left // Status = EFI_SUCCESS; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = In8042Data (&Data); } gBS->CloseEvent (MouseDev->SimplePointerProtocol.WaitForInput); FreeUnicodeStringTable (MouseDev->ControllerNameTable); - FreePool (MouseDev); + FreePool(MouseDev); gBS->CloseProtocol ( Controller, @@ -570,7 +570,7 @@ MouseReset ( // Exhaust input data // Status = EFI_SUCCESS; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = In8042Data (&Data); } @@ -596,31 +596,31 @@ MouseReset ( // Send mouse reset command and set mouse default configure // Status = PS2MouseReset (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseSetSampleRate (MouseDev->SampleRate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseSetResolution (MouseDev->Resolution); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseSetScaling (MouseDev->Scaling); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } Status = PS2MouseEnable (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -653,7 +653,7 @@ CheckMouseConnect ( EFI_STATUS Status; Status = PS2MouseEnable (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return TRUE; } @@ -791,7 +791,7 @@ InitializePs2Mouse( &gPs2MouseComponentName, &gPs2MouseComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.c b/MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.c index a2132d072..734cc9cbd 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.c @@ -187,7 +187,7 @@ EhciComponentNameGetControllerName ( gEhciDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -201,7 +201,7 @@ EhciComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c index bdd9c27db..4bef7a693 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c @@ -148,7 +148,7 @@ EhcReset ( if (!EhcIsHalt (Ehc)) { Status = EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto ON_EXIT; } @@ -164,7 +164,7 @@ EhcReset ( Status = EhcResetHC (Ehc, EHC_RESET_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -256,7 +256,7 @@ EhcSetState ( Status = EhcGetState (This, &CurState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -469,7 +469,7 @@ EhcSetRootHubPortFeature ( if (EhcIsHalt (Ehc)) { Status = EhcRunHC (Ehc, EHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "EhcSetRootHubPortFeature :failed to start HC - %r\n", Status)); break; } @@ -793,7 +793,7 @@ ON_EXIT: Ehc->PciIo->Flush (Ehc->PciIo); gBS->RestoreTPL (OldTpl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcControlTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); } @@ -933,7 +933,7 @@ ON_EXIT: Ehc->PciIo->Flush (Ehc->PciIo); gBS->RestoreTPL (OldTpl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); } @@ -1188,7 +1188,7 @@ ON_EXIT: Ehc->PciIo->Flush (Ehc->PciIo); gBS->RestoreTPL (OldTpl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcSyncInterruptTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); } @@ -1343,7 +1343,7 @@ EhcDriverBindingSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1355,7 +1355,7 @@ EhcDriverBindingSupported ( &UsbClassCReg ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto ON_EXIT; } @@ -1415,7 +1415,7 @@ EhcGetUsbDebugPortInfo ( &PciStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1437,7 +1437,7 @@ EhcGetUsbDebugPortInfo ( &CapabilityPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1453,7 +1453,7 @@ EhcGetUsbDebugPortInfo ( &CapabilityId ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1469,7 +1469,7 @@ EhcGetUsbDebugPortInfo ( &CapabilityPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1492,7 +1492,7 @@ EhcGetUsbDebugPortInfo ( &DebugPort ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1568,7 +1568,7 @@ EhcCreateUsb2Hc ( // EHCI Controllers with a CapLen of 0 are ignored. // if (Ehc->CapLen == 0) { - gBS->FreePool (Ehc); + gBS->FreePool(Ehc); return NULL; } @@ -1585,8 +1585,8 @@ EhcCreateUsb2Hc ( &Ehc->PollTimer ); - if (EFI_ERROR (Status)) { - gBS->FreePool (Ehc); + if (EFI_ERROR(Status)) { + gBS->FreePool(Ehc); return NULL; } @@ -1673,7 +1673,7 @@ EhcDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1701,7 +1701,7 @@ EhcDriverBindingStart ( &OriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } PciAttributesSaved = TRUE; @@ -1712,7 +1712,7 @@ EhcDriverBindingStart ( 0, &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -1722,7 +1722,7 @@ EhcDriverBindingStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to enable controller\n")); goto CLOSE_PCIIO; } @@ -1738,7 +1738,7 @@ EhcDriverBindingStart ( &UsbClassCReg ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto CLOSE_PCIIO; } @@ -1757,7 +1757,7 @@ EhcDriverBindingStart ( &CompanionDeviceNumber, &CompanionFunctionNumber ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } @@ -1768,7 +1768,7 @@ EhcDriverBindingStart ( &NumberOfHandles, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } @@ -1781,7 +1781,7 @@ EhcDriverBindingStart ( &gEfiPciIoProtocolGuid, (VOID **)&Instance ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = Instance->Pci.Read ( Instance, @@ -1791,7 +1791,7 @@ EhcDriverBindingStart ( &UsbClassCReg ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto CLOSE_PCIIO; } @@ -1806,7 +1806,7 @@ EhcDriverBindingStart ( &EhciDeviceNumber, &EhciFunctionNumber ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } // @@ -1851,7 +1851,7 @@ EhcDriverBindingStart ( EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Ehc->Support64BitDma = TRUE; } else { DEBUG ((EFI_D_WARN, @@ -1867,7 +1867,7 @@ EhcDriverBindingStart ( &Ehc->Usb2Hc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to install USB2_HC Protocol\n")); goto FREE_POOL; } @@ -1886,7 +1886,7 @@ EhcDriverBindingStart ( Status = EhcInitHC (Ehc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to init host controller\n")); goto UNINSTALL_USBHC; } @@ -1896,7 +1896,7 @@ EhcDriverBindingStart ( // Status = gBS->SetTimer (Ehc->PollTimer, TimerPeriodic, EHC_ASYNC_POLL_INTERVAL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to start async interrupt monitor\n")); EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT); @@ -1914,7 +1914,7 @@ EhcDriverBindingStart ( &gEfiEventExitBootServicesGuid, &Ehc->ExitBootServiceEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto UNINSTALL_USBHC; } @@ -1951,7 +1951,7 @@ UNINSTALL_USBHC: FREE_POOL: EhcFreeSched (Ehc); gBS->CloseEvent (Ehc->PollTimer); - gBS->FreePool (Ehc); + gBS->FreePool(Ehc); CLOSE_PCIIO: if (PciAttributesSaved) { @@ -2018,7 +2018,7 @@ EhcDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2031,7 +2031,7 @@ EhcDriverBindingStop ( Usb2Hc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2079,7 +2079,7 @@ EhcDriverBindingStop ( Controller ); - FreePool (Ehc); + FreePool(Ehc); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c index ca63736f2..9ff7cb67a 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c @@ -39,7 +39,7 @@ EhcReadCapRegister ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcReadCapRegister: Pci Io read error - %r at %d\n", Status, Offset)); Data = 0xFFFF; } @@ -75,7 +75,7 @@ EhcReadDbgRegister ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcReadDbgRegister: Pci Io read error - %r at %d\n", Status, Offset)); Data = 0xFFFF; } @@ -167,7 +167,7 @@ EhcReadOpReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcReadOpReg: Pci Io Read error - %r at %d\n", Status, Offset)); Data = 0xFFFF; } @@ -204,7 +204,7 @@ EhcWriteOpReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -513,7 +513,7 @@ EhcResetHC ( if (!EHC_REG_BIT_IS_SET (Ehc, EHC_USBSTS_OFFSET, USBSTS_HALT)) { Status = EhcHaltHC (Ehc, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -611,7 +611,7 @@ EhcInitHC ( Status = EhcInitSched (Ehc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -653,14 +653,14 @@ EhcInitHC ( Status = EhcEnablePeriodSchd (Ehc, EHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcInitHC: failed to enable period schedule\n")); return Status; } Status = EhcEnableAsyncSchd (Ehc, EHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcInitHC: failed to enable async schedule\n")); return Status; } diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c index 7db637aa2..b8d1fa481 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c @@ -135,7 +135,7 @@ EhcInitSched ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -148,7 +148,7 @@ EhcInitSched ( &Map ); - if (EFI_ERROR (Status) || (Bytes != 4096)) { + if (EFI_ERROR(Status) || (Bytes != 4096)) { PciIo->FreeBuffer (PciIo, Pages, Buf); return EFI_OUT_OF_RESOURCES; } @@ -183,7 +183,7 @@ EhcInitSched ( Status = EhcCreateHelpQ (Ehc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -294,7 +294,7 @@ EhcFreeSched ( } if (Ehc->PeriodFrameHost != NULL) { - FreePool (Ehc->PeriodFrameHost); + FreePool(Ehc->PeriodFrameHost); Ehc->PeriodFrameHost = NULL; } } @@ -375,7 +375,7 @@ EhcUnlinkQhFromAsync ( // Status = EhcSetAndWaitDoorBell (Ehc, EHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcUnlinkQhFromAsync: Failed to synchronize with doorbell\n")); } } @@ -772,7 +772,7 @@ EhciDelAsyncIntTransfer ( EhcUnlinkQhFromPeriod (Ehc, Urb->Qh); RemoveEntryList (&Urb->UrbList); - gBS->FreePool (Urb->Data); + gBS->FreePool(Urb->Data); EhcFreeUrb (Ehc, Urb); return EFI_SUCCESS; } @@ -803,7 +803,7 @@ EhciDelAllAsyncIntTransfers ( EhcUnlinkQhFromPeriod (Ehc, Urb->Qh); RemoveEntryList (&Urb->UrbList); - gBS->FreePool (Urb->Data); + gBS->FreePool(Urb->Data); EhcFreeUrb (Ehc, Urb); } } @@ -871,7 +871,7 @@ EhciInsertAsyncIntTransfer ( if (Urb == NULL) { DEBUG ((DEBUG_ERROR, "%a: failed to create URB\n", __FUNCTION__)); - gBS->FreePool (Data); + gBS->FreePool(Data); return NULL; } @@ -919,14 +919,14 @@ EhcFlushAsyncIntMap ( } Status = PciIo->Unmap (PciIo, Urb->DataMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } Urb->DataMap = NULL; Status = PciIo->Map (PciIo, MapOp, Urb->Data, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != Urb->DataLen)) { + if (EFI_ERROR(Status) || (Len != Urb->DataLen)) { goto ON_ERROR; } @@ -1067,7 +1067,7 @@ EhcMonitorAsyncRequests ( // bridge to system memory. // Status = EhcFlushAsyncIntMap (Ehc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EhcMonitorAsyncRequests: Fail to Flush AsyncInt Mapped Memeory\n")); } @@ -1117,7 +1117,7 @@ EhcMonitorAsyncRequests ( } if (ProcBuf != NULL) { - FreePool (ProcBuf); + FreePool(ProcBuf); } } diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c index ac5ddd259..29c845b1a 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c @@ -342,7 +342,7 @@ EhcFreeUrb ( UsbHcFreeMem (Ehc->MemPool, Urb->Qh, sizeof (EHC_QH)); } - gBS->FreePool (Urb); + gBS->FreePool(Urb); } @@ -610,7 +610,7 @@ EhcCreateUrb ( MapOp = EfiPciIoOperationBusMasterRead; Status = PciIo->Map (PciIo, MapOp, Request, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != sizeof (EFI_USB_DEVICE_REQUEST))) { + if (EFI_ERROR(Status) || (Len != sizeof (EFI_USB_DEVICE_REQUEST))) { goto ON_ERROR; } @@ -629,7 +629,7 @@ EhcCreateUrb ( Status = PciIo->Map (PciIo, MapOp, Data, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != DataLen)) { + if (EFI_ERROR(Status) || (Len != DataLen)) { goto ON_ERROR; } @@ -639,7 +639,7 @@ EhcCreateUrb ( Status = EhcCreateQtds (Ehc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c index 43d0968dc..d6e160e88 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c @@ -52,7 +52,7 @@ UsbHcAllocMemBlock ( Block->Bits = AllocateZeroPool (Block->BitsLen); if (Block->Bits == NULL) { - gBS->FreePool (Block); + gBS->FreePool(Block); return NULL; } @@ -69,7 +69,7 @@ UsbHcAllocMemBlock ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_BITARRAY; } @@ -83,7 +83,7 @@ UsbHcAllocMemBlock ( &Mapping ); - if (EFI_ERROR (Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { + if (EFI_ERROR(Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { goto FREE_BUFFER; } @@ -106,8 +106,8 @@ FREE_BUFFER: PciIo->FreeBuffer (PciIo, Pages, BufHost); FREE_BITARRAY: - gBS->FreePool (Block->Bits); - gBS->FreePool (Block); + gBS->FreePool(Block->Bits); + gBS->FreePool(Block); return NULL; } @@ -137,8 +137,8 @@ UsbHcFreeMemBlock ( PciIo->Unmap (PciIo, Block->Mapping); PciIo->FreeBuffer (PciIo, EFI_SIZE_TO_PAGES (Block->BufLen), Block->BufHost); - gBS->FreePool (Block->Bits); - gBS->FreePool (Block); + gBS->FreePool(Block->Bits); + gBS->FreePool(Block); } @@ -369,7 +369,7 @@ UsbHcInitMemPool ( Pool->Head = UsbHcAllocMemBlock (Pool, USBHC_MEM_DEFAULT_PAGES); if (Pool->Head == NULL) { - gBS->FreePool (Pool); + gBS->FreePool(Pool); Pool = NULL; } @@ -406,7 +406,7 @@ UsbHcFreeMemPool ( } UsbHcFreeMemBlock (Pool, Pool->Head); - gBS->FreePool (Pool); + gBS->FreePool(Pool); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Pci/EhciPei/DmaMem.c b/MdeModulePkg/Bus/Pci/EhciPei/DmaMem.c index 63870a129..1f44b0add 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/DmaMem.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/DmaMem.c @@ -51,7 +51,7 @@ IoMmuMap ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } switch (Operation) { @@ -76,7 +76,7 @@ IoMmuMap ( *Mapping, Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { IoMmu->Unmap (IoMmu, Mapping); *Mapping = NULL; return Status; @@ -152,7 +152,7 @@ IoMmuAllocateBuffer ( HostAddress, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -165,7 +165,7 @@ IoMmuAllocateBuffer ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { IoMmu->FreeBuffer (IoMmu, Pages, *HostAddress); *HostAddress = NULL; return EFI_OUT_OF_RESOURCES; @@ -175,7 +175,7 @@ IoMmuAllocateBuffer ( *Mapping, EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { IoMmu->Unmap (IoMmu, *Mapping); IoMmu->FreeBuffer (IoMmu, Pages, *HostAddress); *Mapping = NULL; @@ -188,7 +188,7 @@ IoMmuAllocateBuffer ( Pages, &HostPhyAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } *HostAddress = (VOID *) (UINTN) HostPhyAddress; diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c index cd1f87911..7d98e134d 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c @@ -337,7 +337,7 @@ EhcResetHC ( if (!EHC_REG_BIT_IS_SET (Ehc, EHC_USBSTS_OFFSET, USBSTS_HALT)) { Status = EhcHaltHC (Ehc, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -470,7 +470,7 @@ EhcInitHC ( Status = EhcInitSched (Ehc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -501,13 +501,13 @@ EhcInitHC ( Status = EhcEnablePeriodSchd (Ehc, EHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EhcEnableAsyncSchd (Ehc, EHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -865,7 +865,7 @@ EhcSetRootHubPortFeature ( if (EhcIsHalt (Ehc)) { Status = EhcRunHC (Ehc, EHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -1189,7 +1189,7 @@ EhcPeimEntry ( // // Shadow this PEIM to run from memory // - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -1199,7 +1199,7 @@ EhcPeimEntry ( NULL, (VOID **) &ChipSetUsbControllerPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1215,7 +1215,7 @@ EhcPeimEntry ( // // When status is error, meant no controller is found // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -1233,7 +1233,7 @@ EhcPeimEntry ( MemPages, &TempPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -1254,7 +1254,7 @@ EhcPeimEntry ( // Initialize Uhc's hardware // Status = InitializeUsbHC (EhcDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1270,7 +1270,7 @@ EhcPeimEntry ( EhcDev->PpiDescriptor.Ppi = &EhcDev->Usb2HostControllerPpi; Status = PeiServicesInstallPpi (&EhcDev->PpiDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Index++; continue; } @@ -1306,7 +1306,7 @@ InitializeUsbHC ( Status = EhcInitHC (EhcDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c index 8eb432dfc..7f6bcc725 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c @@ -127,7 +127,7 @@ EhcInitSched ( &Map ); - if (EFI_ERROR (Status) || (Buf == NULL)) { + if (EFI_ERROR(Status) || (Buf == NULL)) { return EFI_OUT_OF_RESOURCES; } @@ -152,7 +152,7 @@ EhcInitSched ( Status = EhcCreateHelpQ (Ehc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c index 7c6a6a5f9..50ae2bc9f 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c @@ -583,7 +583,7 @@ EhcCreateUrb ( MapOp = EdkiiIoMmuOperationBusMasterRead; Status = IoMmuMap (Ehc->IoMmu, MapOp, Request, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != sizeof (EFI_USB_DEVICE_REQUEST))) { + if (EFI_ERROR(Status) || (Len != sizeof (EFI_USB_DEVICE_REQUEST))) { goto ON_ERROR; } @@ -602,7 +602,7 @@ EhcCreateUrb ( Status = IoMmuMap (Ehc->IoMmu, MapOp, Data, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != DataLen)) { + if (EFI_ERROR(Status) || (Len != DataLen)) { goto ON_ERROR; } @@ -612,7 +612,7 @@ EhcCreateUrb ( Status = EhcCreateQtds (Ehc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } diff --git a/MdeModulePkg/Bus/Pci/EhciPei/UsbHcMem.c b/MdeModulePkg/Bus/Pci/EhciPei/UsbHcMem.c index 269b3edb8..2c65012d7 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/UsbHcMem.c @@ -43,7 +43,7 @@ UsbHcAllocMemBlock ( &TempPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ZeroMem ((VOID *)(UINTN)TempPtr, PageNumber*EFI_PAGE_SIZE); @@ -65,7 +65,7 @@ UsbHcAllocMemBlock ( &TempPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ZeroMem ((VOID *)(UINTN)TempPtr, PageNumber*EFI_PAGE_SIZE); @@ -79,7 +79,7 @@ UsbHcAllocMemBlock ( &MappedAddr, &Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ZeroMem (BufHost, Pages*EFI_PAGE_SIZE); @@ -318,7 +318,7 @@ UsbHcInitMemPool ( &TempPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ZeroMem ((VOID *)(UINTN)TempPtr, PageNumber*EFI_PAGE_SIZE); diff --git a/MdeModulePkg/Bus/Pci/IdeBusPei/AtapiPeim.c b/MdeModulePkg/Bus/Pci/IdeBusPei/AtapiPeim.c index 2f888424d..7f3099616 100644 --- a/MdeModulePkg/Bus/Pci/IdeBusPei/AtapiPeim.c +++ b/MdeModulePkg/Bus/Pci/IdeBusPei/AtapiPeim.c @@ -35,7 +35,7 @@ AtapiPeimEntry ( ATAPI_BLK_IO_DEV *AtapiBlkIoDev; Status = PeiServicesRegisterForShadow (FileHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return Status; } @@ -45,7 +45,7 @@ AtapiPeimEntry ( NULL, (VOID **) &AtaControllerPpi ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); AtapiBlkIoDev = AllocatePages (EFI_SIZE_TO_PAGES (sizeof (*AtapiBlkIoDev))); if (AtapiBlkIoDev == NULL) { @@ -79,7 +79,7 @@ AtapiPeimEntry ( DEBUG ((EFI_D_INFO, "Atatpi Device Count is %d\n", AtapiBlkIoDev->DeviceCount)); if (AtapiBlkIoDev->DeviceCount != 0) { Status = PeiServicesInstallPpi (&AtapiBlkIoDev->PpiDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -321,7 +321,7 @@ AtapiReadBlocks ( NumberOfBlocks, BlockSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -424,7 +424,7 @@ AtapiGetBlockDeviceMediaInfo2 ( DeviceIndex, &Media ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -605,7 +605,7 @@ AtapiEnumerateDevices ( DEBUG ((EFI_D_INFO, "Atatpi MediaPresent is %d\n", MediaInfo.MediaPresent)); DEBUG ((EFI_D_INFO, "Atatpi BlockSize is 0x%x\n", MediaInfo.BlockSize)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AtapiBlkIoDev->DeviceInfo[DeviceCount].MediaInfo.MediaPresent = FALSE; AtapiBlkIoDev->DeviceInfo[DeviceCount].MediaInfo.LastBlock = 0; AtapiBlkIoDev->DeviceInfo[DeviceCount].MediaInfo2.MediaPresent = FALSE; @@ -650,7 +650,7 @@ DiscoverAtapiDevice ( if (ATAPIIdentify (AtapiBlkIoDev, DevicePosition) == EFI_SUCCESS) { Status = Inquiry (AtapiBlkIoDev, DevicePosition, MediaInfo, MediaInfo2); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return TRUE; } } @@ -729,7 +729,7 @@ CheckPowerMode ( IoWrite8 (CommandRegister, AtaCommand); Status = WaitForBSYClear (AtapiBlkIoDev, &(AtapiBlkIoDev->IdeIoPortReg[Channel]), 3000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_TIMEOUT; } @@ -818,7 +818,7 @@ DetectIDEController ( // Wait 31 seconds for BSY clear // Status = WaitForBSYClear (AtapiBlkIoDev, &(AtapiBlkIoDev->IdeIoPortReg[Channel]), 31000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } // diff --git a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c index be9f873c3..1640eb0fa 100644 --- a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c @@ -208,7 +208,7 @@ IncompatiblePciDeviceSupportEntryPoint ( EFI_NATIVE_INTERFACE, &mIncompatiblePciDeviceSupport ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c index 5c93e2a76..f7d04f361 100644 --- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c @@ -77,7 +77,7 @@ NonDiscoverablePciDeviceSupported ( &gEdkiiNonDiscoverableDeviceProtocolGuid, (VOID **)&Device, This->DriverBindingHandle, DeviceHandle, EFI_OPEN_PROTOCOL_BY_DRIVER); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -89,7 +89,7 @@ NonDiscoverablePciDeviceSupported ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CloseProtocol; } @@ -152,7 +152,7 @@ NonDiscoverablePciDeviceStart ( &gEdkiiNonDiscoverableDeviceProtocolGuid, (VOID **)&Dev->Device, This->DriverBindingHandle, DeviceHandle, EFI_OPEN_PROTOCOL_BY_DRIVER); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeDev; } @@ -165,7 +165,7 @@ NonDiscoverablePciDeviceStart ( Dev->Signature = NON_DISCOVERABLE_PCI_DEVICE_SIG; Status = gBS->InstallProtocolInterface (&DeviceHandle, &gEfiPciIoProtocolGuid, EFI_NATIVE_INTERFACE, &Dev->PciIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CloseProtocol; } @@ -178,7 +178,7 @@ CloseProtocol: This->DriverBindingHandle, DeviceHandle); FreeDev: - FreePool (Dev); + FreePool(Dev); return Status; } @@ -212,7 +212,7 @@ NonDiscoverablePciDeviceStop ( Status = gBS->OpenProtocol (DeviceHandle, &gEfiPciIoProtocolGuid, (VOID **)&PciIo, This->DriverBindingHandle, DeviceHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -223,14 +223,14 @@ NonDiscoverablePciDeviceStop ( // Status = gBS->UninstallProtocolInterface (DeviceHandle, &gEfiPciIoProtocolGuid, &Dev->PciIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } gBS->CloseProtocol (DeviceHandle, &gEdkiiNonDiscoverableDeviceProtocolGuid, This->DriverBindingHandle, DeviceHandle); - FreePool (Dev); + FreePool(Dev); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c index 2d55c9699..73acd0a82 100644 --- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c @@ -245,7 +245,7 @@ PciIoMemRead ( // Only allow accesses to the BARs we emulate // Status = GetBarResource (Dev, BarIndex, &Desc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -332,7 +332,7 @@ PciIoMemWrite ( // Only allow accesses to the BARs we emulate // Status = GetBarResource (Dev, BarIndex, &Desc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -636,13 +636,13 @@ CoherentPciIoMap ( Status = gBS->AllocatePages (AllocateMaxAddress, EfiBootServicesData, EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes), &MapInfo->AllocAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If we fail here, it is likely because the system has no memory below // 4 GB to begin with. There is not much we can do about that other than // fail the map request. // - FreePool (MapInfo); + FreePool(MapInfo); return EFI_DEVICE_ERROR; } if (Operation == EfiPciIoOperationBusMasterRead) { @@ -685,7 +685,7 @@ CoherentPciIoUnmap ( } gBS->FreePages (MapInfo->AllocAddress, EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes)); - FreePool (MapInfo); + FreePool(MapInfo); } return EFI_SUCCESS; } @@ -750,7 +750,7 @@ CoherentPciIoAllocateBuffer ( } Status = gBS->AllocatePages (AllocType, MemoryType, Pages, &AllocAddress); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *HostAddress = (VOID *)(UINTN)AllocAddress; } return Status; @@ -830,7 +830,7 @@ NonCoherentPciIoFreeBuffer ( } if (!Found) { - ASSERT_EFI_ERROR (EFI_NOT_FOUND); + ASSERT_EFI_ERROR(EFI_NOT_FOUND); return EFI_NOT_FOUND; } @@ -840,7 +840,7 @@ NonCoherentPciIoFreeBuffer ( (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress, EFI_PAGES_TO_SIZE (Pages), Alloc->Attributes); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeAlloc; } @@ -851,7 +851,7 @@ NonCoherentPciIoFreeBuffer ( FreePages (HostAddress, Pages); FreeAlloc: - FreePool (Alloc); + FreePool(Alloc); return Status; } @@ -901,14 +901,14 @@ NonCoherentPciIoAllocateBuffer ( Status = CoherentPciIoAllocateBuffer (This, Type, MemoryType, Pages, &AllocAddress, Attributes); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gDS->GetMemorySpaceDescriptor ( (EFI_PHYSICAL_ADDRESS)(UINTN)AllocAddress, &GcdDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeBuffer; } @@ -950,7 +950,7 @@ NonCoherentPciIoAllocateBuffer ( (EFI_PHYSICAL_ADDRESS)(UINTN)AllocAddress, EFI_PAGES_TO_SIZE (Pages), MemType); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto RemoveList; } @@ -959,7 +959,7 @@ NonCoherentPciIoAllocateBuffer ( (EFI_PHYSICAL_ADDRESS)(UINTN)AllocAddress, EFI_PAGES_TO_SIZE (Pages), EfiCpuFlushTypeInvalidate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto RemoveList; } @@ -969,7 +969,7 @@ NonCoherentPciIoAllocateBuffer ( RemoveList: RemoveEntryList (&Alloc->List); - FreePool (Alloc); + FreePool(Alloc); FreeBuffer: CoherentPciIoFreeBuffer (This, Pages, AllocAddress); @@ -1067,7 +1067,7 @@ NonCoherentPciIoMap ( Status = gDS->GetMemorySpaceDescriptor ( (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress, &GcdDescriptor); - if (EFI_ERROR (Status) || + if (EFI_ERROR(Status) || (GcdDescriptor.Attributes & (EFI_MEMORY_WB|EFI_MEMORY_WT)) != 0) { Bounce = TRUE; } @@ -1087,7 +1087,7 @@ NonCoherentPciIoMap ( Status = NonCoherentPciIoAllocateBuffer (This, AllocateAnyPages, EfiBootServicesData, EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes), &AllocAddress, EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeMapInfo; } MapInfo->AllocAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocAddress; @@ -1117,7 +1117,7 @@ NonCoherentPciIoMap ( return EFI_SUCCESS; FreeMapInfo: - FreePool (MapInfo); + FreePool(MapInfo); return Status; } @@ -1170,7 +1170,7 @@ NonCoherentPciIoUnmap ( MapInfo->NumberOfBytes, EfiCpuFlushTypeInvalidate); } } - FreePool (MapInfo); + FreePool(MapInfo); return EFI_SUCCESS; } @@ -1361,7 +1361,7 @@ PciIoGetBarAttributes ( Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(This); Status = GetBarResource (Dev, BarIndex, &BarDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1516,7 +1516,7 @@ InitializePciIoProtocol ( Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_MASS_STORAGE; Dev->BarOffset = 0; } else { - ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER); + ASSERT_EFI_ERROR(EFI_INVALID_PARAMETER); } // diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/ComponentName.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/ComponentName.c index 7ef345eec..d6cfd86f3 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/ComponentName.c @@ -184,7 +184,7 @@ NvmExpressComponentNameGetControllerName ( gNvmExpressDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -195,7 +195,7 @@ NvmExpressComponentNameGetControllerName ( ChildHandle, &gEfiNvmExpressPassThruProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -209,7 +209,7 @@ NvmExpressComponentNameGetControllerName ( ChildHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO (BlockIo); diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c index 3bde96bc9..bcfb16982 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c @@ -202,9 +202,9 @@ EnumerateNvmeDevNamespace ( DeviceHandle = NULL; RemainingDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { + if (!EFI_ERROR(Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { Status = EFI_ALREADY_STARTED; - FreePool (DevicePath); + FreePool(DevicePath); goto Exit; } @@ -305,18 +305,18 @@ EnumerateNvmeDevNamespace ( Exit: if(NamespaceData != NULL) { - FreePool (NamespaceData); + FreePool(NamespaceData); } if (NewDevicePathNode != NULL) { - FreePool (NewDevicePathNode); + FreePool(NewDevicePathNode); } if(EFI_ERROR(Status) && (Device != NULL) && (Device->DevicePath != NULL)) { - FreePool (Device->DevicePath); + FreePool(Device->DevicePath); } if(EFI_ERROR(Status) && (Device != NULL)) { - FreePool (Device); + FreePool(Device); } return Status; } @@ -349,7 +349,7 @@ DiscoverAllNamespaces ( (UINT32 *)&NamespaceId ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -405,7 +405,7 @@ UnregisterNvmeNamespace ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -453,7 +453,7 @@ UnregisterNvmeNamespace ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiNvmExpressPassThruProtocolGuid, @@ -477,13 +477,13 @@ UnregisterNvmeNamespace ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->UninstallProtocolInterface ( Handle, &gEfiStorageSecurityCommandProtocolGuid, &Device->StorageSecurity ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiNvmExpressPassThruProtocolGuid, @@ -497,14 +497,14 @@ UnregisterNvmeNamespace ( } if(Device->DevicePath != NULL) { - FreePool (Device->DevicePath); + FreePool(Device->DevicePath); } if (Device->ControllerNameTable != NULL) { FreeUnicodeStringTable (Device->ControllerNameTable); } - FreePool (Device); + FreePool(Device); return EFI_SUCCESS; } @@ -568,14 +568,14 @@ ProcessAsyncTaskList ( // Remove the BlockIo2 request from the device asynchronous queue. // RemoveEntryList (&BlkIo2Request->Link); - FreePool (BlkIo2Request); + FreePool(BlkIo2Request); gBS->SignalEvent (Token->Event); } - FreePool (Subtask->CommandPacket->NvmeCmd); - FreePool (Subtask->CommandPacket->NvmeCompletion); - FreePool (Subtask->CommandPacket); - FreePool (Subtask); + FreePool(Subtask->CommandPacket->NvmeCmd); + FreePool(Subtask->CommandPacket->NvmeCompletion); + FreePool(Subtask->CommandPacket); + FreePool(Subtask); continue; } @@ -590,7 +590,7 @@ ProcessAsyncTaskList ( InsertHeadList (&Private->UnsubmittedSubtasks, Link); BlkIo2Request->UnsubmittedSubtaskNum++; break; - } else if (EFI_ERROR (Status)) { + } else if (EFI_ERROR(Status)) { Token->TransactionStatus = EFI_DEVICE_ERROR; if (IsListEmpty (&BlkIo2Request->SubtasksQueue) && @@ -599,14 +599,14 @@ ProcessAsyncTaskList ( // Remove the BlockIo2 request from the device asynchronous queue. // RemoveEntryList (&BlkIo2Request->Link); - FreePool (BlkIo2Request); + FreePool(BlkIo2Request); gBS->SignalEvent (Token->Event); } - FreePool (Subtask->CommandPacket->NvmeCmd); - FreePool (Subtask->CommandPacket->NvmeCompletion); - FreePool (Subtask->CommandPacket); - FreePool (Subtask); + FreePool(Subtask->CommandPacket->NvmeCmd); + FreePool(Subtask->CommandPacket->NvmeCompletion); + FreePool(Subtask->CommandPacket); + FreePool(Subtask); } else { InsertTailList (&BlkIo2Request->SubtasksQueue, Link); if (Subtask->IsLast) { @@ -661,7 +661,7 @@ ProcessAsyncTaskList ( RemoveEntryList (Link); gBS->SignalEvent (AsyncRequest->CallerEvent); - FreePool (AsyncRequest); + FreePool(AsyncRequest); // // Update submission queue head. @@ -787,7 +787,7 @@ NvmExpressDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -816,7 +816,7 @@ NvmExpressDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -831,7 +831,7 @@ NvmExpressDriverBindingSupported ( sizeof (ClassCode), ClassCode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -920,7 +920,7 @@ NvmExpressDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if ((EFI_ERROR (Status)) && (Status != EFI_ALREADY_STARTED)) { + if ((EFI_ERROR(Status)) && (Status != EFI_ALREADY_STARTED)) { return Status; } @@ -933,7 +933,7 @@ NvmExpressDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { return Status; } @@ -968,7 +968,7 @@ NvmExpressDriverBindingStart ( (VOID**)&Private->Buffer, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -982,7 +982,7 @@ NvmExpressDriverBindingStart ( &Private->Mapping ); - if (EFI_ERROR (Status) || (Bytes != EFI_PAGES_TO_SIZE (6))) { + if (EFI_ERROR(Status) || (Bytes != EFI_PAGES_TO_SIZE (6))) { goto Exit; } @@ -1018,7 +1018,7 @@ NvmExpressDriverBindingStart ( Private, &Private->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1027,7 +1027,7 @@ NvmExpressDriverBindingStart ( TimerPeriodic, NVME_HC_ASYNC_TIMER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1037,7 +1037,7 @@ NvmExpressDriverBindingStart ( &Private->Passthru, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1051,7 +1051,7 @@ NvmExpressDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1076,7 +1076,7 @@ NvmExpressDriverBindingStart ( &NamespaceId ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = EnumerateNvmeDevNamespace ( Private, NamespaceId @@ -1097,7 +1097,7 @@ Exit: } if ((Private != NULL) && (Private->ControllerData != NULL)) { - FreePool (Private->ControllerData); + FreePool(Private->ControllerData); } if (Private != NULL) { @@ -1105,7 +1105,7 @@ Exit: gBS->CloseEvent (Private->TimerEvent); } - FreePool (Private); + FreePool(Private); } gBS->CloseProtocol ( @@ -1181,7 +1181,7 @@ NvmExpressDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Private = NVME_CONTROLLER_PRIVATE_DATA_FROM_PASS_THRU (PassThru); // @@ -1219,8 +1219,8 @@ NvmExpressDriverBindingStop ( Private->PciIo->FreeBuffer (Private->PciIo, 6, Private->Buffer); } - FreePool (Private->ControllerData); - FreePool (Private); + FreePool(Private->ControllerData); + FreePool(Private); } gBS->CloseProtocol ( @@ -1245,7 +1245,7 @@ NvmExpressDriverBindingStop ( for (Index = 0; Index < NumberOfChildren; Index++) { Status = UnregisterNvmeNamespace (This, Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -1297,7 +1297,7 @@ NvmExpressUnload ( &DeviceHandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Disconnect the driver specified by ImageHandle from all // the devices in the handle database. @@ -1308,7 +1308,7 @@ NvmExpressUnload ( ImageHandle, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } } @@ -1326,7 +1326,7 @@ NvmExpressUnload ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -1344,7 +1344,7 @@ NvmExpressUnload ( &gEfiComponentNameProtocolGuid, (VOID **) &ComponentName ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallProtocolInterface ( ImageHandle, &gEfiComponentNameProtocolGuid, @@ -1357,7 +1357,7 @@ NvmExpressUnload ( &gEfiComponentName2ProtocolGuid, (VOID **) &ComponentName2 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallProtocolInterface ( ImageHandle, &gEfiComponentName2ProtocolGuid, @@ -1372,7 +1372,7 @@ EXIT: // Free the buffer containing the list of handles from the handle database // if (DeviceHandleBuffer != NULL) { - gBS->FreePool (DeviceHandleBuffer); + gBS->FreePool(DeviceHandleBuffer); } return Status; } @@ -1404,7 +1404,7 @@ NvmExpressDriverEntry ( &gNvmExpressComponentName, &gNvmExpressComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install EFI Driver Supported EFI Version Protocol required for @@ -1417,6 +1417,6 @@ NvmExpressDriverEntry ( &gNvmExpressDriverSupportedEfiVersion, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c index c63a6537a..92d15ab3c 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c @@ -395,14 +395,14 @@ AsyncIoCallback ( // Remove the BlockIo2 request from the device asynchronous queue. // RemoveEntryList (&Request->Link); - FreePool (Request); + FreePool(Request); gBS->SignalEvent (Token->Event); } - FreePool (Subtask->CommandPacket->NvmeCmd); - FreePool (Subtask->CommandPacket->NvmeCompletion); - FreePool (Subtask->CommandPacket); - FreePool (Subtask); + FreePool(Subtask->CommandPacket->NvmeCmd); + FreePool(Subtask->CommandPacket->NvmeCompletion); + FreePool(Subtask->CommandPacket); + FreePool(Subtask); } /** @@ -521,15 +521,15 @@ ErrorExit: // Resource cleanup if asynchronous read request has not been queued. // if (Completion != NULL) { - FreePool (Completion); + FreePool(Completion); } if (Command != NULL) { - FreePool (Command); + FreePool(Command); } if (CommandPacket != NULL) { - FreePool (CommandPacket); + FreePool(CommandPacket); } if (Subtask != NULL) { @@ -537,7 +537,7 @@ ErrorExit: gBS->CloseEvent (Subtask->Event); } - FreePool (Subtask); + FreePool(Subtask); } return Status; @@ -663,15 +663,15 @@ ErrorExit: // Resource cleanup if asynchronous read request has not been queued. // if (Completion != NULL) { - FreePool (Completion); + FreePool(Completion); } if (Command != NULL) { - FreePool (Command); + FreePool(Command); } if (CommandPacket != NULL) { - FreePool (CommandPacket); + FreePool(CommandPacket); } if (Subtask != NULL) { @@ -679,7 +679,7 @@ ErrorExit: gBS->CloseEvent (Subtask->Event); } - FreePool (Subtask); + FreePool(Subtask); } return Status; @@ -777,7 +777,7 @@ NvmeAsyncRead ( // Remove the BlockIo2 request from the device asynchronous queue. // RemoveEntryList (&BlkIo2Req->Link); - FreePool (BlkIo2Req); + FreePool(BlkIo2Req); Status = EFI_DEVICE_ERROR; } else { // @@ -897,7 +897,7 @@ NvmeAsyncWrite ( // Remove the BlockIo2 request from the device asynchronous queue. // RemoveEntryList (&BlkIo2Req->Link); - FreePool (BlkIo2Req); + FreePool(BlkIo2Req); Status = EFI_DEVICE_ERROR; } else { // @@ -961,7 +961,7 @@ NvmeBlockIoReset ( Status = NvmeControllerInit (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -1229,7 +1229,7 @@ NvmeBlockIoResetEx ( Status = NvmeControllerInit (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -1615,7 +1615,7 @@ TrustTransferNvmeDevice ( ); if (!IsTrustSend) { - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *TransferLengthOut = 0; } else { *TransferLengthOut = (UINTN) TransferLength; diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c index 95f8b18bc..eaaa28cb2 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c @@ -625,7 +625,7 @@ NvmeCreateIoCompletionQueue ( &CommandPacket, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -699,7 +699,7 @@ NvmeCreateIoSubmissionQueue ( &CommandPacket, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -742,7 +742,7 @@ NvmeControllerInit ( &Private->PciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -753,7 +753,7 @@ NvmeControllerInit ( &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -763,7 +763,7 @@ NvmeControllerInit ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "NvmeControllerInit: failed to enable controller\n")); return Status; } @@ -777,7 +777,7 @@ NvmeControllerInit ( EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_WARN, "NvmeControllerInit: failed to enable 64-bit DMA (%r)\n", Status)); } @@ -785,7 +785,7 @@ NvmeControllerInit ( // Read the Controller Capabilities register and verify that the NVM command set is supported // Status = ReadNvmeControllerCapabilities (Private, &Private->Cap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1000,7 +1000,7 @@ NvmeShutdownAllControllers ( &HandleCount, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { HandleCount = 0; } @@ -1011,7 +1011,7 @@ NvmeShutdownAllControllers ( &OpenInfos, &OpenInfoCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -1030,7 +1030,7 @@ NvmeShutdownAllControllers ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } Private = NVME_CONTROLLER_PRIVATE_DATA_FROM_PASS_THRU (NvmePassThru); @@ -1093,9 +1093,9 @@ NvmeRegisterShutdownNotification ( mNvmeControllerNumber++; if (mNvmeControllerNumber == 1) { Status = gBS->LocateProtocol (&gEfiResetNotificationProtocolGuid, NULL, (VOID **) &ResetNotify); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = ResetNotify->RegisterResetNotify (ResetNotify, NvmeShutdownAllControllers); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else { DEBUG ((DEBUG_WARN, "NVME: ResetNotification absent! Shutdown notification cannot be performed!\n")); } @@ -1118,9 +1118,9 @@ NvmeUnregisterShutdownNotification ( mNvmeControllerNumber--; if (mNvmeControllerNumber == 0) { Status = gBS->LocateProtocol (&gEfiResetNotificationProtocolGuid, NULL, (VOID **) &ResetNotify); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = ResetNotify->UnregisterResetNotify (ResetNotify, NvmeShutdownAllControllers); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } } diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index 8e7213794..40310503e 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c @@ -253,7 +253,7 @@ NvmeCreatePrpList ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -267,7 +267,7 @@ NvmeCreatePrpList ( Mapping ); - if (EFI_ERROR (Status) || (Bytes != EFI_PAGES_TO_SIZE (*PrpListNo))) { + if (EFI_ERROR(Status) || (Bytes != EFI_PAGES_TO_SIZE (*PrpListNo))) { DEBUG ((EFI_D_ERROR, "NvmeCreatePrpList: create PrpList failure!\n")); goto EXIT; } @@ -388,7 +388,7 @@ AbortAsyncPassThruTasks ( RemoveEntryList (Link); gBS->SignalEvent (AsyncRequest->CallerEvent); - FreePool (AsyncRequest); + FreePool(AsyncRequest); } if (IsListEmpty (&Private->AsyncPassThruQueue) && @@ -619,7 +619,7 @@ NvmExpressPassThru ( &PhyAddr, &MapData ); - if (EFI_ERROR (Status) || (Packet->TransferLength != MapLength)) { + if (EFI_ERROR(Status) || (Packet->TransferLength != MapLength)) { return EFI_OUT_OF_RESOURCES; } @@ -637,7 +637,7 @@ NvmExpressPassThru ( &PhyAddr, &MapMeta ); - if (EFI_ERROR (Status) || (Packet->MetadataLength != MapLength)) { + if (EFI_ERROR(Status) || (Packet->MetadataLength != MapLength)) { PciIo->Unmap ( PciIo, MapData @@ -715,7 +715,7 @@ NvmExpressPassThru ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -754,7 +754,7 @@ NvmExpressPassThru ( NULL, &TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -768,7 +768,7 @@ NvmExpressPassThru ( // Wait for completion queue to get filled in. // Status = EFI_TIMEOUT; - while (EFI_ERROR (gBS->CheckEvent (TimerEvent))) { + while (EFI_ERROR(gBS->CheckEvent (TimerEvent))) { if (Cq->Pt != Private->Pt[QueueId]) { Status = EFI_SUCCESS; break; @@ -805,7 +805,7 @@ NvmExpressPassThru ( // Disable the timer to trigger the process of async transfers temporarily. // Status = gBS->SetTimer (Private->TimerEvent, TimerCancel, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -813,14 +813,14 @@ NvmExpressPassThru ( // Reset the NVMe controller. // Status = NvmeControllerInit (Private); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = AbortAsyncPassThruTasks (Private); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Re-enable the timer to trigger the process of async transfers. // Status = gBS->SetTimer (Private->TimerEvent, TimerPeriodic, NVME_HC_ASYNC_TIMER); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Return EFI_TIMEOUT to indicate a timeout occurs for NVMe PassThru command. // @@ -850,7 +850,7 @@ NvmExpressPassThru ( ); // The return status of PciIo->Mem.Write should not override // previous status if previous status contains error. - Status = EFI_ERROR (PreviousStatus) ? PreviousStatus : Status; + Status = EFI_ERROR(PreviousStatus) ? PreviousStatus : Status; // // For now, the code does not support the non-blocking feature for admin queue. @@ -1171,11 +1171,11 @@ NvmExpressBuildDevicePath ( Exit: if(NamespaceData != NULL) { - FreePool (NamespaceData); + FreePool(NamespaceData); } - if (EFI_ERROR (Status)) { - FreePool (Node); + if (EFI_ERROR(Status)) { + FreePool(Node); } return Status; diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/DmaMem.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/DmaMem.c index 7b049b9e4..97d898203 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/DmaMem.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/DmaMem.c @@ -30,7 +30,7 @@ GetIoMmu ( NULL, (VOID **) &IoMmu ); - if (!EFI_ERROR (Status) && (IoMmu != NULL)) { + if (!EFI_ERROR(Status) && (IoMmu != NULL)) { return IoMmu; } @@ -80,7 +80,7 @@ IoMmuMap ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } switch (Operation) { @@ -105,7 +105,7 @@ IoMmuMap ( *Mapping, Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -188,7 +188,7 @@ IoMmuAllocateBuffer ( HostAddress, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -201,7 +201,7 @@ IoMmuAllocateBuffer ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } Status = IoMmu->SetAttribute ( @@ -209,7 +209,7 @@ IoMmuAllocateBuffer ( *Mapping, EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -218,7 +218,7 @@ IoMmuAllocateBuffer ( Pages, &HostPhyAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } *HostAddress = (VOID *)(UINTN)HostPhyAddress; diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c index 987eed420..19504ba72 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c @@ -78,7 +78,7 @@ EnumerateNvmeDevNamespace ( NamespaceId, NamespaceData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NvmeIdentifyNamespace fail, Status - %r\n", __FUNCTION__, Status)); goto Exit; } @@ -123,7 +123,7 @@ EnumerateNvmeDevNamespace ( Exit: if (NamespaceData != NULL) { - FreePool (NamespaceData); + FreePool(NamespaceData); } return Status; @@ -227,7 +227,7 @@ NvmExpressPeimEntry ( // Get the current boot mode. // Status = PeiServicesGetBootMode (&BootMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: Fail to get the current boot mode.\n", __FUNCTION__)); return Status; } @@ -241,7 +241,7 @@ NvmExpressPeimEntry ( NULL, (VOID **) &NvmeHcPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: Fail to locate NvmeHostControllerPpi.\n", __FUNCTION__)); return EFI_UNSUPPORTED; } @@ -257,7 +257,7 @@ NvmExpressPeimEntry ( // // When status is error, meant no controller is found // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -267,7 +267,7 @@ NvmExpressPeimEntry ( &DevicePathLength, &DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: Fail to allocate get the device path for Controller %d.\n", __FUNCTION__, Controller @@ -279,7 +279,7 @@ NvmExpressPeimEntry ( // Check validity of the device path of the NVM Express controller. // Status = NvmeIsHcDevicePathValid (DevicePath, DevicePathLength); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: The device path is invalid for Controller %d.\n", __FUNCTION__, Controller @@ -325,7 +325,7 @@ NvmExpressPeimEntry ( &DeviceAddress, &Private->BufferMapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: Fail to allocate DMA buffers for Controller %d.\n", __FUNCTION__, Controller @@ -347,7 +347,7 @@ NvmExpressPeimEntry ( // Initialize the NVME controller // Status = NvmeControllerInit (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: Controller initialization fail for Controller %d with Status - %r.\n", @@ -362,7 +362,7 @@ NvmExpressPeimEntry ( // Enumerate the NVME namespaces on the controller // Status = NvmeDiscoverNamespaces (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No active namespace was found on the controller // diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c index a9bf4f819..e58198143 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c @@ -447,7 +447,7 @@ NvmeBlockIoPeimGetMediaInfo2 ( DeviceIndex, &Media ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c index 1d7e3d26e..40e641870 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c @@ -229,7 +229,7 @@ NvmeDisableController ( // Read Controller Configuration Register. // Status = NVME_GET_CC (Private, &Cc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NVME_GET_CC fail, Status - %r\n", __FUNCTION__, Status)); goto ErrorExit; } @@ -240,14 +240,14 @@ NvmeDisableController ( // Disable the controller. // Status = NVME_SET_CC (Private, &Cc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NVME_SET_CC fail, Status - %r\n", __FUNCTION__, Status)); goto ErrorExit; } } Status = NvmeWaitController (Private, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NvmeWaitController fail, Status - %r\n", __FUNCTION__, Status)); goto ErrorExit; } @@ -286,13 +286,13 @@ NvmeEnableController ( Cc.Iosqes = 6; Cc.Iocqes = 4; Status = NVME_SET_CC (Private, &Cc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NVME_SET_CC fail, Status - %r\n", __FUNCTION__, Status)); goto ErrorExit; } Status = NvmeWaitController (Private, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NvmeWaitController fail, Status - %r\n", __FUNCTION__, Status)); goto ErrorExit; } @@ -595,7 +595,7 @@ NvmeControllerInit ( // Disable the NVME controller first // Status = NvmeDisableController (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NvmeDisableController fail, Status - %r\n", __FUNCTION__, Status)); return Status; } @@ -643,7 +643,7 @@ NvmeControllerInit ( // Enable the NVME controller // Status = NvmeEnableController (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NvmeEnableController fail, Status - %r\n", __FUNCTION__, Status)); return Status; } @@ -658,7 +658,7 @@ NvmeControllerInit ( } } Status = NvmeIdentifyController (Private, Private->ControllerData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NvmeIdentifyController fail, Status - %r\n", __FUNCTION__, Status)); return Status; } @@ -680,12 +680,12 @@ NvmeControllerInit ( // Create one I/O completion queue and one I/O submission queue // Status = NvmeCreateIoCompletionQueue (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: Create IO completion queue fail, Status - %r\n", __FUNCTION__, Status)); return Status; } Status = NvmeCreateIoSubmissionQueue (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: Create IO submission queue fail, Status - %r\n", __FUNCTION__, Status)); } diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c index 370a54e5a..ed033990e 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c @@ -471,7 +471,7 @@ NvmePassThruExecute ( &PhyAddr, &MapData ); - if (EFI_ERROR (Status) || (MapLength != Packet->TransferLength)) { + if (EFI_ERROR(Status) || (MapLength != Packet->TransferLength)) { Status = EFI_OUT_OF_RESOURCES; DEBUG ((DEBUG_ERROR, "%a: Fail to map data buffer.\n", __FUNCTION__)); goto Exit; @@ -489,7 +489,7 @@ NvmePassThruExecute ( &PhyAddr, &MapMeta ); - if (EFI_ERROR (Status) || (MapLength != Packet->MetadataLength)) { + if (EFI_ERROR(Status) || (MapLength != Packet->MetadataLength)) { Status = EFI_OUT_OF_RESOURCES; DEBUG ((DEBUG_ERROR, "%a: Fail to map meta data buffer.\n", __FUNCTION__)); goto Exit; @@ -554,7 +554,7 @@ NvmePassThruExecute ( } Data32 = ReadUnaligned32 ((UINT32 *)&Private->SqTdbl[QueueId]); Status = NVME_SET_SQTDBL (Private, QueueId, &Data32); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "%a: NVME_SET_SQTDBL fail, Status - %r\n", __FUNCTION__, Status)); goto Exit; } @@ -580,7 +580,7 @@ NvmePassThruExecute ( // DEBUG ((DEBUG_ERROR, "%a: Timeout occurs for the PassThru command.\n", __FUNCTION__)); Status = NvmeControllerInit (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } else { // diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiS3.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiS3.c index f409285d5..f2f3fd5a7 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiS3.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiS3.c @@ -57,7 +57,7 @@ NvmeS3SkipThisController ( } Status = RestoreLockBox (&gS3StorageDeviceInitListGuid, S3InitDevices, &S3InitDevicesLength); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Skip; } } @@ -78,7 +78,7 @@ NvmeS3SkipThisController ( &DevicePathInstLength, &EntireEnd ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiStorageSecurity.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiStorageSecurity.c index 094d61bb8..8e1886573 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiStorageSecurity.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiStorageSecurity.c @@ -103,7 +103,7 @@ TrustTransferNvmeDevice ( ); if (!IsTrustSend) { - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *TransferLengthOut = 0; } else { *TransferLengthOut = (UINTN) TransferLength; diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c index b020ce50c..d7fe71008 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c @@ -84,7 +84,7 @@ PciBusEntryPoint ( &gPciBusComponentName, &gPciBusComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) { // @@ -166,7 +166,7 @@ PciBusDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -195,7 +195,7 @@ PciBusDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -310,7 +310,7 @@ PciBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Report Status Code to indicate PCI bus starts @@ -340,7 +340,7 @@ PciBusDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PciEnumerator (Controller, PciRootBridgeIo->ParentHandle); } } else { @@ -350,7 +350,7 @@ PciBusDriverBindingStart ( Status = PciEnumeratorLight (Controller); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -368,7 +368,7 @@ PciBusDriverBindingStart ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return Status; @@ -438,7 +438,7 @@ PciBusDriverBindingStop ( // Status = DeRegisterPciDevice (Controller, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c index 6283d6022..7a3114a13 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c @@ -232,7 +232,7 @@ LocatePciExpressCapabilityRegBlock ( 1, &CapabilityEntry ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index 292dd25da..e6d751929 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -93,18 +93,18 @@ FreePciDevice ( // Assume all children have been removed underneath this device // if (PciIoDevice->ResourcePaddingDescriptors != NULL) { - FreePool (PciIoDevice->ResourcePaddingDescriptors); + FreePool(PciIoDevice->ResourcePaddingDescriptors); } if (PciIoDevice->DevicePath != NULL) { - FreePool (PciIoDevice->DevicePath); + FreePool(PciIoDevice->DevicePath); } if (PciIoDevice->BusNumberRanges != NULL) { - FreePool (PciIoDevice->BusNumberRanges); + FreePool(PciIoDevice->BusNumberRanges); } - FreePool (PciIoDevice); + FreePool(PciIoDevice); } /** @@ -225,7 +225,7 @@ RegisterPciDevice ( &PciIoDevice->PciIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -251,7 +251,7 @@ RegisterPciDevice ( &PlatformOpRomBuffer, &PlatformOpRomSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIoDevice->EmbeddedRom = FALSE; PciIoDevice->RomSize = (UINT32) PlatformOpRomSize; PciIoDevice->PciIo.RomSize = PlatformOpRomSize; @@ -277,7 +277,7 @@ RegisterPciDevice ( &PlatformOpRomBuffer, &PlatformOpRomSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIoDevice->EmbeddedRom = FALSE; PciIoDevice->RomSize = (UINT32) PlatformOpRomSize; PciIoDevice->PciIo.RomSize = PlatformOpRomSize; @@ -311,7 +311,7 @@ RegisterPciDevice ( &PciIoDevice->LoadFile2, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( PciIoDevice->Handle, &gEfiDevicePathProtocolGuid, @@ -349,7 +349,7 @@ RegisterPciDevice ( &PciIoDevice->PciDriverOverride, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( PciIoDevice->Handle, &gEfiDevicePathProtocolGuid, @@ -379,7 +379,7 @@ RegisterPciDevice ( PciIoDevice->Handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -473,7 +473,7 @@ DeRegisterPciDevice ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (PciIo); // @@ -495,7 +495,7 @@ DeRegisterPciDevice ( Node = PCI_IO_DEVICE_FROM_LINK (CurrentLink); Status = DeRegisterPciDevice (Controller, Node->Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -539,7 +539,7 @@ DeRegisterPciDevice ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Try to uninstall LoadFile2 protocol if exists // @@ -551,7 +551,7 @@ DeRegisterPciDevice ( Controller, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->UninstallMultipleProtocolInterfaces ( Handle, &gEfiLoadFile2ProtocolGuid, @@ -566,7 +566,7 @@ DeRegisterPciDevice ( } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiPciRootBridgeIoProtocolGuid, @@ -852,8 +852,8 @@ CreateRootBridge ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { - FreePool (Dev); + if (EFI_ERROR(Status)) { + FreePool(Dev); return NULL; } @@ -874,7 +874,7 @@ CreateRootBridge ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreePciDevice (Dev); return NULL; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.c index 3531e6b6e..7f30f3a4f 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.c @@ -49,7 +49,7 @@ LocateImageHandle ( &HandleNum, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -58,7 +58,7 @@ LocateImageHandle ( for (Index = 0; Index < HandleNum; Index++) { Status = gBS->HandleProtocol (Handles[Index], &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &DevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } if ((ImagePathSize == GetDevicePathSize (DevicePath)) && @@ -69,7 +69,7 @@ LocateImageHandle ( } } - FreePool (Handles); + FreePool(Handles); return ImageHandle; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c index 8db1ebf8e..81a789e88 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c @@ -41,7 +41,7 @@ PciEnumerator ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -50,7 +50,7 @@ PciEnumerator ( // Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginEnumeration); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -59,7 +59,7 @@ PciEnumerator ( // Status = PciHostBridgeEnumerator (PciResAlloc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -68,7 +68,7 @@ PciEnumerator ( // Status = PciHostBridgeResourceAllocator (PciResAlloc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -77,7 +77,7 @@ PciEnumerator ( // Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeEndEnumeration); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -86,7 +86,7 @@ PciEnumerator ( // Status = PciHostBridgeP2CProcess (PciResAlloc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -94,7 +94,7 @@ PciEnumerator ( // Process attributes for devices on this host bridge // Status = PciHostBridgeDeviceAttribute (PciResAlloc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -154,7 +154,7 @@ PciRootBridgeEnumerator ( (VOID **) &Configuration ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -216,7 +216,7 @@ PciRootBridgeEnumerator ( &PaddedBusRange ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -226,7 +226,7 @@ PciRootBridgeEnumerator ( // Status = PciAllocateBusNumber (RootBridgeDev, SubBusNumber, PaddedBusRange, &SubBusNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -362,21 +362,21 @@ PciAssignBusNumber ( Func ); - if (EFI_ERROR (Status) && Func == 0) { + if (EFI_ERROR(Status) && Func == 0) { // // go to next device if there is no Function 0 // break; } - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && (IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci))) { // // Reserved one bus for cardbus bridge // Status = PciAllocateBusNumber (Bridge, *SubBusNumber, 1, SubBusNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } SecondBus = *SubBusNumber; @@ -424,7 +424,7 @@ PciAssignBusNumber ( SubBusNumber ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } } @@ -490,7 +490,7 @@ DetermineRootBridgeAttributes ( &Attributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -612,7 +612,7 @@ PciHostBridgeDeviceAttribute ( // Set the attributes for devcies behind the Root Bridge // Status = DetermineDeviceAttribute (RootBridgeDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -723,7 +723,7 @@ RejectPciDevice ( // if ( IS_PCI_BRIDGE(&PciDevice->Pci) && PciDevice->ResourcePaddingDescriptors != NULL ) { - FreePool (PciDevice->ResourcePaddingDescriptors); + FreePool(PciDevice->ResourcePaddingDescriptors); PciDevice->ResourcePaddingDescriptors = NULL; return EFI_SUCCESS; } @@ -1393,7 +1393,7 @@ PciBridgeEnumerator ( PciIo = &(BridgeDev->PciIo); Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x19, 1, &StartBusNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1403,25 +1403,25 @@ PciBridgeEnumerator ( &SubBusNumber ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PciPciDeviceInfoCollector (BridgeDev, StartBusNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PciBridgeResourceAllocator (BridgeDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = DetermineDeviceAttribute (BridgeDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1521,7 +1521,7 @@ PciBridgeResourceAllocator ( &PMem64Base ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1571,11 +1571,11 @@ PciBridgeResourceAllocator ( DestroyResourceTree (PMem64Bridge); DestroyResourceTree (Mem64Bridge); - gBS->FreePool (IoBridge); - gBS->FreePool (Mem32Bridge); - gBS->FreePool (PMem32Bridge); - gBS->FreePool (PMem64Bridge); - gBS->FreePool (Mem64Bridge); + gBS->FreePool(IoBridge); + gBS->FreePool(Mem32Bridge); + gBS->FreePool(PMem32Bridge); + gBS->FreePool(PMem64Bridge); + gBS->FreePool(Mem64Bridge); return EFI_SUCCESS; } @@ -1761,7 +1761,7 @@ NotifyPhase ( (VOID **) &PciRootBridgeIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -1791,7 +1791,7 @@ NotifyPhase ( (VOID **) &PciRootBridgeIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -1895,7 +1895,7 @@ PreprocessController ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -2047,7 +2047,7 @@ PciHotPlugRequestNotify ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -2081,7 +2081,7 @@ PciHotPlugRequestNotify ( Status = PciBridgeEnumerator (Bridge); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -2114,7 +2114,7 @@ PciHotPlugRequestNotify ( // Status = DeRegisterPciDevice (RootBridgeHandle, ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2159,7 +2159,7 @@ SearchHostBridgeHandle ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index c7eafff59..4f61d1e78 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -57,7 +57,7 @@ PciDevicePresent ( Pci ); - if (!EFI_ERROR (Status) && (Pci->Hdr).VendorId != 0xffff) { + if (!EFI_ERROR(Status) && (Pci->Hdr).VendorId != 0xffff) { // // Read the entire config header for the device // @@ -120,14 +120,14 @@ PciPciDeviceInfoCollector ( (UINT8) Func ); - if (EFI_ERROR (Status) && Func == 0) { + if (EFI_ERROR(Status) && Func == 0) { // // go to next device if there is no Function 0 // break; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Call back to host bridge function @@ -150,7 +150,7 @@ PciPciDeviceInfoCollector ( // Recursively scan PCI busses on the other side of PCI-PCI bridges // // - if (!EFI_ERROR (Status) && (IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci))) { + if (!EFI_ERROR(Status) && (IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci))) { // // If it is PPB, we need to get the secondary bus to continue the enumeration @@ -159,7 +159,7 @@ PciPciDeviceInfoCollector ( Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET, 1, &SecBus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -643,7 +643,7 @@ GatherPpbInfo ( // PrefetchableMemoryBase = (UINT16)(PMemBaseLimit & 0xffff); PrefetchableMemoryLimit = (UINT16)(PMemBaseLimit >> 16); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && (PrefetchableMemoryBase & 0x000f) == 0x0001 && (PrefetchableMemoryLimit & 0x000f) == 0x0001) { Status = BarExisted ( @@ -653,7 +653,7 @@ GatherPpbInfo ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIoDevice->Decodes |= EFI_BRIDGE_PMEM32_DECODE_SUPPORTED; PciIoDevice->Decodes |= EFI_BRIDGE_PMEM64_DECODE_SUPPORTED; } else { @@ -1126,7 +1126,7 @@ GetFastBackToBackSupport ( // PciIo = &PciIoDevice->PciIo; Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16, StatusIndex, 1, &StatusRegister); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1208,7 +1208,7 @@ DetermineDeviceAttribute ( &PciIoDevice->Supports, &PciIoDevice->Attributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1272,14 +1272,14 @@ DetermineDeviceAttribute ( Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink); Status = DetermineDeviceAttribute (Temp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // Detect Fast Back to Back support for the device under the bridge // Status = GetFastBackToBackSupport (Temp, PCI_PRIMARY_STATUS_OFFSET); - if (FastB2BSupport && EFI_ERROR (Status)) { + if (FastB2BSupport && EFI_ERROR(Status)) { FastB2BSupport = FALSE; } @@ -1294,7 +1294,7 @@ DetermineDeviceAttribute ( Status = GetFastBackToBackSupport (PciIoDevice, PCI_BRIDGE_STATUS_REGISTER_OFFSET); - if (EFI_ERROR (Status) || (!FastB2BSupport)) { + if (EFI_ERROR(Status) || (!FastB2BSupport)) { FastB2BSupport = FALSE; PCI_DISABLE_BRIDGE_CONTROL_REGISTER (PciIoDevice, EFI_PCI_BRIDGE_CONTROL_FAST_BACK_TO_BACK); } else { @@ -1372,7 +1372,7 @@ UpdatePciInfo ( } - if (EFI_ERROR (Status) || Configuration == NULL ) { + if (EFI_ERROR(Status) || Configuration == NULL ) { return EFI_UNSUPPORTED; } @@ -1477,7 +1477,7 @@ UpdatePciInfo ( Ptr++; } - FreePool (Configuration); + FreePool(Configuration); return EFI_SUCCESS; } @@ -1594,7 +1594,7 @@ PciIovParseVfBar ( &OriginalValue ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { PciIoDevice->VfPciBar[BarIndex].BaseAddress = 0; PciIoDevice->VfPciBar[BarIndex].Length = 0; PciIoDevice->VfPciBar[BarIndex].Alignment = 0; @@ -1684,7 +1684,7 @@ PciIovParseVfBar ( &OriginalValue ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Offset + 4; } @@ -1778,7 +1778,7 @@ PciParseBar ( &OriginalValue ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { PciIoDevice->PciBar[BarIndex].BaseAddress = 0; PciIoDevice->PciBar[BarIndex].Length = 0; PciIoDevice->PciBar[BarIndex].Alignment = 0; @@ -1886,7 +1886,7 @@ PciParseBar ( &OriginalValue ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // the high 32 bit does not claim any BAR, we need to re-check the low 32 bit BAR again // @@ -2152,7 +2152,7 @@ CreatePciIoDevice ( &PciIoDevice->PciExpressCapabilityOffset, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIoDevice->IsPciExp = TRUE; } @@ -2166,7 +2166,7 @@ CreatePciIoDevice ( &PciIoDevice->AriCapabilityOffset, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // We need to enable ARI feature before calculate BusReservation, // because FirstVFOffset and VFStride may change after that. @@ -2230,7 +2230,7 @@ CreatePciIoDevice ( &PciIoDevice->SrIovCapabilityOffset, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UINT32 SupportedPageSize; UINT16 VFStride; UINT16 FirstVFOffset; @@ -2344,7 +2344,7 @@ CreatePciIoDevice ( &PciIoDevice->MrIovCapabilityOffset, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, " MR-IOV: CapOffset = 0x%x\n", PciIoDevice->MrIovCapabilityOffset)); } } @@ -2414,13 +2414,13 @@ PciEnumeratorLight ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { return Status; } Status = PciRootBridgeIo->Configuration (PciRootBridgeIo, (VOID **) &Descriptors); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2446,7 +2446,7 @@ PciEnumeratorLight ( (UINT8) MinBus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Remove those PCI devices which are rejected when full enumeration @@ -2560,7 +2560,7 @@ StartManagingRootBridge ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { return Status; } @@ -2608,7 +2608,7 @@ IsPciDeviceRejected ( Mask = (BarOffset < 0x2C) ? 0xFFFFF000 : 0xFFFFFFFC; Status = BarExisted (PciIoDevice, BarOffset, &TestValue, &OldValue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2629,7 +2629,7 @@ IsPciDeviceRejected ( // Test PCI devices // Status = BarExisted (PciIoDevice, BarOffset, &TestValue, &OldValue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2722,14 +2722,14 @@ ResetAllPpbBusNumber ( Func ); - if (EFI_ERROR (Status) && Func == 0) { + if (EFI_ERROR(Status) && Func == 0) { // // go to next device if there is no Function 0 // break; } - if (!EFI_ERROR (Status) && (IS_PCI_BRIDGE (&Pci))) { + if (!EFI_ERROR(Status) && (IS_PCI_BRIDGE (&Pci))) { Register = 0; Address = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x18); diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c index 0dc8ec23b..e7b8043df 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c @@ -103,7 +103,7 @@ InitializeHotPlugSupport ( (VOID **) &gPciHotPlugInit ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -113,7 +113,7 @@ InitializeHotPlugSupport ( &HpcList ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gPciRootHpcPool = HpcList; gPciRootHpcCount = HpcCount; @@ -219,7 +219,7 @@ CreateEventForHpc ( &((gPciRootHpcData + HpIndex)->Event) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *Event = (gPciRootHpcData + HpIndex)->Event; } @@ -303,7 +303,7 @@ IsSHPC ( // If the PCI-PCI bridge has the hot plug controller build-in, // then return TRUE; // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return TRUE; } @@ -355,7 +355,7 @@ SupportsPcieHotplug ( 1, &Capability ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -385,7 +385,7 @@ SupportsPcieHotplug ( 1, &SlotCapability ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -429,7 +429,7 @@ GetResourcePaddingForHpb ( &Attributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c index 40171f9ed..0bd6119f1 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c @@ -216,7 +216,7 @@ PciIoPollMem ( } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, 1, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -230,7 +230,7 @@ PciIoPollMem ( if (FeaturePcdGet (PcdUnalignedPciIoEnable)) { if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) { Status = PciIoMemRead (This, Width, BarIndex, Offset, 1, Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((*Result & Mask) == Value || Delay == 0) { @@ -243,7 +243,7 @@ PciIoPollMem ( gBS->Stall (10); Status = PciIoMemRead (This, Width, BarIndex, Offset, 1, Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((*Result & Mask) == Value) { @@ -267,7 +267,7 @@ PciIoPollMem ( Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, @@ -323,7 +323,7 @@ PciIoPollIo ( } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, 1, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -333,7 +333,7 @@ PciIoPollIo ( if (FeaturePcdGet (PcdUnalignedPciIoEnable)) { if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) { Status = PciIoIoRead (This, Width, BarIndex, Offset, 1, Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((*Result & Mask) == Value || Delay == 0) { @@ -346,7 +346,7 @@ PciIoPollIo ( gBS->Stall (10); Status = PciIoIoRead (This, Width, BarIndex, Offset, 1, Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((*Result & Mask) == Value) { @@ -370,7 +370,7 @@ PciIoPollIo ( Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, @@ -426,7 +426,7 @@ PciIoMemRead ( } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, Count, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -449,7 +449,7 @@ PciIoMemRead ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_READ_ERROR, @@ -505,7 +505,7 @@ PciIoMemWrite ( } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, Count, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -527,7 +527,7 @@ PciIoMemWrite ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_WRITE_ERROR, @@ -583,7 +583,7 @@ PciIoIoRead ( } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, Count, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -605,7 +605,7 @@ PciIoIoRead ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_READ_ERROR, @@ -661,7 +661,7 @@ PciIoIoWrite ( } Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, Count, &Offset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -683,7 +683,7 @@ PciIoIoWrite ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_WRITE_ERROR, @@ -730,7 +730,7 @@ PciIoConfigRead ( Address = Offset; Status = PciIoVerifyConfigAccess (PciIoDevice, Width, Count, &Address); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -752,7 +752,7 @@ PciIoConfigRead ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_READ_ERROR, @@ -799,7 +799,7 @@ PciIoConfigWrite ( Address = Offset; Status = PciIoVerifyConfigAccess (PciIoDevice, Width, Count, &Address); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -821,7 +821,7 @@ PciIoConfigWrite ( Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_WRITE_ERROR, @@ -893,12 +893,12 @@ PciIoCopyMem ( } Status = PciIoVerifyBarAccess (PciIoDevice, DestBarIndex, PciBarTypeMem, Width, Count, &DestOffset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } Status = PciIoVerifyBarAccess (PciIoDevice, SrcBarIndex, PciBarTypeMem, Width, Count, &SrcOffset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -920,7 +920,7 @@ PciIoCopyMem ( Count ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, @@ -990,7 +990,7 @@ PciIoMap ( Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, @@ -999,7 +999,7 @@ PciIoMap ( } if (mIoMmuProtocol != NULL) { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { switch (Operation) { case EfiPciIoOperationBusMasterRead: IoMmuAttribute = EDKII_IOMMU_ACCESS_READ; @@ -1062,7 +1062,7 @@ PciIoUnmap ( Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, @@ -1127,7 +1127,7 @@ PciIoAllocateBuffer ( Attributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, @@ -1169,7 +1169,7 @@ PciIoFreeBuffer ( HostAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, @@ -1205,7 +1205,7 @@ PciIoFlush ( Status = PciIoDevice->PciRootBridgeIo->Flush ( PciIoDevice->PciRootBridgeIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, @@ -1333,7 +1333,7 @@ ModifyRootBridgeAttributes ( &PciRootBridgeSupports, &PciRootBridgeAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1364,7 +1364,7 @@ ModifyRootBridgeAttributes ( NULL, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The PCI Root Bridge could not modify the attributes, so return the error. // @@ -1556,7 +1556,7 @@ PciIoAttributes ( Attributes, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1566,7 +1566,7 @@ PciIoAttributes ( (~Attributes) & (PciIoDevice->Supports), NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1685,7 +1685,7 @@ PciIoAttributes ( // Status = SupportPaletteSnoopAttributes (PciIoDevice, Operation); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Enable operation is forbidden, so mask the bit in attributes @@ -1765,7 +1765,7 @@ PciIoAttributes ( } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, @@ -1802,7 +1802,7 @@ GetMmioAddressTranslationOffset ( RootBridgeIo, (VOID **) &Configuration ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return (UINT64) -1; } @@ -1962,7 +1962,7 @@ PciIoGetBarAttributes ( Descriptor->AddrLen ); if (Descriptor->AddrTranslationOffset == (UINT64) -1) { - FreePool (Descriptor); + FreePool(Descriptor); return EFI_UNSUPPORTED; } } @@ -2048,7 +2048,7 @@ PciIoSetBarAttributes ( (UINT32) *Length, &NonRelativeOffset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c index 5b55fb5d3..958f13c23 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c @@ -331,7 +331,7 @@ DumpResourceMap ( NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_INFO, "Bridge [%02x|%02x|%02x]\n", Bridge->BusNumber, Bridge->DeviceNumber, Bridge->FunctionNumber @@ -344,7 +344,7 @@ DumpResourceMap ( ); DEBUG ((EFI_D_INFO, "Root Bridge %s\n", Str != NULL ? Str : L"")); if (Str != NULL) { - FreePool (Str); + FreePool(Str); } } @@ -372,7 +372,7 @@ DumpResourceMap ( } DumpResourceMap (Device, ChildResources, ChildResourceCount); - FreePool (ChildResources); + FreePool(ChildResources); } } } @@ -565,17 +565,17 @@ PciHostBridgeResourceAllocator ( // It's a fatal error so assertion is added. // DEBUG ((EFI_D_INFO, "PciBus: HostBridge->SubmitResources() - %r\n", Status)); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // // Free acpi resource node // if (AcpiConfig != NULL) { - FreePool (AcpiConfig); + FreePool(AcpiConfig); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Destroy all the resource tree // @@ -601,7 +601,7 @@ PciHostBridgeResourceAllocator ( // // If Hot Plug is not supported // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Allocation failed, then return // @@ -619,7 +619,7 @@ PciHostBridgeResourceAllocator ( // // If Hot Plug is supported // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Allocation succeed, then continue the following // @@ -664,7 +664,7 @@ PciHostBridgeResourceAllocator ( &AcpiConfig ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -680,7 +680,7 @@ PciHostBridgeResourceAllocator ( &Mem64ResStatus, &PMem64ResStatus ); - FreePool (AcpiConfig); + FreePool(AcpiConfig); } } // @@ -727,7 +727,7 @@ PciHostBridgeResourceAllocator ( NotifyPhase (PciResAlloc, EfiPciHostBridgeFreeResources); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -751,7 +751,7 @@ PciHostBridgeResourceAllocator ( // Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeSetResources); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -779,7 +779,7 @@ PciHostBridgeResourceAllocator ( &AcpiConfig ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -885,7 +885,7 @@ PciHostBridgeResourceAllocator ( DumpResourceMap (RootBridgeDev, Resources, ARRAY_SIZE (Resources)); ); - FreePool (AcpiConfig); + FreePool(AcpiConfig); } // @@ -1031,14 +1031,14 @@ PciScanBus ( Func ); - if (EFI_ERROR (Status) && Func == 0) { + if (EFI_ERROR(Status) && Func == 0) { // // go to next device if there is no Function 0 // break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -1054,7 +1054,7 @@ PciScanBus ( &PciDevice ); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); PciAddress = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0); @@ -1088,7 +1088,7 @@ PciScanBus ( Status = CreateEventForHpc (HpIndex, &Event); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); Status = gPciHotPlugInit->InitializeRootHpc ( gPciHotPlugInit, @@ -1136,7 +1136,7 @@ PciScanBus ( &Attributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1149,9 +1149,9 @@ PciScanBus ( &BusRange ); - FreePool (Descriptors); + FreePool(Descriptors); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { BusPadding = TRUE; } else if (Status != EFI_NOT_FOUND) { // @@ -1164,7 +1164,7 @@ PciScanBus ( } Status = PciAllocateBusNumber (Bridge, *SubBusNumber, 1, SubBusNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } SecondBus = *SubBusNumber; @@ -1217,7 +1217,7 @@ PciScanBus ( SubBusNumber, PaddedBusRange ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1235,7 +1235,7 @@ PciScanBus ( // Reserve the larger one between the actual occupied bus number and padded bus number // Status = PciAllocateBusNumber (PciDevice, SecondBus, (UINT8) (BusRange), &PaddedSubBus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } *SubBusNumber = MAX (PaddedSubBus, *SubBusNumber); @@ -1263,7 +1263,7 @@ PciScanBus ( if (TempReservedBusNum < PciDevice->ReservedBusNum) { Status = PciAllocateBusNumber (PciDevice, *SubBusNumber, (UINT8) (PciDevice->ReservedBusNum - TempReservedBusNum), SubBusNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } TempReservedBusNum = PciDevice->ReservedBusNum; @@ -1339,10 +1339,10 @@ PciRootBridgeP2CProcess ( &State ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PciBridgeEnumerator (Temp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1400,7 +1400,7 @@ PciHostBridgeP2CProcess ( } Status = PciRootBridgeP2CProcess (RootBridgeDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1447,7 +1447,7 @@ PciHostBridgeEnumerator ( // Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1478,7 +1478,7 @@ PciHostBridgeEnumerator ( } else { DestroyRootBridge (RootBridgeDev); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1505,7 +1505,7 @@ PciHostBridgeEnumerator ( RootBridgeHandle, (VOID **) &Configuration ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1519,7 +1519,7 @@ PciHostBridgeEnumerator ( StartBusNumber ); - FreePool (Configuration); + FreePool(Configuration); Link = RemoveEntryList (Link); DestroyRootBridge (RootBridgeDev); } @@ -1529,7 +1529,7 @@ PciHostBridgeEnumerator ( // Status = AllRootHPCInitialized (STALL_1_SECOND * 15); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Some root HPC failed to initialize\n")); return Status; } @@ -1539,7 +1539,7 @@ PciHostBridgeEnumerator ( // Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1565,7 +1565,7 @@ PciHostBridgeEnumerator ( ); DestroyRootBridge (RootBridgeDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1581,7 +1581,7 @@ PciHostBridgeEnumerator ( // Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginResourceAllocation); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1599,20 +1599,20 @@ PciHostBridgeEnumerator ( Status = StartManagingRootBridge (RootBridgeDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } PciRootBridgeIo = RootBridgeDev->PciRootBridgeIo; Status = PciRootBridgeIo->Configuration (PciRootBridgeIo, (VOID **) &Descriptors); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PciGetBusRange (&Descriptors, &MinBus, NULL, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1635,7 +1635,7 @@ PciHostBridgeEnumerator ( (UINT8) MinBus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c index c994ed5fe..4d3d49a0e 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c @@ -107,7 +107,7 @@ LocalLoadFile2 ( // Compressed: Uncompress before copying // Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **) &Decompress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } Status = Decompress->GetInfo ( @@ -117,7 +117,7 @@ LocalLoadFile2 ( &DestinationSize, &ScratchSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -141,9 +141,9 @@ LocalLoadFile2 ( Scratch, ScratchSize ); - FreePool (Scratch); + FreePool(Scratch); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } return EFI_SUCCESS; @@ -273,7 +273,7 @@ GetOpRomInfo ( 1, &AllOnes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -287,7 +287,7 @@ GetOpRomInfo ( 1, &AllOnes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -427,7 +427,7 @@ LoadOpRomImage ( RomPcir = AllocatePool (sizeof (PCI_DATA_STRUCTURE)); if (RomPcir == NULL) { - FreePool (RomHeader); + FreePool(RomHeader); return EFI_OUT_OF_RESOURCES; } @@ -511,8 +511,8 @@ LoadOpRomImage ( Image = AllocatePool ((UINT32) RomImageSize); if (Image == NULL) { RomDecode (PciDevice, RomBarIndex, RomBar, FALSE); - FreePool (RomHeader); - FreePool (RomPcir); + FreePool(RomHeader); + FreePool(RomPcir); return EFI_OUT_OF_RESOURCES; } @@ -552,8 +552,8 @@ LoadOpRomImage ( // // Free allocated memory // - FreePool (RomHeader); - FreePool (RomPcir); + FreePool(RomHeader); + FreePool(RomPcir); return RetStatus; } @@ -727,7 +727,7 @@ ProcessOpRomImage ( BufferSize, &ImageHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Record the Option ROM Image device path when LoadImage fails. // PciOverride.GetDriver() will try to look for the Image Handle using the device path later. @@ -735,7 +735,7 @@ ProcessOpRomImage ( AddDriver (PciDevice, NULL, PciOptionRomImageDevicePath); } else { Status = gBS->StartImage (ImageHandle, NULL, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Record the Option ROM Image Handle // @@ -752,7 +752,7 @@ ProcessOpRomImage ( RetStatus = EFI_SUCCESS; } } - FreePool (PciOptionRomImageDevicePath); + FreePool(PciOptionRomImageDevicePath); NextImage: RomBarOffset += ImageSize; diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciPowerManagement.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciPowerManagement.c index c7f3ea509..0f61524b5 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciPowerManagement.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciPowerManagement.c @@ -37,7 +37,7 @@ ResetPowerManagementFeature ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -56,7 +56,7 @@ ResetPowerManagementFeature ( &PowerManagementCSR ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Clear PME_Status bit // diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c index 4969ee0f6..4e16ac19c 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c @@ -205,14 +205,14 @@ CalculateApertureIo16 ( ); } - if (EFI_ERROR (Status) && gPciOverrideProtocol != NULL) { + if (EFI_ERROR(Status) && gPciOverrideProtocol != NULL) { Status = gPciOverrideProtocol->GetPlatformPolicy ( gPciOverrideProtocol, &PciPolicy ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((PciPolicy & EFI_RESERVE_ISA_IO_ALIAS) != 0) { mReserveIsaAliases = TRUE; } @@ -843,7 +843,7 @@ CreateResourceMap ( IoBridge ); } else { - FreePool (IoBridge); + FreePool(IoBridge); IoBridge = NULL; } @@ -859,7 +859,7 @@ CreateResourceMap ( Mem32Bridge ); } else { - FreePool (Mem32Bridge); + FreePool(Mem32Bridge); Mem32Bridge = NULL; } @@ -875,7 +875,7 @@ CreateResourceMap ( PMem32Bridge ); } else { - FreePool (PMem32Bridge); + FreePool(PMem32Bridge); PMem32Bridge = NULL; } @@ -891,7 +891,7 @@ CreateResourceMap ( Mem64Bridge ); } else { - FreePool (Mem64Bridge); + FreePool(Mem64Bridge); Mem64Bridge = NULL; } @@ -907,7 +907,7 @@ CreateResourceMap ( PMem64Bridge ); } else { - FreePool (PMem64Bridge); + FreePool(PMem64Bridge); PMem64Bridge = NULL; } @@ -1235,7 +1235,7 @@ ProgramResource ( // Program the PCI devices under this bridge // Status = ProgramResource (Base + Node->Offset, Node); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1778,7 +1778,7 @@ DestroyResourceTree ( DestroyResourceTree (Temp); } - FreePool (Temp); + FreePool(Temp); } } diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c index 4ab9415c9..dcafc3e94 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c @@ -119,7 +119,7 @@ IntersectIoDescriptor ( Status = gDS->AddIoSpace (EfiGcdIoTypeIo, IntersectionBase, IntersectionEnd - IntersectionBase); - DEBUG ((EFI_ERROR (Status) ? EFI_D_ERROR : EFI_D_VERBOSE, + DEBUG ((EFI_ERROR(Status) ? EFI_D_ERROR : EFI_D_VERBOSE, "%a: %a: add [%Lx, %Lx): %r\n", gEfiCallerBaseName, __FUNCTION__, IntersectionBase, IntersectionEnd, Status)); return Status; @@ -154,7 +154,7 @@ AddIoSpace ( EFI_GCD_IO_SPACE_DESCRIPTOR *IoSpaceMap; Status = gDS->GetIoSpaceMap (&NumberOfDescriptors, &IoSpaceMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "%a: %a: GetIoSpaceMap(): %r\n", gEfiCallerBaseName, __FUNCTION__, Status)); return Status; @@ -162,7 +162,7 @@ AddIoSpace ( for (Index = 0; Index < NumberOfDescriptors; Index++) { Status = IntersectIoDescriptor (Base, Length, &IoSpaceMap[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeIoSpaceMap; } } @@ -181,13 +181,13 @@ AddIoSpace ( CheckBase < Base + Length; CheckBase = Descriptor.BaseAddress + Descriptor.Length) { CheckStatus = gDS->GetIoSpaceDescriptor (CheckBase, &Descriptor); - ASSERT_EFI_ERROR (CheckStatus); + ASSERT_EFI_ERROR(CheckStatus); ASSERT (Descriptor.GcdIoType == EfiGcdIoTypeIo); } ); FreeIoSpaceMap: - FreePool (IoSpaceMap); + FreePool(IoSpaceMap); return Status; } @@ -263,7 +263,7 @@ IntersectMemoryDescriptor ( IntersectionBase, IntersectionEnd - IntersectionBase, Capabilities); - DEBUG ((EFI_ERROR (Status) ? EFI_D_ERROR : EFI_D_VERBOSE, + DEBUG ((EFI_ERROR(Status) ? EFI_D_ERROR : EFI_D_VERBOSE, "%a: %a: add [%Lx, %Lx): %r\n", gEfiCallerBaseName, __FUNCTION__, IntersectionBase, IntersectionEnd, Status)); return Status; @@ -301,7 +301,7 @@ AddMemoryMappedIoSpace ( EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap; Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "%a: %a: GetMemorySpaceMap(): %r\n", gEfiCallerBaseName, __FUNCTION__, Status)); return Status; @@ -310,7 +310,7 @@ AddMemoryMappedIoSpace ( for (Index = 0; Index < NumberOfDescriptors; Index++) { Status = IntersectMemoryDescriptor (Base, Length, Capabilities, &MemorySpaceMap[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeMemorySpaceMap; } } @@ -329,14 +329,14 @@ AddMemoryMappedIoSpace ( CheckBase < Base + Length; CheckBase = Descriptor.BaseAddress + Descriptor.Length) { CheckStatus = gDS->GetMemorySpaceDescriptor (CheckBase, &Descriptor); - ASSERT_EFI_ERROR (CheckStatus); + ASSERT_EFI_ERROR(CheckStatus); ASSERT (Descriptor.GcdMemoryType == EfiGcdMemoryTypeMemoryMappedIo); ASSERT ((Descriptor.Capabilities & Capabilities) == Capabilities); } ); FreeMemorySpaceMap: - FreePool (MemorySpaceMap); + FreePool(MemorySpaceMap); return Status; } @@ -399,7 +399,7 @@ InitializePciHostBridge ( } Status = gBS->LocateProtocol (&gEfiCpuIo2ProtocolGuid, NULL, (VOID **) &mCpuIo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Most systems in the world including complex servers have only one Host Bridge. @@ -446,7 +446,7 @@ InitializePciHostBridge ( HostAddress, RootBridges[Index].Io.Limit - RootBridges[Index].Io.Base + 1 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (ResourceAssigned) { Status = gDS->AllocateIoSpace ( EfiGcdAllocateAddress, @@ -457,7 +457,7 @@ InitializePciHostBridge ( gImageHandle, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -485,13 +485,13 @@ InitializePciHostBridge ( MemApertures[MemApertureIndex]->Limit - MemApertures[MemApertureIndex]->Base + 1, EFI_MEMORY_UC ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gDS->SetMemorySpaceAttributes ( HostAddress, MemApertures[MemApertureIndex]->Limit - MemApertures[MemApertureIndex]->Base + 1, EFI_MEMORY_UC ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "PciHostBridge driver failed to set EFI_MEMORY_UC to MMIO aperture - %r.\n", Status)); } if (ResourceAssigned) { @@ -504,7 +504,7 @@ InitializePciHostBridge ( gImageHandle, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } } @@ -533,7 +533,7 @@ InitializePciHostBridge ( &gEfiPciHostBridgeResourceAllocationProtocolGuid, &HostBridge->ResAlloc, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } for (Link = GetFirstNode (&HostBridge->RootBridges) @@ -549,11 +549,11 @@ InitializePciHostBridge ( &gEfiPciRootBridgeIoProtocolGuid, &RootBridge->RootBridgeIo, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } PciHostBridgeFreeRootBridges (RootBridges, RootBridgeCount); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { mIoMmuEvent = EfiCreateProtocolNotifyEvent ( &gEdkiiIoMmuProtocolGuid, TPL_CALLBACK, @@ -661,7 +661,7 @@ ResourceConflict ( DEBUG ((DEBUG_ERROR, "Call PciHostBridgeResourceConflict().\n")); PciHostBridgeResourceConflict (HostBridge->Handle, Resources); - FreePool (Resources); + FreePool(Resources); } /** @@ -722,7 +722,7 @@ AllocateResource ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return BaseAddress; } BaseAddress += LShiftU64 (1, BitsOfAlignment); @@ -1022,7 +1022,7 @@ NotifyPhase ( switch (Index) { case TypeIo: Status = gDS->FreeIoSpace (RootBridge->ResAllocNode[Index].Base, RootBridge->ResAllocNode[Index].Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } break; @@ -1032,7 +1032,7 @@ NotifyPhase ( case TypeMem64: case TypePMem64: Status = gDS->FreeMemorySpace (RootBridge->ResAllocNode[Index].Base, RootBridge->ResAllocNode[Index].Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } break; diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c index d304fae42..40daea558 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c @@ -628,7 +628,7 @@ RootBridgeIoPollMem ( // No matter what, always do a single poll. // Status = This->Mem.Read (This, Width, Address, 1, Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -653,7 +653,7 @@ RootBridgeIoPollMem ( ; ElapsedTick += GetElapsedTick (&CurrentTick, StartTick, EndTick) ) { Status = This->Mem.Read (This, Width, Address, 1, Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -731,7 +731,7 @@ RootBridgeIoPollIo ( } Status = This->Io.Read (This, Width, Address, 1, Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((*Result & Mask) == Value) { @@ -755,7 +755,7 @@ RootBridgeIoPollIo ( ; ElapsedTick += GetElapsedTick (&CurrentTick, StartTick, EndTick) ) { Status = This->Io.Read (This, Width, Address, 1, Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -810,13 +810,13 @@ RootBridgeIoMemRead ( Status = RootBridgeIoCheckParameter (This, MemOperation, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } RootBridge = ROOT_BRIDGE_FROM_THIS (This); Status = RootBridgeIoGetMemTranslationByAddress (RootBridge, Address, &Translation); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -869,13 +869,13 @@ RootBridgeIoMemWrite ( Status = RootBridgeIoCheckParameter (This, MemOperation, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } RootBridge = ROOT_BRIDGE_FROM_THIS (This); Status = RootBridgeIoGetMemTranslationByAddress (RootBridge, Address, &Translation); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -923,7 +923,7 @@ RootBridgeIoIoRead ( This, IoOperation, Width, Address, Count, Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -973,7 +973,7 @@ RootBridgeIoIoWrite ( This, IoOperation, Width, Address, Count, Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1058,7 +1058,7 @@ RootBridgeIoCopyMem ( 1, &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = RootBridgeIoMemWrite ( @@ -1068,7 +1068,7 @@ RootBridgeIoCopyMem ( 1, &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (Forward) { @@ -1118,7 +1118,7 @@ RootBridgeIoPciAccess ( UINTN Size; Status = RootBridgeIoCheckParameter (This, PciOperation, Width, Address, Count, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1333,8 +1333,8 @@ RootBridgeIoMap ( MapInfo->NumberOfPages, &MapInfo->MappedHostAddress ); - if (EFI_ERROR (Status)) { - FreePool (MapInfo); + if (EFI_ERROR(Status)) { + FreePool(MapInfo); *NumberOfBytes = 0; return Status; } @@ -1460,7 +1460,7 @@ RootBridgeIoUnmap ( // Free the mapped buffer and the MAP_INFO structure. // gBS->FreePages (MapInfo->MappedHostAddress, MapInfo->NumberOfPages); - FreePool (Mapping); + FreePool(Mapping); return EFI_SUCCESS; } @@ -1564,7 +1564,7 @@ RootBridgeIoAllocateBuffer ( Pages, &PhysicalAddress ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *HostAddress = (VOID *) (UINTN) PhysicalAddress; } diff --git a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/ComponentName.c b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/ComponentName.c index 68b0de8ed..a1c98e2d7 100644 --- a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/ComponentName.c @@ -187,7 +187,7 @@ SerialComponentNameGetControllerName ( gSerialControllerDriver.DriverBindingHandle, IoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { IoProtocolGuid = &gEfiPciIoProtocolGuid; Status = EfiTestManagedDevice ( ControllerHandle, @@ -196,7 +196,7 @@ SerialComponentNameGetControllerName ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -207,7 +207,7 @@ SerialComponentNameGetControllerName ( ChildHandle, IoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -222,7 +222,7 @@ SerialComponentNameGetControllerName ( ChildHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c index 9fe8a482e..56df763f9 100644 --- a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c +++ b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c @@ -135,7 +135,7 @@ InitializePciSioSerial ( &gPciSioSerialComponentName, &gPciSioSerialComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Initialize UART default setting in gSerialDevTempate @@ -186,7 +186,7 @@ IsSioSerialController ( return EFI_SUCCESS; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Close the I/O Abstraction(s) used to perform the supported test // @@ -207,7 +207,7 @@ IsSioSerialController ( ); ASSERT (Status != EFI_ALREADY_STARTED); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { do { Acpi = (ACPI_HID_DEVICE_PATH *) DevicePath; DevicePath = NextDevicePathNode (DevicePath); @@ -268,9 +268,9 @@ IsPciSerialController ( return EFI_SUCCESS; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0, sizeof (Pci), &Pci); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (!IS_PCI_16550_SERIAL (&Pci)) { for (PciSerialParameter = (PCI_SERIAL_PARAMETER *) PcdGetPtr (PcdPciSerialParameters) ; PciSerialParameter->VendorId != 0xFFFF @@ -300,7 +300,7 @@ IsPciSerialController ( Controller ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -387,7 +387,7 @@ SerialControllerDriverSupported ( } Status = IsSioSerialController (Controller); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = IsPciSerialController (Controller); } return Status; @@ -500,7 +500,7 @@ CreateSerialDevice ( Status = ParentIo.PciIo->GetBarAttributes (ParentIo.PciIo, BarIndex, NULL, (VOID **) &Resources); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get the base address information from ACPI resource descriptor. // ACPI_IO_PORT_DESCRIPTOR and ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR are returned from Sio; @@ -594,7 +594,7 @@ CreateSerialDevice ( TempDevicePath, (EFI_DEVICE_PATH_PROTOCOL *) &SerialDevice->UartDevicePath ); - FreePool (TempDevicePath); + FreePool(TempDevicePath); } else { SerialDevice->DevicePath = AppendDevicePathNode ( SerialDevice->ParentDevicePath, @@ -612,7 +612,7 @@ CreateSerialDevice ( TempDevicePath, (EFI_DEVICE_PATH_PROTOCOL *) FlowControl ); - FreePool (TempDevicePath); + FreePool(TempDevicePath); } } ASSERT (SerialDevice->DevicePath != NULL); @@ -629,7 +629,7 @@ CreateSerialDevice ( // Issue a reset to initialize the COM port // Status = SerialDevice->SerialIo.Reset (&SerialDevice->SerialIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE, EFI_P_EC_CONTROLLER_ERROR | EFI_PERIPHERAL_SERIAL_PORT, @@ -648,7 +648,7 @@ CreateSerialDevice ( &gEfiSerialIoProtocolGuid, &SerialDevice->SerialIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CreateError; } // @@ -663,7 +663,7 @@ CreateSerialDevice ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( SerialDevice->Handle, &gEfiDevicePathProtocolGuid, SerialDevice->DevicePath, @@ -673,14 +673,14 @@ CreateSerialDevice ( } CreateError: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (SerialDevice->DevicePath != NULL) { - FreePool (SerialDevice->DevicePath); + FreePool(SerialDevice->DevicePath); } if (SerialDevice->ControllerNameTable != NULL) { FreeUnicodeStringTable (SerialDevice->ControllerNameTable); } - FreePool (SerialDevice); + FreePool(SerialDevice); } return Status; } @@ -721,7 +721,7 @@ GetChildSerialDevices ( &OpenInfoBuffer, &EntryCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -740,7 +740,7 @@ GetChildSerialDevices ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SerialDevices[(*Count)++] = SERIAL_DEV_FROM_THIS (SerialIo); } } @@ -752,7 +752,7 @@ GetChildSerialDevices ( } } if (OpenInfoBuffer != NULL) { - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); } ASSERT ((*Count == 0) || (OpenByDriver)); @@ -810,7 +810,7 @@ SerialControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { return Status; } // @@ -834,7 +834,7 @@ SerialControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { IoProtocolGuid = &gEfiPciIoProtocolGuid; Status = gBS->OpenProtocol ( Controller, @@ -845,7 +845,7 @@ SerialControllerDriverStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); } - ASSERT (!EFI_ERROR (Status) || Status == EFI_ALREADY_STARTED); + ASSERT (!EFI_ERROR(Status) || Status == EFI_ALREADY_STARTED); // // Do nothing for END device path node @@ -894,9 +894,9 @@ SerialControllerDriverStart ( ); } FlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (Uart); - if (!EFI_ERROR (Status) && IsUartFlowControlDevicePathNode (FlowControl)) { + if (!EFI_ERROR(Status) && IsUartFlowControlDevicePathNode (FlowControl)) { Status = SerialIo->GetControl (SerialIo, &Control); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (ReadUnaligned32 (&FlowControl->FlowControlMap) == UART_FLOW_CONTROL_HARDWARE) { Control |= EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE; } else { @@ -920,7 +920,7 @@ SerialControllerDriverStart ( // Otherwise continue to create the instance specified by RemainingDevicePath. // if (SerialDevices != NULL) { - FreePool (SerialDevices); + FreePool(SerialDevices); } return Status; } @@ -947,7 +947,7 @@ SerialControllerDriverStart ( } } else { Status = ParentIo.PciIo->Pci.Read (ParentIo.PciIo, EfiPciIoWidthUint8, 0, sizeof (Pci), &Pci); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // PcdPciSerialParameters takes the higher priority. // @@ -976,14 +976,14 @@ SerialControllerDriverStart ( &PciDeviceInfo->PciAttributes ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = ParentIo.PciIo->Attributes ( ParentIo.PciIo, EfiPciIoAttributeOperationSupported, 0, &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)(EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY); Status = ParentIo.PciIo->Attributes ( ParentIo.PciIo, @@ -1025,7 +1025,7 @@ SerialControllerDriverStart ( Status = CreateSerialDevice (Controller, Uart, ParentDevicePath, FALSE, 0, ParentIo, PciSerialParameter, PciDeviceInfo); DEBUG ((EFI_D_INFO, "PciSioSerial: Create PCI child serial device (single) - %r\n", Status)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciDeviceInfo->ChildCount++; } } @@ -1046,7 +1046,7 @@ SerialControllerDriverStart ( Status = CreateSerialDevice (Controller, Uart, ParentDevicePath, TRUE, PciSerialCount, ParentIo, PciSerialParameter, PciDeviceInfo); PciSerialCount++; DEBUG ((EFI_D_INFO, "PciSioSerial: Create PCI child serial device (multiple) - %r\n", Status)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciDeviceInfo->ChildCount++; } } @@ -1057,7 +1057,7 @@ SerialControllerDriverStart ( } if (SerialDevices != NULL) { - FreePool (SerialDevices); + FreePool(SerialDevices); } // @@ -1067,7 +1067,7 @@ SerialControllerDriverStart ( Status = EFI_SUCCESS; } - if (EFI_ERROR (Status) && (SerialDeviceCount == 0)) { + if (EFI_ERROR(Status) && (SerialDeviceCount == 0)) { if (PciDeviceInfo != NULL) { Status = ParentIo.PciIo->Attributes ( ParentIo.PciIo, @@ -1075,8 +1075,8 @@ SerialControllerDriverStart ( PciDeviceInfo->PciAttributes, NULL ); - ASSERT_EFI_ERROR (Status); - FreePool (PciDeviceInfo); + ASSERT_EFI_ERROR(Status); + FreePool(PciDeviceInfo); } gBS->CloseProtocol ( Controller, @@ -1157,7 +1157,7 @@ SerialControllerDriverStop ( ); gBS->CloseProtocol ( Controller, - !EFI_ERROR (Status) ? &gEfiPciIoProtocolGuid : &gEfiSioProtocolGuid, + !EFI_ERROR(Status) ? &gEfiPciIoProtocolGuid : &gEfiSioProtocolGuid, This->DriverBindingHandle, Controller ); @@ -1183,7 +1183,7 @@ SerialControllerDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SerialDevice = SERIAL_DEV_FROM_THIS (SerialIo); ASSERT ((PciDeviceInfo == NULL) || (PciDeviceInfo == SerialDevice->PciDeviceInfo)); @@ -1202,7 +1202,7 @@ SerialControllerDriverStop ( &gEfiSerialIoProtocolGuid, &SerialDevice->SerialIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, PciDeviceInfo != NULL ? &gEfiPciIoProtocolGuid : &gEfiSioProtocolGuid, @@ -1212,9 +1212,9 @@ SerialControllerDriverStop ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); } else { - FreePool (SerialDevice->DevicePath); + FreePool(SerialDevice->DevicePath); FreeUnicodeStringTable (SerialDevice->ControllerNameTable); - FreePool (SerialDevice); + FreePool(SerialDevice); if (PciDeviceInfo != NULL) { ASSERT (PciDeviceInfo->ChildCount != 0); @@ -1223,7 +1223,7 @@ SerialControllerDriverStop ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -1242,8 +1242,8 @@ SerialControllerDriverStop ( PciDeviceInfo->PciAttributes, NULL ); - ASSERT_EFI_ERROR (Status); - FreePool (PciDeviceInfo); + ASSERT_EFI_ERROR(Status); + FreePool(PciDeviceInfo); } return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c index 8377ffa13..97c8f4242 100644 --- a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c +++ b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c @@ -538,7 +538,7 @@ SerialReset ( (EFI_STOP_BITS_TYPE) This->Mode->StopBits ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->RestoreTPL (Tpl); return EFI_DEVICE_ERROR; } @@ -557,7 +557,7 @@ SerialReset ( Control ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->RestoreTPL (Tpl); return EFI_DEVICE_ERROR; } @@ -1134,7 +1134,7 @@ SerialRead ( Status = SerialReceiveTransmit (SerialDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *BufferSize = 0; REPORT_STATUS_CODE_WITH_DEVICE_PATH ( @@ -1253,7 +1253,7 @@ SerialReadRegister ( Status = SerialDev->PciDeviceInfo->PciIo->Io.Read (SerialDev->PciDeviceInfo->PciIo, EfiPciIoWidthUint8, EFI_PCI_IO_PASS_THROUGH_BAR, SerialDev->BaseAddress + Offset * SerialDev->RegisterStride, 1, &Data); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Data; } } @@ -1284,6 +1284,6 @@ SerialWriteRegister ( Status = SerialDev->PciDeviceInfo->PciIo->Io.Write (SerialDev->PciDeviceInfo->PciIo, EfiPciIoWidthUint8, EFI_PCI_IO_PASS_THROUGH_BAR, SerialDev->BaseAddress + Offset * SerialDev->RegisterStride, 1, &Data); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } diff --git a/MdeModulePkg/Bus/Pci/SataControllerDxe/ComponentName.c b/MdeModulePkg/Bus/Pci/SataControllerDxe/ComponentName.c index 5086d7747..bc612fda4 100644 --- a/MdeModulePkg/Bus/Pci/SataControllerDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Pci/SataControllerDxe/ComponentName.c @@ -152,7 +152,7 @@ SataControllerComponentNameGetControllerName ( gSataControllerDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c index ab06e2833..6ef536c91 100644 --- a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c +++ b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c @@ -263,7 +263,7 @@ InitializeSataControllerDriver ( &gSataControllerComponentName, &gSataControllerComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -305,7 +305,7 @@ SataControllerSupported ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -320,7 +320,7 @@ SataControllerSupported ( sizeof (PciData.Hdr.ClassCode), PciData.Hdr.ClassCode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -377,7 +377,7 @@ SataControllerStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SataControllerStart error. return status = %r\n", Status)); return Status; } @@ -414,7 +414,7 @@ SataControllerStart ( 0, &Private->OriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -430,7 +430,7 @@ SataControllerStart ( 0, &Supports ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -443,7 +443,7 @@ SataControllerStart ( Supports, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -457,7 +457,7 @@ SataControllerStart ( sizeof (PciData.Hdr.ClassCode), PciData.Hdr.ClassCode ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ASSERT (FALSE); goto Done; } @@ -528,7 +528,7 @@ SataControllerStart ( ); Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, @@ -538,13 +538,13 @@ Done: ); if (Private != NULL) { if (Private->DisqualifiedModes != NULL) { - FreePool (Private->DisqualifiedModes); + FreePool(Private->DisqualifiedModes); } if (Private->IdentifyData != NULL) { - FreePool (Private->IdentifyData); + FreePool(Private->IdentifyData); } if (Private->IdentifyValid != NULL) { - FreePool (Private->IdentifyValid); + FreePool(Private->IdentifyValid); } if (Private->PciAttributesChanged) { // @@ -557,7 +557,7 @@ Done: NULL ); } - FreePool (Private); + FreePool(Private); } } @@ -602,7 +602,7 @@ SataControllerStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -618,19 +618,19 @@ SataControllerStop ( &(Private->IdeInit), NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (Private != NULL) { if (Private->DisqualifiedModes != NULL) { - FreePool (Private->DisqualifiedModes); + FreePool(Private->DisqualifiedModes); } if (Private->IdentifyData != NULL) { - FreePool (Private->IdentifyData); + FreePool(Private->IdentifyData); } if (Private->IdentifyValid != NULL) { - FreePool (Private->IdentifyValid); + FreePool(Private->IdentifyValid); } if (Private->PciAttributesChanged) { // @@ -643,7 +643,7 @@ SataControllerStop ( NULL ); } - FreePool (Private); + FreePool(Private); } // @@ -1032,7 +1032,7 @@ IdeInitCalculateMode ( // Make sure we've got the valid identify data of the device from SubmitData() // if (!IdentifyValid) { - FreePool (*SupportedModes); + FreePool(*SupportedModes); return EFI_NOT_READY; } @@ -1041,7 +1041,7 @@ IdeInitCalculateMode ( (DisqualifiedModes->PioMode.Valid ? ((UINT16 *) &(DisqualifiedModes->PioMode.Mode)) : NULL), &SelectedMode ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { (*SupportedModes)->PioMode.Valid = TRUE; (*SupportedModes)->PioMode.Mode = SelectedMode; @@ -1056,7 +1056,7 @@ IdeInitCalculateMode ( &SelectedMode ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { (*SupportedModes)->UdmaMode.Valid = TRUE; (*SupportedModes)->UdmaMode.Mode = SelectedMode; diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/ComponentName.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/ComponentName.c index 85a5ce841..5b4d223e4 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/ComponentName.c @@ -191,7 +191,7 @@ SdMmcPciHcComponentNameGetControllerName ( gSdMmcPciHcDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c index 3f4a8e541..48041d8fe 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c @@ -93,7 +93,7 @@ EmmcGetOcr ( SdMmcCmdBlk.CommandArgument = *Argument; Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -233,7 +233,7 @@ EmmcGetCsd ( SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -422,7 +422,7 @@ EmmcSendStatus ( SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *DevStatus = SdMmcStatusBlk.Resp0; } @@ -518,7 +518,7 @@ EmmcTuningClkForHs200 ( // HostCtrl2 = BIT6; Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -527,13 +527,13 @@ EmmcTuningClkForHs200 ( Retry = 0; do { Status = EmmcSendTuningBlk (PassThru, Slot, BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EmmcTuningClkForHs200: Send tuning block fails with %r\n", Status)); return Status; } Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, TRUE, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -552,7 +552,7 @@ EmmcTuningClkForHs200 ( // HostCtrl2 = (UINT8)~(BIT6 | BIT7); Status = SdMmcHcAndMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } return EFI_DEVICE_ERROR; @@ -612,13 +612,13 @@ EmmcSwitchBusWidth ( CmdSet = 0; Status = EmmcSwitch (PassThru, Slot, Access, Index, Value, CmdSet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EmmcSwitchBusWidth: Switch to bus width %d fails with %r\n", BusWidth, Status)); return Status; } Status = EmmcSendStatus (PassThru, Slot, Rca, &DevStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EmmcSwitchBusWidth: Send status fails with %r\n", Status)); return Status; } @@ -699,7 +699,7 @@ EmmcSwitchBusTiming ( } Status = EmmcSwitch (PassThru, Slot, Access, Index, Value, CmdSet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EmmcSwitchBusTiming: Switch to bus timing %d fails with %r\n", BusTiming, Status)); return Status; } @@ -708,12 +708,12 @@ EmmcSwitchBusTiming ( // Convert the clock freq unit from MHz to KHz. // Status = SdMmcHcClockSupply (PciIo, Slot, ClockFreq * 1000, Private->BaseClkFreq[Slot], Private->ControllerVersion[Slot]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EmmcSendStatus (PassThru, Slot, Rca, &DevStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EmmcSwitchBusTiming: Send status fails with %r\n", Status)); return Status; } @@ -732,7 +732,7 @@ EmmcSwitchBusTiming ( EdkiiSdMmcSwitchClockFreqPost, &BusTiming ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: SD/MMC switch clock freq post notifier callback failed - %r\n", @@ -790,7 +790,7 @@ EmmcSwitchToHighSpeed ( } Status = EmmcSwitchBusWidth (PciIo, PassThru, Slot, Rca, IsDdr, BusMode->BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -799,12 +799,12 @@ EmmcSwitchToHighSpeed ( // HostCtrl1 = BIT2; Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdMmcHcUhsSignaling (Private->ControllerHandle, PciIo, Slot, BusMode->BusTiming); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -848,19 +848,19 @@ EmmcSwitchToHS200 ( } Status = EmmcSwitchBusWidth (PciIo, PassThru, Slot, Rca, FALSE, BusMode->BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // Stop bus clock at first // Status = SdMmcHcStopClock (PciIo, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdMmcHcUhsSignaling (Private->ControllerHandle, PciIo, Slot, BusMode->BusTiming); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -876,7 +876,7 @@ EmmcSwitchToHS200 ( BIT1, SD_MMC_HC_GENERIC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -886,7 +886,7 @@ EmmcSwitchToHS200 ( Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_CLOCK_CTRL, sizeof (ClockCtrl), &ClockCtrl); Status = EmmcSwitchBusTiming (PciIo, PassThru, Slot, Rca, BusMode->DriverStrength, BusMode->BusTiming, BusMode->ClockFreq); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -937,7 +937,7 @@ EmmcSwitchToHS400 ( Hs200BusMode.DriverStrength = BusMode->DriverStrength; Status = EmmcSwitchToHS200 (PciIo, PassThru, Slot, Rca, &Hs200BusMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -946,23 +946,23 @@ EmmcSwitchToHS400 ( // This step is necessary to be able to switch Bus into 8 bit DDR mode which is unsupported in HS200. // Status = SdMmcHcUhsSignaling (Private->ControllerHandle, PciIo, Slot, SdMmcMmcHsSdr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HsFreq = BusMode->ClockFreq < 52 ? BusMode->ClockFreq : 52; Status = EmmcSwitchBusTiming (PciIo, PassThru, Slot, Rca, BusMode->DriverStrength, SdMmcMmcHsSdr, HsFreq); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EmmcSwitchBusWidth (PciIo, PassThru, Slot, Rca, TRUE, BusMode->BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdMmcHcUhsSignaling (Private->ControllerHandle, PciIo, Slot, BusMode->BusTiming); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1259,13 +1259,13 @@ EmmcSetBusMode ( Private = SD_MMC_HC_PRIVATE_FROM_THIS (PassThru); Status = EmmcGetCsd (PassThru, Slot, Rca, &Csd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EmmcSetBusMode: GetCsd fails with %r\n", Status)); return Status; } Status = EmmcSelect (PassThru, Slot, Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EmmcSetBusMode: Select fails with %r\n", Status)); return Status; } @@ -1276,7 +1276,7 @@ EmmcSetBusMode ( // Get Device_Type from EXT_CSD register. // Status = EmmcGetExtCsd (PassThru, Slot, &ExtCsd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EmmcSetBusMode: GetExtCsd fails with %r\n", Status)); return Status; } @@ -1328,7 +1328,7 @@ EmmcIdentification ( PassThru = &Private->PassThru; Status = EmmcReset (PassThru, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_VERBOSE, "EmmcIdentification: Executing Cmd0 fails with %r\n", Status)); return Status; } @@ -1337,7 +1337,7 @@ EmmcIdentification ( Retry = 0; do { Status = EmmcGetOcr (PassThru, Slot, &Ocr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_VERBOSE, "EmmcIdentification: Executing Cmd1 fails with %r\n", Status)); return Status; } @@ -1351,7 +1351,7 @@ EmmcIdentification ( } while ((Ocr & BIT31) == 0); Status = EmmcGetAllCid (PassThru, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_VERBOSE, "EmmcIdentification: Executing Cmd2 fails with %r\n", Status)); return Status; } @@ -1363,7 +1363,7 @@ EmmcIdentification ( // Rca = Slot + 1; Status = EmmcSetRca (PassThru, Slot, Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EmmcIdentification: Executing Cmd3 fails with %r\n", Status)); return Status; } diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c index 336baade9..b75fc85b3 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c @@ -91,7 +91,7 @@ SdCardVoltageCheck ( Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (SdMmcStatusBlk.Resp0 != SdMmcCmdBlk.CommandArgument) { return EFI_DEVICE_ERROR; } @@ -201,7 +201,7 @@ SdCardSendOpCond ( SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -216,7 +216,7 @@ SdCardSendOpCond ( SdMmcCmdBlk.CommandArgument = (VoltageWindow & 0xFFFFFF) | Switch | MaxPower | HostCapacity; Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -306,7 +306,7 @@ SdCardSetRca ( SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR6; Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *Rca = (UINT16)(SdMmcStatusBlk.Resp0 >> 16); } @@ -441,7 +441,7 @@ SdCardSetBusWidth ( SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -544,7 +544,7 @@ SdCardSwitch ( Packet.InTransferLength = 64; Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -601,7 +601,7 @@ SdCardSendStatus ( SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *DevStatus = SdMmcStatusBlk.Resp0; } @@ -689,7 +689,7 @@ SdCardTuningClock ( // HostCtrl2 = BIT6; Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -698,13 +698,13 @@ SdCardTuningClock ( Retry = 0; do { Status = SdCardSendTuningBlk (PassThru, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "SdCardSendTuningBlk: Send tuning block fails with %r\n", Status)); return Status; } Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, TRUE, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -722,7 +722,7 @@ SdCardTuningClock ( // HostCtrl2 = (UINT8)~(BIT6 | BIT7); Status = SdMmcHcAndMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } return EFI_DEVICE_ERROR; @@ -757,13 +757,13 @@ SdCardSwitchBusWidth ( UINT32 DevStatus; Status = SdCardSetBusWidth (PassThru, Slot, Rca, BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "SdCardSwitchBusWidth: Switch to bus width %d fails with %r\n", BusWidth, Status)); return Status; } Status = SdCardSendStatus (PassThru, Slot, Rca, &DevStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "SdCardSwitchBusWidth: Send status fails with %r\n", Status)); return Status; } @@ -1084,7 +1084,7 @@ SdCardSetBusMode ( Capability = &Private->Capability[Slot]; Status = SdCardSelect (PassThru, Slot, Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1094,7 +1094,7 @@ SdCardSetBusMode ( // switch here irrespective of platform preference. // Status = SdCardSwitchBusWidth (PciIo, PassThru, Slot, Rca, 4); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1103,7 +1103,7 @@ SdCardSetBusMode ( // Get the supported bus speed from SWITCH cmd return data group #1. // Status = SdCardSwitch (PassThru, Slot, 0xFF, 0xF, SdDriverStrengthIgnore, 0xF, FALSE, SwitchResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1114,18 +1114,18 @@ SdCardSetBusMode ( if (!S18A) { Status = SdCardSwitchBusWidth (PciIo, PassThru, Slot, Rca, BusMode.BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } Status = SdCardSwitch (PassThru, Slot, BusMode.BusTiming, 0xF, BusMode.DriverStrength.Sd, 0xF, TRUE, SwitchResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdMmcSetDriverStrength (Private->PciIo, Slot, BusMode.DriverStrength.Sd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1135,18 +1135,18 @@ SdCardSetBusMode ( if (BusMode.BusTiming == SdMmcSdHs) { HostCtrl1 = BIT2; Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } Status = SdMmcHcUhsSignaling (Private->ControllerHandle, PciIo, Slot, BusMode.BusTiming); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdMmcHcClockSupply (PciIo, Slot, BusMode.ClockFreq * 1000, Private->BaseClkFreq[Slot], Private->ControllerVersion[Slot]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1157,7 +1157,7 @@ SdCardSetBusMode ( EdkiiSdMmcSwitchClockFreqPost, &BusMode.BusTiming ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: SD/MMC switch clock freq post notifier callback failed - %r\n", @@ -1170,7 +1170,7 @@ SdCardSetBusMode ( if ((BusMode.BusTiming == SdMmcUhsSdr104) || ((BusMode.BusTiming == SdMmcUhsSdr50) && (Capability->TuningSDR50 != 0))) { Status = SdCardTuningClock (PciIo, PassThru, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1216,7 +1216,7 @@ SdCardIdentification ( // 1. Send Cmd0 to the device // Status = SdCardReset (PassThru, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SdCardIdentification: Executing Cmd0 fails with %r\n", Status)); return Status; } @@ -1224,7 +1224,7 @@ SdCardIdentification ( // 2. Send Cmd8 to the device // Status = SdCardVoltageCheck (PassThru, Slot, 0x1, 0xFF); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SdCardIdentification: Executing Cmd8 fails with %r\n", Status)); return Status; } @@ -1232,7 +1232,7 @@ SdCardIdentification ( // 3. Send SDIO Cmd5 to the device to the SDIO device OCR register. // Status = SdioSendOpCond (PassThru, Slot, 0, FALSE); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SdCardIdentification: Found SDIO device, ignore it as we don't support\n")); return EFI_DEVICE_ERROR; } @@ -1240,7 +1240,7 @@ SdCardIdentification ( // 4. Send Acmd41 with voltage window 0 to the device // Status = SdCardSendOpCond (PassThru, Slot, 0, 0, FALSE, FALSE, FALSE, &Ocr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SdCardIdentification: Executing SdCardSendOpCond fails with %r\n", Status)); return EFI_DEVICE_ERROR; } @@ -1272,7 +1272,7 @@ SdCardIdentification ( } Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_CTRL_VER, TRUE, sizeof (ControllerVer), &ControllerVer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1294,7 +1294,7 @@ SdCardIdentification ( Retry = 0; do { Status = SdCardSendOpCond (PassThru, Slot, 0, Ocr, S18r, Xpc, TRUE, &Ocr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "SdCardIdentification: SdCardSendOpCond fails with %r Ocr %x, S18r %x, Xpc %x\n", Status, Ocr, S18r, Xpc)); return EFI_DEVICE_ERROR; } @@ -1316,13 +1316,13 @@ SdCardIdentification ( Private->Capability[Slot].Ddr50 != 0) && ((Ocr & BIT24) != 0)) { Status = SdCardVoltageSwitch (PassThru, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "SdCardIdentification: Executing SdCardVoltageSwitch fails with %r\n", Status)); Status = EFI_DEVICE_ERROR; goto Error; } else { Status = SdMmcHcStopClock (PciIo, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Error; } @@ -1360,13 +1360,13 @@ SdCardIdentification ( } Status = SdCardAllSendCid (PassThru, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "SdCardIdentification: Executing SdCardAllSendCid fails with %r\n", Status)); return Status; } Status = SdCardSetRca (PassThru, Slot, &Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "SdCardIdentification: Executing SdCardSetRca fails with %r\n", Status)); return Status; } diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c index 373f1bed4..088817986 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c @@ -134,7 +134,7 @@ InitializeSdMmcPciHcDxe ( &gSdMmcPciHcComponentName, &gSdMmcPciHcComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -181,10 +181,10 @@ ProcessAsyncTaskList ( // Check whether the cmd/data line is ready for transfer. // Status = SdMmcCheckTrbEnv (Private, Trb); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Trb->Started = TRUE; Status = SdMmcExecTrb (Private, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } else { @@ -292,14 +292,14 @@ SdMmcPciHcEnumerateDevice ( // Reset the specified slot of the SD/MMC Pci Host Controller // Status = SdMmcHcReset (Private, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } // // Reinitialize slot and restart identification process for the new attached device // Status = SdMmcHcInitHost (Private, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -310,7 +310,7 @@ SdMmcPciHcEnumerateDevice ( Routine = &mCardTypeDetectRoutineTable[Index]; if (*Routine != NULL) { Status = (*Routine) (Private, Slot); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } } @@ -408,7 +408,7 @@ SdMmcPciHcDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EFI_ALREADY_STARTED is also an error. // @@ -435,7 +435,7 @@ SdMmcPciHcDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -451,7 +451,7 @@ SdMmcPciHcDriverBindingSupported ( sizeof (PciData), &PciData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiPciIoProtocolGuid, @@ -555,7 +555,7 @@ SdMmcPciHcDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -570,7 +570,7 @@ SdMmcPciHcDriverBindingStart ( &PciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -581,7 +581,7 @@ SdMmcPciHcDriverBindingStart ( &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -608,7 +608,7 @@ SdMmcPciHcDriverBindingStart ( // Get SD/MMC Pci Host Controller Slot info // Status = SdMmcHcGetSlotInfo (PciIo, &FirstBar, &SlotNum); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -620,7 +620,7 @@ SdMmcPciHcDriverBindingStart ( if (mOverride == NULL) { Status = gBS->LocateProtocol (&gEdkiiSdMmcOverrideProtocolGuid, NULL, (VOID **)&mOverride); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "%a: found SD/MMC override protocol\n", __FUNCTION__)); } @@ -633,12 +633,12 @@ SdMmcPciHcDriverBindingStart ( // Get SD/MMC Pci Host Controller Version // Status = SdMmcHcGetControllerVersion (PciIo, Slot, &Private->ControllerVersion[Slot]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } Status = SdMmcHcGetCapability (PciIo, Slot, &Private->Capability[Slot]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -652,7 +652,7 @@ SdMmcPciHcDriverBindingStart ( &Private->Capability[Slot], &Private->BaseClkFreq[Slot] ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "%a: Failed to override capability - %r\n", __FUNCTION__, Status)); continue; @@ -666,7 +666,7 @@ SdMmcPciHcDriverBindingStart ( EdkiiSdMmcGetOperatingParam, (VOID*)&Private->Slot[Slot].OperatingParameters ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "%a: Failed to get operating parameters, using defaults\n", __FUNCTION__)); } } @@ -694,7 +694,7 @@ SdMmcPciHcDriverBindingStart ( } Status = SdMmcHcGetMaxCurrent (PciIo, Slot, &Private->MaxCurrent[Slot]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -708,7 +708,7 @@ SdMmcPciHcDriverBindingStart ( // Reset the specified slot of the SD/MMC Pci Host Controller // Status = SdMmcHcReset (Private, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } // @@ -716,7 +716,7 @@ SdMmcPciHcDriverBindingStart ( // if (Private->Slot[Slot].SlotType == RemovableSlot) { Status = SdMmcHcCardDetect (PciIo, Slot, &MediaPresent); - if (EFI_ERROR (Status) && (Status != EFI_MEDIA_CHANGED)) { + if (EFI_ERROR(Status) && (Status != EFI_MEDIA_CHANGED)) { continue; } else if (!MediaPresent) { DEBUG (( @@ -729,7 +729,7 @@ SdMmcPciHcDriverBindingStart ( } Status = SdMmcHcInitHost (Private, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -740,7 +740,7 @@ SdMmcPciHcDriverBindingStart ( Routine = &mCardTypeDetectRoutineTable[Index]; if (*Routine != NULL) { Status = (*Routine) (Private, Slot); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } } @@ -764,7 +764,7 @@ SdMmcPciHcDriverBindingStart ( EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "SdMmcPciHcDriverBindingStart: failed to enable 64-bit DMA (%r)\n", Status)); } } @@ -779,12 +779,12 @@ SdMmcPciHcDriverBindingStart ( Private, &Private->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = gBS->SetTimer (Private->TimerEvent, TimerPeriodic, SD_MMC_HC_ASYNC_TIMER); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -798,12 +798,12 @@ SdMmcPciHcDriverBindingStart ( Private, &Private->ConnectEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = gBS->SetTimer (Private->ConnectEvent, TimerPeriodic, SD_MMC_HC_ENUM_TIMER); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -817,7 +817,7 @@ SdMmcPciHcDriverBindingStart ( DEBUG ((DEBUG_INFO, "SdMmcPciHcDriverBindingStart: %r End on %x\n", Status, Controller)); Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if ((Private != NULL) && (Private->PciAttributes != 0)) { // // Restore original PCI attributes @@ -845,7 +845,7 @@ Done: } if (Private != NULL) { - FreePool (Private); + FreePool(Private); } } @@ -905,7 +905,7 @@ SdMmcPciHcDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -945,7 +945,7 @@ SdMmcPciHcDriverBindingStop ( &(Private->PassThru) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -965,9 +965,9 @@ SdMmcPciHcDriverBindingStop ( Private->PciAttributes, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - FreePool (Private); + FreePool(Private); DEBUG ((DEBUG_INFO, "SdMmcPciHcDriverBindingStop: End with %r\n", Status)); @@ -1079,17 +1079,17 @@ SdMmcPassThruPassThru ( } Status = SdMmcWaitTrbEnv (Private, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = SdMmcExecTrb (Private, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = SdMmcWaitTrbResult (Private, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c index b9d04e0f1..114e1086b 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c @@ -103,7 +103,7 @@ SdMmcHcGetSlotInfo ( sizeof (SlotInfo), &SlotInfo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -233,7 +233,7 @@ SdMmcHcOrMmio ( UINT64 Or; Status = SdMmcHcRwMmio (PciIo, BarIndex, Offset, TRUE, Count, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -291,7 +291,7 @@ SdMmcHcAndMmio ( UINT64 And; Status = SdMmcHcRwMmio (PciIo, BarIndex, Offset, TRUE, Count, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -351,7 +351,7 @@ SdMmcHcCheckMmioSet ( // Value = 0; Status = SdMmcHcRwMmio (PciIo, BarIndex, Offset, TRUE, Count, &Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -452,7 +452,7 @@ SdMmcHcGetControllerVersion ( EFI_STATUS Status; Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_CTRL_VER, TRUE, sizeof (UINT16), Version); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -491,7 +491,7 @@ SdMmcHcReset ( Slot, EdkiiSdMmcResetPre, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "%a: SD/MMC pre reset notifier callback failed - %r\n", __FUNCTION__, Status)); @@ -503,7 +503,7 @@ SdMmcHcReset ( SwReset = BIT0; Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_SW_RST, sizeof (SwReset), &SwReset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "SdMmcHcReset: write SW Reset for All fails: %r\n", Status)); return Status; } @@ -517,7 +517,7 @@ SdMmcHcReset ( 0x00, SD_MMC_HC_GENERIC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SdMmcHcReset: reset done with %r\n", Status)); return Status; } @@ -526,7 +526,7 @@ SdMmcHcReset ( // Enable all interrupt after reset all. // Status = SdMmcHcEnableInterrupt (PciIo, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SdMmcHcReset: SdMmcHcEnableInterrupt done with %r\n", Status)); return Status; @@ -542,7 +542,7 @@ SdMmcHcReset ( Slot, EdkiiSdMmcResetPost, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "%a: SD/MMC post reset notifier callback failed - %r\n", __FUNCTION__, Status)); @@ -577,7 +577,7 @@ SdMmcHcEnableInterrupt ( // IntStatus = 0xFFFF; Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_ERR_INT_STS_EN, FALSE, sizeof (IntStatus), &IntStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -611,7 +611,7 @@ SdMmcHcGetCapability ( UINT64 Cap; Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_CAP, TRUE, sizeof (Cap), &Cap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -675,7 +675,7 @@ SdMmcHcCardDetect ( // Check Present State Register to see if there is a card presented. // Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_PRESENT_STATE, TRUE, sizeof (PresentState), &PresentState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -689,7 +689,7 @@ SdMmcHcCardDetect ( // Check Normal Interrupt Status Register // Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_NOR_INT_STS, TRUE, sizeof (Data), &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -699,7 +699,7 @@ SdMmcHcCardDetect ( // Data &= BIT6 | BIT7; Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_NOR_INT_STS, FALSE, sizeof (Data), &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -745,7 +745,7 @@ SdMmcHcStopClock ( 0, SD_MMC_HC_GENERIC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -847,7 +847,7 @@ SdMmcHcClockSupply ( // Stop bus clock at first // Status = SdMmcHcStopClock (PciIo, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -856,7 +856,7 @@ SdMmcHcClockSupply ( // ClockCtrl |= BIT0; Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_CLOCK_CTRL, FALSE, sizeof (ClockCtrl), &ClockCtrl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Set SDCLK Frequency Select and Internal Clock Enable fields fails\n")); return Status; } @@ -873,7 +873,7 @@ SdMmcHcClockSupply ( BIT1, SD_MMC_HC_GENERIC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -913,7 +913,7 @@ SdMmcHcPowerControl ( // PowerCtrl &= (UINT8)~BIT0; Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_POWER_CTRL, FALSE, sizeof (PowerCtrl), &PowerCtrl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -954,7 +954,7 @@ SdMmcHcSetBusWidth ( Status = SdMmcHcAndMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); } else if (BusWidth == 4) { Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL1, TRUE, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl1 |= BIT1; @@ -962,7 +962,7 @@ SdMmcHcSetBusWidth ( Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL1, FALSE, sizeof (HostCtrl1), &HostCtrl1); } else if (BusWidth == 8) { Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL1, TRUE, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl1 &= (UINT8)~BIT1; @@ -1030,7 +1030,7 @@ SdMmcHcInitV4Enhancements ( DEBUG ((DEBUG_INFO, "Enabled V4 26 bit data length ADMA support\n")); } Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1126,7 +1126,7 @@ SdMmcHcInitPowerVoltage ( HostCtrl2 = BIT3; Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); gBS->Stall (5000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -1200,7 +1200,7 @@ SdMmcHcInitHost ( Slot, EdkiiSdMmcInitHostPre, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "%a: SD/MMC pre init notifier callback failed - %r\n", __FUNCTION__, Status)); @@ -1212,22 +1212,22 @@ SdMmcHcInitHost ( Capability = Private->Capability[Slot]; Status = SdMmcHcInitV4Enhancements (PciIo, Slot, Capability, Private->ControllerVersion[Slot]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdMmcHcInitClockFreq (PciIo, Slot, Private->BaseClkFreq[Slot], Private->ControllerVersion[Slot]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdMmcHcInitPowerVoltage (PciIo, Slot, Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdMmcHcInitTimeoutCtrl (PciIo, Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1241,7 +1241,7 @@ SdMmcHcInitHost ( Slot, EdkiiSdMmcInitHostPost, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "%a: SD/MMC post init notifier callback failed - %r\n", __FUNCTION__, Status)); @@ -1274,7 +1274,7 @@ SdMmcHcUhsSignaling ( HostCtrl2 = (UINT8)~SD_MMC_HC_CTRL_UHS_MASK; Status = SdMmcHcAndMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1314,7 +1314,7 @@ SdMmcHcUhsSignaling ( break; } Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1325,7 +1325,7 @@ SdMmcHcUhsSignaling ( EdkiiSdMmcUhsSignaling, &Timing ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: SD/MMC uhs signaling notifier callback failed - %r\n", @@ -1365,7 +1365,7 @@ SdMmcSetDriverStrength ( HostCtrl2 = (UINT16)~SD_MMC_HC_CTRL_DRIVER_STRENGTH_MASK; Status = SdMmcHcAndMmio (PciIo, SlotIndex, SD_MMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1497,7 +1497,7 @@ BuildAdmaDescTable ( (VOID **)&AdmaDesc, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } ZeroMem (AdmaDesc, TableSize); @@ -1511,7 +1511,7 @@ BuildAdmaDescTable ( &Trb->AdmaMap ); - if (EFI_ERROR (Status) || (Bytes != TableSize)) { + if (EFI_ERROR(Status) || (Bytes != TableSize)) { // // Map error or unable to map the whole RFis buffer into a contiguous region. // @@ -1715,7 +1715,7 @@ SdMmcCreateTrb ( &Trb->DataPhy, &Trb->DataMap ); - if (EFI_ERROR (Status) || (Trb->DataLen != MapLength)) { + if (EFI_ERROR(Status) || (Trb->DataLen != MapLength)) { Status = EFI_BAD_BUFFER_SIZE; goto Error; } @@ -1739,7 +1739,7 @@ SdMmcCreateTrb ( Trb->AdmaLengthMode = SdMmcAdmaLen26b; } Status = BuildAdmaDescTable (Trb, Private->ControllerVersion[Slot]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { PciIo->Unmap (PciIo, Trb->DataMap); goto Error; } @@ -1811,7 +1811,7 @@ SdMmcFreeTrb ( Trb->DataMap ); } - FreePool (Trb); + FreePool(Trb); return; } @@ -1959,7 +1959,7 @@ SdMmcExecTrb ( // IntStatus = 0xFFFF; Status = SdMmcHcRwMmio (PciIo, Trb->Slot, SD_MMC_HC_ERR_INT_STS, FALSE, sizeof (IntStatus), &IntStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1967,14 +1967,14 @@ SdMmcExecTrb ( // IntStatus = 0xFF3F; Status = SdMmcHcRwMmio (PciIo, Trb->Slot, SD_MMC_HC_NOR_INT_STS, FALSE, sizeof (IntStatus), &IntStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (Private->ControllerVersion[Trb->Slot] >= SD_MMC_HC_CTRL_VER_400) { Status = SdMmcHcCheckMmioSet(PciIo, Trb->Slot, SD_MMC_HC_HOST_CTRL2, sizeof(UINT16), SD_MMC_HC_64_ADDR_EN, SD_MMC_HC_64_ADDR_EN); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AddressingMode64 = TRUE; } } @@ -1986,13 +1986,13 @@ SdMmcExecTrb ( (Trb->Mode == SdMmcAdma64bV4Mode)) { HostCtrl1 = BIT4; Status = SdMmcHcOrMmio (PciIo, Trb->Slot, SD_MMC_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else if (Trb->Mode == SdMmcAdma64bV3Mode) { HostCtrl1 = BIT4|BIT3; Status = SdMmcHcOrMmio (PciIo, Trb->Slot, SD_MMC_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -2013,7 +2013,7 @@ SdMmcExecTrb ( Status = SdMmcHcRwMmio (PciIo, Trb->Slot, SD_MMC_HC_SDMA_ADDR, FALSE, sizeof (UINT32), &SdmaAddr); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else if ((Trb->Mode == SdMmcAdma32bMode) || @@ -2021,7 +2021,7 @@ SdMmcExecTrb ( (Trb->Mode == SdMmcAdma64bV4Mode)) { AdmaAddr = (UINT64)(UINTN)Trb->AdmaDescPhy; Status = SdMmcHcRwMmio (PciIo, Trb->Slot, SD_MMC_HC_ADMA_SYS_ADDR, FALSE, sizeof (AdmaAddr), &AdmaAddr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -2035,7 +2035,7 @@ SdMmcExecTrb ( } Status = SdMmcHcRwMmio (PciIo, Trb->Slot, SD_MMC_HC_BLK_SIZE, FALSE, sizeof (BlkSize), &BlkSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2051,13 +2051,13 @@ SdMmcExecTrb ( } else { Status = SdMmcHcRwMmio (PciIo, Trb->Slot, SD_MMC_HC_BLK_COUNT, FALSE, sizeof (UINT16), &BlkCount); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Argument = Packet->SdMmcCmdBlk->CommandArgument; Status = SdMmcHcRwMmio (PciIo, Trb->Slot, SD_MMC_HC_ARG1, FALSE, sizeof (Argument), &Argument); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2083,7 +2083,7 @@ SdMmcExecTrb ( } Status = SdMmcHcRwMmio (PciIo, Trb->Slot, SD_MMC_HC_TRANS_MOD, FALSE, sizeof (TransMode), &TransMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2164,7 +2164,7 @@ SdMmcCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -2186,7 +2186,7 @@ SdMmcCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((IntStatus & BIT4) == BIT4) { Status = EFI_SUCCESS; } else { @@ -2211,7 +2211,7 @@ SdMmcCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } if ((IntStatus & 0x0F) != 0) { @@ -2229,7 +2229,7 @@ SdMmcCheckTrbResult ( sizeof (SwReset), &SwReset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = SdMmcHcWaitMmioSet ( @@ -2241,7 +2241,7 @@ SdMmcCheckTrbResult ( 0, SD_MMC_HC_GENERIC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2264,7 +2264,7 @@ SdMmcCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -2292,7 +2292,7 @@ SdMmcCheckTrbResult ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Trb->DataPhy = (UINT64)(UINTN)SdmaAddr; @@ -2338,7 +2338,7 @@ Done: // // Get response data when the cmd is executed successfully. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Packet->SdMmcCmdBlk->CommandType != SdMmcCommandTypeBc) { for (Index = 0; Index < 4; Index++) { Status = SdMmcHcRwMmio ( @@ -2349,7 +2349,7 @@ Done: sizeof (UINT32), &Response[Index] ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SdMmcHcLedOnOff (Private->PciIo, Trb->Slot, FALSE); return Status; } diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c index 3aa11f8ee..8ca8855c7 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c @@ -94,7 +94,7 @@ InitializeSdMmcHcPeim ( // // Shadow this PEIM to run from memory // - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -201,6 +201,6 @@ InitializeSdMmcHcPeim ( /// Status = PeiServicesInstallPpi (&Private->PpiList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/ComponentName.c b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/ComponentName.c index 5dc67e890..86af32c18 100644 --- a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/ComponentName.c @@ -204,7 +204,7 @@ UfsHcComponentNameGetControllerName ( gUfsHcDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c index 4be90d7a8..59952c946 100644 --- a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c +++ b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c @@ -78,13 +78,13 @@ UfsHcGetMmioBar ( NULL, (VOID**) &BarDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } *MmioBar = (UINTN)BarDesc->AddrRangeMin; - FreePool (BarDesc); + FreePool(BarDesc); return Status; } @@ -431,7 +431,7 @@ UfsHcDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EFI_ALREADY_STARTED is also an error // @@ -458,7 +458,7 @@ UfsHcDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -472,7 +472,7 @@ UfsHcDriverBindingSupported ( sizeof (PciData), &PciData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiPciIoProtocolGuid, @@ -582,7 +582,7 @@ UfsHcDriverBindingStart ( // opened 'again' by this call. // Status != ALREADY_STARTED - Error status, terminate program execution // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EFI_ALREADY_STARTED is also an error // @@ -606,17 +606,17 @@ UfsHcDriverBindingStart ( ); if (Status == EFI_UNSUPPORTED) { continue; - } else if (EFI_ERROR (Status)) { + } else if (EFI_ERROR(Status)) { goto Done; } if (BarDesc->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM) { Private->BarIndex = BarIndex; - FreePool (BarDesc); + FreePool(BarDesc); break; } - FreePool (BarDesc); + FreePool(BarDesc); } Status = PciIo->Attributes ( @@ -626,7 +626,7 @@ UfsHcDriverBindingStart ( &Private->PciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -637,7 +637,7 @@ UfsHcDriverBindingStart ( &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -660,7 +660,7 @@ UfsHcDriverBindingStart ( ); Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if ((Private != NULL) && (Private->PciAttributes != 0)) { // // Restore original PCI attributes @@ -679,7 +679,7 @@ Done: Controller ); if (Private != NULL) { - FreePool (Private); + FreePool(Private); } } @@ -738,7 +738,7 @@ UfsHcDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -749,7 +749,7 @@ UfsHcDriverBindingStop ( &gEdkiiUfsHostControllerProtocolGuid, &(Private->UfsHc) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Restore original PCI attributes // @@ -759,7 +759,7 @@ UfsHcDriverBindingStop ( Private->PciAttributes, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Close protocols opened by UFS host controller driver @@ -771,7 +771,7 @@ UfsHcDriverBindingStop ( Controller ); - FreePool (Private); + FreePool(Private); } return Status; @@ -804,7 +804,7 @@ UfsHcDriverEntry ( &gUfsHcComponentName, &gUfsHcComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.c b/MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.c index 447a05b5b..4c4a4094a 100644 --- a/MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.c +++ b/MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.c @@ -83,7 +83,7 @@ InitializeUfsHcPeim ( // // Shadow this PEIM to run from memory // - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -141,6 +141,6 @@ InitializeUfsHcPeim ( /// Status = PeiServicesInstallPpi (&Private->PpiList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.c b/MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.c index 572c11c28..9a4355ffa 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.c @@ -192,7 +192,7 @@ UhciComponentNameGetControllerName ( gUhciDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -208,7 +208,7 @@ UhciComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c index 3ec5ecf0e..14b515dd7 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c @@ -187,7 +187,7 @@ Uhci2SetState ( Uhc = UHC_FROM_USB2_HC_PROTO (This); Status = Uhci2GetState (This, &CurState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -242,7 +242,7 @@ Uhci2SetState ( case EfiUsbHcStateSuspend: Status = Uhci2SetState (This, EfiUsbHcStateHalt); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto ON_EXIT; } @@ -697,13 +697,13 @@ Uhci2ControlTransfer ( // Status = UhciMapUserRequest (Uhc, Request, &RequestPhy, &RequestMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } Status = UhciMapUserData (Uhc, TransferDirection, Data, DataLength, &PktId, &DataPhy, &DataMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Uhc->PciIo->Unmap (Uhc->PciIo, RequestMap); goto ON_EXIT; } @@ -855,7 +855,7 @@ Uhci2BulkTransfer ( Status = UhciMapUserData (Uhc, Direction, *Data, DataLength, &PktId, &DataPhy, &DataMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -1065,7 +1065,7 @@ Uhci2AsyncInterruptTransfer ( IsSlowDevice ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto DESTORY_QH; } @@ -1189,7 +1189,7 @@ Uhci2SyncInterruptTransfer ( &DataMap ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -1374,7 +1374,7 @@ UhciDriverBindingSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (OpenStatus)) { + if (EFI_ERROR(OpenStatus)) { return OpenStatus; } @@ -1386,7 +1386,7 @@ UhciDriverBindingSupported ( &UsbClassCReg ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto ON_EXIT; } @@ -1482,7 +1482,7 @@ UhciAllocateDev ( &Uhc->AsyncIntMonitor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { UsbHcFreeMemPool (Uhc->MemPool); goto ON_ERROR; } @@ -1490,7 +1490,7 @@ UhciAllocateDev ( return Uhc; ON_ERROR: - FreePool (Uhc); + FreePool(Uhc); return NULL; } @@ -1522,7 +1522,7 @@ UhciFreeDev ( FreeUnicodeStringTable (Uhc->CtrlNameTable); } - FreePool (Uhc); + FreePool(Uhc); } @@ -1553,7 +1553,7 @@ UhciCleanDevUp ( &gEfiUsb2HcProtocolGuid, &Uhc->Usb2Hc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -1646,7 +1646,7 @@ UhciDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1674,7 +1674,7 @@ UhciDriverBindingStart ( &OriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } PciAttributesSaved = TRUE; @@ -1693,7 +1693,7 @@ UhciDriverBindingStart ( 0, &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -1703,7 +1703,7 @@ UhciDriverBindingStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } @@ -1719,7 +1719,7 @@ UhciDriverBindingStart ( // Status = UhciInitFrameList (Uhc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto FREE_UHC; } @@ -1730,7 +1730,7 @@ UhciDriverBindingStart ( UHC_ASYNC_POLL_INTERVAL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_UHC; } @@ -1744,7 +1744,7 @@ UhciDriverBindingStart ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_UHC; } @@ -1759,7 +1759,7 @@ UhciDriverBindingStart ( &gEfiEventExitBootServicesGuid, &Uhc->ExitBootServiceEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto UNINSTALL_USBHC; } @@ -1865,7 +1865,7 @@ UhciDriverBindingStop ( // Usb controller handle that should be supported, if not, // return the error status directly // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/UhciQueue.c b/MdeModulePkg/Bus/Pci/UhciDxe/UhciQueue.c index fb97326dc..f0e3aea3f 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/UhciQueue.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/UhciQueue.c @@ -44,7 +44,7 @@ UhciMapUserRequest ( Map ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *MappedAddr = (UINT8 *) (UINTN) PhyAddr; } @@ -98,7 +98,7 @@ UhciMapUserData ( Map ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -116,7 +116,7 @@ UhciMapUserData ( Map ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/UhciReg.c b/MdeModulePkg/Bus/Pci/UhciDxe/UhciReg.c index 582c25e78..31aa82c8a 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/UhciReg.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/UhciReg.c @@ -37,7 +37,7 @@ UhciReadReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UhciReadReg: PciIo Io.Read error: %r at offset %d\n", Status, Offset)); Data = 0xFFFF; @@ -73,7 +73,7 @@ UhciWriteReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UhciWriteReg: PciIo Io.Write error: %r at offset %d\n", Status, Offset)); } } @@ -244,7 +244,7 @@ UhciSetFrameListBaseAddr ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UhciSetFrameListBaseAddr: PciIo Io.Write error: %r\n", Status)); } } diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c b/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c index 12afbec85..13cf18665 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c @@ -52,7 +52,7 @@ UhciInitFrameList ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -65,7 +65,7 @@ UhciInitFrameList ( &Mapping ); - if (EFI_ERROR (Status) || (Bytes != 4096)) { + if (EFI_ERROR(Status) || (Bytes != 4096)) { Status = EFI_UNSUPPORTED; goto ON_ERROR; } @@ -176,7 +176,7 @@ UhciDestoryFrameList ( ); if (Uhc->FrameBaseHostAddr != NULL) { - FreePool (Uhc->FrameBaseHostAddr); + FreePool(Uhc->FrameBaseHostAddr); } if (Uhc->SyncIntQh != NULL) { @@ -756,7 +756,7 @@ UhciFreeAsyncReq ( UsbHcFreeMem (Uhc->MemPool, AsyncReq->Data, AsyncReq->DataLen); } - gBS->FreePool (AsyncReq); + gBS->FreePool(AsyncReq); } @@ -1034,7 +1034,7 @@ UhciMonitorAsyncReqList ( } if (Data != NULL) { - gBS->FreePool (Data); + gBS->FreePool(Data); } } while (Link != &(Uhc->AsyncIntList)); } diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c index 60c1a24a1..f5e219631 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c @@ -57,7 +57,7 @@ UsbHcAllocMemBlock ( Block->Bits = AllocateZeroPool (Block->BitsLen); if (Block->Bits == NULL) { - gBS->FreePool (Block); + gBS->FreePool(Block); return NULL; } @@ -74,7 +74,7 @@ UsbHcAllocMemBlock ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_BITARRAY; } @@ -88,7 +88,7 @@ UsbHcAllocMemBlock ( &Mapping ); - if (EFI_ERROR (Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { + if (EFI_ERROR(Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { goto FREE_BUFFER; } @@ -111,8 +111,8 @@ FREE_BUFFER: PciIo->FreeBuffer (PciIo, Pages, BufHost); FREE_BITARRAY: - gBS->FreePool (Block->Bits); - gBS->FreePool (Block); + gBS->FreePool(Block->Bits); + gBS->FreePool(Block); return NULL; } @@ -142,8 +142,8 @@ UsbHcFreeMemBlock ( PciIo->Unmap (PciIo, Block->Mapping); PciIo->FreeBuffer (PciIo, EFI_SIZE_TO_PAGES (Block->BufLen), Block->BufHost); - gBS->FreePool (Block->Bits); - gBS->FreePool (Block); + gBS->FreePool(Block->Bits); + gBS->FreePool(Block); } @@ -373,7 +373,7 @@ UsbHcInitMemPool ( Pool->Head = UsbHcAllocMemBlock (Pool, USBHC_MEM_DEFAULT_PAGES); if (Pool->Head == NULL) { - gBS->FreePool (Pool); + gBS->FreePool(Pool); Pool = NULL; } @@ -410,7 +410,7 @@ UsbHcFreeMemPool ( } UsbHcFreeMemBlock (Pool, Pool->Head); - gBS->FreePool (Pool); + gBS->FreePool(Pool); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c b/MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c index 91e5bf567..9c3c6571e 100644 --- a/MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c +++ b/MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c @@ -51,7 +51,7 @@ IoMmuMap ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } switch (Operation) { @@ -76,7 +76,7 @@ IoMmuMap ( *Mapping, Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { IoMmu->Unmap (IoMmu, Mapping); *Mapping = NULL; return Status; @@ -152,7 +152,7 @@ IoMmuAllocateBuffer ( HostAddress, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -165,7 +165,7 @@ IoMmuAllocateBuffer ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { IoMmu->FreeBuffer (IoMmu, Pages, *HostAddress); *HostAddress = NULL; return EFI_OUT_OF_RESOURCES; @@ -175,7 +175,7 @@ IoMmuAllocateBuffer ( *Mapping, EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { IoMmu->Unmap (IoMmu, *Mapping); IoMmu->FreeBuffer (IoMmu, Pages, *HostAddress); *Mapping = NULL; @@ -188,7 +188,7 @@ IoMmuAllocateBuffer ( Pages, &HostPhyAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } *HostAddress = (VOID *) (UINTN) HostPhyAddress; diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c index b897c3f82..e3ed226eb 100644 --- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c +++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c @@ -111,7 +111,7 @@ UhcPeimEntry ( // // Shadow this PEIM to run from memory // - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -124,7 +124,7 @@ UhcPeimEntry ( // // If failed to locate, it is a bug in dispather as depex has gPeiUsbControllerPpiGuid. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Index = 0; while (TRUE) { @@ -138,7 +138,7 @@ UhcPeimEntry ( // // When status is error, meant no controller is found // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -157,7 +157,7 @@ UhcPeimEntry ( MemPages, &TempPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -170,7 +170,7 @@ UhcPeimEntry ( // Init local memory management service // Status = InitializeMemoryManagement (UhcDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -178,7 +178,7 @@ UhcPeimEntry ( // Initialize Uhc's hardware // Status = InitializeUsbHC (UhcDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -194,7 +194,7 @@ UhcPeimEntry ( UhcDev->PpiDescriptor.Ppi = &UhcDev->UsbHostControllerPpi; Status = PeiServicesInstallPpi (&UhcDev->PpiDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Index++; continue; } @@ -295,13 +295,13 @@ UhcControlTransfer ( // then create a list of TD for this transfer // Status = UhciMapUserRequest (UhcDev, Request, &RequestPhy, &RequestMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = UhciMapUserData (UhcDev, TransferDirection, Data, DataLength, &PktID, &DataPhy, &DataMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (RequestMap != NULL) { IoMmuUnmap (UhcDev->IoMmu, RequestMap); } @@ -580,7 +580,7 @@ UhcBulkTransfer ( Status = UhciMapUserData (UhcDev, TransferDirection, Data, DataLength, &PktID, &DataPhy, &DataMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1037,7 +1037,7 @@ InitializeUsbHC ( // Create and Initialize Frame List For the Host Controller. // Status = CreateFrameList (UhcDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1290,7 +1290,7 @@ CreateQH ( // allocate align memory for QH_STRUCT // Status = AllocateTDorQHStruct (UhcDev, sizeof(QH_STRUCT), (void **)PtrQH); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } // @@ -1456,7 +1456,7 @@ AllocateTDorQHStruct ( (UINT8 **) PtrStruct, Size ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1486,7 +1486,7 @@ CreateTD ( // create memory for TD_STRUCT, and align the memory. // Status = AllocateTDorQHStruct (UhcDev, sizeof(TD_STRUCT), (void **)PtrTD); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1530,7 +1530,7 @@ GenSetupStageTD ( EFI_STATUS Status; Status = CreateTD (UhcDev, &TdStruct); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1645,7 +1645,7 @@ GenDataTD ( EFI_STATUS Status; Status = CreateTD (UhcDev, &TdStruct); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1760,7 +1760,7 @@ CreateStatusTD ( EFI_STATUS Status; Status = CreateTD (UhcDev, &PtrTDStruct); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2657,7 +2657,7 @@ DeleteQueuedTDs ( Tptr1 = GetTDLinkPtr (Tptr2); } - UhcFreePool (UhcDev, (UINT8 *) Tptr2, sizeof (TD_STRUCT)); + UhcFreePool(UhcDev, (UINT8 *) Tptr2, sizeof (TD_STRUCT)); } return ; @@ -2782,7 +2782,7 @@ CreateMemoryBlock ( &MappedAddr, &Mapping ); - if (EFI_ERROR (Status) || (TempPtr == NULL)) { + if (EFI_ERROR(Status) || (TempPtr == NULL)) { return EFI_OUT_OF_RESOURCES; } @@ -2840,7 +2840,7 @@ InitializeMemoryManagement ( MemPages = NORMAL_MEMORY_BLOCK_UNIT_IN_PAGES; Status = CreateMemoryBlock (UhcDev, &MemoryHeader, MemPages); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2895,7 +2895,7 @@ UhcAllocatePool ( (VOID **) Pool, RealAllocSize / 32 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } } @@ -2914,7 +2914,7 @@ UhcAllocatePool ( } Status = CreateMemoryBlock (UhcDev, &NewMemoryHeader, MemoryBlockSizeInPages); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -3074,7 +3074,7 @@ AllocMemInMemoryBlock ( **/ VOID -UhcFreePool ( +UhcFreePool( IN USB_UHC_DEV *UhcDev, IN UINT8 *Pool, IN UINTN AllocSize @@ -3196,7 +3196,7 @@ UhciMapUserRequest ( Map ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *MappedAddr = (UINT8 *) (UINTN) PhyAddr; } @@ -3249,7 +3249,7 @@ UhciMapUserData ( Map ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -3267,7 +3267,7 @@ UhciMapUserData ( Map ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h index 9100cbeab..521e7b2c9 100644 --- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h +++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h @@ -1238,7 +1238,7 @@ AllocMemInMemoryBlock ( **/ VOID -UhcFreePool ( +UhcFreePool( IN USB_UHC_DEV *UhcDev, IN UINT8 *Pool, IN UINTN AllocSize diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/ComponentName.c b/MdeModulePkg/Bus/Pci/XhciDxe/ComponentName.c index 9e2697b82..b71a1a305 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/ComponentName.c @@ -185,7 +185,7 @@ XhciComponentNameGetControllerName ( gXhciDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -200,7 +200,7 @@ XhciComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c index fd799884f..44ebe4bd1 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c @@ -52,7 +52,7 @@ UsbHcAllocMemBlock ( Block->Bits = AllocateZeroPool (Block->BitsLen); if (Block->Bits == NULL) { - gBS->FreePool (Block); + gBS->FreePool(Block); return NULL; } @@ -69,7 +69,7 @@ UsbHcAllocMemBlock ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_BITARRAY; } @@ -83,7 +83,7 @@ UsbHcAllocMemBlock ( &Mapping ); - if (EFI_ERROR (Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { + if (EFI_ERROR(Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { goto FREE_BUFFER; } @@ -97,8 +97,8 @@ FREE_BUFFER: PciIo->FreeBuffer (PciIo, Pages, BufHost); FREE_BITARRAY: - gBS->FreePool (Block->Bits); - gBS->FreePool (Block); + gBS->FreePool(Block->Bits); + gBS->FreePool(Block); return NULL; } @@ -128,8 +128,8 @@ UsbHcFreeMemBlock ( PciIo->Unmap (PciIo, Block->Mapping); PciIo->FreeBuffer (PciIo, EFI_SIZE_TO_PAGES (Block->BufLen), Block->BufHost); - gBS->FreePool (Block->Bits); - gBS->FreePool (Block); + gBS->FreePool(Block->Bits); + gBS->FreePool(Block); } @@ -402,7 +402,7 @@ UsbHcInitMemPool ( Pool->Head = UsbHcAllocMemBlock (Pool, USBHC_MEM_DEFAULT_PAGES); if (Pool->Head == NULL) { - gBS->FreePool (Pool); + gBS->FreePool(Pool); Pool = NULL; } @@ -439,7 +439,7 @@ UsbHcFreeMemPool ( } UsbHcFreeMemBlock (Pool, Pool->Head); - gBS->FreePool (Pool); + gBS->FreePool(Pool); return EFI_SUCCESS; } @@ -660,7 +660,7 @@ UsbHcAllocateAlignedPages ( &Memory, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -670,7 +670,7 @@ UsbHcAllocateAlignedPages ( // Free first unaligned page(s). // Status = PciIo->FreeBuffer (PciIo, UnalignedPages, Memory); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Memory = (VOID *)(UINTN)(AlignedMemory + EFI_PAGES_TO_SIZE (Pages)); UnalignedPages = RealPages - Pages - UnalignedPages; @@ -679,7 +679,7 @@ UsbHcAllocateAlignedPages ( // Free last unaligned page(s). // Status = PciIo->FreeBuffer (PciIo, UnalignedPages, Memory); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } else { // @@ -693,7 +693,7 @@ UsbHcAllocateAlignedPages ( &Memory, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } AlignedMemory = (UINTN) Memory; @@ -709,7 +709,7 @@ UsbHcAllocateAlignedPages ( Mapping ); - if (EFI_ERROR (Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { + if (EFI_ERROR(Status) || (Bytes != EFI_PAGES_TO_SIZE (Pages))) { Status = PciIo->FreeBuffer (PciIo, Pages, (VOID *) AlignedMemory); return EFI_OUT_OF_RESOURCES; } @@ -741,12 +741,12 @@ UsbHcFreeAlignedPages ( ASSERT (Pages != 0); Status = PciIo->Unmap (PciIo, Mapping); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PciIo->FreeBuffer ( PciIo, Pages, HostAddress ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c index 43c53bad4..7245c54b3 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -184,7 +184,7 @@ XhcReset ( if (!XhcIsHalt (Xhc)) { Status = XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto ON_EXIT; } @@ -193,7 +193,7 @@ XhcReset ( Status = XhcResetHC (Xhc, XHC_RESET_TIMEOUT); ASSERT (!(XHC_REG_BIT_IS_SET (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_CNR))); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } // @@ -292,7 +292,7 @@ XhcSetState ( Status = XhcGetState (This, &CurState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -537,7 +537,7 @@ XhcSetRootHubPortFeature ( if (XhcIsHalt (Xhc)) { Status = XhcRunHC (Xhc, XHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "XhcSetRootHubPortFeature :failed to start HC - %r\n", Status)); break; } @@ -800,7 +800,7 @@ XhcTransfer ( if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) { ASSERT (Status == EFI_DEVICE_ERROR); RecoveryStatus = XhcRecoverHaltedEndpoint(Xhc, Urb); - if (EFI_ERROR (RecoveryStatus)) { + if (EFI_ERROR(RecoveryStatus)) { DEBUG ((DEBUG_ERROR, "XhcTransfer[Type=%d]: XhcRecoverHaltedEndpoint failed!\n", Type)); } } @@ -981,7 +981,7 @@ XhcControlTransfer ( TransferResult ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -1161,7 +1161,7 @@ XhcControlTransfer ( } ON_EXIT: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcControlTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); } @@ -1281,7 +1281,7 @@ XhcBulkTransfer ( ); ON_EXIT: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); } gBS->RestoreTPL (OldTpl); @@ -1535,7 +1535,7 @@ XhcSyncInterruptTransfer ( ); ON_EXIT: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcSyncInterruptTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); } gBS->RestoreTPL (OldTpl); @@ -1691,7 +1691,7 @@ XhcDriverBindingSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1703,7 +1703,7 @@ XhcDriverBindingSupported ( &UsbClassCReg ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto ON_EXIT; } @@ -1775,7 +1775,7 @@ XhcCreateUsbHc ( &ReleaseNumber ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Xhc->Usb2Hc.MajorRevision = (ReleaseNumber & 0xF0) >> 4; Xhc->Usb2Hc.MinorRevision = (ReleaseNumber & 0x0F); } @@ -1825,14 +1825,14 @@ XhcCreateUsbHc ( &Xhc->PollTimer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } return Xhc; ON_ERROR: - FreePool (Xhc); + FreePool(Xhc); return NULL; } @@ -1922,7 +1922,7 @@ XhcDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1950,7 +1950,7 @@ XhcDriverBindingStart ( &OriginalPciAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CLOSE_PCIIO; } PciAttributesSaved = TRUE; @@ -1961,7 +1961,7 @@ XhcDriverBindingStart ( 0, &Supports ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; Status = PciIo->Attributes ( PciIo, @@ -1971,7 +1971,7 @@ XhcDriverBindingStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDriverBindingStart: failed to enable controller\n")); goto CLOSE_PCIIO; } @@ -1997,7 +1997,7 @@ XhcDriverBindingStart ( EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Xhc->Support64BitDma = TRUE; } else { DEBUG ((EFI_D_WARN, @@ -2031,7 +2031,7 @@ XhcDriverBindingStart ( // Start the asynchronous interrupt monitor // Status = gBS->SetTimer (Xhc->PollTimer, TimerPeriodic, XHC_ASYNC_TIMER_INTERVAL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDriverBindingStart: failed to start async interrupt monitor\n")); XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT); goto FREE_POOL; @@ -2048,7 +2048,7 @@ XhcDriverBindingStart ( &gEfiEventExitBootServicesGuid, &Xhc->ExitBootServiceEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FREE_POOL; } @@ -2077,7 +2077,7 @@ XhcDriverBindingStart ( EFI_NATIVE_INTERFACE, &Xhc->Usb2Hc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDriverBindingStart: failed to install USB2_HC Protocol\n")); goto FREE_POOL; } @@ -2088,7 +2088,7 @@ XhcDriverBindingStart ( FREE_POOL: gBS->CloseEvent (Xhc->PollTimer); XhcFreeSched (Xhc); - FreePool (Xhc); + FreePool(Xhc); CLOSE_PCIIO: if (PciAttributesSaved) { @@ -2156,7 +2156,7 @@ XhcDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2166,7 +2166,7 @@ XhcDriverBindingStop ( Usb2Hc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2229,7 +2229,7 @@ XhcDriverBindingStop ( Controller ); - FreePool (Xhc); + FreePool(Xhc); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c index 42b773ab3..bdffc3470 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c @@ -37,7 +37,7 @@ XhcReadCapReg8 ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadCapReg: Pci Io read error - %r at %d\n", Status, Offset)); Data = 0xFF; } @@ -73,7 +73,7 @@ XhcReadCapReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadCapReg: Pci Io read error - %r at %d\n", Status, Offset)); Data = 0xFFFFFFFF; } @@ -111,7 +111,7 @@ XhcReadOpReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadOpReg: Pci Io Read error - %r at %d\n", Status, Offset)); Data = 0xFFFFFFFF; } @@ -147,7 +147,7 @@ XhcWriteOpReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -184,7 +184,7 @@ XhcWriteDoorBellReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -218,7 +218,7 @@ XhcReadRuntimeReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadRuntimeReg: Pci Io Read error - %r at %d\n", Status, Offset)); Data = 0xFFFFFFFF; } @@ -254,7 +254,7 @@ XhcWriteRuntimeReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcWriteRuntimeReg: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -288,7 +288,7 @@ XhcReadExtCapReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcReadExtCapReg: Pci Io Read error - %r at %d\n", Status, Offset)); Data = 0xFFFFFFFF; } @@ -324,7 +324,7 @@ XhcWriteExtCapReg ( &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcWriteExtCapReg: Pci Io Write error: %r at %d\n", Status, Offset)); } } @@ -606,7 +606,7 @@ XhcSetHsee ( sizeof (XhciCmd) / sizeof (UINT16), &XhciCmd ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((XhciCmd & EFI_PCI_COMMAND_SERR) != 0) { XhcSetOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_HSEE); } @@ -640,7 +640,7 @@ XhcResetHC ( if (!XHC_REG_BIT_IS_SET (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_HALT)) { Status = XhcHaltHC (Xhc, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -656,7 +656,7 @@ XhcResetHC ( gBS->Stall (XHC_1_MILLISECOND); Status = XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET, FALSE, Timeout); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The USBCMD HSEE Bit will be reset to default 0 by USBCMD HCRST. // Set USBCMD HSEE Bit if PCICMD SERR# Enable Bit is set. diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c index c0c374fc4..45b0187c3 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c @@ -169,10 +169,10 @@ XhcCreateUrb ( Urb->Context = Context; Status = XhcCreateTransferTrb (Xhc, Urb); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcCreateUrb: XhcCreateTransferTrb Failed, Status = %r\n", Status)); - FreePool (Urb); + FreePool(Urb); Urb = NULL; } @@ -200,7 +200,7 @@ XhcFreeUrb ( Xhc->PciIo->Unmap (Xhc->PciIo, Urb->DataMap); } - FreePool (Urb); + FreePool(Urb); } /** @@ -267,7 +267,7 @@ XhcCreateTransferTrb ( Len = Urb->DataLen; Status = Xhc->PciIo->Map (Xhc->PciIo, MapOp, Urb->Data, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != Urb->DataLen)) { + if (EFI_ERROR(Status) || (Len != Urb->DataLen)) { DEBUG ((EFI_D_ERROR, "XhcCreateTransferTrb: Fail to map Urb->Data.\n")); return EFI_OUT_OF_RESOURCES; } @@ -531,7 +531,7 @@ XhcInitSched ( &ScratchPhy, &Xhc->ScratchMap ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem (ScratchBuf, MaxScratchpadBufs * sizeof (UINT64)); Xhc->ScratchBuf = ScratchBuf; @@ -549,7 +549,7 @@ XhcInitSched ( &ScratchEntryPhy, (VOID **) &ScratchEntryMap[Index] ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem ((VOID *)(UINTN)ScratchEntry[Index], Xhc->PageSize); // // Fill with the PCI device address @@ -740,7 +740,7 @@ XhcDequeueTrbFromEndpoint ( DEBUG ((DEBUG_INFO, "XhcDequeueTrbFromEndpoint: Pending URB is finished: Length Actual/Expect = %d/%d!\n", Urb->Completed, Urb->DataLen)); } else { Status = XhcSetTrDequeuePointer(Xhc, SlotId, Dci, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "XhcDequeueTrbFromEndpoint: Set Transfer Ring Dequeue Pointer Failed, Status = %r\n", Status)); goto Done; } @@ -960,8 +960,8 @@ XhcFreeSched ( // Free Scratchpad Buffer Array // UsbHcFreeAlignedPages (Xhc->PciIo, Xhc->ScratchBuf, EFI_SIZE_TO_PAGES (Xhc->MaxScratchpadBufs * sizeof (UINT64)), Xhc->ScratchMap); - FreePool (Xhc->ScratchEntryMap); - FreePool (Xhc->ScratchEntry); + FreePool(Xhc->ScratchEntryMap); + FreePool(Xhc->ScratchEntry); } if (Xhc->CmdRing.RingSeg0 != NULL) { @@ -1356,12 +1356,12 @@ XhciDelAsyncIntTransfer ( // So the TRB should be removed as well. // Status = XhcDequeueTrbFromEndpoint (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhciDelAsyncIntTransfer: XhcDequeueTrbFromEndpoint failed\n")); } RemoveEntryList (&Urb->UrbList); - FreePool (Urb->Data); + FreePool(Urb->Data); XhcFreeUrb (Xhc, Urb); return EFI_SUCCESS; } @@ -1394,12 +1394,12 @@ XhciDelAllAsyncIntTransfers ( // So the TRB should be removed as well. // Status = XhcDequeueTrbFromEndpoint (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhciDelAllAsyncIntTransfers: XhcDequeueTrbFromEndpoint failed\n")); } RemoveEntryList (&Urb->UrbList); - FreePool (Urb->Data); + FreePool(Urb->Data); XhcFreeUrb (Xhc, Urb); } } @@ -1456,7 +1456,7 @@ XhciInsertAsyncIntTransfer ( ); if (Urb == NULL) { DEBUG ((DEBUG_ERROR, "%a: failed to create URB\n", __FUNCTION__)); - FreePool (Data); + FreePool(Data); return NULL; } @@ -1486,11 +1486,11 @@ XhcUpdateAsyncRequest ( if (Urb->Result == EFI_USB_NOERROR) { Status = XhcCreateTransferTrb (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } Status = RingIntTransferDoorBell (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } } @@ -1531,7 +1531,7 @@ XhcFlushAsyncIntMap ( if (Urb->DataMap != NULL) { Status = PciIo->Unmap (PciIo, Urb->DataMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } } @@ -1539,7 +1539,7 @@ XhcFlushAsyncIntMap ( Urb->DataMap = NULL; Status = PciIo->Map (PciIo, MapOp, Urb->Data, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != Urb->DataLen)) { + if (EFI_ERROR(Status) || (Len != Urb->DataLen)) { goto ON_ERROR; } @@ -1604,7 +1604,7 @@ XhcMonitorAsyncRequests ( // bridge to system memory. // Status = XhcFlushAsyncIntMap (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcMonitorAsyncRequests: Fail to Flush AsyncInt Mapped Memeory\n")); } @@ -1651,7 +1651,7 @@ XhcMonitorAsyncRequests ( } if (ProcBuf != NULL) { - gBS->FreePool (ProcBuf); + gBS->FreePool(ProcBuf); } XhcUpdateAsyncRequest (Xhc, Urb); @@ -2085,7 +2085,7 @@ XhcInitializeDeviceSlot ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcInitializeDeviceSlot: Enable Slot Failed, Status = %r\n", Status)); return Status; } @@ -2241,7 +2241,7 @@ XhcInitializeDeviceSlot ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DeviceAddress = (UINT8) ((DEVICE_CONTEXT *) OutputContext)->Slot.DeviceAddress; DEBUG ((EFI_D_INFO, " Address %d assigned successfully\n", DeviceAddress)); Xhc->UsbDevContext[SlotId].XhciDevAddr = DeviceAddress; @@ -2295,7 +2295,7 @@ XhcInitializeDeviceSlot64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcInitializeDeviceSlot64: Enable Slot Failed, Status = %r\n", Status)); return Status; } @@ -2451,7 +2451,7 @@ XhcInitializeDeviceSlot64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DeviceAddress = (UINT8) ((DEVICE_CONTEXT_64 *) OutputContext)->Slot.DeviceAddress; DEBUG ((EFI_D_INFO, " Address %d assigned successfully\n", DeviceAddress)); Xhc->UsbDevContext[SlotId].XhciDevAddr = DeviceAddress; @@ -2495,7 +2495,7 @@ XhcDisableSlotCmd ( Status = XhcDisableSlotCmd (Xhc, Xhc->UsbDevContext[Index + 1].SlotId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDisableSlotCmd: failed to disable child, ignore error\n")); Xhc->UsbDevContext[Index + 1].SlotId = 0; } @@ -2516,7 +2516,7 @@ XhcDisableSlotCmd ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDisableSlotCmd: Disable Slot Command Failed, Status = %r\n", Status)); return Status; } @@ -2534,19 +2534,19 @@ XhcDisableSlotCmd ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL; } } for (Index = 0; Index < Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations; Index++) { if (Xhc->UsbDevContext[SlotId].ConfDesc[Index] != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ConfDesc[Index]); + FreePool(Xhc->UsbDevContext[SlotId].ConfDesc[Index]); } } if (Xhc->UsbDevContext[SlotId].ActiveAlternateSetting != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ActiveAlternateSetting); + FreePool(Xhc->UsbDevContext[SlotId].ActiveAlternateSetting); } if (Xhc->UsbDevContext[SlotId].InputContext != NULL) { @@ -2602,7 +2602,7 @@ XhcDisableSlotCmd64 ( Status = XhcDisableSlotCmd64 (Xhc, Xhc->UsbDevContext[Index + 1].SlotId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDisableSlotCmd: failed to disable child, ignore error\n")); Xhc->UsbDevContext[Index + 1].SlotId = 0; } @@ -2623,7 +2623,7 @@ XhcDisableSlotCmd64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcDisableSlotCmd: Disable Slot Command Failed, Status = %r\n", Status)); return Status; } @@ -2641,19 +2641,19 @@ XhcDisableSlotCmd64 ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL; } } for (Index = 0; Index < Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations; Index++) { if (Xhc->UsbDevContext[SlotId].ConfDesc[Index] != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ConfDesc[Index]); + FreePool(Xhc->UsbDevContext[SlotId].ConfDesc[Index]); } } if (Xhc->UsbDevContext[SlotId].ActiveAlternateSetting != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ActiveAlternateSetting); + FreePool(Xhc->UsbDevContext[SlotId].ActiveAlternateSetting); } if (Xhc->UsbDevContext[SlotId].InputContext != NULL) { @@ -3139,7 +3139,7 @@ XhcSetConfigCmd ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcSetConfigCmd: Config Endpoint Failed, Status = %r\n", Status)); } else { Xhc->UsbDevContext[SlotId].ActiveConfiguration = ConfigDesc->ConfigurationValue; @@ -3229,7 +3229,7 @@ XhcSetConfigCmd64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcSetConfigCmd64: Config Endpoint Failed, Status = %r\n", Status)); } else { Xhc->UsbDevContext[SlotId].ActiveConfiguration = ConfigDesc->ConfigurationValue; @@ -3535,7 +3535,7 @@ XhcSetInterface ( // 1) Stop any Running Transfer Rings affected by the Alternate Interface setting. // Status = XhcStopEndpoint (Xhc, SlotId, Dci, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -3547,7 +3547,7 @@ XhcSetInterface ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1] = NULL; } @@ -3599,7 +3599,7 @@ XhcSetInterface ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SetInterface: Config Endpoint Failed, Status = %r\n", Status)); } else { // @@ -3737,7 +3737,7 @@ XhcSetInterface64 ( // 1) Stop any Running Transfer Rings affected by the Alternate Interface setting. // Status = XhcStopEndpoint (Xhc, SlotId, Dci, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -3749,7 +3749,7 @@ XhcSetInterface64 ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci - 1] = NULL; } @@ -3801,7 +3801,7 @@ XhcSetInterface64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SetInterface64: Config Endpoint Failed, Status = %r\n", Status)); } else { // @@ -3863,7 +3863,7 @@ XhcEvaluateContext ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcEvaluateContext: Evaluate Context Failed, Status = %r\n", Status)); } return Status; @@ -3918,7 +3918,7 @@ XhcEvaluateContext64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcEvaluateContext64: Evaluate Context Failed, Status = %r\n", Status)); } return Status; @@ -3987,7 +3987,7 @@ XhcConfigHubContext ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcConfigHubContext: Config Endpoint Failed, Status = %r\n", Status)); } return Status; @@ -4055,7 +4055,7 @@ XhcConfigHubContext64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcConfigHubContext64: Config Endpoint Failed, Status = %r\n", Status)); } return Status; diff --git a/MdeModulePkg/Bus/Pci/XhciPei/DmaMem.c b/MdeModulePkg/Bus/Pci/XhciPei/DmaMem.c index 71d61138b..7a9987188 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/DmaMem.c +++ b/MdeModulePkg/Bus/Pci/XhciPei/DmaMem.c @@ -51,7 +51,7 @@ IoMmuMap ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } switch (Operation) { @@ -76,7 +76,7 @@ IoMmuMap ( *Mapping, Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -153,7 +153,7 @@ IoMmuAllocateBuffer ( HostAddress, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -166,7 +166,7 @@ IoMmuAllocateBuffer ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } Status = mIoMmu->SetAttribute ( @@ -174,7 +174,7 @@ IoMmuAllocateBuffer ( *Mapping, EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -183,7 +183,7 @@ IoMmuAllocateBuffer ( Pages, &HostPhyAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } *HostAddress = (VOID *)(UINTN)HostPhyAddress; diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c index 56c0b900f..fb35cc30d 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c @@ -38,7 +38,7 @@ UsbHcAllocMemBlock ( &TempPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ZeroMem ((VOID *) (UINTN) TempPtr, EFI_PAGES_TO_SIZE (PageNumber)); @@ -60,7 +60,7 @@ UsbHcAllocMemBlock ( &TempPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ZeroMem ((VOID *) (UINTN) TempPtr, EFI_PAGES_TO_SIZE (PageNumber)); @@ -73,7 +73,7 @@ UsbHcAllocMemBlock ( &MappedAddr, &Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ZeroMem ((VOID *) (UINTN) BufHost, EFI_PAGES_TO_SIZE (Pages)); @@ -345,7 +345,7 @@ UsbHcInitMemPool ( PageNumber, &TempPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ZeroMem ((VOID *) (UINTN) TempPtr, EFI_PAGES_TO_SIZE (PageNumber)); @@ -598,7 +598,7 @@ UsbHcAllocateAlignedPages ( &DeviceMemory, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -613,7 +613,7 @@ UsbHcAllocateAlignedPages ( &DeviceMemory, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } AlignedMemory = (UINTN) Memory; diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c index 4b670ebed..bb5925545 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c @@ -372,7 +372,7 @@ XhcPeiResetHC ( if (!XhcPeiIsHalt (Xhc)) { Status = XhcPeiHaltHC (Xhc, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } } @@ -640,7 +640,7 @@ XhcPeiControlTransfer ( Status = EFI_SUCCESS; } else if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) { RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb); - if (EFI_ERROR (RecoveryStatus)) { + if (EFI_ERROR(RecoveryStatus)) { DEBUG ((EFI_D_ERROR, "XhcPeiControlTransfer: XhcPeiRecoverHaltedEndpoint failed\n")); } Status = EFI_DEVICE_ERROR; @@ -824,7 +824,7 @@ XhcPeiControlTransfer ( ON_EXIT: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcPeiControlTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); } @@ -965,7 +965,7 @@ XhcPeiBulkTransfer ( Status = EFI_SUCCESS; } else if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) { RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb); - if (EFI_ERROR (RecoveryStatus)) { + if (EFI_ERROR(RecoveryStatus)) { DEBUG ((EFI_D_ERROR, "XhcPeiBulkTransfer: XhcPeiRecoverHaltedEndpoint failed\n")); } Status = EFI_DEVICE_ERROR; @@ -976,7 +976,7 @@ XhcPeiBulkTransfer ( ON_EXIT: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcPeiBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult)); } @@ -1219,7 +1219,7 @@ XhcPeiSetRootHubPortFeature ( // if (XhcPeiIsHalt (Xhc)) { Status = XhcPeiRunHC (Xhc, XHC_GENERIC_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -1432,7 +1432,7 @@ XhcPeimEntry ( // // Shadow this PEIM to run from memory. // - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -1442,7 +1442,7 @@ XhcPeimEntry ( NULL, (VOID **) &UsbControllerPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -1460,7 +1460,7 @@ XhcPeimEntry ( // // When status is error, it means no controller is found. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -1478,7 +1478,7 @@ XhcPeimEntry ( MemPages, &TempPtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } ZeroMem ((VOID *) (UINTN) TempPtr, EFI_PAGES_TO_SIZE (MemPages)); diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c index 32d72ef03..d0fa24ba8 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c @@ -167,9 +167,9 @@ XhcPeiCreateUrb ( Urb->Context = Context; Status = XhcPeiCreateTransferTrb (Xhc, Urb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcPeiCreateUrb: XhcPeiCreateTransferTrb Failed, Status = %r\n", Status)); - FreePool (Urb); + FreePool(Urb); Urb = NULL; } @@ -195,7 +195,7 @@ XhcPeiFreeUrb ( IoMmuUnmap (Urb->DataMap); - FreePool (Urb); + FreePool(Urb); } /** @@ -261,7 +261,7 @@ XhcPeiCreateTransferTrb ( Len = Urb->DataLen; Status = IoMmuMap (MapOp, Urb->Data, &Len, &PhyAddr, &Map); - if (EFI_ERROR (Status) || (Len != Urb->DataLen)) { + if (EFI_ERROR(Status) || (Len != Urb->DataLen)) { DEBUG ((DEBUG_ERROR, "XhcCreateTransferTrb: Fail to map Urb->Data.\n")); return EFI_OUT_OF_RESOURCES; } @@ -1075,7 +1075,7 @@ XhcPeiInitializeDeviceSlot ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcPeiInitializeDeviceSlot: Enable Slot Failed, Status = %r\n", Status)); return Status; } @@ -1231,7 +1231,7 @@ XhcPeiInitializeDeviceSlot ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DeviceAddress = (UINT8) OutputContext->Slot.DeviceAddress; DEBUG ((EFI_D_INFO, "XhcPeiInitializeDeviceSlot: Address %d assigned successfully\n", DeviceAddress)); Xhc->UsbDevContext[SlotId].XhciDevAddr = DeviceAddress; @@ -1286,7 +1286,7 @@ XhcPeiInitializeDeviceSlot64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcPeiInitializeDeviceSlot64: Enable Slot Failed, Status = %r\n", Status)); return Status; } @@ -1442,7 +1442,7 @@ XhcPeiInitializeDeviceSlot64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DeviceAddress = (UINT8) OutputContext->Slot.DeviceAddress; DEBUG ((EFI_D_INFO, "XhcPeiInitializeDeviceSlot64: Address %d assigned successfully\n", DeviceAddress)); Xhc->UsbDevContext[SlotId].XhciDevAddr = DeviceAddress; @@ -1487,7 +1487,7 @@ XhcPeiDisableSlotCmd ( Status = XhcPeiDisableSlotCmd (Xhc, Xhc->UsbDevContext[Index + 1].SlotId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcPeiDisableSlotCmd: failed to disable child, ignore error\n")); Xhc->UsbDevContext[Index + 1].SlotId = 0; } @@ -1508,7 +1508,7 @@ XhcPeiDisableSlotCmd ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcPeiDisableSlotCmd: Disable Slot Command Failed, Status = %r\n", Status)); return Status; } @@ -1526,14 +1526,14 @@ XhcPeiDisableSlotCmd ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL; } } for (Index = 0; Index < Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations; Index++) { if (Xhc->UsbDevContext[SlotId].ConfDesc[Index] != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ConfDesc[Index]); + FreePool(Xhc->UsbDevContext[SlotId].ConfDesc[Index]); } } @@ -1590,7 +1590,7 @@ XhcPeiDisableSlotCmd64 ( Status = XhcPeiDisableSlotCmd64 (Xhc, Xhc->UsbDevContext[Index + 1].SlotId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcPeiDisableSlotCmd64: failed to disable child, ignore error\n")); Xhc->UsbDevContext[Index + 1].SlotId = 0; } @@ -1611,7 +1611,7 @@ XhcPeiDisableSlotCmd64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcPeiDisableSlotCmd64: Disable Slot Command Failed, Status = %r\n", Status)); return Status; } @@ -1629,14 +1629,14 @@ XhcPeiDisableSlotCmd64 ( if (RingSeg != NULL) { UsbHcFreeMem (Xhc->MemPool, RingSeg, sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER); } - FreePool (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); + FreePool(Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index]); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL; } } for (Index = 0; Index < Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations; Index++) { if (Xhc->UsbDevContext[SlotId].ConfDesc[Index] != NULL) { - FreePool (Xhc->UsbDevContext[SlotId].ConfDesc[Index]); + FreePool(Xhc->UsbDevContext[SlotId].ConfDesc[Index]); } } @@ -1869,7 +1869,7 @@ XhcPeiSetConfigCmd ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcSetConfigCmd: Config Endpoint Failed, Status = %r\n", Status)); } return Status; @@ -2088,7 +2088,7 @@ XhcPeiSetConfigCmd64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcSetConfigCmd64: Config Endpoint Failed, Status = %r\n", Status)); } @@ -2144,7 +2144,7 @@ XhcPeiEvaluateContext ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcEvaluateContext: Evaluate Context Failed, Status = %r\n", Status)); } return Status; @@ -2198,7 +2198,7 @@ XhcPeiEvaluateContext64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcEvaluateContext64: Evaluate Context Failed, Status = %r\n", Status)); } return Status; @@ -2266,7 +2266,7 @@ XhcPeiConfigHubContext ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcConfigHubContext: Config Endpoint Failed, Status = %r\n", Status)); } return Status; @@ -2334,7 +2334,7 @@ XhcPeiConfigHubContext64 ( XHC_GENERIC_TIMEOUT, (TRB_TEMPLATE **) (UINTN) &EvtTrb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "XhcConfigHubContext64: Config Endpoint Failed, Status = %r\n", Status)); } return Status; @@ -2889,7 +2889,7 @@ XhcPeiInitSched ( &ScratchPhy, &Xhc->ScratchMap ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem (ScratchBuf, MaxScratchpadBufs * sizeof (UINT64)); Xhc->ScratchBuf = ScratchBuf; @@ -2906,7 +2906,7 @@ XhcPeiInitSched ( &ScratchEntryPhy, (VOID **) &ScratchEntryMap[Index] ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem ((VOID *) (UINTN) ScratchEntry[Index], Xhc->PageSize); // // Fill with the PCI device address @@ -3002,8 +3002,8 @@ XhcPeiFreeSched ( // Free Scratchpad Buffer Array // UsbHcFreeAlignedPages (Xhc->ScratchBuf, EFI_SIZE_TO_PAGES (Xhc->MaxScratchpadBufs * sizeof (UINT64)), Xhc->ScratchMap); - FreePool (Xhc->ScratchEntryMap); - FreePool (Xhc->ScratchEntry); + FreePool(Xhc->ScratchEntryMap); + FreePool(Xhc->ScratchEntry); } if (Xhc->CmdRing.RingSeg0 != NULL) { diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c index c4069aec0..77133c658 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c @@ -138,7 +138,7 @@ InitializeScsiBus( &gScsiBusComponentName, &gScsiBusComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -251,7 +251,7 @@ SCSIBusDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -331,7 +331,7 @@ SCSIBusDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (DevicePathStatus) && (DevicePathStatus != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(DevicePathStatus) && (DevicePathStatus != EFI_ALREADY_STARTED)) { return DevicePathStatus; } @@ -372,7 +372,7 @@ SCSIBusDriverBindingStart ( // // Fail to open EFI PassThru Protocol, Close the DevicePathProtocol if it is opened by this time. // - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { if (!EFI_ERROR(DevicePathStatus)) { gBS->CloseProtocol ( Controller, @@ -431,7 +431,7 @@ SCSIBusDriverBindingStart ( EFI_NATIVE_INTERFACE, &ScsiBusDev->BusIdentify ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } } else { @@ -448,7 +448,7 @@ SCSIBusDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ScsiBusDev = SCSI_BUS_CONTROLLER_DEVICE_FROM_THIS (BusIdentify); @@ -481,7 +481,7 @@ SCSIBusDriverBindingStart ( Status = ScsiBusDev->ScsiInterface->GetTargetLun (ScsiBusDev->ScsiInterface, RemainingDevicePath, &ScsiTargetId.ScsiId.Scsi, &Lun); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -503,7 +503,7 @@ SCSIBusDriverBindingStart ( } else { Status = ScsiBusDev->ScsiInterface->GetNextDevice (ScsiBusDev->ScsiInterface, &ScsiTargetId.ScsiId.Scsi, &Lun); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // no legal Pun and Lun found any more // @@ -535,7 +535,7 @@ SCSIBusDriverBindingStart ( ErrorExit: if (ScsiBusDev != NULL) { - FreePool (ScsiBusDev); + FreePool(ScsiBusDev); } if (ExtScsiSupport) { @@ -545,7 +545,7 @@ ErrorExit: This->DriverBindingHandle, Controller ); - if (!EFI_ERROR (PassThruStatus)) { + if (!EFI_ERROR(PassThruStatus)) { gBS->CloseProtocol ( Controller, &gEfiScsiPassThruProtocolGuid, @@ -614,7 +614,7 @@ SCSIBusDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -668,7 +668,7 @@ SCSIBusDriverBindingStop ( This->DriverBindingHandle, Controller ); - FreePool (ScsiBusDev); + FreePool(ScsiBusDev); return EFI_SUCCESS; } @@ -684,7 +684,7 @@ SCSIBusDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; continue; } @@ -718,7 +718,7 @@ SCSIBusDriverBindingStop ( &ScsiIoDevice->ScsiIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; if (ScsiIoDevice->ExtScsiSupport) { gBS->OpenProtocol ( @@ -740,7 +740,7 @@ SCSIBusDriverBindingStop ( ); } } else { - FreePool (ScsiIoDevice); + FreePool(ScsiIoDevice); } } @@ -1166,7 +1166,7 @@ ScsiScanCreateDevice ( DeviceHandle = NULL; RemainingDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { + if (!EFI_ERROR(Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { // // The device has been started, directly return to fast boot. // @@ -1226,7 +1226,7 @@ ScsiScanCreateDevice ( &ScsiIoDevice->ScsiIo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } else { if (ScsiBusDev->ExtScsiSupport) { @@ -1258,14 +1258,14 @@ ErrorExit: // ScsiPassThru->BuildDevicePath() function; It is no longer used // after AppendDevicePathNode,so free the memory it occupies. // - FreePool (ScsiDevicePath); + FreePool(ScsiDevicePath); if (DevicePath != NULL) { - FreePool (DevicePath); + FreePool(DevicePath); } if (ScsiIoDevice != NULL) { - FreePool (ScsiIoDevice); + FreePool(ScsiIoDevice); } return Status; @@ -1337,7 +1337,7 @@ DiscoverScsiDevice ( &InquiryDataLength, FALSE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((HostAdapterStatus == EFI_SCSI_IO_STATUS_HOST_ADAPTER_OK) && (TargetStatus == EFI_SCSI_IO_STATUS_TARGET_CHECK_CONDITION) && (SenseData->Error_Code == 0x70) && diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c index b193de9ed..bd5d0ea59 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c @@ -186,7 +186,7 @@ ScsiDiskComponentNameGetControllerName ( gScsiDiskDriverBinding.DriverBindingHandle, &gEfiScsiIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -201,7 +201,7 @@ ScsiDiskComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c index fbdf927a1..047454f93 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c @@ -100,7 +100,7 @@ InitializeScsiDisk( &gScsiDiskComponentName, &gScsiDiskComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; @@ -145,12 +145,12 @@ ScsiDiskDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = ScsiIo->GetDeviceType (ScsiIo, &DeviceType); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((DeviceType == EFI_SCSI_TYPE_DISK) || (DeviceType == EFI_SCSI_TYPE_CDROM)) { Status = EFI_SUCCESS; } else { @@ -219,8 +219,8 @@ ScsiDiskDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { - FreePool (ScsiDiskDevice); + if (EFI_ERROR(Status)) { + FreePool(ScsiDiskDevice); return Status; } @@ -273,7 +273,7 @@ ScsiDiskDriverBindingStart ( This->DriverBindingHandle, Controller ); - FreePool (ScsiDiskDevice); + FreePool(ScsiDiskDevice); return EFI_OUT_OF_RESOURCES; } @@ -283,19 +283,19 @@ ScsiDiskDriverBindingStart ( MaxRetry = 2; for (Index = 0; Index < MaxRetry; Index++) { Status = ScsiDiskInquiryDevice (ScsiDiskDevice, &NeedRetry); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } if (!NeedRetry) { - FreePool (ScsiDiskDevice->SenseData); + FreePool(ScsiDiskDevice->SenseData); gBS->CloseProtocol ( Controller, &gEfiScsiIoProtocolGuid, This->DriverBindingHandle, Controller ); - FreePool (ScsiDiskDevice); + FreePool(ScsiDiskDevice); return EFI_DEVICE_ERROR; } } @@ -304,7 +304,7 @@ ScsiDiskDriverBindingStart ( // retrieve media capacity // Status = ScsiDiskDetectMedia (ScsiDiskDevice, MustReadCapacity, &Temp); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Determine if Block IO & Block IO2 should be produced on this controller // handle @@ -353,8 +353,8 @@ ScsiDiskDriverBindingStart ( } } - gBS->FreePool (ScsiDiskDevice->SenseData); - gBS->FreePool (ScsiDiskDevice); + gBS->FreePool(ScsiDiskDevice->SenseData); + gBS->FreePool(ScsiDiskDevice); gBS->CloseProtocol ( Controller, &gEfiScsiIoProtocolGuid, @@ -407,7 +407,7 @@ ScsiDiskDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -430,13 +430,13 @@ ScsiDiskDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->UninstallProtocolInterface ( Controller, &gEfiEraseBlockProtocolGuid, &ScsiDiskDevice->EraseBlock ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -451,7 +451,7 @@ ScsiDiskDriverBindingStop ( &ScsiDiskDevice->DiskInfo, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiScsiIoProtocolGuid, @@ -499,7 +499,7 @@ ScsiDiskReset ( Status = ScsiDiskDevice->ScsiIo->ResetDevice (ScsiDiskDevice->ScsiIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_UNSUPPORTED) { Status = EFI_SUCCESS; } else { @@ -514,7 +514,7 @@ ScsiDiskReset ( Status = ScsiDiskDevice->ScsiIo->ResetBus (ScsiDiskDevice->ScsiIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -567,7 +567,7 @@ ScsiDiskReadBlocks ( if (!IS_DEVICE_FIXED(ScsiDiskDevice)) { Status = ScsiDiskDetectMedia (ScsiDiskDevice, FALSE, &MediaChange); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -703,7 +703,7 @@ ScsiDiskWriteBlocks ( if (!IS_DEVICE_FIXED(ScsiDiskDevice)) { Status = ScsiDiskDetectMedia (ScsiDiskDevice, FALSE, &MediaChange); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -851,7 +851,7 @@ ScsiDiskResetEx ( Status = ScsiDiskDevice->ScsiIo->ResetDevice (ScsiDiskDevice->ScsiIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_UNSUPPORTED) { Status = EFI_SUCCESS; } else { @@ -866,7 +866,7 @@ ScsiDiskResetEx ( Status = ScsiDiskDevice->ScsiIo->ResetBus (ScsiDiskDevice->ScsiIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -929,7 +929,7 @@ ScsiDiskReadBlocksEx ( if (!IS_DEVICE_FIXED(ScsiDiskDevice)) { Status = ScsiDiskDetectMedia (ScsiDiskDevice, FALSE, &MediaChange); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -1092,7 +1092,7 @@ ScsiDiskWriteBlocksEx ( if (!IS_DEVICE_FIXED(ScsiDiskDevice)) { Status = ScsiDiskDetectMedia (ScsiDiskDevice, FALSE, &MediaChange); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -1245,7 +1245,7 @@ ScsiDiskFlushBlocksEx ( if (!IS_DEVICE_FIXED(ScsiDiskDevice)) { Status = ScsiDiskDetectMedia (ScsiDiskDevice, FALSE, &MediaChange); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -1364,9 +1364,9 @@ ScsiDiskAsyncUnmapNotify ( Done: RemoveEntryList (&EraseBlkReq->Link); - FreePool (CommandPacket->OutDataBuffer); - FreePool (EraseBlkReq->CommandPacket.Cdb); - FreePool (EraseBlkReq); + FreePool(CommandPacket->OutDataBuffer); + FreePool(EraseBlkReq->CommandPacket.Cdb); + FreePool(EraseBlkReq); gBS->SignalEvent (Token->Event); } @@ -1559,13 +1559,13 @@ ScsiDiskUnmap ( Done: if (EraseBlkReq != NULL) { if (EraseBlkReq->CommandPacket.Cdb != NULL) { - FreePool (EraseBlkReq->CommandPacket.Cdb); + FreePool(EraseBlkReq->CommandPacket.Cdb); } - FreePool (EraseBlkReq); + FreePool(EraseBlkReq); } if (UnmapParamList != NULL) { - FreePool (UnmapParamList); + FreePool(UnmapParamList); } if (AsyncUnmapEvent != NULL) { @@ -1626,7 +1626,7 @@ ScsiDiskEraseBlocks ( if (!IS_DEVICE_FIXED(ScsiDiskDevice)) { Status = ScsiDiskDetectMedia (ScsiDiskDevice, FALSE, &MediaChange); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -1757,12 +1757,12 @@ ScsiDiskDetectMedia ( NULL, &TimeoutEvt ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->SetTimer (TimeoutEvt, TimerRelative, EFI_TIMER_PERIOD_SECONDS(120)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -1771,21 +1771,21 @@ ScsiDiskDetectMedia ( // If the sense data shows the drive is not ready or reset before, we need poll the device status again. // We limit the upper boundary to 120 seconds. // - while (EFI_ERROR (gBS->CheckEvent (TimeoutEvt))) { + while (EFI_ERROR(gBS->CheckEvent (TimeoutEvt))) { Status = ScsiDiskTestUnitReady ( ScsiDiskDevice, &NeedRetry, &SenseData, &NumberOfSenseKeys ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = DetectMediaParsingSenseKeys ( ScsiDiskDevice, SenseData, NumberOfSenseKeys, &Action ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } else if (Action == ACTION_RETRY_COMMAND_LATER) { continue; @@ -1800,7 +1800,7 @@ ScsiDiskDetectMedia ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } @@ -1827,7 +1827,7 @@ ScsiDiskDetectMedia ( &SenseData, &NumberOfSenseKeys ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // analyze sense key to action // @@ -1837,7 +1837,7 @@ ScsiDiskDetectMedia ( NumberOfSenseKeys, &Action ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // if Status is error, it may indicate crisis error, // so return without retry. @@ -1857,7 +1857,7 @@ ScsiDiskDetectMedia ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } } @@ -1981,7 +1981,7 @@ ScsiDiskInquiryDevice ( TRUE, EFI_SCSI_PAGE_CODE_SUPPORTED_VPD ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PageLength = (SupportedVpdPages->PageLength2 << 8) | SupportedVpdPages->PageLength1; @@ -2052,7 +2052,7 @@ ScsiDiskInquiryDevice ( TRUE, EFI_SCSI_PAGE_CODE_BLOCK_LIMITS_VPD ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ScsiDiskDevice->BlkIo.Media->OptimalTransferLengthGranularity = (BlockLimits->OptimalTransferLengthGranularity2 << 8) | BlockLimits->OptimalTransferLengthGranularity1; @@ -2099,7 +2099,7 @@ ScsiDiskInquiryDevice ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } else if (Status == EFI_NOT_READY) { @@ -2156,7 +2156,7 @@ ScsiDiskInquiryDevice ( &NumberOfSenseKeys, TRUE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *NeedRetry = TRUE; return EFI_DEVICE_ERROR; } @@ -2276,7 +2276,7 @@ ScsiDiskTestUnitReady ( NumberOfSenseKeys, FALSE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -2454,7 +2454,7 @@ ScsiDiskReadCapacity ( ); ScsiDiskDevice->Cdb16Byte = FALSE; - if ((!EFI_ERROR (CommandStatus)) && (CapacityData10->LastLba3 == 0xff) && (CapacityData10->LastLba2 == 0xff) && + if ((!EFI_ERROR(CommandStatus)) && (CapacityData10->LastLba3 == 0xff) && (CapacityData10->LastLba2 == 0xff) && (CapacityData10->LastLba1 == 0xff) && (CapacityData10->LastLba0 == 0xff)) { // // use Read Capacity (16), Read (16) and Write (16) next when hard disk size > 2TB @@ -2546,7 +2546,7 @@ ScsiDiskReadCapacity ( NumberOfSenseKeys, TRUE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -2719,7 +2719,7 @@ ScsiDiskRequestSenseKeys ( FallStatus = EFI_DEVICE_ERROR; } - if (EFI_ERROR (FallStatus)) { + if (EFI_ERROR(FallStatus)) { if (*NumberOfSenseKeys != 0) { *NeedRetry = FALSE; Status = EFI_SUCCESS; @@ -2946,7 +2946,7 @@ ScsiDiskReadSectors ( SectorCount ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } @@ -3110,7 +3110,7 @@ ScsiDiskWriteSectors ( SectorCount ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } @@ -3297,7 +3297,7 @@ ScsiDiskAsyncReadSectors ( Token ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Some devices will return EFI_DEVICE_ERROR or EFI_TIMEOUT when the data // length of a SCSI I/O command is too large. @@ -3319,7 +3319,7 @@ ScsiDiskAsyncReadSectors ( // function ScsiDiskNotify(). // RemoveEntryList (&BlkIo2Req->Link); - FreePool (BlkIo2Req); + FreePool(BlkIo2Req); BlkIo2Req = NULL; gBS->RestoreTPL (OldTpl); @@ -3361,7 +3361,7 @@ Done: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); if (IsListEmpty (&BlkIo2Req->ScsiRWQueue)) { RemoveEntryList (&BlkIo2Req->Link); - FreePool (BlkIo2Req); + FreePool(BlkIo2Req); BlkIo2Req = NULL; gBS->SignalEvent (Token->Event); @@ -3514,7 +3514,7 @@ ScsiDiskAsyncWriteSectors ( Token ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Some devices will return EFI_DEVICE_ERROR or EFI_TIMEOUT when the data // length of a SCSI I/O command is too large. @@ -3536,7 +3536,7 @@ ScsiDiskAsyncWriteSectors ( // function ScsiDiskNotify(). // RemoveEntryList (&BlkIo2Req->Link); - FreePool (BlkIo2Req); + FreePool(BlkIo2Req); BlkIo2Req = NULL; gBS->RestoreTPL (OldTpl); @@ -3578,7 +3578,7 @@ Done: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); if (IsListEmpty (&BlkIo2Req->ScsiRWQueue)) { RemoveEntryList (&BlkIo2Req->Link); - FreePool (BlkIo2Req); + FreePool(BlkIo2Req); BlkIo2Req = NULL; gBS->SignalEvent (Token->Event); @@ -3684,7 +3684,7 @@ BackOff: return EFI_DEVICE_ERROR; } - if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) { + if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR(ReturnStatus))) { DEBUG ((EFI_D_ERROR, "ScsiDiskRead10: Check Condition happened!\n")); Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action); if (Action == ACTION_RETRY_COMMAND_LATER) { @@ -3808,7 +3808,7 @@ BackOff: return EFI_DEVICE_ERROR; } - if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) { + if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR(ReturnStatus))) { DEBUG ((EFI_D_ERROR, "ScsiDiskWrite10: Check Condition happened!\n")); Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action); if (Action == ACTION_RETRY_COMMAND_LATER) { @@ -3931,7 +3931,7 @@ BackOff: return EFI_DEVICE_ERROR; } - if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) { + if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR(ReturnStatus))) { DEBUG ((EFI_D_ERROR, "ScsiDiskRead16: Check Condition happened!\n")); Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action); if (Action == ACTION_RETRY_COMMAND_LATER) { @@ -4055,7 +4055,7 @@ BackOff: return EFI_DEVICE_ERROR; } - if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) { + if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR(ReturnStatus))) { DEBUG ((EFI_D_ERROR, "ScsiDiskWrite16: Check Condition happened!\n")); Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action); if (Action == ACTION_RETRY_COMMAND_LATER) { @@ -4240,7 +4240,7 @@ Retry: ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Token->TransactionStatus = EFI_DEVICE_ERROR; goto Exit; } else if (OldSectorCount != Request->SectorCount) { @@ -4273,7 +4273,7 @@ Retry: Token ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Token->TransactionStatus = EFI_DEVICE_ERROR; goto Exit; } @@ -4308,7 +4308,7 @@ Retry: ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Token->TransactionStatus = EFI_DEVICE_ERROR; goto Exit; } else if (OldSectorCount != Request->SectorCount) { @@ -4341,7 +4341,7 @@ Retry: Token ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Token->TransactionStatus = EFI_DEVICE_ERROR; goto Exit; } @@ -4356,12 +4356,12 @@ Exit: // The last SCSI R/W command of a BlockIo2 request completes // RemoveEntryList (&Request->BlkIo2Req->Link); - FreePool (Request->BlkIo2Req); // Should be freed only once + FreePool(Request->BlkIo2Req); // Should be freed only once gBS->SignalEvent (Token->Event); } - FreePool (Request->SenseData); - FreePool (Request); + FreePool(Request->SenseData); + FreePool(Request); } @@ -4470,14 +4470,14 @@ ErrorExit: if (Request != NULL) { if (Request->SenseData != NULL) { - FreePool (Request->SenseData); + FreePool(Request->SenseData); } OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&Request->Link); gBS->RestoreTPL (OldTpl); - FreePool (Request); + FreePool(Request); } return Status; @@ -4589,14 +4589,14 @@ ErrorExit: if (Request != NULL) { if (Request->SenseData != NULL) { - FreePool (Request->SenseData); + FreePool(Request->SenseData); } OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&Request->Link); gBS->RestoreTPL (OldTpl); - FreePool (Request); + FreePool(Request); } return Status; @@ -4708,14 +4708,14 @@ ErrorExit: if (Request != NULL) { if (Request->SenseData != NULL) { - FreePool (Request->SenseData); + FreePool(Request->SenseData); } OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&Request->Link); gBS->RestoreTPL (OldTpl); - FreePool (Request); + FreePool(Request); } return Status; @@ -4827,14 +4827,14 @@ ErrorExit: if (Request != NULL) { if (Request->SenseData != NULL) { - FreePool (Request->SenseData); + FreePool(Request->SenseData); } OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&Request->Link); gBS->RestoreTPL (OldTpl); - FreePool (Request); + FreePool(Request); } return Status; @@ -5212,7 +5212,7 @@ ReleaseScsiDiskDeviceResources ( } if (ScsiDiskDevice->SenseData != NULL) { - FreePool (ScsiDiskDevice->SenseData); + FreePool(ScsiDiskDevice->SenseData); ScsiDiskDevice->SenseData = NULL; } @@ -5221,7 +5221,7 @@ ReleaseScsiDiskDeviceResources ( ScsiDiskDevice->ControllerNameTable = NULL; } - FreePool (ScsiDiskDevice); + FreePool(ScsiDiskDevice); ScsiDiskDevice = NULL; } @@ -5305,7 +5305,7 @@ GetParentProtocol ( &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -5314,16 +5314,16 @@ GetParentProtocol ( // for (Index = 0; Index < HandleCount; Index++) { Status = EfiTestChildHandle (HandleBuffer[Index], ChildHandle, ProtocolGuid); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (HandleBuffer[Index], ProtocolGuid, (VOID **)&Interface); - if (!EFI_ERROR (Status)) { - gBS->FreePool (HandleBuffer); + if (!EFI_ERROR(Status)) { + gBS->FreePool(HandleBuffer); return Interface; } } } - gBS->FreePool (HandleBuffer); + gBS->FreePool(HandleBuffer); return NULL; } @@ -5366,7 +5366,7 @@ DetermineInstallEraseBlock ( // // Device Path protocol must be installed on the device handle. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); while (!IsDevicePathEndType (DevicePathNode)) { // @@ -5679,7 +5679,7 @@ InitializeInstallDiskInfo ( // // Device Path protocol must be installed on the device handle. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Copy the DiskInfo protocol template. // @@ -5700,7 +5700,7 @@ InitializeInstallDiskInfo ( // with IDE/AHCI interface GUID. // Status = AtapiIdentifyDevice (ScsiDiskDevice); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (DevicePathSubType(ChildDevicePathNode) == MSG_ATAPI_DP) { // // We find the valid ATAPI device path diff --git a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/DmaMem.c b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/DmaMem.c index 2d8bfa1b0..eeed2a33b 100644 --- a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/DmaMem.c +++ b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/DmaMem.c @@ -51,7 +51,7 @@ IoMmuMap ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } switch (Operation) { @@ -76,7 +76,7 @@ IoMmuMap ( *Mapping, Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -153,7 +153,7 @@ IoMmuAllocateBuffer ( HostAddress, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -166,7 +166,7 @@ IoMmuAllocateBuffer ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } Status = mIoMmu->SetAttribute ( @@ -174,7 +174,7 @@ IoMmuAllocateBuffer ( *Mapping, EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -183,7 +183,7 @@ IoMmuAllocateBuffer ( Pages, &HostPhyAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } *HostAddress = (VOID *)(UINTN)HostPhyAddress; diff --git a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.c b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.c index 267db4a89..a27557e95 100644 --- a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.c +++ b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.c @@ -394,7 +394,7 @@ EmmcBlockIoPeimReadBlocks ( PartitionConfig, 0x0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Private->Slot[SlotNum].ExtCsd.PartitionConfig = PartitionConfig; @@ -413,13 +413,13 @@ EmmcBlockIoPeimReadBlocks ( } Status = EmmcPeimSetBlkCount (&Private->Slot[SlotNum], (UINT16)NumberOfBlocks); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } BufferSize = NumberOfBlocks * BlockSize; Status = EmmcPeimRwMultiBlocks (&Private->Slot[SlotNum], StartLBA, BlockSize, Buffer, BufferSize, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -532,7 +532,7 @@ EmmcBlockIoPeimGetMediaInfo2 ( DeviceIndex, &Media ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -684,7 +684,7 @@ InitializeEmmcBlockIoPeim ( // // Shadow this PEIM to run from memory // - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -697,7 +697,7 @@ InitializeEmmcBlockIoPeim ( NULL, (VOID **) &SdMmcHcPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -710,7 +710,7 @@ InitializeEmmcBlockIoPeim ( // // When status is error, meant no controller is found // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -730,14 +730,14 @@ InitializeEmmcBlockIoPeim ( // Initialize the memory pool which will be used in all transactions. // Status = EmmcPeimInitMemPool (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; break; } for (Index = 0; Index < BarNum; Index++) { Status = EmmcPeimHcGetCapability (MmioBase[Index], &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } if (Capability.SlotType != 0x1) { @@ -747,15 +747,15 @@ InitializeEmmcBlockIoPeim ( } Status = EmmcPeimHcReset (MmioBase[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } Status = EmmcPeimHcCardDetect (MmioBase[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } Status = EmmcPeimHcInitHost (MmioBase[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -767,7 +767,7 @@ InitializeEmmcBlockIoPeim ( CopyMem (&Slot->Capability, &Capability, sizeof (Capability)); Status = EmmcPeimIdentification (Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -829,7 +829,7 @@ InitializeEmmcBlockIoPeim ( } Controller++; - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PeiServicesInstallPpi (&Private->BlkIoPpiList); PeiServicesNotifyPpi (&Private->EndOfPeiNotifyList); } else { diff --git a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c index c60ac3042..0eca43a91 100644 --- a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c +++ b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c @@ -32,7 +32,7 @@ EmmcPeimAllocMemBlock ( Block = NULL; Status = PeiServicesAllocatePool (sizeof(EMMC_PEIM_MEM_BLOCK), &TempPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -49,7 +49,7 @@ EmmcPeimAllocMemBlock ( Block->BitsLen = Block->BufLen / (EMMC_PEIM_MEM_UNIT * 8); Status = PeiServicesAllocatePool (Block->BitsLen, &TempPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -63,7 +63,7 @@ EmmcPeimAllocMemBlock ( &MappedAddr, &Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -236,7 +236,7 @@ EmmcPeimInitMemPool ( Pool = NULL; Status = PeiServicesAllocatePool (sizeof (EMMC_PEIM_MEM_POOL), &TempPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c index 679646eeb..00b147fc8 100644 --- a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c +++ b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c @@ -108,7 +108,7 @@ EmmcPeimHcOrMmio ( UINT64 Or; Status = EmmcPeimHcRwMmio (Address, TRUE, Count, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -159,7 +159,7 @@ EmmcPeimHcAndMmio ( UINT64 And; Status = EmmcPeimHcRwMmio (Address, TRUE, Count, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -212,7 +212,7 @@ EmmcPeimHcCheckMmioSet ( // Value = 0; Status = EmmcPeimHcRwMmio (Address, TRUE, Count, &Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -303,7 +303,7 @@ EmmcPeimHcReset ( SwReset = 0xFF; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_SW_RST, FALSE, sizeof (SwReset), &SwReset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EmmcPeimHcReset: write full 1 fails: %r\n", Status)); return Status; } @@ -315,7 +315,7 @@ EmmcPeimHcReset ( 0x00, EMMC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "EmmcPeimHcReset: reset done with %r\n", Status)); return Status; } @@ -350,7 +350,7 @@ EmmcPeimHcEnableInterrupt ( // IntStatus = 0xFFFF; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_ERR_INT_STS_EN, FALSE, sizeof (IntStatus), &IntStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -382,7 +382,7 @@ EmmcPeimHcGetCapability ( UINT64 Cap; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_CAP, TRUE, sizeof (Cap), &Cap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -417,7 +417,7 @@ EmmcPeimHcCardDetect ( // Check Normal Interrupt Status Register // Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_NOR_INT_STS, TRUE, sizeof (Data), &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -427,7 +427,7 @@ EmmcPeimHcCardDetect ( // Data &= BIT6 | BIT7; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_NOR_INT_STS, FALSE, sizeof (Data), &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -436,7 +436,7 @@ EmmcPeimHcCardDetect ( // Check Present State Register to see if there is a card presented. // Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_PRESENT_STATE, TRUE, sizeof (PresentState), &PresentState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -479,7 +479,7 @@ EmmcPeimHcStopClock ( 0, EMMC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -523,7 +523,7 @@ EmmcPeimHcClockSupply ( // Calculate a divisor for SD clock frequency // Status = EmmcPeimHcGetCapability (Bar, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT (Capability.BaseClkFreq != 0); @@ -559,7 +559,7 @@ EmmcPeimHcClockSupply ( DEBUG ((EFI_D_INFO, "BaseClkFreq %dMHz Divisor %d ClockFreq %dKhz\n", BaseClkFreq, Divisor, ClockFreq)); Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_CTRL_VER, TRUE, sizeof (ControllerVer), &ControllerVer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -586,7 +586,7 @@ EmmcPeimHcClockSupply ( // Stop bus clock at first // Status = EmmcPeimHcStopClock (Bar); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -595,7 +595,7 @@ EmmcPeimHcClockSupply ( // ClockCtrl |= BIT0; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_CLOCK_CTRL, FALSE, sizeof (ClockCtrl), &ClockCtrl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Set SDCLK Frequency Select and Internal Clock Enable fields fails\n")); return Status; } @@ -610,7 +610,7 @@ EmmcPeimHcClockSupply ( BIT1, EMMC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -648,7 +648,7 @@ EmmcPeimHcPowerControl ( // PowerCtrl &= (UINT8)~BIT0; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_POWER_CTRL, FALSE, sizeof (PowerCtrl), &PowerCtrl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -687,7 +687,7 @@ EmmcPeimHcSetBusWidth ( Status = EmmcPeimHcAndMmio (Bar + EMMC_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); } else if (BusWidth == 4) { Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_HOST_CTRL1, TRUE, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl1 |= BIT1; @@ -695,7 +695,7 @@ EmmcPeimHcSetBusWidth ( Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_HOST_CTRL1, FALSE, sizeof (HostCtrl1), &HostCtrl1); } else if (BusWidth == 8) { Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_HOST_CTRL1, TRUE, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl1 &= (UINT8)~BIT1; @@ -731,7 +731,7 @@ EmmcPeimHcInitClockFreq ( // Calculate a divisor for SD clock frequency // Status = EmmcPeimHcGetCapability (Bar, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -774,7 +774,7 @@ EmmcPeimHcInitPowerVoltage ( // Get the support voltage of the Host Controller // Status = EmmcPeimHcGetCapability (Bar, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -797,7 +797,7 @@ EmmcPeimHcInitPowerVoltage ( MaxVoltage = 0x0A; HostCtrl2 = BIT3; Status = EmmcPeimHcOrMmio (Bar + EMMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } MicroSecondDelay (5000); @@ -857,12 +857,12 @@ EmmcPeimHcInitHost ( EFI_STATUS Status; Status = EmmcPeimHcInitClockFreq (Bar); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EmmcPeimHcInitPowerVoltage (Bar); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -999,7 +999,7 @@ EmmcPeimCreateTrb ( // Calculate a divisor for SD clock frequency // Status = EmmcPeimHcGetCapability (Slot->EmmcHcBase, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -1045,7 +1045,7 @@ EmmcPeimCreateTrb ( MapLength = Trb->DataLen; Status = IoMmuMap (MapOp, Trb->Data, &MapLength, &Trb->DataPhy, &Trb->DataMap); - if (EFI_ERROR (Status) || (MapLength != Trb->DataLen)) { + if (EFI_ERROR(Status) || (MapLength != Trb->DataLen)) { DEBUG ((DEBUG_ERROR, "EmmcPeimCreateTrb: Fail to map data buffer.\n")); goto Error; } @@ -1056,7 +1056,7 @@ EmmcPeimCreateTrb ( } else if (Capability.Adma2 != 0) { Trb->Mode = EmmcAdmaMode; Status = BuildAdmaDescTable (Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else if (Capability.Sdma != 0) { @@ -1092,7 +1092,7 @@ EmmcPeimFreeTrb ( } if (Trb != NULL) { - FreePool (Trb); + FreePool(Trb); } return; } @@ -1232,7 +1232,7 @@ EmmcPeimExecTrb ( // IntStatus = 0xFFFF; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_ERR_INT_STS, FALSE, sizeof (IntStatus), &IntStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1240,7 +1240,7 @@ EmmcPeimExecTrb ( // IntStatus = 0xFFFF; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_NOR_INT_STS, FALSE, sizeof (IntStatus), &IntStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1249,7 +1249,7 @@ EmmcPeimExecTrb ( if (Trb->Mode == EmmcAdmaMode) { HostCtrl1 = BIT4; Status = EmmcPeimHcOrMmio (Bar + EMMC_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1263,13 +1263,13 @@ EmmcPeimExecTrb ( SdmaAddr = (UINT32)(UINTN)Trb->DataPhy; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_SDMA_ADDR, FALSE, sizeof (SdmaAddr), &SdmaAddr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else if (Trb->Mode == EmmcAdmaMode) { AdmaAddr = (UINT64)(UINTN)Trb->AdmaDesc; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_ADMA_SYS_ADDR, FALSE, sizeof (AdmaAddr), &AdmaAddr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1283,7 +1283,7 @@ EmmcPeimExecTrb ( } Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_BLK_SIZE, FALSE, sizeof (BlkSize), &BlkSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1296,13 +1296,13 @@ EmmcPeimExecTrb ( } Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_BLK_COUNT, FALSE, sizeof (BlkCount), &BlkCount); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Argument = Packet->EmmcCmdBlk->CommandArgument; Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_ARG1, FALSE, sizeof (Argument), &Argument); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1320,7 +1320,7 @@ EmmcPeimExecTrb ( } Status = EmmcPeimHcRwMmio (Bar + EMMC_HC_TRANS_MOD, FALSE, sizeof (TransMode), &TransMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1399,7 +1399,7 @@ EmmcPeimCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -1419,7 +1419,7 @@ EmmcPeimCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((IntStatus & BIT4) == BIT4) { Status = EFI_SUCCESS; } else { @@ -1442,7 +1442,7 @@ EmmcPeimCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1459,7 +1459,7 @@ EmmcPeimCheckTrbResult ( sizeof (SwReset), &SwReset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = EmmcPeimHcWaitMmioSet ( @@ -1469,7 +1469,7 @@ EmmcPeimCheckTrbResult ( 0, EMMC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1490,7 +1490,7 @@ EmmcPeimCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -1503,7 +1503,7 @@ EmmcPeimCheckTrbResult ( sizeof (UINT32), &SdmaAddr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Trb->DataPhy = (UINT32)(UINTN)SdmaAddr; @@ -1546,7 +1546,7 @@ Done: // // Get response data when the cmd is executed successfully. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Packet->EmmcCmdBlk->CommandType != EmmcCommandTypeBc) { for (Index = 0; Index < 4; Index++) { Status = EmmcPeimHcRwMmio ( @@ -1555,7 +1555,7 @@ Done: sizeof (UINT32), &Response[Index] ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EmmcPeimHcLedOnOff (Bar, FALSE); return Status; } @@ -1684,17 +1684,17 @@ EmmcPeimExecCmd ( } Status = EmmcPeimWaitTrbEnv (Slot->EmmcHcBase, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = EmmcPeimExecTrb (Slot->EmmcHcBase, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = EmmcPeimWaitTrbResult (Slot->EmmcHcBase, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1782,7 +1782,7 @@ EmmcPeimGetOcr ( EmmcCmdBlk.CommandArgument = *Argument; Status = EmmcPeimExecCmd (Slot, &Packet); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -1916,7 +1916,7 @@ EmmcPeimGetCsd ( EmmcCmdBlk.CommandArgument = Rca << 16; Status = EmmcPeimExecCmd (Slot, &Packet); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -2097,7 +2097,7 @@ EmmcPeimSendStatus ( EmmcCmdBlk.CommandArgument = Rca << 16; Status = EmmcPeimExecCmd (Slot, &Packet); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *DevStatus = EmmcStatusBlk.Resp0; } @@ -2303,7 +2303,7 @@ EmmcPeimTuningClkForHs200 ( // HostCtrl2 = BIT6; Status = EmmcPeimHcOrMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2312,12 +2312,12 @@ EmmcPeimTuningClkForHs200 ( Retry = 0; do { Status = EmmcPeimSendTuningBlk (Slot, BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EmmcPeimHcRwMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL2, TRUE, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2336,7 +2336,7 @@ EmmcPeimTuningClkForHs200 ( // HostCtrl2 = (UINT8)~(BIT6 | BIT7); Status = EmmcPeimHcAndMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } return EFI_DEVICE_ERROR; @@ -2392,12 +2392,12 @@ EmmcPeimSwitchBusWidth ( CmdSet = 0; Status = EmmcPeimSwitch (Slot, Access, Index, Value, CmdSet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EmmcPeimSendStatus (Slot, Rca, &DevStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2451,12 +2451,12 @@ EmmcPeimSwitchClockFreq ( CmdSet = 0; Status = EmmcPeimSwitch (Slot, Access, Index, Value, CmdSet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EmmcPeimSendStatus (Slot, Rca, &DevStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2505,7 +2505,7 @@ EmmcPeimSwitchToHighSpeed ( UINT8 HostCtrl2; Status = EmmcPeimSwitchBusWidth (Slot, Rca, IsDdr, BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2513,13 +2513,13 @@ EmmcPeimSwitchToHighSpeed ( // HostCtrl1 = BIT2; Status = EmmcPeimHcOrMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl2 = (UINT8)~0x7; Status = EmmcPeimHcAndMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (IsDdr) { @@ -2530,7 +2530,7 @@ EmmcPeimSwitchToHighSpeed ( HostCtrl2 = 0; } Status = EmmcPeimHcOrMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2573,7 +2573,7 @@ EmmcPeimSwitchToHS200 ( } Status = EmmcPeimSwitchBusWidth (Slot, Rca, FALSE, BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2583,18 +2583,18 @@ EmmcPeimSwitchToHS200 ( // Stop bus clock at first // Status = EmmcPeimHcStopClock (Slot->EmmcHcBase); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl2 = (UINT8)~0x7; Status = EmmcPeimHcAndMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl2 = BIT0 | BIT1; Status = EmmcPeimHcOrMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2608,7 +2608,7 @@ EmmcPeimSwitchToHS200 ( BIT1, EMMC_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2619,7 +2619,7 @@ EmmcPeimSwitchToHS200 ( HsTiming = 2; Status = EmmcPeimSwitchClockFreq (Slot, Rca, HsTiming, ClockFreq); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2654,7 +2654,7 @@ EmmcPeimSwitchToHS400 ( UINT8 HostCtrl2; Status = EmmcPeimSwitchToHS200 (Slot, Rca, ClockFreq, 8); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2662,14 +2662,14 @@ EmmcPeimSwitchToHS400 ( // HsTiming = 1; Status = EmmcPeimSwitchClockFreq (Slot, Rca, HsTiming, 52); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // HS400 mode must use 8 data lines. // Status = EmmcPeimSwitchBusWidth (Slot, Rca, TRUE, 8); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2677,12 +2677,12 @@ EmmcPeimSwitchToHS400 ( // HostCtrl2 = (UINT8)~0x7; Status = EmmcPeimHcAndMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl2 = BIT0 | BIT2; Status = EmmcPeimHcOrMmio (Slot->EmmcHcBase + EMMC_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2719,7 +2719,7 @@ EmmcPeimSetBusMode ( UINT8 BusWidth; Status = EmmcPeimGetCsd (Slot, Rca, &Slot->Csd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EmmcPeimSetBusMode: EmmcPeimGetCsd fails with %r\n", Status)); return Status; } @@ -2731,13 +2731,13 @@ EmmcPeimSetBusMode ( } Status = EmmcPeimSelect (Slot, Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EmmcPeimSetBusMode: EmmcPeimSelect fails with %r\n", Status)); return Status; } Status = EmmcPeimHcGetCapability (Slot->EmmcHcBase, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EmmcPeimSetBusMode: EmmcPeimHcGetCapability fails with %r\n", Status)); return Status; } @@ -2755,7 +2755,7 @@ EmmcPeimSetBusMode ( // Get Deivce_Type from EXT_CSD register. // Status = EmmcPeimGetExtCsd (Slot, &Slot->ExtCsd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EmmcPeimSetBusMode: EmmcPeimGetExtCsd fails with %r\n", Status)); return Status; } @@ -2846,7 +2846,7 @@ EmmcPeimIdentification ( UINTN Retry; Status = EmmcPeimReset (Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EmmcPeimIdentification: EmmcPeimReset fails with %r\n", Status)); return Status; } @@ -2855,7 +2855,7 @@ EmmcPeimIdentification ( Retry = 0; do { Status = EmmcPeimGetOcr (Slot, &Ocr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EmmcPeimIdentification: EmmcPeimGetOcr fails with %r\n", Status)); return Status; } @@ -2868,7 +2868,7 @@ EmmcPeimIdentification ( } while ((Ocr & BIT31) == 0); Status = EmmcPeimGetAllCid (Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EmmcPeimIdentification: EmmcPeimGetAllCid fails with %r\n", Status)); return Status; } @@ -2878,7 +2878,7 @@ EmmcPeimIdentification ( // Rca = 1; Status = EmmcPeimSetRca (Slot, Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EmmcPeimIdentification: EmmcPeimSetRca fails with %r\n", Status)); return Status; } diff --git a/MdeModulePkg/Bus/Sd/EmmcDxe/ComponentName.c b/MdeModulePkg/Bus/Sd/EmmcDxe/ComponentName.c index 6a4d18d4d..3e1049767 100644 --- a/MdeModulePkg/Bus/Sd/EmmcDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Sd/EmmcDxe/ComponentName.c @@ -191,7 +191,7 @@ EmmcDxeComponentNameGetControllerName ( gEmmcDxeDriverBinding.DriverBindingHandle, &gEfiSdMmcPassThruProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -202,7 +202,7 @@ EmmcDxeComponentNameGetControllerName ( ChildHandle, &gEfiSdMmcPassThruProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -216,7 +216,7 @@ EmmcDxeComponentNameGetControllerName ( ChildHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } diff --git a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c index 1b247af57..37e719f65 100644 --- a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c +++ b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c @@ -27,7 +27,7 @@ AsyncIoCallback ( EFI_STATUS Status; Status = gBS->CloseEvent (Event); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -39,7 +39,7 @@ AsyncIoCallback ( Request->Packet.TransactionStatus)); DEBUG_CODE_END (); - if (EFI_ERROR (Request->Packet.TransactionStatus)) { + if (EFI_ERROR(Request->Packet.TransactionStatus)) { Request->Token->TransactionStatus = Request->Packet.TransactionStatus; } @@ -49,7 +49,7 @@ AsyncIoCallback ( gBS->SignalEvent (Request->Token->Event); } - FreePool (Request); + FreePool(Request); } /** @@ -134,7 +134,7 @@ EmmcSendStatus ( SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CopyMem (DevStatus, &SdMmcStatusBlk.Resp0, sizeof (UINT32)); } @@ -183,7 +183,7 @@ EmmcGetCsd ( SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -235,7 +235,7 @@ EmmcGetCid ( SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -360,7 +360,7 @@ EmmcSetExtCsd ( SetExtCsdReq, &SetExtCsdReq->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -375,14 +375,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (SetExtCsdReq != NULL)) { + if (EFI_ERROR(Status) && (SetExtCsdReq != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&SetExtCsdReq->Link); gBS->RestoreTPL (OldTpl); if (SetExtCsdReq->Event != NULL) { gBS->CloseEvent (SetExtCsdReq->Event); } - FreePool (SetExtCsdReq); + FreePool(SetExtCsdReq); } } else { // @@ -392,7 +392,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&SetExtCsdReq->Link); gBS->RestoreTPL (OldTpl); - FreePool (SetExtCsdReq); + FreePool(SetExtCsdReq); } } @@ -462,7 +462,7 @@ EmmcSetBlkCount ( SetBlkCntReq, &SetBlkCntReq->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -477,14 +477,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (SetBlkCntReq != NULL)) { + if (EFI_ERROR(Status) && (SetBlkCntReq != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&SetBlkCntReq->Link); gBS->RestoreTPL (OldTpl); if (SetBlkCntReq->Event != NULL) { gBS->CloseEvent (SetBlkCntReq->Event); } - FreePool (SetBlkCntReq); + FreePool(SetBlkCntReq); } } else { // @@ -494,7 +494,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&SetBlkCntReq->Link); gBS->RestoreTPL (OldTpl); - FreePool (SetBlkCntReq); + FreePool(SetBlkCntReq); } } @@ -595,7 +595,7 @@ EmmcProtocolInOut ( ProtocolReq, &ProtocolReq->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -610,14 +610,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (ProtocolReq != NULL)) { + if (EFI_ERROR(Status) && (ProtocolReq != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&ProtocolReq->Link); gBS->RestoreTPL (OldTpl); if (ProtocolReq->Event != NULL) { gBS->CloseEvent (ProtocolReq->Event); } - FreePool (ProtocolReq); + FreePool(ProtocolReq); } } else { // @@ -627,7 +627,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&ProtocolReq->Link); gBS->RestoreTPL (OldTpl); - FreePool (ProtocolReq); + FreePool(ProtocolReq); } } @@ -729,7 +729,7 @@ EmmcRwMultiBlocks ( RwMultiBlkReq, &RwMultiBlkReq->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -744,14 +744,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (RwMultiBlkReq != NULL)) { + if (EFI_ERROR(Status) && (RwMultiBlkReq != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&RwMultiBlkReq->Link); gBS->RestoreTPL (OldTpl); if (RwMultiBlkReq->Event != NULL) { gBS->CloseEvent (RwMultiBlkReq->Event); } - FreePool (RwMultiBlkReq); + FreePool(RwMultiBlkReq); } } else { // @@ -761,7 +761,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&RwMultiBlkReq->Link); gBS->RestoreTPL (OldTpl); - FreePool (RwMultiBlkReq); + FreePool(RwMultiBlkReq); } } @@ -867,7 +867,7 @@ EmmcReadWrite ( PartitionConfig &= (UINT8)~0x7; PartitionConfig |= Partition->PartitionType; Status = EmmcSetExtCsd (Partition, OFFSET_OF (EMMC_EXT_CSD, PartitionConfig), PartitionConfig, Token, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Device->ExtCsd.PartitionConfig = PartitionConfig; @@ -886,13 +886,13 @@ EmmcReadWrite ( BlockNum = MaxBlock; } Status = EmmcSetBlkCount (Partition, (UINT16)BlockNum, Token, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } BufferSize = BlockNum * BlockSize; Status = EmmcRwMultiBlocks (Partition, Lba, Buffer, BufferSize, IsRead, Token, LastRw); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DEBUG ((DEBUG_BLKIO, @@ -934,7 +934,7 @@ EmmcReset ( PassThru = Partition->Device->Private->PassThru; Status = PassThru->ResetDevice (PassThru, Partition->Device->Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -1082,7 +1082,7 @@ EmmcResetEx ( gBS->SignalEvent (Request->Token->Event); } - FreePool (Request); + FreePool(Request); } gBS->RestoreTPL (OldTpl); @@ -1351,7 +1351,7 @@ EmmcSecurityProtocolInOut ( PartitionConfig &= (UINT8)~0x7; PartitionConfig |= Partition->PartitionType; Status = EmmcSetExtCsd (Partition, OFFSET_OF (EMMC_EXT_CSD, PartitionConfig), PartitionConfig, NULL, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Device->ExtCsd.PartitionConfig = PartitionConfig; @@ -1370,13 +1370,13 @@ EmmcSecurityProtocolInOut ( } Status = EmmcSetBlkCount (Partition, (UINT16)BlockNum, NULL, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } PayloadBufferSize = BlockNum * BlockSize; Status = EmmcProtocolInOut (Partition, SecurityProtocolId, SecurityProtocolSpecificData, PayloadBufferSize, PayloadBuffer, IsRead, Timeout, NULL, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1654,7 +1654,7 @@ EmmcEraseBlockStart ( EraseBlockStart, &EraseBlockStart->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -1669,14 +1669,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (EraseBlockStart != NULL)) { + if (EFI_ERROR(Status) && (EraseBlockStart != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlockStart->Link); gBS->RestoreTPL (OldTpl); if (EraseBlockStart->Event != NULL) { gBS->CloseEvent (EraseBlockStart->Event); } - FreePool (EraseBlockStart); + FreePool(EraseBlockStart); } } else { // @@ -1686,7 +1686,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlockStart->Link); gBS->RestoreTPL (OldTpl); - FreePool (EraseBlockStart); + FreePool(EraseBlockStart); } } @@ -1761,7 +1761,7 @@ EmmcEraseBlockEnd ( EraseBlockEnd, &EraseBlockEnd->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -1776,14 +1776,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (EraseBlockEnd != NULL)) { + if (EFI_ERROR(Status) && (EraseBlockEnd != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlockEnd->Link); gBS->RestoreTPL (OldTpl); if (EraseBlockEnd->Event != NULL) { gBS->CloseEvent (EraseBlockEnd->Event); } - FreePool (EraseBlockEnd); + FreePool(EraseBlockEnd); } } else { // @@ -1793,7 +1793,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlockEnd->Link); gBS->RestoreTPL (OldTpl); - FreePool (EraseBlockEnd); + FreePool(EraseBlockEnd); } } @@ -1868,7 +1868,7 @@ EmmcEraseBlock ( EraseBlock, &EraseBlock->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -1883,14 +1883,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (EraseBlock != NULL)) { + if (EFI_ERROR(Status) && (EraseBlock != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlock->Link); gBS->RestoreTPL (OldTpl); if (EraseBlock->Event != NULL) { gBS->CloseEvent (EraseBlock->Event); } - FreePool (EraseBlock); + FreePool(EraseBlock); } } else { // @@ -1900,7 +1900,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlock->Link); gBS->RestoreTPL (OldTpl); - FreePool (EraseBlock); + FreePool(EraseBlock); } } @@ -1939,7 +1939,7 @@ EmmcWriteZeros ( MediaId = Partition->BlockMedia.MediaId; Status = EmmcReadWrite (Partition, MediaId, StartLba, Buffer, Size, FALSE, NULL); - FreePool (Buffer); + FreePool(Buffer); return Status; } @@ -2037,7 +2037,7 @@ EmmcEraseBlocks ( PartitionConfig &= (UINT8)~0x7; PartitionConfig |= Partition->PartitionType; Status = EmmcSetExtCsd (Partition, OFFSET_OF (EMMC_EXT_CSD, PartitionConfig), PartitionConfig, (EFI_BLOCK_IO2_TOKEN*)Token, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Device->ExtCsd.PartitionConfig = PartitionConfig; @@ -2062,7 +2062,7 @@ EmmcEraseBlocks ( // if (BlockNum < EraseGroupSize) { Status = EmmcWriteZeros (Partition, FirstLba, Size); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2090,7 +2090,7 @@ EmmcEraseBlocks ( if (StartGroupLba > FirstLba) { WriteZeroSize = (UINTN)(StartGroupLba - FirstLba) * BlockSize; Status = EmmcWriteZeros (Partition, FirstLba, WriteZeroSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -2103,7 +2103,7 @@ EmmcEraseBlocks ( if (EndGroupLba <= LastLba) { WriteZeroSize = (UINTN)(LastLba + 1 - EndGroupLba) * BlockSize; Status = EmmcWriteZeros (Partition, EndGroupLba, WriteZeroSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -2133,17 +2133,17 @@ EmmcEraseBlocks ( } Status = EmmcEraseBlockStart (Partition, FirstLba, (EFI_BLOCK_IO2_TOKEN*)Token, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EmmcEraseBlockEnd (Partition, LastLba, (EFI_BLOCK_IO2_TOKEN*)Token, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EmmcEraseBlock (Partition, (EFI_BLOCK_IO2_TOKEN*)Token, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c index e2ae56c50..6115511f4 100644 --- a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c +++ b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c @@ -266,7 +266,7 @@ DiscoverAllPartitions ( Slot = Device->Slot; Status = EmmcSendStatus (Device, Slot + 1, &DevStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -278,13 +278,13 @@ DiscoverAllPartitions ( EmmcSelect (Device, 0); Status = EmmcSendStatus (Device, Slot + 1, &DevStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Csd = &Device->Csd; Status = EmmcGetCsd (Device, Slot + 1, Csd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DumpCsd (Csd); @@ -297,18 +297,18 @@ DiscoverAllPartitions ( Cid = &Device->Cid; Status = EmmcGetCid (Device, Slot + 1, Cid); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = EmmcSelect (Device, Slot + 1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ExtCsd = &Device->ExtCsd; Status = EmmcGetExtCsd (Device, ExtCsd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DumpExtCsd (ExtCsd); @@ -433,7 +433,7 @@ InstallProtocolOnPartition ( DeviceHandle = NULL; RemainingDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { + if (!EFI_ERROR(Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { Status = EFI_ALREADY_STARTED; goto Error; } @@ -459,7 +459,7 @@ InstallProtocolOnPartition ( &Partition->DiskInfo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -473,7 +473,7 @@ InstallProtocolOnPartition ( EFI_NATIVE_INTERFACE, &Partition->StorageSecurity ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Partition->Handle, &gEfiDevicePathProtocolGuid, @@ -507,8 +507,8 @@ InstallProtocolOnPartition ( } Error: - if (EFI_ERROR (Status) && (DevicePath != NULL)) { - FreePool (DevicePath); + if (EFI_ERROR(Status) && (DevicePath != NULL)) { + FreePool(DevicePath); } return Status; @@ -586,7 +586,7 @@ DiscoverEmmcDevice ( // // The device path to the EMMC device doesn't exist. It means the corresponding device private data hasn't been initialized. // - if (EFI_ERROR (Status) || (DeviceHandle == NULL) || !IsDevicePathEnd (RemainingEmmcDevPath)) { + if (EFI_ERROR(Status) || (DeviceHandle == NULL) || !IsDevicePathEnd (RemainingEmmcDevPath)) { Device->DevicePath = NewDevicePath; Device->Slot = Slot; Device->Private = Private; @@ -595,7 +595,7 @@ DiscoverEmmcDevice ( // Status = DiscoverAllPartitions (Device); if (EFI_ERROR(Status)) { - FreePool (NewDevicePath); + FreePool(NewDevicePath); goto Error; } @@ -606,7 +606,7 @@ DiscoverEmmcDevice ( Device->DevicePath ); if (EFI_ERROR(Status)) { - FreePool (NewDevicePath); + FreePool(NewDevicePath); goto Error; } @@ -657,7 +657,7 @@ DiscoverEmmcDevice ( } Error: - FreePool (DevicePath); + FreePool(DevicePath); return Status; } @@ -733,7 +733,7 @@ EmmcDxeDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -742,7 +742,7 @@ EmmcDxeDriverBindingSupported ( // if ((RemainingDevicePath != NULL) && !IsDevicePathEnd (RemainingDevicePath)) { Status = PassThru->GetSlotNumber (PassThru, RemainingDevicePath, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Close the I/O Abstraction(s) used to perform the supported test // @@ -839,7 +839,7 @@ EmmcDxeDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if ((EFI_ERROR (Status)) && (Status != EFI_ALREADY_STARTED)) { + if ((EFI_ERROR(Status)) && (Status != EFI_ALREADY_STARTED)) { return Status; } @@ -861,7 +861,7 @@ EmmcDxeDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Private->PassThru = PassThru; Private->Controller = Controller; Private->ParentDevicePath = ParentDevicePath; @@ -873,7 +873,7 @@ EmmcDxeDriverBindingStart ( EFI_NATIVE_INTERFACE, Private ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -885,7 +885,7 @@ EmmcDxeDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } @@ -894,7 +894,7 @@ EmmcDxeDriverBindingStart ( Slot = 0xFF; while (TRUE) { Status = PassThru->GetNextSlot (PassThru, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Cannot find more legal slots. // @@ -903,19 +903,19 @@ EmmcDxeDriverBindingStart ( } Status = DiscoverEmmcDevice (Private, Slot, NULL); - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { break; } } } else if (!IsDevicePathEnd (RemainingDevicePath)) { Status = PassThru->GetSlotNumber (PassThru, RemainingDevicePath, &Slot); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = DiscoverEmmcDevice (Private, Slot, NextDevicePathNode (RemainingDevicePath)); } } Error: - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { gBS->CloseProtocol ( Controller, &gEfiSdMmcPassThruProtocolGuid, @@ -930,7 +930,7 @@ Error: Private, NULL ); - FreePool (Private); + FreePool(Private); } } return Status; @@ -996,7 +996,7 @@ EmmcDxeDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1010,7 +1010,7 @@ EmmcDxeDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } ASSERT (DevicePath == Device->DevicePath); @@ -1019,7 +1019,7 @@ EmmcDxeDriverBindingStop ( &gEfiDevicePathProtocolGuid, DevicePath ); - FreePool (Device->DevicePath); + FreePool(Device->DevicePath); } gBS->UninstallProtocolInterface ( @@ -1033,7 +1033,7 @@ EmmcDxeDriverBindingStop ( This->DriverBindingHandle, Controller ); - FreePool (Private); + FreePool(Private); return EFI_SUCCESS; } @@ -1049,7 +1049,7 @@ EmmcDxeDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( ChildHandleBuffer[Index], &gEfiBlockIo2ProtocolGuid, @@ -1058,7 +1058,7 @@ EmmcDxeDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; continue; } @@ -1086,7 +1086,7 @@ EmmcDxeDriverBindingStop ( gBS->SignalEvent (Request->Token->Event); } - FreePool (Request); + FreePool(Request); } // @@ -1113,7 +1113,7 @@ EmmcDxeDriverBindingStop ( &Partition->DiskInfo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; gBS->OpenProtocol ( Controller, @@ -1138,13 +1138,13 @@ EmmcDxeDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->UninstallProtocolInterface ( ChildHandleBuffer[Index], &gEfiStorageSecurityCommandProtocolGuid, &Partition->StorageSecurity ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiSdMmcPassThruProtocolGuid, @@ -1158,7 +1158,7 @@ EmmcDxeDriverBindingStop ( } } - FreePool (Partition->DevicePath); + FreePool(Partition->DevicePath); } if (!AllChildrenStopped) { @@ -1198,7 +1198,7 @@ InitializeEmmcDxe ( &gEmmcDxeComponentName, &gEmmcDxeComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/DmaMem.c b/MdeModulePkg/Bus/Sd/SdBlockIoPei/DmaMem.c index 63ad6ce46..e9d9bdcec 100644 --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/DmaMem.c +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/DmaMem.c @@ -51,7 +51,7 @@ IoMmuMap ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } switch (Operation) { @@ -76,7 +76,7 @@ IoMmuMap ( *Mapping, Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -153,7 +153,7 @@ IoMmuAllocateBuffer ( HostAddress, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -166,7 +166,7 @@ IoMmuAllocateBuffer ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } Status = mIoMmu->SetAttribute ( @@ -174,7 +174,7 @@ IoMmuAllocateBuffer ( *Mapping, EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -183,7 +183,7 @@ IoMmuAllocateBuffer ( Pages, &HostPhyAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } *HostAddress = (VOID *)(UINTN)HostPhyAddress; diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c index 8fa58d65b..9d929c527 100644 --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c @@ -286,7 +286,7 @@ SdBlockIoPeimReadBlocks ( } else { Status = SdPeimRwSingleBlock (&Private->Slot[DeviceIndex - 1], StartLBA, BlockSize, Buffer, BufferSize, TRUE); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -394,7 +394,7 @@ SdBlockIoPeimGetMediaInfo2 ( DeviceIndex, &Media ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -531,7 +531,7 @@ InitializeSdBlockIoPeim ( // // Shadow this PEIM to run from memory // - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -544,7 +544,7 @@ InitializeSdBlockIoPeim ( NULL, (VOID **) &SdMmcHcPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -557,7 +557,7 @@ InitializeSdBlockIoPeim ( // // When status is error, meant no controller is found // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -577,14 +577,14 @@ InitializeSdBlockIoPeim ( // Initialize the memory pool which will be used in all transactions. // Status = SdPeimInitMemPool (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; break; } for (Index = 0; Index < BarNum; Index++) { Status = SdPeimHcGetCapability (MmioBase[Index], &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } if (Capability.SlotType != 0x1) { @@ -594,15 +594,15 @@ InitializeSdBlockIoPeim ( } Status = SdPeimHcReset (MmioBase[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } Status = SdPeimHcCardDetect (MmioBase[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } Status = SdPeimHcInitHost (MmioBase[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -614,7 +614,7 @@ InitializeSdBlockIoPeim ( CopyMem (&Slot->Capability, &Capability, sizeof (Capability)); Status = SdPeimIdentification (Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -639,7 +639,7 @@ InitializeSdBlockIoPeim ( } Controller++; - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PeiServicesInstallPpi (&Private->BlkIoPpiList); PeiServicesNotifyPpi (&Private->EndOfPeiNotifyList); } else { diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c index 63a35cc25..0192fe510 100644 --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c @@ -32,7 +32,7 @@ SdPeimAllocMemBlock ( Block = NULL; Status = PeiServicesAllocatePool (sizeof(SD_PEIM_MEM_BLOCK), &TempPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -49,7 +49,7 @@ SdPeimAllocMemBlock ( Block->BitsLen = Block->BufLen / (SD_PEIM_MEM_UNIT * 8); Status = PeiServicesAllocatePool (Block->BitsLen, &TempPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -63,7 +63,7 @@ SdPeimAllocMemBlock ( &MappedAddr, &Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -236,7 +236,7 @@ SdPeimInitMemPool ( Pool = NULL; Status = PeiServicesAllocatePool (sizeof (SD_PEIM_MEM_POOL), &TempPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c index 5efc06af5..c18d1d114 100644 --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c @@ -108,7 +108,7 @@ SdPeimHcOrMmio ( UINT64 Or; Status = SdPeimHcRwMmio (Address, TRUE, Count, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -159,7 +159,7 @@ SdPeimHcAndMmio ( UINT64 And; Status = SdPeimHcRwMmio (Address, TRUE, Count, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -212,7 +212,7 @@ SdPeimHcCheckMmioSet ( // Value = 0; Status = SdPeimHcRwMmio (Address, TRUE, Count, &Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -303,7 +303,7 @@ SdPeimHcReset ( SwReset = 0xFF; Status = SdPeimHcRwMmio (Bar + SD_HC_SW_RST, FALSE, sizeof (SwReset), &SwReset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimHcReset: write full 1 fails: %r\n", Status)); return Status; } @@ -315,7 +315,7 @@ SdPeimHcReset ( 0x00, SD_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "SdPeimHcReset: reset done with %r\n", Status)); return Status; } @@ -350,7 +350,7 @@ SdPeimHcEnableInterrupt ( // IntStatus = 0xFFFF; Status = SdPeimHcRwMmio (Bar + SD_HC_ERR_INT_STS_EN, FALSE, sizeof (IntStatus), &IntStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -382,7 +382,7 @@ SdPeimHcGetCapability ( UINT64 Cap; Status = SdPeimHcRwMmio (Bar + SD_HC_CAP, TRUE, sizeof (Cap), &Cap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -417,7 +417,7 @@ SdPeimHcCardDetect ( // Check Normal Interrupt Status Register // Status = SdPeimHcRwMmio (Bar + SD_HC_NOR_INT_STS, TRUE, sizeof (Data), &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -427,7 +427,7 @@ SdPeimHcCardDetect ( // Data &= BIT6 | BIT7; Status = SdPeimHcRwMmio (Bar + SD_HC_NOR_INT_STS, FALSE, sizeof (Data), &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -436,7 +436,7 @@ SdPeimHcCardDetect ( // Check Present State Register to see if there is a card presented. // Status = SdPeimHcRwMmio (Bar + SD_HC_PRESENT_STATE, TRUE, sizeof (PresentState), &PresentState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -479,7 +479,7 @@ SdPeimHcStopClock ( 0, SD_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -523,7 +523,7 @@ SdPeimHcClockSupply ( // Calculate a divisor for SD clock frequency // Status = SdPeimHcGetCapability (Bar, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT (Capability.BaseClkFreq != 0); @@ -559,7 +559,7 @@ SdPeimHcClockSupply ( DEBUG ((EFI_D_INFO, "BaseClkFreq %dMHz Divisor %d ClockFreq %dKhz\n", BaseClkFreq, Divisor, ClockFreq)); Status = SdPeimHcRwMmio (Bar + SD_HC_CTRL_VER, TRUE, sizeof (ControllerVer), &ControllerVer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -586,7 +586,7 @@ SdPeimHcClockSupply ( // Stop bus clock at first // Status = SdPeimHcStopClock (Bar); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -595,7 +595,7 @@ SdPeimHcClockSupply ( // ClockCtrl |= BIT0; Status = SdPeimHcRwMmio (Bar + SD_HC_CLOCK_CTRL, FALSE, sizeof (ClockCtrl), &ClockCtrl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Set SDCLK Frequency Select and Internal Clock Enable fields fails\n")); return Status; } @@ -610,7 +610,7 @@ SdPeimHcClockSupply ( BIT1, SD_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -648,7 +648,7 @@ SdPeimHcPowerControl ( // PowerCtrl &= (UINT8)~BIT0; Status = SdPeimHcRwMmio (Bar + SD_HC_POWER_CTRL, FALSE, sizeof (PowerCtrl), &PowerCtrl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -687,7 +687,7 @@ SdPeimHcSetBusWidth ( Status = SdPeimHcAndMmio (Bar + SD_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); } else if (BusWidth == 4) { Status = SdPeimHcRwMmio (Bar + SD_HC_HOST_CTRL1, TRUE, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl1 |= BIT1; @@ -695,7 +695,7 @@ SdPeimHcSetBusWidth ( Status = SdPeimHcRwMmio (Bar + SD_HC_HOST_CTRL1, FALSE, sizeof (HostCtrl1), &HostCtrl1); } else if (BusWidth == 8) { Status = SdPeimHcRwMmio (Bar + SD_HC_HOST_CTRL1, TRUE, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl1 &= (UINT8)~BIT1; @@ -731,7 +731,7 @@ SdPeimHcInitClockFreq ( // Calculate a divisor for SD clock frequency // Status = SdPeimHcGetCapability (Bar, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -774,7 +774,7 @@ SdPeimHcInitPowerVoltage ( // Get the support voltage of the Host Controller // Status = SdPeimHcGetCapability (Bar, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -797,7 +797,7 @@ SdPeimHcInitPowerVoltage ( MaxVoltage = 0x0A; HostCtrl2 = BIT3; Status = SdPeimHcOrMmio (Bar + SD_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } MicroSecondDelay (5000); @@ -857,12 +857,12 @@ SdPeimHcInitHost ( EFI_STATUS Status; Status = SdPeimHcInitClockFreq (Bar); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdPeimHcInitPowerVoltage (Bar); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -999,7 +999,7 @@ SdPeimCreateTrb ( // Calculate a divisor for SD clock frequency // Status = SdPeimHcGetCapability (Slot->SdHcBase, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -1045,7 +1045,7 @@ SdPeimCreateTrb ( MapLength = Trb->DataLen; Status = IoMmuMap (MapOp, Trb->Data, &MapLength, &Trb->DataPhy, &Trb->DataMap); - if (EFI_ERROR (Status) || (MapLength != Trb->DataLen)) { + if (EFI_ERROR(Status) || (MapLength != Trb->DataLen)) { DEBUG ((DEBUG_ERROR, "SdPeimCreateTrb: Fail to map data buffer.\n")); goto Error; } @@ -1056,7 +1056,7 @@ SdPeimCreateTrb ( } else if (Capability.Adma2 != 0) { Trb->Mode = SdAdmaMode; Status = BuildAdmaDescTable (Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else if (Capability.Sdma != 0) { @@ -1092,7 +1092,7 @@ SdPeimFreeTrb ( } if (Trb != NULL) { - FreePool (Trb); + FreePool(Trb); } return; } @@ -1232,7 +1232,7 @@ SdPeimExecTrb ( // IntStatus = 0xFFFF; Status = SdPeimHcRwMmio (Bar + SD_HC_ERR_INT_STS, FALSE, sizeof (IntStatus), &IntStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1240,7 +1240,7 @@ SdPeimExecTrb ( // IntStatus = 0xFFFF; Status = SdPeimHcRwMmio (Bar + SD_HC_NOR_INT_STS, FALSE, sizeof (IntStatus), &IntStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1249,7 +1249,7 @@ SdPeimExecTrb ( if (Trb->Mode == SdAdmaMode) { HostCtrl1 = BIT4; Status = SdPeimHcOrMmio (Bar + SD_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1263,13 +1263,13 @@ SdPeimExecTrb ( SdmaAddr = (UINT32)(UINTN)Trb->DataPhy; Status = SdPeimHcRwMmio (Bar + SD_HC_SDMA_ADDR, FALSE, sizeof (SdmaAddr), &SdmaAddr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else if (Trb->Mode == SdAdmaMode) { AdmaAddr = (UINT64)(UINTN)Trb->AdmaDesc; Status = SdPeimHcRwMmio (Bar + SD_HC_ADMA_SYS_ADDR, FALSE, sizeof (AdmaAddr), &AdmaAddr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1283,7 +1283,7 @@ SdPeimExecTrb ( } Status = SdPeimHcRwMmio (Bar + SD_HC_BLK_SIZE, FALSE, sizeof (BlkSize), &BlkSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1295,13 +1295,13 @@ SdPeimExecTrb ( BlkCount = (UINT16)(Trb->DataLen / Trb->BlockSize); } Status = SdPeimHcRwMmio (Bar + SD_HC_BLK_COUNT, FALSE, sizeof (BlkCount), &BlkCount); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Argument = Packet->SdCmdBlk->CommandArgument; Status = SdPeimHcRwMmio (Bar + SD_HC_ARG1, FALSE, sizeof (Argument), &Argument); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1325,7 +1325,7 @@ SdPeimExecTrb ( } Status = SdPeimHcRwMmio (Bar + SD_HC_TRANS_MOD, FALSE, sizeof (TransMode), &TransMode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1404,7 +1404,7 @@ SdPeimCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -1424,7 +1424,7 @@ SdPeimCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((IntStatus & BIT4) == BIT4) { Status = EFI_SUCCESS; } else { @@ -1447,7 +1447,7 @@ SdPeimCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1464,7 +1464,7 @@ SdPeimCheckTrbResult ( sizeof (SwReset), &SwReset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = SdPeimHcWaitMmioSet ( @@ -1474,7 +1474,7 @@ SdPeimCheckTrbResult ( 0, SD_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1495,7 +1495,7 @@ SdPeimCheckTrbResult ( sizeof (IntStatus), &IntStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -1508,7 +1508,7 @@ SdPeimCheckTrbResult ( sizeof (UINT32), &SdmaAddr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Trb->DataPhy = (UINT32)(UINTN)SdmaAddr; @@ -1551,7 +1551,7 @@ Done: // // Get response data when the cmd is executed successfully. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Packet->SdCmdBlk->CommandType != SdCommandTypeBc) { for (Index = 0; Index < 4; Index++) { Status = SdPeimHcRwMmio ( @@ -1560,7 +1560,7 @@ Done: sizeof (UINT32), &Response[Index] ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SdPeimHcLedOnOff (Bar, FALSE); return Status; } @@ -1689,17 +1689,17 @@ SdPeimExecCmd ( } Status = SdPeimWaitTrbEnv (Slot->SdHcBase, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = SdPeimExecTrb (Slot->SdHcBase, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = SdPeimWaitTrbResult (Slot->SdHcBase, Trb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1788,7 +1788,7 @@ SdPeimVoltageCheck ( SdCmdBlk.CommandArgument = (SupplyVoltage << 8) | CheckPattern; Status = SdPeimExecCmd (Slot, &Packet); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (SdStatusBlk.Resp0 != SdCmdBlk.CommandArgument) { return EFI_DEVICE_ERROR; } @@ -1895,7 +1895,7 @@ SdPeimSendOpCond ( SdCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = SdPeimExecCmd (Slot, &Packet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1909,7 +1909,7 @@ SdPeimSendOpCond ( SdCmdBlk.CommandArgument = (VoltageWindow & 0xFFFFFF) | Switch | MaxPower | HostCapacity; Status = SdPeimExecCmd (Slot, &Packet); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -1996,7 +1996,7 @@ SdPeimSetRca ( SdCmdBlk.ResponseType = SdResponseTypeR6; Status = SdPeimExecCmd (Slot, &Packet); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *Rca = (UINT16)(SdStatusBlk.Resp0 >> 16); } @@ -2045,7 +2045,7 @@ SdPeimGetCsd ( SdCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = SdPeimExecCmd (Slot, &Packet); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -2175,7 +2175,7 @@ SdPeimSetBusWidth ( SdCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = SdPeimExecCmd (Slot, &Packet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2294,7 +2294,7 @@ SdPeimSendStatus ( SdCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = SdPeimExecCmd (Slot, &Packet); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *DevStatus = SdStatusBlk.Resp0; } @@ -2522,7 +2522,7 @@ SdPeimTuningClock ( // HostCtrl2 = BIT6; Status = SdPeimHcOrMmio (Slot->SdHcBase + SD_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2531,12 +2531,12 @@ SdPeimTuningClock ( Retry = 0; do { Status = SdPeimSendTuningBlk (Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdPeimHcRwMmio (Slot->SdHcBase + SD_HC_HOST_CTRL2, TRUE, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2555,7 +2555,7 @@ SdPeimTuningClock ( // HostCtrl2 = (UINT8)~(BIT6 | BIT7); Status = SdPeimHcAndMmio (Slot->SdHcBase + SD_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } return EFI_DEVICE_ERROR; @@ -2586,12 +2586,12 @@ SdPeimSwitchBusWidth ( UINT32 DevStatus; Status = SdPeimSetBusWidth (Slot, Rca, BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdPeimSendStatus (Slot, Rca, &DevStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2637,25 +2637,25 @@ SdPeimSetBusMode ( UINT8 SwitchResp[64]; Status = SdPeimGetCsd (Slot, Rca, &Slot->Csd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimSetBusMode: SdPeimGetCsd fails with %r\n", Status)); return Status; } Status = SdPeimHcGetCapability (Slot->SdHcBase, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdPeimSelect (Slot, Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimSetBusMode: SdPeimSelect fails with %r\n", Status)); return Status; } BusWidth = 4; Status = SdPeimSwitchBusWidth (Slot, Rca, BusWidth); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimSetBusMode: SdPeimSwitchBusWidth fails with %r\n", Status)); return Status; } @@ -2665,7 +2665,7 @@ SdPeimSetBusMode ( // ZeroMem (SwitchResp, sizeof (SwitchResp)); Status = SdPeimSwitch (Slot, 0xF, 0xF, 0xF, 0xF, FALSE, SwitchResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -2692,7 +2692,7 @@ SdPeimSetBusMode ( DEBUG ((EFI_D_INFO, "SdPeimSetBusMode: AccessMode %d ClockFreq %d BusWidth %d\n", AccessMode, ClockFreq, BusWidth)); Status = SdPeimSwitch (Slot, AccessMode, 0xF, 0xF, 0xF, TRUE, SwitchResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimSetBusMode: SdPeimSwitch fails with %r\n", Status)); return Status; } @@ -2707,31 +2707,31 @@ SdPeimSetBusMode ( if (AccessMode == 1) { HostCtrl1 = BIT2; Status = SdPeimHcOrMmio (Slot->SdHcBase + SD_HC_HOST_CTRL1, sizeof (HostCtrl1), &HostCtrl1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } HostCtrl2 = (UINT8)~0x7; Status = SdPeimHcAndMmio (Slot->SdHcBase + SD_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } HostCtrl2 = AccessMode; Status = SdPeimHcOrMmio (Slot->SdHcBase + SD_HC_HOST_CTRL2, sizeof (HostCtrl2), &HostCtrl2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdPeimHcClockSupply (Slot->SdHcBase, ClockFreq * 1000); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimSetBusMode: SdPeimHcClockSupply %r\n", Status)); return Status; } if ((AccessMode == 3) || ((AccessMode == 2) && (Capability.TuningSDR50 != 0))) { Status = SdPeimTuningClock (Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimSetBusMode: SdPeimTuningClock fails with %r\n", Status)); return Status; } @@ -2775,7 +2775,7 @@ SdPeimIdentification ( // 1. Send Cmd0 to the device // Status = SdPeimReset (Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimIdentification: Executing Cmd0 fails with %r\n", Status)); return Status; } @@ -2783,7 +2783,7 @@ SdPeimIdentification ( // 2. Send Cmd8 to the device // Status = SdPeimVoltageCheck (Slot, 0x1, 0xFF); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimIdentification: Executing Cmd8 fails with %r\n", Status)); return Status; } @@ -2791,7 +2791,7 @@ SdPeimIdentification ( // 3. Send SDIO Cmd5 to the device to the SDIO device OCR register. // Status = SdioSendOpCond (Slot, 0, FALSE); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimIdentification: Found SDIO device, ignore it as we don't support\n")); return EFI_DEVICE_ERROR; } @@ -2799,18 +2799,18 @@ SdPeimIdentification ( // 4. Send Acmd41 with voltage window 0 to the device // Status = SdPeimSendOpCond (Slot, 0, 0, FALSE, FALSE, FALSE, &Ocr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimIdentification: Executing SdPeimSendOpCond fails with %r\n", Status)); return EFI_DEVICE_ERROR; } Status = SdPeimHcGetCapability (Slot->SdHcBase, &Capability); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdPeimHcRwMmio (Slot->SdHcBase + SD_HC_MAX_CURRENT_CAP, TRUE, sizeof (Current), &Current); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2841,7 +2841,7 @@ SdPeimIdentification ( } Status = SdPeimHcRwMmio (Slot->SdHcBase + SD_HC_CTRL_VER, TRUE, sizeof (ControllerVer), &ControllerVer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2862,7 +2862,7 @@ SdPeimIdentification ( Retry = 0; do { Status = SdPeimSendOpCond (Slot, 0, Ocr, S18r, Xpc, TRUE, &Ocr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimIdentification: SdPeimSendOpCond fails with %r Ocr %x, S18r %x, Xpc %x\n", Status, Ocr, S18r, Xpc)); return EFI_DEVICE_ERROR; } @@ -2884,13 +2884,13 @@ SdPeimIdentification ( Capability.Ddr50 != 0) && ((Ocr & BIT24) != 0)) { Status = SdPeimVoltageSwitch (Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimIdentification: Executing SdPeimVoltageSwitch fails with %r\n", Status)); Status = EFI_DEVICE_ERROR; goto Error; } else { Status = SdPeimHcStopClock (Slot->SdHcBase); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Error; } @@ -2928,13 +2928,13 @@ SdPeimIdentification ( } Status = SdPeimAllSendCid (Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimIdentification: Executing SdPeimAllSendCid fails with %r\n", Status)); return Status; } Status = SdPeimSetRca (Slot, &Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SdPeimIdentification: Executing SdPeimSetRca fails with %r\n", Status)); return Status; } diff --git a/MdeModulePkg/Bus/Sd/SdDxe/ComponentName.c b/MdeModulePkg/Bus/Sd/SdDxe/ComponentName.c index acd29d72c..28f9a3417 100644 --- a/MdeModulePkg/Bus/Sd/SdDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Sd/SdDxe/ComponentName.c @@ -190,7 +190,7 @@ SdDxeComponentNameGetControllerName ( gSdDxeDriverBinding.DriverBindingHandle, &gEfiSdMmcPassThruProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -201,7 +201,7 @@ SdDxeComponentNameGetControllerName ( ChildHandle, &gEfiSdMmcPassThruProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -215,7 +215,7 @@ SdDxeComponentNameGetControllerName ( ChildHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c index 876efe31e..965dbeb3a 100644 --- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c @@ -35,7 +35,7 @@ AsyncIoCallback ( Request->Packet.TransactionStatus)); DEBUG_CODE_END (); - if (EFI_ERROR (Request->Packet.TransactionStatus)) { + if (EFI_ERROR(Request->Packet.TransactionStatus)) { Request->Token->TransactionStatus = Request->Packet.TransactionStatus; } @@ -45,7 +45,7 @@ AsyncIoCallback ( gBS->SignalEvent (Request->Token->Event); } - FreePool (Request); + FreePool(Request); } /** @@ -85,7 +85,7 @@ SdSetRca ( SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR6; Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "Set RCA succeeds with Resp0 = 0x%x\n", SdMmcStatusBlk.Resp0)); *Rca = (UINT16)(SdMmcStatusBlk.Resp0 >> 16); } @@ -177,7 +177,7 @@ SdSendStatus ( SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16; Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CopyMem (DevStatus, &SdMmcStatusBlk.Resp0, sizeof (UINT32)); } return Status; @@ -226,7 +226,7 @@ SdGetCsd ( Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -279,7 +279,7 @@ SdGetCid ( Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. // @@ -381,7 +381,7 @@ SdRwSingleBlock ( RwSingleBlkReq, &RwSingleBlkReq->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -396,14 +396,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (RwSingleBlkReq != NULL)) { + if (EFI_ERROR(Status) && (RwSingleBlkReq != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&RwSingleBlkReq->Link); gBS->RestoreTPL (OldTpl); if (RwSingleBlkReq->Event != NULL) { gBS->CloseEvent (RwSingleBlkReq->Event); } - FreePool (RwSingleBlkReq); + FreePool(RwSingleBlkReq); } } else { // @@ -413,7 +413,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&RwSingleBlkReq->Link); gBS->RestoreTPL (OldTpl); - FreePool (RwSingleBlkReq); + FreePool(RwSingleBlkReq); } } @@ -513,7 +513,7 @@ SdRwMultiBlocks ( RwMultiBlkReq, &RwMultiBlkReq->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -528,14 +528,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (RwMultiBlkReq != NULL)) { + if (EFI_ERROR(Status) && (RwMultiBlkReq != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&RwMultiBlkReq->Link); gBS->RestoreTPL (OldTpl); if (RwMultiBlkReq->Event != NULL) { gBS->CloseEvent (RwMultiBlkReq->Event); } - FreePool (RwMultiBlkReq); + FreePool(RwMultiBlkReq); } } else { // @@ -545,7 +545,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&RwMultiBlkReq->Link); gBS->RestoreTPL (OldTpl); - FreePool (RwMultiBlkReq); + FreePool(RwMultiBlkReq); } } @@ -661,7 +661,7 @@ SdReadWrite ( } else { Status = SdRwMultiBlocks (Device, Lba, Buffer, BufferSize, IsRead, Token, LastRw); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DEBUG ((DEBUG_BLKIO, "Sd%a(): Lba 0x%x BlkNo 0x%x Event %p with %r\n", @@ -701,7 +701,7 @@ SdReset ( PassThru = Device->Private->PassThru; Status = PassThru->ResetDevice (PassThru, Device->Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } @@ -849,7 +849,7 @@ SdResetEx ( gBS->SignalEvent (Request->Token->Event); } - FreePool (Request); + FreePool(Request); } gBS->RestoreTPL (OldTpl); @@ -1038,7 +1038,7 @@ SdEraseBlockStart ( EraseBlockStart, &EraseBlockStart->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -1053,14 +1053,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (EraseBlockStart != NULL)) { + if (EFI_ERROR(Status) && (EraseBlockStart != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlockStart->Link); gBS->RestoreTPL (OldTpl); if (EraseBlockStart->Event != NULL) { gBS->CloseEvent (EraseBlockStart->Event); } - FreePool (EraseBlockStart); + FreePool(EraseBlockStart); } } else { // @@ -1070,7 +1070,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlockStart->Link); gBS->RestoreTPL (OldTpl); - FreePool (EraseBlockStart); + FreePool(EraseBlockStart); } } @@ -1142,7 +1142,7 @@ SdEraseBlockEnd ( EraseBlockEnd, &EraseBlockEnd->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -1157,14 +1157,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (EraseBlockEnd != NULL)) { + if (EFI_ERROR(Status) && (EraseBlockEnd != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlockEnd->Link); gBS->RestoreTPL (OldTpl); if (EraseBlockEnd->Event != NULL) { gBS->CloseEvent (EraseBlockEnd->Event); } - FreePool (EraseBlockEnd); + FreePool(EraseBlockEnd); } } else { // @@ -1174,7 +1174,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlockEnd->Link); gBS->RestoreTPL (OldTpl); - FreePool (EraseBlockEnd); + FreePool(EraseBlockEnd); } } @@ -1238,7 +1238,7 @@ SdEraseBlock ( EraseBlock, &EraseBlock->Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -1253,14 +1253,14 @@ Error: // For asynchronous operation, only free request and event in error case. // The request and event will be freed in asynchronous callback for success case. // - if (EFI_ERROR (Status) && (EraseBlock != NULL)) { + if (EFI_ERROR(Status) && (EraseBlock != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlock->Link); gBS->RestoreTPL (OldTpl); if (EraseBlock->Event != NULL) { gBS->CloseEvent (EraseBlock->Event); } - FreePool (EraseBlock); + FreePool(EraseBlock); } } else { // @@ -1270,7 +1270,7 @@ Error: OldTpl = gBS->RaiseTPL (TPL_NOTIFY); RemoveEntryList (&EraseBlock->Link); gBS->RestoreTPL (OldTpl); - FreePool (EraseBlock); + FreePool(EraseBlock); } } @@ -1353,17 +1353,17 @@ SdEraseBlocks ( LastLba = Lba + BlockNum - 1; Status = SdEraseBlockStart (Device, Lba, (EFI_BLOCK_IO2_TOKEN*)Token, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdEraseBlockEnd (Device, LastLba, (EFI_BLOCK_IO2_TOKEN*)Token, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = SdEraseBlock (Device, (EFI_BLOCK_IO2_TOKEN*)Token, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c b/MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c index e341b4cc1..f15a568a4 100644 --- a/MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c @@ -200,33 +200,33 @@ DiscoverUserArea ( SdSelect (Device, 0); Status = SdSetRca (Device, &Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "DiscoverUserArea(): Assign new Rca = 0x%x fails with %r\n", Rca, Status)); return Status; } Csd = &Device->Csd; Status = SdGetCsd (Device, Rca, Csd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DumpCsd (Csd); Cid = &Device->Cid; Status = SdGetCid (Device, Rca, Cid); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } GetSdModelName (Device, Cid); Status = SdSelect (Device, Rca); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "DiscoverUserArea(): Reselect the device 0x%x fails with %r\n", Rca, Status)); return Status; } Status = SdSendStatus (Device, Rca, &DevStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -327,7 +327,7 @@ DiscoverSdDevice ( DeviceHandle = NULL; RemainingDevicePath = NewDevicePath; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { + if (!EFI_ERROR(Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) { // // The device has been started, directly return to fast boot. // @@ -388,7 +388,7 @@ DiscoverSdDevice ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->OpenProtocol ( Private->Controller, &gEfiSdMmcPassThruProtocolGuid, @@ -400,14 +400,14 @@ DiscoverSdDevice ( } Error: - FreePool (DevicePath); + FreePool(DevicePath); - if (EFI_ERROR (Status) && (NewDevicePath != NULL)) { - FreePool (NewDevicePath); + if (EFI_ERROR(Status) && (NewDevicePath != NULL)) { + FreePool(NewDevicePath); } - if (EFI_ERROR (Status) && (Device != NULL)) { - FreePool (Device); + if (EFI_ERROR(Status) && (Device != NULL)) { + FreePool(Device); } return Status; @@ -484,7 +484,7 @@ SdDxeDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -493,7 +493,7 @@ SdDxeDriverBindingSupported ( // if ((RemainingDevicePath != NULL) && !IsDevicePathEnd (RemainingDevicePath)) { Status = PassThru->GetSlotNumber (PassThru, RemainingDevicePath, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Close the I/O Abstraction(s) used to perform the supported test // @@ -590,7 +590,7 @@ SdDxeDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if ((EFI_ERROR (Status)) && (Status != EFI_ALREADY_STARTED)) { + if ((EFI_ERROR(Status)) && (Status != EFI_ALREADY_STARTED)) { return Status; } @@ -612,7 +612,7 @@ SdDxeDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Private->PassThru = PassThru; Private->Controller = Controller; Private->ParentDevicePath = ParentDevicePath; @@ -624,7 +624,7 @@ SdDxeDriverBindingStart ( EFI_NATIVE_INTERFACE, Private ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } else { @@ -636,7 +636,7 @@ SdDxeDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } @@ -645,7 +645,7 @@ SdDxeDriverBindingStart ( Slot = 0xFF; while (TRUE) { Status = PassThru->GetNextSlot (PassThru, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Cannot find more legal slots. // @@ -654,19 +654,19 @@ SdDxeDriverBindingStart ( } Status = DiscoverSdDevice (Private, Slot); - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { break; } } } else if (!IsDevicePathEnd (RemainingDevicePath)) { Status = PassThru->GetSlotNumber (PassThru, RemainingDevicePath, &Slot); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = DiscoverSdDevice (Private, Slot); } } Error: - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { gBS->CloseProtocol ( Controller, &gEfiSdMmcPassThruProtocolGuid, @@ -681,7 +681,7 @@ Error: Private, NULL ); - FreePool (Private); + FreePool(Private); } } return Status; @@ -744,7 +744,7 @@ SdDxeDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -760,7 +760,7 @@ SdDxeDriverBindingStop ( Controller ); - FreePool (Private); + FreePool(Private); return EFI_SUCCESS; } @@ -778,7 +778,7 @@ SdDxeDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( ChildHandleBuffer[Index], &gEfiBlockIo2ProtocolGuid, @@ -787,7 +787,7 @@ SdDxeDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; continue; } @@ -819,7 +819,7 @@ SdDxeDriverBindingStop ( gBS->SignalEvent (Request->Token->Event); } - FreePool (Request); + FreePool(Request); } gBS->RestoreTPL (OldTpl); @@ -847,7 +847,7 @@ SdDxeDriverBindingStop ( &Device->DiskInfo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; gBS->OpenProtocol ( Controller, @@ -858,9 +858,9 @@ SdDxeDriverBindingStop ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); } else { - FreePool (Device->DevicePath); + FreePool(Device->DevicePath); FreeUnicodeStringTable (Device->ControllerNameTable); - FreePool (Device); + FreePool(Device); } } @@ -901,7 +901,7 @@ InitializeSdDxe ( &gSdDxeComponentName, &gSdDxeComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/DmaMem.c b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/DmaMem.c index 61378a63c..1b24dd971 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/DmaMem.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/DmaMem.c @@ -51,7 +51,7 @@ IoMmuMap ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } switch (Operation) { @@ -76,7 +76,7 @@ IoMmuMap ( *Mapping, Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -153,7 +153,7 @@ IoMmuAllocateBuffer ( HostAddress, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -166,7 +166,7 @@ IoMmuAllocateBuffer ( DeviceAddress, Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } Status = mIoMmu->SetAttribute ( @@ -174,7 +174,7 @@ IoMmuAllocateBuffer ( *Mapping, EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -183,7 +183,7 @@ IoMmuAllocateBuffer ( Pages, &HostPhyAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } *HostAddress = (VOID *)(UINTN)HostPhyAddress; diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c index d79ca3904..42013e94c 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c @@ -230,7 +230,7 @@ UfsPeimReadCapacity ( *SenseDataLength = Packet.SenseDataLength; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *DataLength = Packet.InTransferLength; } @@ -288,7 +288,7 @@ UfsPeimReadCapacity16 ( *SenseDataLength = Packet.SenseDataLength; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *DataLength = Packet.InTransferLength; } @@ -350,7 +350,7 @@ UfsPeimRead10 ( *SenseDataLength = Packet.SenseDataLength; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *DataLength = Packet.InTransferLength; } @@ -412,7 +412,7 @@ UfsPeimRead16 ( *SenseDataLength = Packet.SenseDataLength; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *DataLength = Packet.InTransferLength; } @@ -609,7 +609,7 @@ UfsBlockIoPeimGetMediaInfo ( &SenseData, &SenseDataLength ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } @@ -618,7 +618,7 @@ UfsBlockIoPeimGetMediaInfo ( } Status = UfsPeimParsingSenseKeys (&(Private->Media[Lun]), &SenseData, &NeedRetry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -627,7 +627,7 @@ UfsBlockIoPeimGetMediaInfo ( DataLength = sizeof (EFI_SCSI_DISK_CAPACITY_DATA); SenseDataLength = 0; Status = UfsPeimReadCapacity (Private, Lun, &Capacity, (UINT32 *)&DataLength, NULL, &SenseDataLength); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -636,7 +636,7 @@ UfsBlockIoPeimGetMediaInfo ( DataLength = sizeof (EFI_SCSI_DISK_CAPACITY_DATA16); SenseDataLength = 0; Status = UfsPeimReadCapacity16 (Private, Lun, &Capacity16, (UINT32 *)&DataLength, NULL, &SenseDataLength); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } Private->Media[Lun].LastBlock = ((UINT32)Capacity16.LastLba3 << 24) | (Capacity16.LastLba2 << 16) | (Capacity16.LastLba1 << 8) | Capacity16.LastLba0; @@ -755,7 +755,7 @@ UfsBlockIoPeimReadBlocks ( &SenseData, &SenseDataLength ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } @@ -764,7 +764,7 @@ UfsBlockIoPeimReadBlocks ( } Status = UfsPeimParsingSenseKeys (&(Private->Media[Lun]), &SenseData, &NeedRetry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -896,7 +896,7 @@ UfsBlockIoPeimGetMediaInfo2 ( DeviceIndex, &Media ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1043,7 +1043,7 @@ InitializeUfsBlockIoPeim ( // // Shadow this PEIM to run from memory // - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -1056,7 +1056,7 @@ InitializeUfsBlockIoPeim ( NULL, (VOID **) &UfsHcPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1069,7 +1069,7 @@ InitializeUfsBlockIoPeim ( // // When status is error, meant no controller is found // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -1087,7 +1087,7 @@ InitializeUfsBlockIoPeim ( // Initialize the memory pool which will be used in all transactions. // Status = UfsPeimInitMemPool (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; break; } @@ -1096,7 +1096,7 @@ InitializeUfsBlockIoPeim ( // Initialize UFS Host Controller H/W. // Status = UfsControllerInit (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UfsDevicePei: Host Controller Initialization Error, Status = %r\n", Status)); Controller++; continue; @@ -1108,7 +1108,7 @@ InitializeUfsBlockIoPeim ( // the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready. // Status = UfsExecNopCmds (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", Status)); Controller++; continue; @@ -1118,7 +1118,7 @@ InitializeUfsBlockIoPeim ( // The host enables the device initialization completion by setting fDeviceInit flag. // Status = UfsSetFlag (Private, UfsFlagDevInit); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ufs Set fDeviceInit Flag Error, Status = %r\n", Status)); Controller++; continue; @@ -1128,7 +1128,7 @@ InitializeUfsBlockIoPeim ( // Get Ufs Device's Lun Info by reading Configuration Descriptor. // Status = UfsRwDeviceDesc (Private, TRUE, UfsConfigDesc, 0, 0, &Config, sizeof (UFS_CONFIG_DESC)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ufs Get Configuration Descriptor Error, Status = %r\n", Status)); Controller++; continue; diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c index a4e731640..89ca81e42 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c @@ -32,7 +32,7 @@ UfsPeimAllocMemBlock ( Block = NULL; Status = PeiServicesAllocatePool (sizeof(UFS_PEIM_MEM_BLOCK), &TempPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -49,7 +49,7 @@ UfsPeimAllocMemBlock ( Block->BitsLen = Block->BufLen / (UFS_PEIM_MEM_UNIT * 8); Status = PeiServicesAllocatePool (Block->BitsLen, &TempPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -63,7 +63,7 @@ UfsPeimAllocMemBlock ( &MappedAddr, &Mapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -236,7 +236,7 @@ UfsPeimInitMemPool ( Pool = NULL; Status = PeiServicesAllocatePool (sizeof (UFS_PEIM_MEM_POOL), &TempPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c index e8ef0c2a7..d246f3875 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c @@ -467,7 +467,7 @@ UfsCreateScsiCommandDesc ( MapLength = Length; Status = IoMmuMap (MapOp, Buffer, &MapLength, &BufferPhyAddr, BufferMap); - if (EFI_ERROR (Status) || (MapLength != Length)) { + if (EFI_ERROR(Status) || (MapLength != Length)) { DEBUG ((DEBUG_ERROR, "UfsCreateScsiCommandDesc: Fail to map data buffer.\n")); return EFI_OUT_OF_RESOURCES; } @@ -806,7 +806,7 @@ UfsRwDeviceDesc ( // Find out which slot of transfer request list is available. // Status = UfsFindAvailableSlotInTrl (Private, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -815,7 +815,7 @@ UfsRwDeviceDesc ( // Fill transfer request descriptor to this slot. // Status = UfsCreateDMCommandDesc (Private, &Packet, Trd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -836,7 +836,7 @@ UfsRwDeviceDesc ( // Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet.Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -936,7 +936,7 @@ UfsRwFlags ( // Find out which slot of transfer request list is available. // Status = UfsFindAvailableSlotInTrl (Private, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -945,7 +945,7 @@ UfsRwFlags ( // Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot; Status = UfsCreateDMCommandDesc (Private, &Packet, Trd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -966,7 +966,7 @@ UfsRwFlags ( // Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet.Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1047,13 +1047,13 @@ UfsExecNopCmds ( // Find out which slot of transfer request list is available. // Status = UfsFindAvailableSlotInTrl (Private, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot; Status = UfsCreateNopCommandDesc (Private, Trd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1074,7 +1074,7 @@ UfsExecNopCmds ( // Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1132,7 +1132,7 @@ UfsExecScsiCmds ( // Find out which slot of transfer request list is available. // Status = UfsFindAvailableSlotInTrl (Private, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1143,7 +1143,7 @@ UfsExecScsiCmds ( // Fill transfer request descriptor to this slot. // Status = UfsCreateScsiCommandDesc (Private, Lun, Packet, Trd, &PacketBufferMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1160,7 +1160,7 @@ UfsExecScsiCmds ( // Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet->Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1278,7 +1278,7 @@ UfsExecUicCommands ( // Address = Private->UfsHcBase + UFS_HC_STATUS_OFFSET; Status = UfsWaitMemSet (Address, UFS_HC_HCS_UCRDY, UFS_HC_HCS_UCRDY, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1292,7 +1292,7 @@ UfsExecUicCommands ( Address = UfsHcBase + UFS_HC_IS_OFFSET; Data = MmioRead32 (Address); Status = UfsWaitMemSet (Address, UFS_HC_IS_UCCS, UFS_HC_IS_UCCS, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1315,7 +1315,7 @@ UfsExecUicCommands ( if ((Data & UFS_HC_HCS_DP) == 0) { Address = UfsHcBase + UFS_HC_IS_OFFSET; Status = UfsWaitMemSet (Address, UFS_HC_IS_ULSS, UFS_HC_IS_ULSS, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } return EFI_NOT_FOUND; @@ -1360,7 +1360,7 @@ UfsEnableHostController ( // Wait until HCE is read as '0' before continuing. // Status = UfsWaitMemSet (Address, UFS_HC_HCE_EN, 0, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } } @@ -1373,7 +1373,7 @@ UfsEnableHostController ( // Wait until HCE is read as '1' before continuing. // Status = UfsWaitMemSet (Address, UFS_HC_HCE_EN, UFS_HC_HCE_EN, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1404,7 +1404,7 @@ UfsDeviceDetection ( // for (Retry = 0; Retry < 3; Retry++) { Status = UfsExecUicCommands (Private, UfsUicDmeLinkStartup, 0, 0, 0); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } @@ -1461,7 +1461,7 @@ UfsInitTaskManagementRequestList ( &CmdDescPhyAddr, &CmdDescMapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1528,7 +1528,7 @@ UfsInitTransferRequestList ( &CmdDescPhyAddr, &CmdDescMapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1573,25 +1573,25 @@ UfsControllerInit ( EFI_STATUS Status; Status = UfsEnableHostController (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UfsDevicePei: Enable Host Controller Fails, Status = %r\n", Status)); return Status; } Status = UfsDeviceDetection (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UfsDevicePei: Device Detection Fails, Status = %r\n", Status)); return Status; } Status = UfsInitTaskManagementRequestList (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UfsDevicePei: Task management list initialization Fails, Status = %r\n", Status)); return Status; } Status = UfsInitTransferRequestList (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UfsDevicePei: Transfer list initialization Fails, Status = %r\n", Status)); if (Private->TmrlMapping != NULL) { @@ -1654,7 +1654,7 @@ UfsControllerStop ( // Wait until HCE is read as '0' before continuing. // Status = UfsWaitMemSet (Address, UFS_HC_HCE_EN, 0, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/ComponentName.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/ComponentName.c index aced63b49..a8b592045 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/ComponentName.c @@ -202,7 +202,7 @@ UfsPassThruComponentNameGetControllerName ( gUfsPassThruDriverBinding.DriverBindingHandle, &gEdkiiUfsHostControllerProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsDevConfigProtocol.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsDevConfigProtocol.c index 4730ecd90..2df89cbdc 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsDevConfigProtocol.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsDevConfigProtocol.c @@ -176,7 +176,7 @@ UfsRwUfsAttribute ( Selector, &Attribute32 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Read) { CopyMem (Attribute, &Attribute32, *AttrSize); } diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c index b12404aac..6925e4efc 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c @@ -686,7 +686,7 @@ UfsPassThruDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EFI_ALREADY_STARTED is also an error // @@ -711,7 +711,7 @@ UfsPassThruDriverBindingSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // EFI_ALREADY_STARTED is also an error // @@ -756,14 +756,14 @@ UfsFinishDeviceInitialization ( // The host enables the device initialization completion by setting fDeviceInit flag. // Status = UfsSetFlag (Private, UfsFlagDevInit); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Timeout = 5; do { Status = UfsReadFlag (Private, UfsFlagDevInit, &DeviceInitStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } MicroSecondDelay (1); @@ -840,7 +840,7 @@ UfsPassThruDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Open Ufs Host Controller Protocol Error, Status = %r\n", Status)); goto Error; } @@ -849,7 +849,7 @@ UfsPassThruDriverBindingStart ( // Get the UFS Host Controller MMIO Bar Base Address. // Status = UfsHc->GetUfsHcMmioBar (UfsHc, &UfsHcBase); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Get Ufs Host Controller Mmio Bar Error, Status = %r\n", Status)); goto Error; } @@ -877,13 +877,13 @@ UfsPassThruDriverBindingStart ( // if (mUfsHcPlatform == NULL) { Status = gBS->LocateProtocol (&gEdkiiUfsHcPlatformProtocolGuid, NULL, (VOID**)&mUfsHcPlatform); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "No UfsHcPlatformProtocol present\n")); } } Status = GetUfsHcInfo (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failed to initialize UfsHcInfo\n")); goto Error; } @@ -892,7 +892,7 @@ UfsPassThruDriverBindingStart ( // Initialize UFS Host Controller H/W. // Status = UfsControllerInit (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Ufs Host Controller Initialization Error, Status = %r\n", Status)); goto Error; } @@ -903,13 +903,13 @@ UfsPassThruDriverBindingStart ( // the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready. // Status = UfsExecNopCmds (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", Status)); goto Error; } Status = UfsFinishDeviceInitialization (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Device failed to finish initialization, Status = %r\n", Status)); goto Error; } @@ -921,7 +921,7 @@ UfsPassThruDriverBindingStart ( UnitDescriptorSize = sizeof (UFS_UNIT_DESC); for (Index = 0; Index < 8; Index++) { Status = UfsRwDeviceDesc (Private, TRUE, UfsUnitDesc, (UINT8) Index, 0, &UnitDescriptor, &UnitDescriptorSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failed to read unit descriptor, index = %X, status = %r\n", Index, Status)); continue; } @@ -941,7 +941,7 @@ UfsPassThruDriverBindingStart ( Private, &Private->TimerEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Ufs Create Async Tasks Event Error, Status = %r\n", Status)); goto Error; } @@ -951,7 +951,7 @@ UfsPassThruDriverBindingStart ( TimerPeriodic, UFS_HC_ASYNC_TIMER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Ufs Set Periodic Timer Error, Status = %r\n", Status)); goto Error; } @@ -964,7 +964,7 @@ UfsPassThruDriverBindingStart ( &(Private->UfsDevConfig), NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; @@ -988,7 +988,7 @@ Error: gBS->CloseEvent (Private->TimerEvent); } - FreePool (Private); + FreePool(Private); } if (UfsHc != NULL) { @@ -1057,7 +1057,7 @@ UfsPassThruDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1091,7 +1091,7 @@ UfsPassThruDriverBindingStop ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1099,7 +1099,7 @@ UfsPassThruDriverBindingStop ( // Stop Ufs Host Controller // Status = UfsControllerStop (Private); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (Private->TmrlMapping != NULL) { UfsHc->Unmap (UfsHc, Private->TmrlMapping); @@ -1119,7 +1119,7 @@ UfsPassThruDriverBindingStop ( gBS->CloseEvent (Private->TimerEvent); } - FreePool (Private); + FreePool(Private); // // Close protocols opened by UfsPassThru controller driver @@ -1165,7 +1165,7 @@ InitializeUfsPassThru ( &gUfsPassThruComponentName, &gUfsPassThruComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index 0b95e7ddd..1790b565c 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -111,7 +111,7 @@ UfsWaitMemSet ( // Access PCI MMIO space to see if the value is the tested one. // Status = UfsMmioRead32 (Private, Offset, &Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -528,7 +528,7 @@ UfsCreateScsiCommandDesc ( TotalLen = ROUNDUP8 (sizeof (UTP_COMMAND_UPIU)) + ROUNDUP8 (sizeof (UTP_RESPONSE_UPIU)) + PrdtNumber * sizeof (UTP_TR_PRD); Status = UfsAllocateAlignCommonBuffer (Private, TotalLen, CmdDescHost, &CmdDescPhyAddr, CmdDescMapping); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -608,7 +608,7 @@ UfsCreateDMCommandDesc ( } Status = UfsAllocateAlignCommonBuffer (Private, TotalLen, CmdDescHost, &CmdDescPhyAddr, CmdDescMapping); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -679,7 +679,7 @@ UfsCreateNopCommandDesc ( TotalLen = ROUNDUP8 (sizeof (UTP_NOP_OUT_UPIU)) + ROUNDUP8 (sizeof (UTP_NOP_IN_UPIU)); Status = UfsAllocateAlignCommonBuffer (Private, TotalLen, CmdDescHost, &CmdDescPhyAddr, CmdDescMapping); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -727,7 +727,7 @@ UfsFindAvailableSlotInTrl ( ASSERT ((Private != NULL) && (Slot != NULL)); Status = UfsMmioRead32 (Private, UFS_HC_UTRLDBR_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -761,19 +761,19 @@ UfsStartExecCmd ( EFI_STATUS Status; Status = UfsMmioRead32 (Private, UFS_HC_UTRLRSR_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((Data & UFS_HC_UTRLRSR) != UFS_HC_UTRLRSR) { Status = UfsMmioWrite32 (Private, UFS_HC_UTRLRSR_OFFSET, UFS_HC_UTRLRSR); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } Status = UfsMmioWrite32 (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -797,18 +797,18 @@ UfsStopExecCmd ( EFI_STATUS Status; Status = UfsMmioRead32 (Private, UFS_HC_UTRLDBR_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((Data & (BIT0 << Slot)) != 0) { Status = UfsMmioRead32 (Private, UFS_HC_UTRLCLR_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = UfsMmioWrite32 (Private, UFS_HC_UTRLCLR_OFFSET, Data & ~(BIT0 << Slot)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -910,7 +910,7 @@ UfsSendDmRequestRetry ( // Find out which slot of transfer request list is available. // Status = UfsFindAvailableSlotInTrl (Private, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -919,7 +919,7 @@ UfsSendDmRequestRetry ( // Fill transfer request descriptor to this slot. // Status = UfsCreateDMCommandDesc (Private, Packet, Trd, &CmdDescHost, &CmdDescMapping); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failed to create DM command descriptor\n")); return Status; } @@ -938,7 +938,7 @@ UfsSendDmRequestRetry ( // Wait for the completion of the transfer request. // Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0, 0, Packet->Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -957,7 +957,7 @@ UfsSendDmRequestRetry ( } Status = UfsGetReturnDataFromQueryResponse (Packet, QueryResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failed to get return data from query response\n")); goto Exit; } @@ -1003,7 +1003,7 @@ UfsSendDmRequest ( for (Retry = 0; Retry < 5; Retry ++) { Status = UfsSendDmRequestRetry (Private, Packet); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } } @@ -1067,7 +1067,7 @@ UfsRwDeviceDesc ( Packet.Timeout = UFS_TIMEOUT; Status = UfsSendDmRequest (Private, &Packet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *DescSize = 0; } else { *DescSize = Packet.TransferLength; @@ -1259,13 +1259,13 @@ UfsExecNopCmds ( // Find out which slot of transfer request list is available. // Status = UfsFindAvailableSlotInTrl (Private, &Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot; Status = UfsCreateNopCommandDesc (Private, Trd, &CmdDescHost, &CmdDescMapping); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1286,7 +1286,7 @@ UfsExecNopCmds ( // Wait for the completion of the transfer request. // Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1425,7 +1425,7 @@ UfsPrepareDataTransferBuffer ( &TransReq->DataBufMapping ); - if (EFI_ERROR (Status) || (DataLen != MapLength)) { + if (EFI_ERROR(Status) || (DataLen != MapLength)) { if (TransReq->AlignedDataBuf != NULL) { // // Wipe out the transfer buffer in case it contains sensitive data. @@ -1502,7 +1502,7 @@ UfsExecScsiCmds ( // Find out which slot of transfer request list is available. // Status = UfsFindAvailableSlotInTrl (Private, &TransReq->Slot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1519,14 +1519,14 @@ UfsExecScsiCmds ( &TransReq->CmdDescHost, &TransReq->CmdDescMapping ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } TransReq->CmdDescSize = TransReq->Trd->PrdtO * sizeof (UINT32) + TransReq->Trd->PrdtL * sizeof (UTP_TR_PRD); Status = UfsPrepareDataTransferBuffer (Private, TransReq); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit1; } @@ -1556,7 +1556,7 @@ UfsExecScsiCmds ( // Wait for the completion of the transfer request. // Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << TransReq->Slot, 0, Packet->Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -1623,7 +1623,7 @@ Exit1: UfsHc->FreeBuffer (UfsHc, EFI_SIZE_TO_PAGES (TransReq->CmdDescSize), TransReq->CmdDescHost); } if (TransReq != NULL) { - FreePool (TransReq); + FreePool(TransReq); } return Status; } @@ -1648,7 +1648,7 @@ UfsExecUicCommands ( UINT32 Data; Status = UfsMmioRead32 (Private, UFS_HC_IS_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1657,7 +1657,7 @@ UfsExecUicCommands ( // Clear IS.BIT10 UIC Command Completion Status (UCCS) at first. // Status = UfsMmioWrite32 (Private, UFS_HC_IS_OFFSET, Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1668,17 +1668,17 @@ UfsExecUicCommands ( // are set. // Status = UfsMmioWrite32 (Private, UFS_HC_UCMD_ARG1_OFFSET, UicCommand->Arg1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = UfsMmioWrite32 (Private, UFS_HC_UCMD_ARG2_OFFSET, UicCommand->Arg2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = UfsMmioWrite32 (Private, UFS_HC_UCMD_ARG3_OFFSET, UicCommand->Arg3); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1686,12 +1686,12 @@ UfsExecUicCommands ( // Host software shall only set the UICCMD if HCS.UCRDY is set to 1. // Status = UfsWaitMemSet (Private, UFS_HC_STATUS_OFFSET, UFS_HC_HCS_UCRDY, UFS_HC_HCS_UCRDY, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = UfsMmioWrite32 (Private, UFS_HC_UIC_CMD_OFFSET, UicCommand->Opcode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1700,17 +1700,17 @@ UfsExecUicCommands ( // This bit is set to '1' by the host controller upon completion of a UIC command. // Status = UfsWaitMemSet (Private, UFS_HC_IS_OFFSET, UFS_HC_IS_UCCS, UFS_HC_IS_UCCS, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (UicCommand->Opcode != UfsUicDmeReset) { Status = UfsMmioRead32 (Private, UFS_HC_UCMD_ARG2_OFFSET, &UicCommand->Arg2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = UfsMmioRead32 (Private, UFS_HC_UCMD_ARG3_OFFSET, &UicCommand->Arg3); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((UicCommand->Arg2 & 0xFF) != 0) { @@ -1767,7 +1767,7 @@ UfsAllocateAlignCommonBuffer ( CmdDescHost, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *CmdDescMapping = NULL; *CmdDescHost = NULL; *CmdDescPhyAddr = 0; @@ -1784,7 +1784,7 @@ UfsAllocateAlignCommonBuffer ( CmdDescMapping ); - if (EFI_ERROR (Status) || (Bytes != EFI_PAGES_TO_SIZE (EFI_SIZE_TO_PAGES (Size)))) { + if (EFI_ERROR(Status) || (Bytes != EFI_PAGES_TO_SIZE (EFI_SIZE_TO_PAGES (Size)))) { UfsHc->FreeBuffer ( UfsHc, EFI_PAGES_TO_SIZE (EFI_SIZE_TO_PAGES (Size)), @@ -1835,7 +1835,7 @@ UfsEnableHostController ( if (mUfsHcPlatform != NULL && mUfsHcPlatform->Callback != NULL) { Status = mUfsHcPlatform->Callback (Private->Handle, EdkiiUfsHcPreHce, &Private->UfsHcDriverInterface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failure from platform driver during EdkiiUfsHcPreHce, Status = %r\n", Status)); return Status; } @@ -1847,7 +1847,7 @@ UfsEnableHostController ( // Reinitialize the UFS host controller if HCE bit of HC register is set. // Status = UfsMmioRead32 (Private, UFS_HC_ENABLE_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1856,14 +1856,14 @@ UfsEnableHostController ( // Write a 0 to the HCE register at first to disable the host controller. // Status = UfsMmioWrite32 (Private, UFS_HC_ENABLE_OFFSET, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // Wait until HCE is read as '0' before continuing. // Status = UfsWaitMemSet (Private, UFS_HC_ENABLE_OFFSET, UFS_HC_HCE_EN, 0, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } } @@ -1872,7 +1872,7 @@ UfsEnableHostController ( // Write a 1 to the HCE register to enable the UFS host controller. // Status = UfsMmioWrite32 (Private, UFS_HC_ENABLE_OFFSET, UFS_HC_HCE_EN); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1880,13 +1880,13 @@ UfsEnableHostController ( // Wait until HCE is read as '1' before continuing. // Status = UfsWaitMemSet (Private, UFS_HC_ENABLE_OFFSET, UFS_HC_HCE_EN, UFS_HC_HCE_EN, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } if (mUfsHcPlatform != NULL && mUfsHcPlatform->Callback != NULL) { Status = mUfsHcPlatform->Callback (Private->Handle, EdkiiUfsHcPostHce, &Private->UfsHcDriverInterface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failure from platform driver during EdkiiUfsHcPostHce, Status = %r\n", Status)); return Status; } @@ -1917,7 +1917,7 @@ UfsDeviceDetection ( if (mUfsHcPlatform != NULL && mUfsHcPlatform->Callback != NULL) { Status = mUfsHcPlatform->Callback (Private->Handle, EdkiiUfsHcPreLinkStartup, &Private->UfsHcDriverInterface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failure from platform driver during EdkiiUfsHcPreLinkStartup, Status = %r\n", Status)); return Status; } @@ -1933,24 +1933,24 @@ UfsDeviceDetection ( LinkStartupCommand.Arg2 = 0; LinkStartupCommand.Arg3 = 0; Status = UfsExecUicCommands (Private, &LinkStartupCommand); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } Status = UfsMmioRead32 (Private, UFS_HC_STATUS_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } if ((Data & UFS_HC_HCS_DP) == 0) { Status = UfsWaitMemSet (Private, UFS_HC_IS_OFFSET, UFS_HC_IS_ULSS, UFS_HC_IS_ULSS, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } } else { if (mUfsHcPlatform != NULL && mUfsHcPlatform->Callback != NULL) { Status = mUfsHcPlatform->Callback (Private->Handle, EdkiiUfsHcPostLinkStartup, &Private->UfsHcDriverInterface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failure from platform driver during EdkiiUfsHcPostLinkStartup, Status = %r\n", Status)); return Status; } @@ -1994,7 +1994,7 @@ UfsInitTaskManagementRequestList ( // Nutmrs = (UINT8) (RShiftU64 ((Private->UfsHcInfo.Capabilities & UFS_HC_CAP_NUTMRS), 16) + 1); Status = UfsAllocateAlignCommonBuffer (Private, Nutmrs * sizeof (UTP_TMRD), &CmdDescHost, &CmdDescPhyAddr, &CmdDescMapping); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2003,12 +2003,12 @@ UfsInitTaskManagementRequestList ( // Request List Base Address with a 64-bit address allocated at step 6. // Status = UfsMmioWrite32 (Private, UFS_HC_UTMRLBA_OFFSET, (UINT32)(UINTN)CmdDescPhyAddr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = UfsMmioWrite32 (Private, UFS_HC_UTMRLBAU_OFFSET, (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Private->UtpTmrlBase = CmdDescHost; @@ -2020,7 +2020,7 @@ UfsInitTaskManagementRequestList ( // Request List RunStop Register (UTMRLRSR) to '1'. // Status = UfsMmioWrite32 (Private, UFS_HC_UTMRLRSR_OFFSET, UFS_HC_UTMRLRSR); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2059,7 +2059,7 @@ UfsInitTransferRequestList ( // Nutrs = (UINT8)((Private->UfsHcInfo.Capabilities & UFS_HC_CAP_NUTRS) + 1); Status = UfsAllocateAlignCommonBuffer (Private, Nutrs * sizeof (UTP_TRD), &CmdDescHost, &CmdDescPhyAddr, &CmdDescMapping); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2068,12 +2068,12 @@ UfsInitTransferRequestList ( // Base Address with a 64-bit address allocated at step 8. // Status = UfsMmioWrite32 (Private, UFS_HC_UTRLBA_OFFSET, (UINT32)(UINTN)CmdDescPhyAddr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = UfsMmioWrite32 (Private, UFS_HC_UTRLBAU_OFFSET, (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2086,7 +2086,7 @@ UfsInitTransferRequestList ( // RunStop Register (UTRLRSR) to '1'. // Status = UfsMmioWrite32 (Private, UFS_HC_UTRLRSR_OFFSET, UFS_HC_UTRLRSR); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2110,25 +2110,25 @@ UfsControllerInit ( EFI_STATUS Status; Status = UfsEnableHostController (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "UfsControllerInit: Enable Host Controller Fails, Status = %r\n", Status)); return Status; } Status = UfsDeviceDetection (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "UfsControllerInit: Device Detection Fails, Status = %r\n", Status)); return Status; } Status = UfsInitTaskManagementRequestList (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "UfsControllerInit: Task management list initialization Fails, Status = %r\n", Status)); return Status; } Status = UfsInitTransferRequestList (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "UfsControllerInit: Transfer list initialization Fails, Status = %r\n", Status)); return Status; } @@ -2159,7 +2159,7 @@ UfsControllerStop ( // Request List RunStop Register (UTMRLRSR) to '1'. // Status = UfsMmioWrite32 (Private, UFS_HC_UTMRLRSR_OFFSET, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2168,7 +2168,7 @@ UfsControllerStop ( // RunStop Register (UTRLRSR) to '1'. // Status = UfsMmioWrite32 (Private, UFS_HC_UTRLRSR_OFFSET, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2176,13 +2176,13 @@ UfsControllerStop ( // Write a 0 to the HCE register in order to disable the host controller. // Status = UfsMmioRead32 (Private, UFS_HC_ENABLE_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT ((Data & UFS_HC_HCE_EN) == UFS_HC_HCE_EN); Status = UfsMmioWrite32 (Private, UFS_HC_ENABLE_OFFSET, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2190,7 +2190,7 @@ UfsControllerStop ( // Wait until HCE is read as '0' before continuing. // Status = UfsWaitMemSet (Private, UFS_HC_ENABLE_OFFSET, UFS_HC_HCE_EN, 0, UFS_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -2243,7 +2243,7 @@ SignalCallerEvent ( ); } - FreePool (TransReq); + FreePool(TransReq); gBS->SignalEvent (CallerEvent); return; @@ -2292,7 +2292,7 @@ ProcessAsyncTaskList ( SlotsMap |= BIT0 << TransReq->Slot; Status = UfsMmioRead32 (Private, UFS_HC_UTRLDBR_OFFSET, &Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // TODO: Should find/add a proper host adapter return status for this // case. @@ -2424,14 +2424,14 @@ GetUfsHcInfo ( EFI_STATUS Status; Status = UfsMmioRead32 (Private, UFS_HC_VER_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Private->UfsHcInfo.Version = Data; Status = UfsMmioRead32 (Private, UFS_HC_CAP_OFFSET, &Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2439,7 +2439,7 @@ GetUfsHcInfo ( if (mUfsHcPlatform != NULL && mUfsHcPlatform->OverrideHcInfo != NULL) { Status = mUfsHcPlatform->OverrideHcInfo (Private->Handle, &Private->UfsHcInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failure from platform on OverrideHcInfo, Status = %r\n", Status)); return Status; } diff --git a/MdeModulePkg/Bus/Usb/UsbBotPei/BotPeim.c b/MdeModulePkg/Bus/Usb/UsbBotPei/BotPeim.c index 5c071c661..9073b2670 100644 --- a/MdeModulePkg/Bus/Usb/UsbBotPei/BotPeim.c +++ b/MdeModulePkg/Bus/Usb/UsbBotPei/BotPeim.c @@ -136,7 +136,7 @@ BotCommandPhase ( &DataSize, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Command phase fail, we need to recovery reset this device // @@ -223,7 +223,7 @@ BotDataPhase ( TransferredSize += Increment; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { PeiUsbClearEndpointHalt (PeiServices, UsbIoPpi, EndpointAddr); return Status; } @@ -287,7 +287,7 @@ BotStatusPhase ( &DataSize, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -348,7 +348,7 @@ PeiAtapiCommand ( TimeOutInMilliSeconds ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } // @@ -381,7 +381,7 @@ PeiAtapiCommand ( &TransferStatus, TimeOutInMilliSeconds ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BotRecoveryReset (PeiServices, PeiBotDev); return EFI_DEVICE_ERROR; } diff --git a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiAtapi.c b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiAtapi.c index 9e6e74884..784c24ee0 100644 --- a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiAtapi.c +++ b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiAtapi.c @@ -59,7 +59,7 @@ PeiUsbInquiry ( 2000 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -120,7 +120,7 @@ PeiUsbTestUnitReady ( 2000 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -191,7 +191,7 @@ PeiUsbRequestSense ( // // failed to get Sense data // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (*SenseCounts == 0) { return EFI_DEVICE_ERROR; } else { @@ -264,7 +264,7 @@ PeiUsbReadCapacity ( 2000 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } LastBlock = ((UINT32) Data.LastLba3 << 24) | (Data.LastLba2 << 16) | (Data.LastLba1 << 8) | Data.LastLba0; @@ -325,7 +325,7 @@ PeiUsbReadFormattedCapacity ( 2000 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } diff --git a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c index fe9e62030..e4dc25fb1 100644 --- a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c +++ b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c @@ -102,12 +102,12 @@ PeiUsbClearEndpointHalt ( UsbIoPpi, &InterfaceDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } for (EndpointIndex = 0; EndpointIndex < InterfaceDesc->NumEndpoints; EndpointIndex++) { Status = UsbIoPpi->UsbGetEndpointDescriptor (PeiServices, UsbIoPpi, EndpointIndex, &EndpointDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } diff --git a/MdeModulePkg/Bus/Usb/UsbBotPei/UsbBotPeim.c b/MdeModulePkg/Bus/Usb/UsbBotPei/UsbBotPeim.c index e11062688..1da570ac3 100644 --- a/MdeModulePkg/Bus/Usb/UsbBotPei/UsbBotPeim.c +++ b/MdeModulePkg/Bus/Usb/UsbBotPei/UsbBotPeim.c @@ -86,7 +86,7 @@ PeimInitializeUsbBot ( // // Shadow this PEIM to run from memory // - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -101,7 +101,7 @@ PeimInitializeUsbBot ( &TempPpiDescriptor, (VOID **) &UsbIoPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -174,7 +174,7 @@ InitUsbBot ( UsbIoPpi, &InterfaceDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -191,7 +191,7 @@ InitUsbBot ( MemPages, &AllocateAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -223,7 +223,7 @@ InitUsbBot ( &EndpointDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -258,7 +258,7 @@ InitUsbBot ( PeiBotDevice->BlkIo2PpiList.Ppi = &PeiBotDevice->BlkIo2Ppi; Status = PeiUsbInquiry (PeiServices, PeiBotDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -267,7 +267,7 @@ InitUsbBot ( 1, &AllocateAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -275,7 +275,7 @@ InitUsbBot ( Status = PeiServicesInstallPpi (&PeiBotDevice->BlkIoPpiList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -370,7 +370,7 @@ BotGetMediaInfo ( PeiBotDev ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -488,7 +488,7 @@ BotReadBlocks ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // if any error encountered, detect what happened to the media and // update the media info accordingly. @@ -645,7 +645,7 @@ BotGetMediaInfo2 ( &PeiBotDev->Media ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -763,7 +763,7 @@ PeiBotDetectMedia ( 1, &AllocateAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -845,7 +845,7 @@ PeiBotDetectMedia ( PeiServices, PeiBotDev ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // retry the ReadFormatCapacity command // @@ -874,7 +874,7 @@ PeiBotDetectMedia ( // // If Request Sense data failed,retry. // - if (EFI_ERROR (FloppyStatus)) { + if (EFI_ERROR(FloppyStatus)) { continue; } // diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c index d4002c48d..417120e35 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c @@ -101,14 +101,14 @@ UsbIoControlTransfer ( // transfered is the same as the number of bytes requested. If a different // number of bytes were transfered, then return EFI_DEVICE_ERROR. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Direction != EfiUsbNoData && DataLength != RequestedDataLength) { Status = EFI_DEVICE_ERROR; goto ON_EXIT; } } - if (EFI_ERROR (Status) || (*UsbStatus != EFI_USB_NOERROR)) { + if (EFI_ERROR(Status) || (*UsbStatus != EFI_USB_NOERROR)) { // // Clear TT buffer when CTRL/BULK split transaction failes // Clear the TRANSLATOR TT buffer, not parent's buffer @@ -197,7 +197,7 @@ UsbIoControlTransfer ( Status = UsbSelectSetting (UsbIf->IfDesc, (UINT8) Request->Value); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (UsbIf->IfDesc->ActiveIndex < USB_MAX_INTERFACE_SETTING); UsbIf->IfSetting = UsbIf->IfDesc->Settings[UsbIf->IfDesc->ActiveIndex]; } @@ -281,7 +281,7 @@ UsbIoBulkTransfer ( EpDesc->Toggle = Toggle; - if (EFI_ERROR (Status) || (*UsbStatus != EFI_USB_NOERROR)) { + if (EFI_ERROR(Status) || (*UsbStatus != EFI_USB_NOERROR)) { // // Clear TT buffer when CTRL/BULK split transaction failes. // Clear the TRANSLATOR TT buffer, not parent's buffer @@ -792,7 +792,7 @@ UsbIoGetStringDescriptor ( Status = EFI_SUCCESS; FREE_STR: - gBS->FreePool (StrDesc); + gBS->FreePool(StrDesc); ON_EXIT: gBS->RestoreTPL (OldTpl); @@ -836,7 +836,7 @@ UsbIoPortReset ( HubIf = Dev->ParentIf; Status = HubIf->HubApi->ResetPort (HubIf, Dev->ParentPort); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbIoPortReset: failed to reset hub port %d@hub %d, %r \n", Dev->ParentPort, Dev->ParentAddr, Status)); @@ -857,7 +857,7 @@ UsbIoPortReset ( gBS->Stall (USB_SET_DEVICE_ADDRESS_STALL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // It may fail due to device disconnection or other reasons. // @@ -876,7 +876,7 @@ UsbIoPortReset ( if (Dev->ActiveConfig != NULL) { Status = UsbSetConfig (Dev, Dev->ActiveConfig->Desc.ConfigurationValue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbIoPortReset: failed to set configure for device %d - %r\n", Dev->Address, Status)); } @@ -933,10 +933,10 @@ UsbBusBuildProtocol ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to open device path %r\n", Status)); - FreePool (UsbBus); + FreePool(UsbBus); return Status; } @@ -966,14 +966,14 @@ UsbBusBuildProtocol ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && EFI_ERROR (Status2)) { + if (EFI_ERROR(Status) && EFI_ERROR(Status2)) { DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to open USB_HC/USB2_HC %r\n", Status)); Status = EFI_DEVICE_ERROR; goto CLOSE_HC; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The EFI_USB2_HC_PROTOCOL is produced for XHCI support. // Then its max supported devices are 256. Otherwise it's 128. @@ -994,7 +994,7 @@ UsbBusBuildProtocol ( &UsbBus->BusId ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to install bus protocol %r\n", Status)); goto CLOSE_HC; } @@ -1004,7 +1004,7 @@ UsbBusBuildProtocol ( // InitializeListHead (&UsbBus->WantedUsbIoDPList); Status = UsbBusAddWantedUsbIoDP (&UsbBus->BusId, RemainingDevicePath); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); // // Create a fake usb device for root hub // @@ -1018,7 +1018,7 @@ UsbBusBuildProtocol ( RootIf = AllocateZeroPool (sizeof (USB_INTERFACE)); if (RootIf == NULL) { - FreePool (RootHub); + FreePool(RootHub); Status = EFI_OUT_OF_RESOURCES; goto FREE_ROOTHUB; } @@ -1042,7 +1042,7 @@ UsbBusBuildProtocol ( Status = mUsbRootHubApi.Init (RootIf); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to init root hub %r\n", Status)); goto FREE_ROOTHUB; } @@ -1054,10 +1054,10 @@ UsbBusBuildProtocol ( FREE_ROOTHUB: if (RootIf != NULL) { - FreePool (RootIf); + FreePool(RootIf); } if (RootHub != NULL) { - FreePool (RootHub); + FreePool(RootHub); } UNINSTALL_USBBUS: @@ -1086,7 +1086,7 @@ CLOSE_HC: This->DriverBindingHandle, Controller ); - FreePool (UsbBus); + FreePool(UsbBus); DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to start bus driver %r\n", Status)); return Status; @@ -1187,7 +1187,7 @@ UsbBusControllerDriverSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If failed to open USB_HC2, fall back to USB_HC // @@ -1203,7 +1203,7 @@ UsbBusControllerDriverSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1245,7 +1245,7 @@ UsbBusControllerDriverSupported ( return EFI_SUCCESS; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Close protocol, don't use device path protocol in the Support() function // @@ -1296,7 +1296,7 @@ UsbBusControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Report Status Code here since we will initialize the host controller @@ -1320,13 +1320,13 @@ UsbBusControllerDriverStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If first start, build the bus execute environment and install bus protocol // REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_IO_BUS_USB | EFI_P_PC_ENABLE)); Status = UsbBusBuildProtocol (This, Controller, RemainingDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1340,7 +1340,7 @@ UsbBusControllerDriverStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); } else { // // USB Bus driver need to control the recursive connect policy of the bus, only those wanted @@ -1362,12 +1362,12 @@ UsbBusControllerDriverStart ( } Status = UsbBusAddWantedUsbIoDP (UsbBusId, RemainingDevicePath); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); // // Ensure all wanted child usb devices are fully recursively connected // Status = UsbBusRecursivelyConnectWantedUsbIo (UsbBusId); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); } @@ -1428,7 +1428,7 @@ UsbBusControllerDriverStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // It is possible that the child has already been released: // 1. For combo device, free one device will release others. @@ -1462,7 +1462,7 @@ UsbBusControllerDriverStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1483,7 +1483,7 @@ UsbBusControllerDriverStop ( for (Index = 1; Index < Bus->MaxDevices; Index++) { if (Bus->Devices[Index] != NULL) { Status = UsbRemoveDevice (Bus->Devices[Index]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -1491,13 +1491,13 @@ UsbBusControllerDriverStop ( gBS->RestoreTPL (OldTpl); - if (!EFI_ERROR (ReturnStatus)) { + if (!EFI_ERROR(ReturnStatus)) { mUsbRootHubApi.Release (RootIf); gBS->FreePool (RootIf); gBS->FreePool (RootHub); Status = UsbBusFreeUsbDPList (&Bus->WantedUsbIoDPList); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); // // Uninstall the bus identifier and close USB_HC/USB2_HC protocols @@ -1522,7 +1522,7 @@ UsbBusControllerDriverStop ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -1530,7 +1530,7 @@ UsbBusControllerDriverStop ( Controller ); - gBS->FreePool (Bus); + gBS->FreePool(Bus); } } return Status; diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c index a64f33fde..f8d39c021 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c @@ -32,7 +32,7 @@ UsbFreeInterfaceDesc ( Ep = Setting->Endpoints[Index]; if (Ep != NULL) { - FreePool (Ep); + FreePool(Ep); } } @@ -40,11 +40,11 @@ UsbFreeInterfaceDesc ( // Only call FreePool() if NumEndpoints > 0. // if (Setting->Desc.NumEndpoints > 0) { - FreePool (Setting->Endpoints); + FreePool(Setting->Endpoints); } } - FreePool (Setting); + FreePool(Setting); } @@ -84,13 +84,13 @@ UsbFreeConfigDesc ( } } - FreePool (Interface); + FreePool(Interface); } - FreePool (Config->Interfaces); + FreePool(Config->Interfaces); } - FreePool (Config); + FreePool(Config); } @@ -115,10 +115,10 @@ UsbFreeDevDesc ( } } - FreePool (DevDesc->Configs); + FreePool(DevDesc->Configs); } - FreePool (DevDesc); + FreePool(DevDesc); } @@ -564,7 +564,7 @@ UsbGetMaxPacketSize0 ( for (Index = 0; Index < 3; Index++) { Status = UsbCtrlGetDesc (UsbDev, USB_DESC_TYPE_DEVICE, 0, 0, &DevDesc, 8); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((DevDesc.BcdUSB >= 0x0300) && (DevDesc.MaxPacketSize0 == 9)) { UsbDev->MaxPacket0 = 1 << 9; return EFI_SUCCESS; @@ -612,8 +612,8 @@ UsbGetDevDesc ( sizeof (EFI_USB_DEVICE_DESCRIPTOR) ); - if (EFI_ERROR (Status)) { - gBS->FreePool (DevDesc); + if (EFI_ERROR(Status)) { + gBS->FreePool(DevDesc); } else { UsbDev->DevDesc = DevDesc; } @@ -653,7 +653,7 @@ UsbGetOneString ( // // Reject if Length even cannot cover itself, or odd because Unicode string byte length should be even. // - if (EFI_ERROR (Status) || + if (EFI_ERROR(Status) || (Desc.Length < OFFSET_OF (EFI_USB_STRING_DESCRIPTOR, Length) + sizeof (Desc.Length)) || (Desc.Length % 2 != 0) ) { @@ -675,8 +675,8 @@ UsbGetOneString ( Desc.Length ); - if (EFI_ERROR (Status)) { - FreePool (Buf); + if (EFI_ERROR(Status)) { + FreePool(Buf); return NULL; } @@ -731,7 +731,7 @@ UsbBuildLangTable ( UsbDev->TotalLangId = (UINT16)Max; ON_EXIT: - gBS->FreePool (Desc); + gBS->FreePool(Desc); return Status; } @@ -764,7 +764,7 @@ UsbGetOneConfig ( // Status = UsbCtrlGetDesc (UsbDev, USB_DESC_TYPE_CONFIG, Index, 0, &Desc, 8); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbGetOneConfig: failed to get descript length(%d) %r\n", Desc.TotalLength, Status)); @@ -788,10 +788,10 @@ UsbGetOneConfig ( Status = UsbCtrlGetDesc (UsbDev, USB_DESC_TYPE_CONFIG, Index, 0, Buf, Desc.TotalLength); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbGetOneConfig: failed to get full descript %r\n", Status)); - FreePool (Buf); + FreePool(Buf); return NULL; } @@ -828,7 +828,7 @@ UsbBuildDescTable ( // Status = UsbGetDevDesc (UsbDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbBuildDescTable: failed to get device descriptor - %r\n", Status)); return Status; } @@ -868,7 +868,7 @@ UsbBuildDescTable ( ConfigDesc = UsbParseConfigDesc ((UINT8 *) Config, Config->TotalLength); - FreePool (Config); + FreePool(Config); if (ConfigDesc == NULL) { DEBUG (( EFI_D_ERROR, "UsbBuildDescTable: failed to parse configure (index %d)\n", Index)); @@ -893,7 +893,7 @@ UsbBuildDescTable ( // Status = UsbBuildLangTable (UsbDev); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_INFO, "UsbBuildDescTable: get language ID table %r\n", Status)); } diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c index cc0de52de..756717679 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c @@ -65,11 +65,11 @@ UsbFreeInterface ( &gEfiUsbIoProtocolGuid, &UsbIf->UsbIo, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (UsbIf->DevicePath != NULL) { - FreePool (UsbIf->DevicePath); + FreePool(UsbIf->DevicePath); } - FreePool (UsbIf); + FreePool(UsbIf); } else { UsbOpenHostProtoByChild (UsbIf->Device->Bus, UsbIf->Handle); } @@ -147,7 +147,7 @@ UsbCreateInterface ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbCreateInterface: failed to install UsbIo - %r\n", Status)); goto ON_ERROR; } @@ -157,7 +157,7 @@ UsbCreateInterface ( // Status = UsbOpenHostProtoByChild (Device->Bus, UsbIf->Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( UsbIf->Handle, &gEfiDevicePathProtocolGuid, @@ -175,10 +175,10 @@ UsbCreateInterface ( ON_ERROR: if (UsbIf->DevicePath != NULL) { - FreePool (UsbIf->DevicePath); + FreePool(UsbIf->DevicePath); } - FreePool (UsbIf); + FreePool(UsbIf); return NULL; } @@ -198,7 +198,7 @@ UsbFreeDevice ( UsbFreeDevDesc (Device->DevDesc); } - gBS->FreePool (Device); + gBS->FreePool(Device); } @@ -284,7 +284,7 @@ UsbConnectDriver ( gBS->RestoreTPL (TPL_CALLBACK); Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE); - UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR (Status); + UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR(Status); DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl())); ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK); @@ -433,7 +433,7 @@ UsbSelectConfig ( // Status = UsbConnectDriver (UsbIf); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_WARN, "UsbSelectConfig: failed to connect driver %r, ignored\n", @@ -484,7 +484,7 @@ UsbDisconnectDriver ( gBS->RestoreTPL (TPL_CALLBACK); Status = gBS->DisconnectController (UsbIf->Handle, NULL, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UsbIf->IsManaged = FALSE; } @@ -527,14 +527,14 @@ UsbRemoveConfig ( } Status = UsbDisconnectDriver (UsbIf); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = UsbFreeInterface (UsbIf); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { UsbConnectDriver (UsbIf); } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Device->Interfaces[Index] = NULL; } else { ReturnStatus = Status; @@ -581,7 +581,7 @@ UsbRemoveDevice ( Status = UsbRemoveDevice (Child); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Bus->Devices[Index] = NULL; } else { Bus->Devices[Index]->DisconnectFail = TRUE; @@ -590,13 +590,13 @@ UsbRemoveDevice ( } } - if (EFI_ERROR (ReturnStatus)) { + if (EFI_ERROR(ReturnStatus)) { return ReturnStatus; } Status = UsbRemoveConfig (Device); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG (( EFI_D_INFO, "UsbRemoveDevice: device %d removed\n", Device->Address)); ASSERT (Device->Address < Bus->MaxDevices); @@ -690,7 +690,7 @@ UsbEnumerateNewDev ( // if (ResetIsNeeded) { Status = HubApi->ResetPort (HubIf, Port); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to reset port %d - %r\n", Port, Status)); return Status; @@ -712,7 +712,7 @@ UsbEnumerateNewDev ( // Status = HubApi->GetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to get speed of port %d\n", Port)); goto ON_ERROR; } @@ -785,7 +785,7 @@ UsbEnumerateNewDev ( Child->Address = (UINT8)Address; Bus->Devices[Address] = Child; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to set device address - %r\n", Status)); goto ON_ERROR; } @@ -800,7 +800,7 @@ UsbEnumerateNewDev ( // Status = UsbGetMaxPacketSize0 (Child); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to get max packet for EP 0 - %r\n", Status)); goto ON_ERROR; } @@ -813,7 +813,7 @@ UsbEnumerateNewDev ( // Status = UsbBuildDescTable (Child); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to build descriptor table - %r\n", Status)); goto ON_ERROR; } @@ -825,7 +825,7 @@ UsbEnumerateNewDev ( Config = Child->DevDesc->Configs[0]->Desc.ConfigurationValue; Status = UsbSetConfig (Child, Config); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to set configure %d - %r\n", Config, Status)); goto ON_ERROR; } @@ -837,7 +837,7 @@ UsbEnumerateNewDev ( // Status = UsbSelectConfig (Child, Config); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to create interfaces - %r\n", Status)); goto ON_ERROR; } @@ -901,7 +901,7 @@ UsbEnumeratePort ( // Status = HubApi->GetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbEnumeratePort: failed to get state of port %d\n", Port)); return Status; } @@ -1045,7 +1045,7 @@ UsbHubEnumeration ( UsbHubAckHubStatus (HubIf->Device); - gBS->FreePool (HubIf->ChangeMap); + gBS->FreePool(HubIf->ChangeMap); HubIf->ChangeMap = NULL; return ; } diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c index c7c27a548..0ab357b8b 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c @@ -376,7 +376,7 @@ UsbHubReadDesc ( // Status = UsbHubCtrlGetHubDesc (HubDev, HubDesc, 2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -408,7 +408,7 @@ UsbHubAckHubStatus ( Status = UsbHubCtrlGetHubStatus (HubDev, (UINT32 *) &HubState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -515,7 +515,7 @@ UsbOnHubInterrupt ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbOnHubInterrupt: failed to remove async transfer - %r\n", Status)); return Status; } @@ -530,7 +530,7 @@ UsbOnHubInterrupt ( HubIf ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbOnHubInterrupt: failed to submit new async transfer - %r\n", Status)); } @@ -619,7 +619,7 @@ UsbHubInit ( HubDesc = (EFI_USB_HUB_DESCRIPTOR *) HubDescBuffer; Status = UsbHubReadDesc (HubDev, HubDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbHubInit: failed to read HUB descriptor %r\n", Status)); return Status; } @@ -675,7 +675,7 @@ UsbHubInit ( &HubIf->HubNotify ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbHubInit: failed to create signal for hub %d - %r\n", HubDev->Address, Status)); @@ -700,7 +700,7 @@ UsbHubInit ( HubIf ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbHubInit: failed to queue interrupt transfer for hub %d - %r\n", HubDev->Address, Status)); @@ -766,7 +766,7 @@ UsbHubClearPortChange ( Status = UsbHubGetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -862,7 +862,7 @@ UsbHubResetPort ( Status = UsbHubSetPortFeature (HubIf, Port, (EFI_USB_PORT_FEATURE) USB_HUB_PORT_RESET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -880,11 +880,11 @@ UsbHubResetPort ( for (Index = 0; Index < USB_WAIT_PORT_STS_CHANGE_LOOP; Index++) { Status = UsbHubGetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)) { gBS->Stall (USB_SET_PORT_RECOVERY_STALL); return EFI_SUCCESS; @@ -924,7 +924,7 @@ UsbHubRelease ( 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -962,7 +962,7 @@ UsbRootHubInit ( Status = UsbHcGetCapability (HubIf->Device->Bus, &MaxSpeed, &NumOfPort, &Support64); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -987,7 +987,7 @@ UsbRootHubInit ( &HubIf->HubNotify ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1003,7 +1003,7 @@ UsbRootHubInit ( USB_ROOTHUB_POLL_INTERVAL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (HubIf->HubNotify); } @@ -1062,7 +1062,7 @@ UsbRootHubClearPortChange ( Status = UsbRootHubGetPortStatus (HubIf, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -1167,7 +1167,7 @@ UsbRootHubResetPort ( Status = UsbHcSetRootHubPortFeature (Bus, Port, EfiUsbPortReset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbRootHubResetPort: failed to start reset on port %d\n", Port)); return Status; } @@ -1180,7 +1180,7 @@ UsbRootHubResetPort ( Status = UsbHcClearRootHubPortFeature (Bus, Port, EfiUsbPortReset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbRootHubResetPort: failed to clear reset on port %d\n", Port)); return Status; } @@ -1196,7 +1196,7 @@ UsbRootHubResetPort ( for (Index = 0; Index < USB_WAIT_PORT_STS_CHANGE_LOOP; Index++) { Status = UsbHcGetRootHubPortStatus (Bus, Port, &PortState); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1229,7 +1229,7 @@ UsbRootHubResetPort ( Status = UsbRootHubSetPortFeature (RootIf, Port, EfiUsbPortEnable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "UsbRootHubResetPort: failed to enable port %d for UHCI\n", Port)); return Status; } diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c index 8559992d2..d11c8c25e 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c @@ -952,7 +952,7 @@ UsbBusFreeUsbDPList ( // ListIndex = ListIndex->ForwardLink; RemoveEntryList (&ListItem->Link); - FreePool (ListItem); + FreePool(ListItem); } InitializeListHead (UsbIoDPList); @@ -1007,7 +1007,7 @@ UsbBusAddWantedUsbIoDP ( // are wanted Usb devices // Status = UsbBusFreeUsbDPList (&Bus->WantedUsbIoDPList); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); DevicePathPtr = DuplicateDevicePath ((EFI_DEVICE_PATH_PROTOCOL *) &mAllUsbClassDevicePath); } else if (!IsDevicePathEnd (RemainingDevicePath)) { // @@ -1025,8 +1025,8 @@ UsbBusAddWantedUsbIoDP ( ASSERT (DevicePathPtr != NULL); Status = AddUsbDPToList (DevicePathPtr, &Bus->WantedUsbIoDPList); - ASSERT (!EFI_ERROR (Status)); - FreePool (DevicePathPtr); + ASSERT (!EFI_ERROR(Status)); + FreePool(DevicePathPtr); return EFI_SUCCESS; } @@ -1123,7 +1123,7 @@ UsbBusIsWantedUsbIO ( WantedListIndex = WantedListIndex->ForwardLink; } - gBS->FreePool (DevicePathPtr); + gBS->FreePool(DevicePathPtr); // // Check whether the new Usb device path is wanted @@ -1174,7 +1174,7 @@ UsbBusRecursivelyConnectWantedUsbIo ( if (Status == EFI_NOT_FOUND || UsbIoHandleCount == 0) { return EFI_SUCCESS; } - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); for (Index = 0; Index < UsbIoHandleCount; Index++) { // @@ -1183,7 +1183,7 @@ UsbBusRecursivelyConnectWantedUsbIo ( // UsbIoDevicePath = NULL; Status = gBS->HandleProtocol (UsbIoBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID *) &UsbIoDevicePath); - if (EFI_ERROR (Status) || UsbIoDevicePath == NULL) { + if (EFI_ERROR(Status) || UsbIoDevicePath == NULL) { continue; } if (CompareMem ( @@ -1202,7 +1202,7 @@ UsbBusRecursivelyConnectWantedUsbIo ( &gEfiUsbIoProtocolGuid, (VOID **) &UsbIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } UsbIf = USB_INTERFACE_FROM_USBIO (UsbIo); @@ -1214,13 +1214,13 @@ UsbBusRecursivelyConnectWantedUsbIo ( // DEBUG ((EFI_D_INFO, "UsbBusRecursivelyConnectWantedUsbIo: TPL before connect is %d\n", (UINT32)UsbGetCurrentTpl ())); Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE); - UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR (Status); + UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR(Status); DEBUG ((EFI_D_INFO, "UsbBusRecursivelyConnectWantedUsbIo: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl())); } } } - FreePool (UsbIoBuffer); + FreePool(UsbIoBuffer); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c b/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c index c44c40389..f5311ebd9 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c +++ b/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c @@ -312,7 +312,7 @@ PeiUsbHubReadDesc ( // Status = PeiGetHubDescriptor (PeiServices, PeiUsbDevice, UsbIoPpi, 2, HubDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -402,7 +402,7 @@ PeiDoHubConfig ( UsbIoPpi, HubDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -426,7 +426,7 @@ PeiDoHubConfig ( (UINT8) (Index + 1), EfiUsbPortPower ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_ERROR, "PeiDoHubConfig: PeiHubSetPortFeature EfiUsbPortPower failed %x\n", Index)); continue; } @@ -445,7 +445,7 @@ PeiDoHubConfig ( UsbIoPpi, (UINT32 *) &HubStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } else { // @@ -524,7 +524,7 @@ PeiResetHubPort ( (UINT32 *) &HubPortStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbIoPeim.c b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbIoPeim.c index 653bbf52f..e49847379 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbIoPeim.c +++ b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbIoPeim.c @@ -61,7 +61,7 @@ PeiUsbControlTransfer ( // while (EndpointIndex < MAX_ENDPOINT) { Status = PeiUsbGetEndpointDescriptor (PeiServices, This, EndpointIndex, &EndpointDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -174,7 +174,7 @@ PeiUsbBulkTransfer ( while (EndpointIndex < MAX_ENDPOINT) { Status = PeiUsbGetEndpointDescriptor (PeiServices, This, EndpointIndex, &EndpointDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -347,7 +347,7 @@ PeiUsbPortReset ( Address ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c index 45e48f472..e3c16eecc 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c +++ b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c @@ -130,7 +130,7 @@ PeimInitializeUsb ( PEI_USB_HOST_CONTROLLER_PPI *UsbHcPpi; PEI_USB2_HOST_CONTROLLER_PPI *Usb2HcPpi; - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -149,7 +149,7 @@ PeimInitializeUsb ( NULL, (VOID **) &UsbHcPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No more host controller, break out // @@ -170,7 +170,7 @@ PeimInitializeUsb ( NULL, (VOID **) &Usb2HcPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No more host controller, break out // @@ -232,7 +232,7 @@ PeiHubEnumeration ( (UINT32 *) &PortStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -253,7 +253,7 @@ PeiHubEnumeration ( MemPages, &AllocateAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -336,7 +336,7 @@ PeiHubEnumeration ( CurrentAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } DEBUG ((EFI_D_INFO, "PeiHubEnumeration: PeiConfigureUsbDevice Success\n")); @@ -347,7 +347,7 @@ PeiHubEnumeration ( NewPeiUsbDevice->IsHub = 0x1; Status = PeiDoHubConfig (PeiServices, NewPeiUsbDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -364,7 +364,7 @@ PeiHubEnumeration ( MemPages, &AllocateAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } CopyMem ((VOID *)(UINTN)AllocateAddress, NewPeiUsbDevice, sizeof (PEI_USB_DEVICE)); @@ -382,7 +382,7 @@ PeiHubEnumeration ( NewPeiUsbDevice->IsHub = 0x1; Status = PeiDoHubConfig (PeiServices, NewPeiUsbDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -480,7 +480,7 @@ PeiUsbEnumeration ( MemPages, &AllocateAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -577,7 +577,7 @@ PeiUsbEnumeration ( &CurrentAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } DEBUG ((EFI_D_INFO, "PeiUsbEnumeration: PeiConfigureUsbDevice Success\n")); @@ -588,7 +588,7 @@ PeiUsbEnumeration ( PeiUsbDevice->IsHub = 0x1; Status = PeiDoHubConfig (PeiServices, PeiUsbDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -605,7 +605,7 @@ PeiUsbEnumeration ( MemPages, &AllocateAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } CopyMem ((VOID *)(UINTN)AllocateAddress, PeiUsbDevice, sizeof (PEI_USB_DEVICE)); @@ -623,7 +623,7 @@ PeiUsbEnumeration ( PeiUsbDevice->IsHub = 0x1; Status = PeiDoHubConfig (PeiServices, PeiUsbDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -684,7 +684,7 @@ PeiConfigureUsbDevice ( &DeviceDescriptor ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "PeiUsbGet Device Descriptor the %d time Success\n", Retry)); break; } @@ -709,7 +709,7 @@ PeiConfigureUsbDevice ( *DeviceAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "PeiUsbSetDeviceAddress Failed: %r\n", Status)); return Status; } @@ -729,7 +729,7 @@ PeiConfigureUsbDevice ( &DeviceDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "PeiUsbGetDescriptor First Failed\n")); return Status; } @@ -741,7 +741,7 @@ PeiConfigureUsbDevice ( PeiServices, PeiUsbDevice ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } MicroSecondDelay (USB_GET_CONFIG_DESCRIPTOR_STALL); @@ -751,7 +751,7 @@ PeiConfigureUsbDevice ( UsbIoPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -800,7 +800,7 @@ PeiUsbGetAllConfiguration ( PeiUsbDevice->ConfigurationData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "PeiUsbGet Config Descriptor First Failed\n")); return Status; } @@ -835,7 +835,7 @@ PeiUsbGetAllConfiguration ( PeiUsbDevice->ConfigurationData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "PeiUsbGet Config Descriptor all Failed\n")); return Status; } @@ -851,7 +851,7 @@ PeiUsbGetAllConfiguration ( &SkipBytes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -874,7 +874,7 @@ PeiUsbGetAllConfiguration ( &SkipBytes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -906,7 +906,7 @@ PeiUsbGetAllConfiguration ( &SkipBytes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1045,7 +1045,7 @@ ResetRootPort ( EfiUsbPortReset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SetRootHubPortFeature EfiUsbPortReset Failed\n")); return; } @@ -1066,7 +1066,7 @@ ResetRootPort ( EfiUsbPortReset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "ClearRootHubPortFeature EfiUsbPortReset Failed\n")); return; } @@ -1086,7 +1086,7 @@ ResetRootPort ( PortNum, &PortStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -1147,7 +1147,7 @@ ResetRootPort ( EfiUsbPortReset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SetRootHubPortFeature EfiUsbPortReset Failed\n")); return; } @@ -1168,7 +1168,7 @@ ResetRootPort ( EfiUsbPortReset ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "ClearRootHubPortFeature EfiUsbPortReset Failed\n")); return; } @@ -1188,7 +1188,7 @@ ResetRootPort ( PortNum, &PortStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/ComponentName.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/ComponentName.c index 6af1d7809..20c24be48 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/ComponentName.c @@ -174,7 +174,7 @@ UsbKeyboardComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiUsbIoProtocolGuid, @@ -200,7 +200,7 @@ UsbKeyboardComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c index 27685995c..d219f4cd6 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c @@ -51,7 +51,7 @@ USBKeyboardDriverBindingEntryPoint ( &gUsbKeyboardComponentName, &gUsbKeyboardComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -89,7 +89,7 @@ USBKeyboardDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -162,7 +162,7 @@ USBKeyboardDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit1; } @@ -181,7 +181,7 @@ USBKeyboardDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } // @@ -276,10 +276,10 @@ USBKeyboardDriverBindingStart ( UsbKeyboardDevice, &UsbKeyboardDevice->TimerEvent ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->SetTimer (UsbKeyboardDevice->TimerEvent, TimerPeriodic, KEYBOARD_TIMER_INTERVAL); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -291,7 +291,7 @@ USBKeyboardDriverBindingStart ( &(UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -302,7 +302,7 @@ USBKeyboardDriverBindingStart ( UsbKeyboardDevice, &(UsbKeyboardDevice->SimpleInput.WaitForKey) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -313,7 +313,7 @@ USBKeyboardDriverBindingStart ( UsbKeyboardDevice, &UsbKeyboardDevice->KeyNotifyProcessEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -332,13 +332,13 @@ USBKeyboardDriverBindingStart ( &UsbKeyboardDevice->SimpleInputEx, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } UsbKeyboardDevice->ControllerHandle = Controller; Status = InitKeyboardLayout (UsbKeyboardDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Controller, &gEfiSimpleTextInProtocolGuid, @@ -358,7 +358,7 @@ USBKeyboardDriverBindingStart ( &UsbKeyboardDevice->SimpleInputEx, TRUE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Controller, &gEfiSimpleTextInProtocolGuid, @@ -387,7 +387,7 @@ USBKeyboardDriverBindingStart ( UsbKeyboardDevice ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Controller, &gEfiSimpleTextInProtocolGuid, @@ -439,7 +439,7 @@ ErrorExit: ReleaseKeyboardLayoutResources (UsbKeyboardDevice); gBS->CloseEvent (UsbKeyboardDevice->KeyboardLayoutEvent); } - FreePool (UsbKeyboardDevice); + FreePool(UsbKeyboardDevice); UsbKeyboardDevice = NULL; } gBS->CloseProtocol ( @@ -493,7 +493,7 @@ USBKeyboardDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -505,7 +505,7 @@ USBKeyboardDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -570,7 +570,7 @@ USBKeyboardDriverBindingStop ( DestroyQueue (&UsbKeyboardDevice->EfiKeyQueue); DestroyQueue (&UsbKeyboardDevice->EfiKeyQueueForNotify); - FreePool (UsbKeyboardDevice); + FreePool(UsbKeyboardDevice); return Status; } @@ -668,7 +668,7 @@ USBKeyboardReset ( // Exhaustive reset // Status = InitUSBKeyboard (UsbKeyboardDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -709,7 +709,7 @@ USBKeyboardReadKeyStroke ( // while (1) { Status = USBKeyboardReadKeyStrokeWorker (UsbKeyboardDevice, &KeyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -815,7 +815,7 @@ USBKeyboardTimerHandler ( // and translate it into USB keycode. // Status = USBParseKey (UsbKeyboardDevice, &KeyCode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -823,7 +823,7 @@ USBKeyboardTimerHandler ( // Translate saved USB keycode into EFI_INPUT_KEY // Status = UsbKeyCodeToEfiInputKey (UsbKeyboardDevice, KeyCode, &KeyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -857,7 +857,7 @@ KbdFreeNotifyList ( Link = GetFirstNode (NotifyList); NotifyNode = CR (Link, KEYBOARD_CONSOLE_IN_EX_NOTIFY, NotifyEntry, USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE); RemoveEntryList (Link); - FreePool (NotifyNode); + FreePool(NotifyNode); } return EFI_SUCCESS; @@ -939,7 +939,7 @@ USBKeyboardResetEx ( UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This); Status = UsbKeyboardDevice->SimpleInput.Reset (&UsbKeyboardDevice->SimpleInput, ExtendedVerification); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -1176,7 +1176,7 @@ USBKeyboardUnregisterKeyNotify ( // RemoveEntryList (&CurrentNotify->NotifyEntry); - FreePool (CurrentNotify); + FreePool(CurrentNotify); return EFI_SUCCESS; } } @@ -1224,7 +1224,7 @@ KeyNotifyProcessHandler ( // Leave critical section // gBS->RestoreTPL (OldTpl); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList, Link); Link = GetNextNode (NotifyList, Link)) { diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c index 7eb65b881..418b0f7b4 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c @@ -329,7 +329,7 @@ InstallDefaultKeyboardLayout ( NULL, (VOID **) &HiiDatabase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -380,7 +380,7 @@ IsUSBKeyboard ( &InterfaceDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -419,7 +419,7 @@ GetCurrentKeyboardLayout ( NULL, (VOID **) &HiiDatabase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -444,8 +444,8 @@ GetCurrentKeyboardLayout ( &Length, KeyboardLayout ); - if (EFI_ERROR (Status)) { - FreePool (KeyboardLayout); + if (EFI_ERROR(Status)) { + FreePool(KeyboardLayout); KeyboardLayout = NULL; } } @@ -631,7 +631,7 @@ SetKeyboardLayoutEvent ( TableEntry = GetKeyDescriptor (UsbKeyboardDevice, KeyCode); if (TableEntry == NULL) { ReleaseKeyboardLayoutResources (UsbKeyboardDevice); - FreePool (KeyboardLayout); + FreePool(KeyboardLayout); return; } CopyMem (TableEntry, KeyDescriptor, sizeof (EFI_KEY_DESCRIPTOR)); @@ -683,7 +683,7 @@ SetKeyboardLayoutEvent ( KeyDescriptor = GetKeyDescriptor (UsbKeyboardDevice, 0x28); CopyMem (TableEntry, KeyDescriptor, sizeof (EFI_KEY_DESCRIPTOR)); - FreePool (KeyboardLayout); + FreePool(KeyboardLayout); } /** @@ -701,7 +701,7 @@ ReleaseKeyboardLayoutResources ( LIST_ENTRY *Link; if (UsbKeyboardDevice->KeyConvertionTable != NULL) { - FreePool (UsbKeyboardDevice->KeyConvertionTable); + FreePool(UsbKeyboardDevice->KeyConvertionTable); } UsbKeyboardDevice->KeyConvertionTable = NULL; @@ -710,8 +710,8 @@ ReleaseKeyboardLayoutResources ( UsbNsKey = USB_NS_KEY_FORM_FROM_LINK (Link); RemoveEntryList (&UsbNsKey->Link); - FreePool (UsbNsKey->NsKey); - FreePool (UsbNsKey); + FreePool(UsbNsKey->NsKey); + FreePool(UsbNsKey); } } @@ -757,7 +757,7 @@ InitKeyboardLayout ( &gEfiHiiKeyBoardLayoutGuid, &UsbKeyboardDevice->KeyboardLayoutEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -825,7 +825,7 @@ InitUSBKeyboard ( &ConfigValue, &TransferResult ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ConfigValue = 0x01; // // Uses default configuration to configure the USB Keyboard device. @@ -835,7 +835,7 @@ InitUSBKeyboard ( ConfigValue, &TransferResult ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If configuration could not be set here, it means // the keyboard interface has some errors and could @@ -1720,7 +1720,7 @@ InitQueue ( Queue->Tail = 0; if (Queue->Buffer[0] != NULL) { - FreePool (Queue->Buffer[0]); + FreePool(Queue->Buffer[0]); } Queue->Buffer[0] = AllocatePool (sizeof (Queue->Buffer) / sizeof (Queue->Buffer[0]) * ItemSize); @@ -1741,7 +1741,7 @@ DestroyQueue ( IN OUT USB_SIMPLE_QUEUE *Queue ) { - FreePool (Queue->Buffer[0]); + FreePool(Queue->Buffer[0]); } diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c index 600896b6a..cf8284ad2 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c @@ -57,9 +57,9 @@ UsbBootRequestSense ( USB_BOOT_GENERAL_CMD_TIMEOUT, &CmdResult ); - if (EFI_ERROR (Status) || CmdResult != USB_MASS_CMD_SUCCESS) { + if (EFI_ERROR(Status) || CmdResult != USB_MASS_CMD_SUCCESS) { DEBUG ((EFI_D_ERROR, "UsbBootRequestSense: (%r) CmdResult=0x%x\n", Status, CmdResult)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; } return Status; @@ -199,7 +199,7 @@ UsbBootExecCmd ( // If ExecCommand() returns no error and CmdResult is success, // then the commnad transfer is successful. // - if ((CmdResult == USB_MASS_CMD_SUCCESS) && !EFI_ERROR (Status)) { + if ((CmdResult == USB_MASS_CMD_SUCCESS) && !EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -256,19 +256,19 @@ UsbBootExecCmdWithRetry ( NULL, &TimeoutEvt ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->SetTimer (TimeoutEvt, TimerRelative, EFI_TIMER_PERIOD_SECONDS(60)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto EXIT; } // // Execute the cmd and retry if it fails. // - while (EFI_ERROR (gBS->CheckEvent (TimeoutEvt))) { + while (EFI_ERROR(gBS->CheckEvent (TimeoutEvt))) { Status = UsbBootExecCmd ( UsbMass, Cmd, @@ -375,7 +375,7 @@ UsbBootInquiry ( sizeof (USB_BOOT_INQUIRY_DATA), USB_BOOT_GENERAL_CMD_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -446,7 +446,7 @@ UsbBootReadCapacity16 ( sizeof (CapacityData), USB_BOOT_GENERAL_CMD_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -518,7 +518,7 @@ UsbBootReadCapacity ( sizeof (USB_BOOT_READ_CAPACITY_DATA), USB_BOOT_GENERAL_CMD_TIMEOUT ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -541,7 +541,7 @@ UsbBootReadCapacity ( if (Media->LastBlock == 0xFFFFFFFF) { Status = UsbBootReadCapacity16 (UsbMass); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UsbMass->Cdb16Byte = TRUE; } } @@ -596,7 +596,7 @@ UsbScsiModeSense ( // Section 8.2.10 of SCSI-2 Spec. // BIT7 of this byte is indicates whether the medium is write protected. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Media->ReadOnly = (BOOLEAN) ((ModeParaHeader.DevicePara & BIT7) != 0); } @@ -630,7 +630,7 @@ UsbBootGetParams ( Media = &(UsbMass->BlockIoMedia); Status = UsbBootInquiry (UsbMass); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbBootGetParams: UsbBootInquiry (%r)\n", Status)); return Status; } @@ -694,7 +694,7 @@ UsbBootDetectMedia ( CmdSet = ((EFI_USB_INTERFACE_DESCRIPTOR *) (UsbMass->Context))->InterfaceSubClass; Status = UsbBootIsUnitReady (UsbMass); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbBootDetectMedia: UsbBootIsUnitReady (%r)\n", Status)); } @@ -705,7 +705,7 @@ UsbBootDetectMedia ( // others: HW error. // For either EFI_NO_MEDIA, or HW error, skip to get WriteProtected and capacity information. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((UsbMass->Pdt != USB_PDT_CDROM) && (CmdSet == USB_MASS_STORE_SCSI)) { // // MODE SENSE is required for the device with PDT of 0x00/0x07/0x0E, @@ -718,12 +718,12 @@ UsbBootDetectMedia ( } Status = UsbBootReadCapacity (UsbMass); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbBootDetectMedia: UsbBootReadCapacity (%r)\n", Status)); } } - if (EFI_ERROR (Status) && Status != EFI_NO_MEDIA) { + if (EFI_ERROR(Status) && Status != EFI_NO_MEDIA) { // // For NoMedia, BlockIo is still needed. // @@ -860,7 +860,7 @@ UsbBootReadWriteBlocks ( ByteSize, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DEBUG (( @@ -940,7 +940,7 @@ UsbBootReadWriteBlocks16 ( ByteSize, Timeout ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DEBUG (( diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c index 98d2ba996..4aa832590 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c @@ -62,7 +62,7 @@ UsbBotInit ( // Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &UsbBot->Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } @@ -79,7 +79,7 @@ UsbBotInit ( for (Index = 0; Index < Interface->NumEndpoints; Index++) { Status = UsbIo->UsbGetEndpointDescriptor (UsbIo, Index, &EndPoint); - if (EFI_ERROR (Status) || !USB_IS_BULK_ENDPOINT (EndPoint.Attributes)) { + if (EFI_ERROR(Status) || !USB_IS_BULK_ENDPOINT (EndPoint.Attributes)) { continue; } @@ -114,13 +114,13 @@ UsbBotInit ( if (Context != NULL) { *Context = UsbBot; } else { - FreePool (UsbBot); + FreePool(UsbBot); } return EFI_SUCCESS; ON_ERROR: - FreePool (UsbBot); + FreePool(UsbBot); return Status; } @@ -189,7 +189,7 @@ UsbBotSendCommand ( Timeout, &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (USB_IS_ERROR (Result, EFI_USB_ERR_STALL) && DataDir == EfiUsbDataOut) { // // Respond to Bulk-Out endpoint stall with a Reset Recovery, @@ -264,7 +264,7 @@ UsbBotDataTransfer ( Timeout, &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (USB_IS_ERROR (Result, EFI_USB_ERR_STALL)) { DEBUG ((EFI_D_INFO, "UsbBotDataTransfer: (%r)\n", Status)); DEBUG ((EFI_D_INFO, "UsbBotDataTransfer: DataIn Stall\n")); @@ -415,7 +415,7 @@ UsbBotExecCommand ( // rejects the command. // Status = UsbBotSendCommand (UsbBot, Cmd, CmdLen, DataDir, DataLen, Lun); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbBotExecCommand: UsbBotSendCommand (%r)\n", Status)); return Status; } @@ -432,7 +432,7 @@ UsbBotExecCommand ( // Get the status, if that succeeds, interpret the result // Status = UsbBotGetStatus (UsbBot, DataLen, &Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbBotExecCommand: UsbBotGetStatus (%r)\n", Status)); return Status; } @@ -476,7 +476,7 @@ UsbBotResetDevice ( // If we need to do strictly reset, reset its parent hub port // Status = UsbBot->UsbIo->UsbPortReset (UsbBot->UsbIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } } @@ -502,7 +502,7 @@ UsbBotResetDevice ( &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -572,7 +572,7 @@ UsbBotGetMaxLun ( 1, &Result ); - if (EFI_ERROR (Status) || *MaxLun > USB_BOT_MAX_LUN) { + if (EFI_ERROR(Status) || *MaxLun > USB_BOT_MAX_LUN) { // // If the Get LUN request returns an error or the MaxLun is larger than // the maximum LUN value (0x0f) supported by the USB Mass Storage Class @@ -601,7 +601,7 @@ UsbBotCleanUp ( IN VOID *Context ) { - FreePool (Context); + FreePool(Context); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c index 1e5508c75..f83980398 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c @@ -77,7 +77,7 @@ UsbCbiInit ( // is a USB Mass Storage CBI interface. // Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &UsbCbi->Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } @@ -93,7 +93,7 @@ UsbCbiInit ( // for (Index = 0; Index < Interface->NumEndpoints; Index++) { Status = UsbIo->UsbGetEndpointDescriptor (UsbIo, Index, &EndPoint); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -139,13 +139,13 @@ UsbCbiInit ( if (Context != NULL) { *Context = UsbCbi; } else { - FreePool (UsbCbi); + FreePool(UsbCbi); } return EFI_SUCCESS; ON_ERROR: - FreePool (UsbCbi); + FreePool(UsbCbi); return Status; } @@ -213,7 +213,7 @@ UsbCbiSendCommand ( // is a "class-specific exemption to the USB specification". Retry // if the command is NAKed. // - if (EFI_ERROR (Status) && (TransStatus == EFI_USB_ERR_NAK)) { + if (EFI_ERROR(Status) && (TransStatus == EFI_USB_ERR_NAK)) { continue; } @@ -301,7 +301,7 @@ UsbCbiDataTransfer ( Timeout, &TransStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (TransStatus == EFI_USB_ERR_NAK) { // // The device can NAK the host if either the data/buffer isn't @@ -395,7 +395,7 @@ UsbCbiGetStatus ( // // The CBI can NAK the interrupt endpoint if the command is in-progress. // - if (EFI_ERROR (Status) && (TransStatus == EFI_USB_ERR_NAK)) { + if (EFI_ERROR(Status) && (TransStatus == EFI_USB_ERR_NAK)) { continue; } @@ -449,7 +449,7 @@ UsbCbiExecCommand ( // rejects the command. // Status = UsbCbiSendCommand (UsbCbi, Cmd, CmdLen, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->Stall(10 * USB_MASS_1_MILLISECOND); DEBUG ((EFI_D_ERROR, "UsbCbiExecCommand: UsbCbiSendCommand (%r)\n",Status)); return Status; @@ -471,7 +471,7 @@ UsbCbiExecCommand ( // Get the status. If it succeeds, interpret the result. // Status = UsbCbiGetStatus (UsbCbi, Timeout, &Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbCbiExecCommand: UsbCbiGetStatus (%r)\n",Status)); return Status; } @@ -567,7 +567,7 @@ UsbCbiResetDevice ( // Send the command to the device. Don't use UsbCbiExecCommand here. // Status = UsbCbiSendCommand (UsbCbi, ResetCmd, USB_CBI_RESET_CMD_LEN, Timeout); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -601,6 +601,6 @@ UsbCbiCleanUp ( IN VOID *Context ) { - FreePool (Context); + FreePool(Context); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c index 0dcbc5da2..819546685 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c @@ -122,7 +122,7 @@ UsbMassReadBlocks ( // if (Media->RemovableMedia) { Status = UsbBootDetectMedia (UsbMass); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } } @@ -171,7 +171,7 @@ UsbMassReadBlocks ( Status = UsbBootReadWriteBlocks (UsbMass, FALSE, (UINT32) Lba, TotalBlock, Buffer); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbMassReadBlocks: UsbBootReadBlocks (%r) -> Reset\n", Status)); UsbMassReset (This, TRUE); } @@ -238,7 +238,7 @@ UsbMassWriteBlocks ( // if (Media->RemovableMedia) { Status = UsbBootDetectMedia (UsbMass); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } } @@ -291,7 +291,7 @@ UsbMassWriteBlocks ( Status = UsbBootReadWriteBlocks (UsbMass, TRUE, (UINT32) Lba, TotalBlock, Buffer); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbMassWriteBlocks: UsbBootWriteBlocks (%r) -> Reset\n", Status)); UsbMassReset (This, TRUE); } @@ -406,12 +406,12 @@ UsbMassInitTransport ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -432,7 +432,7 @@ UsbMassInitTransport ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -513,9 +513,9 @@ UsbMassInitMultiLun ( // Initialize the media parameter data for EFI_BLOCK_IO_MEDIA of Block I/O Protocol. // Status = UsbMassInitMedia (UsbMass); - if ((EFI_ERROR (Status)) && (Status != EFI_NO_MEDIA)) { + if ((EFI_ERROR(Status)) && (Status != EFI_NO_MEDIA)) { DEBUG ((EFI_D_ERROR, "UsbMassInitMultiLun: UsbMassInitMedia (%r)\n", Status)); - FreePool (UsbMass); + FreePool(UsbMass); continue; } @@ -533,7 +533,7 @@ UsbMassInitMultiLun ( if (UsbMass->DevicePath == NULL) { DEBUG ((EFI_D_ERROR, "UsbMassInitMultiLun: failed to create device logic unit device path\n")); Status = EFI_OUT_OF_RESOURCES; - FreePool (UsbMass); + FreePool(UsbMass); continue; } @@ -553,10 +553,10 @@ UsbMassInitMultiLun ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbMassInitMultiLun: InstallMultipleProtocolInterfaces (%r)\n", Status)); - FreePool (UsbMass->DevicePath); - FreePool (UsbMass); + FreePool(UsbMass->DevicePath); + FreePool(UsbMass); continue; } @@ -572,7 +572,7 @@ UsbMassInitMultiLun ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbMassInitMultiLun: OpenUsbIoProtocol By Child (%r)\n", Status)); gBS->UninstallMultipleProtocolInterfaces ( UsbMass->Controller, @@ -584,8 +584,8 @@ UsbMassInitMultiLun ( &UsbMass->DiskInfo, NULL ); - FreePool (UsbMass->DevicePath); - FreePool (UsbMass); + FreePool(UsbMass->DevicePath); + FreePool(UsbMass); continue; } ReturnStatus = EFI_SUCCESS; @@ -632,7 +632,7 @@ UsbMassInitNonLun ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "UsbMassInitNonLun: OpenUsbIoProtocol By Driver (%r)\n", Status)); goto ON_ERROR; } @@ -653,7 +653,7 @@ UsbMassInitNonLun ( // Initialize the media parameter data for EFI_BLOCK_IO_MEDIA of Block I/O Protocol. // Status = UsbMassInitMedia (UsbMass); - if ((EFI_ERROR (Status)) && (Status != EFI_NO_MEDIA)) { + if ((EFI_ERROR(Status)) && (Status != EFI_NO_MEDIA)) { DEBUG ((EFI_D_ERROR, "UsbMassInitNonLun: UsbMassInitMedia (%r)\n", Status)); goto ON_ERROR; } @@ -668,7 +668,7 @@ UsbMassInitNonLun ( &UsbMass->DiskInfo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_ERROR; } @@ -676,7 +676,7 @@ UsbMassInitNonLun ( ON_ERROR: if (UsbMass != NULL) { - FreePool (UsbMass); + FreePool(UsbMass); } if (UsbIo != NULL) { gBS->CloseProtocol ( @@ -723,7 +723,7 @@ USBMassDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -732,7 +732,7 @@ USBMassDriverBindingSupported ( // protocol handler. // Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -809,7 +809,7 @@ USBMassDriverBindingStart ( Status = UsbMassInitTransport (This, Controller, &Transport, &Context, &MaxLun); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: UsbMassInitTransport (%r)\n", Status)); goto Exit; } @@ -818,7 +818,7 @@ USBMassDriverBindingStart ( // Initialize data for device that does not support multiple LUNSs. // Status = UsbMassInitNonLun (This, Controller, Transport, Context); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: UsbMassInitNonLun (%r)\n", Status)); } } else { @@ -834,7 +834,7 @@ USBMassDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: OpenDevicePathProtocol By Driver (%r)\n", Status)); goto Exit; } @@ -848,7 +848,7 @@ USBMassDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: OpenUsbIoProtocol By Driver (%r)\n", Status)); gBS->CloseProtocol ( Controller, @@ -864,7 +864,7 @@ USBMassDriverBindingStart ( // EFI_SUCCESS is returned if at least 1 LUN is initialized successfully. // Status = UsbMassInitMultiLun (This, Controller, Transport, Context, DevicePath, MaxLun); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -975,7 +975,7 @@ USBMassDriverBindingStop ( &UsbMass->DiskInfo, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -987,7 +987,7 @@ USBMassDriverBindingStop ( ); UsbMass->Transport->CleanUp (UsbMass->Context); - FreePool (UsbMass); + FreePool(UsbMass); DEBUG ((EFI_D_INFO, "Success to stop non-multi-lun root handle\n")); return EFI_SUCCESS; @@ -1010,7 +1010,7 @@ USBMassDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; DEBUG ((EFI_D_ERROR, "Fail to stop No.%d multi-lun child handle when opening blockio\n", (UINT32)Index)); continue; @@ -1036,7 +1036,7 @@ USBMassDriverBindingStop ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Fail to uninstall Block I/O Protocol and Device Path Protocol, so re-open USB I/O Protocol by child. // @@ -1058,7 +1058,7 @@ USBMassDriverBindingStop ( if (((Index + 1) == NumberOfChildren) && AllChildrenStopped) { UsbMass->Transport->CleanUp (UsbMass->Context); } - FreePool (UsbMass); + FreePool(UsbMass); } } @@ -1102,7 +1102,7 @@ USBMassStorageEntryPoint ( &gUsbMassStorageComponentName, &gUsbMassStorageComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/ComponentName.c b/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/ComponentName.c index efad274fd..22a256e75 100644 --- a/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/ComponentName.c @@ -175,7 +175,7 @@ UsbMouseAbsolutePointerComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiUsbIoProtocolGuid, @@ -201,7 +201,7 @@ UsbMouseAbsolutePointerComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c b/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c index 8953e7031..4fc2adeeb 100644 --- a/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c +++ b/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c @@ -46,7 +46,7 @@ USBMouseAbsolutePointerDriverBindingEntryPoint ( &gUsbMouseAbsolutePointerComponentName, &gUsbMouseAbsolutePointerComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -82,7 +82,7 @@ USBMouseAbsolutePointerDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -157,7 +157,7 @@ USBMouseAbsolutePointerDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit1; } @@ -179,7 +179,7 @@ USBMouseAbsolutePointerDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -248,7 +248,7 @@ USBMouseAbsolutePointerDriverBindingStart ( ); Status = InitializeUsbMouseDevice (UsbMouseAbsolutePointerDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Fail to initialize USB mouse device. // @@ -275,7 +275,7 @@ USBMouseAbsolutePointerDriverBindingStart ( UsbMouseAbsolutePointerDevice, &((UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol).WaitForInput) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -286,7 +286,7 @@ USBMouseAbsolutePointerDriverBindingStart ( &UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -318,7 +318,7 @@ USBMouseAbsolutePointerDriverBindingStart ( UsbMouseAbsolutePointerDevice ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If submit error, uninstall that interface // @@ -353,7 +353,7 @@ USBMouseAbsolutePointerDriverBindingStart ( // Error handler // ErrorExit: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiUsbIoProtocolGuid, @@ -366,7 +366,7 @@ ErrorExit: gBS->CloseEvent ((UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol).WaitForInput); } - FreePool (UsbMouseAbsolutePointerDevice); + FreePool(UsbMouseAbsolutePointerDevice); UsbMouseAbsolutePointerDevice = NULL; } } @@ -414,7 +414,7 @@ USBMouseAbsolutePointerDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -449,7 +449,7 @@ USBMouseAbsolutePointerDriverBindingStop ( &gEfiAbsolutePointerProtocolGuid, &UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -474,7 +474,7 @@ USBMouseAbsolutePointerDriverBindingStop ( FreeUnicodeStringTable (UsbMouseAbsolutePointerDevice->ControllerNameTable); } - FreePool (UsbMouseAbsolutePointerDevice); + FreePool(UsbMouseAbsolutePointerDevice); return EFI_SUCCESS; @@ -506,7 +506,7 @@ IsUsbMouse ( &InterfaceDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -562,7 +562,7 @@ InitializeUsbMouseDevice ( UsbIo, &ConfigDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -583,8 +583,8 @@ InitializeUsbMouseDevice ( Buf, &TransferResult ); - if (EFI_ERROR (Status)) { - FreePool (Buf); + if (EFI_ERROR(Status)) { + FreePool(Buf); return Status; } @@ -617,7 +617,7 @@ InitializeUsbMouseDevice ( } if (MouseHidDesc == NULL) { - FreePool (Buf); + FreePool(Buf); return EFI_UNSUPPORTED; } @@ -625,7 +625,7 @@ InitializeUsbMouseDevice ( // Get report descriptor // if (MouseHidDesc->HidClassDesc[0].DescriptorType != USB_DESC_TYPE_REPORT) { - FreePool (Buf); + FreePool(Buf); return EFI_UNSUPPORTED; } @@ -639,9 +639,9 @@ InitializeUsbMouseDevice ( ReportDesc ); - if (EFI_ERROR (Status)) { - FreePool (Buf); - FreePool (ReportDesc); + if (EFI_ERROR(Status)) { + FreePool(Buf); + FreePool(ReportDesc); return Status; } @@ -654,9 +654,9 @@ InitializeUsbMouseDevice ( MouseHidDesc->HidClassDesc[0].DescriptorLength ); - if (EFI_ERROR (Status)) { - FreePool (Buf); - FreePool (ReportDesc); + if (EFI_ERROR(Status)) { + FreePool(Buf); + FreePool(ReportDesc); return Status; } @@ -692,15 +692,15 @@ InitializeUsbMouseDevice ( BOOT_PROTOCOL ); - if (EFI_ERROR (Status)) { - FreePool (Buf); - FreePool (ReportDesc); + if (EFI_ERROR(Status)) { + FreePool(Buf); + FreePool(ReportDesc); return Status; } } - FreePool (Buf); - FreePool (ReportDesc); + FreePool(Buf); + FreePool(ReportDesc); // // Create event for delayed recovery, which deals with device error. diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/ComponentName.c b/MdeModulePkg/Bus/Usb/UsbMouseDxe/ComponentName.c index 7f4b3e821..216746453 100644 --- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/ComponentName.c +++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/ComponentName.c @@ -175,7 +175,7 @@ UsbMouseComponentNameGetControllerName ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiUsbIoProtocolGuid, @@ -201,7 +201,7 @@ UsbMouseComponentNameGetControllerName ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c index 677815a8a..d1e295b94 100644 --- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c +++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c @@ -46,7 +46,7 @@ USBMouseDriverBindingEntryPoint ( &gUsbMouseComponentName, &gUsbMouseComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -82,7 +82,7 @@ USBMouseDriverBindingSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -157,7 +157,7 @@ USBMouseDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit1; } @@ -179,7 +179,7 @@ USBMouseDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -248,7 +248,7 @@ USBMouseDriverBindingStart ( ); Status = InitializeUsbMouseDevice (UsbMouseDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Fail to initialize USB mouse device. // @@ -275,7 +275,7 @@ USBMouseDriverBindingStart ( UsbMouseDevice, &((UsbMouseDevice->SimplePointerProtocol).WaitForInput) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -286,7 +286,7 @@ USBMouseDriverBindingStart ( &UsbMouseDevice->SimplePointerProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -318,7 +318,7 @@ USBMouseDriverBindingStart ( UsbMouseDevice ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If submit error, uninstall that interface // @@ -354,7 +354,7 @@ USBMouseDriverBindingStart ( // Error handler // ErrorExit: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiUsbIoProtocolGuid, @@ -367,7 +367,7 @@ ErrorExit: gBS->CloseEvent ((UsbMouseDevice->SimplePointerProtocol).WaitForInput); } - FreePool (UsbMouseDevice); + FreePool(UsbMouseDevice); UsbMouseDevice = NULL; } } @@ -414,7 +414,7 @@ USBMouseDriverBindingStop ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -449,7 +449,7 @@ USBMouseDriverBindingStop ( &gEfiSimplePointerProtocolGuid, &UsbMouseDevice->SimplePointerProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -474,7 +474,7 @@ USBMouseDriverBindingStop ( FreeUnicodeStringTable (UsbMouseDevice->ControllerNameTable); } - FreePool (UsbMouseDevice); + FreePool(UsbMouseDevice); return EFI_SUCCESS; @@ -506,7 +506,7 @@ IsUsbMouse ( &InterfaceDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -562,7 +562,7 @@ InitializeUsbMouseDevice ( UsbIo, &ConfigDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -583,8 +583,8 @@ InitializeUsbMouseDevice ( Buf, &TransferResult ); - if (EFI_ERROR (Status)) { - FreePool (Buf); + if (EFI_ERROR(Status)) { + FreePool(Buf); return Status; } @@ -617,7 +617,7 @@ InitializeUsbMouseDevice ( } if (MouseHidDesc == NULL) { - FreePool (Buf); + FreePool(Buf); return EFI_UNSUPPORTED; } @@ -625,7 +625,7 @@ InitializeUsbMouseDevice ( // Get report descriptor // if (MouseHidDesc->HidClassDesc[0].DescriptorType != USB_DESC_TYPE_REPORT) { - FreePool (Buf); + FreePool(Buf); return EFI_UNSUPPORTED; } @@ -639,9 +639,9 @@ InitializeUsbMouseDevice ( ReportDesc ); - if (EFI_ERROR (Status)) { - FreePool (Buf); - FreePool (ReportDesc); + if (EFI_ERROR(Status)) { + FreePool(Buf); + FreePool(ReportDesc); return Status; } @@ -654,9 +654,9 @@ InitializeUsbMouseDevice ( MouseHidDesc->HidClassDesc[0].DescriptorLength ); - if (EFI_ERROR (Status)) { - FreePool (Buf); - FreePool (ReportDesc); + if (EFI_ERROR(Status)) { + FreePool(Buf); + FreePool(ReportDesc); return Status; } @@ -690,15 +690,15 @@ InitializeUsbMouseDevice ( BOOT_PROTOCOL ); - if (EFI_ERROR (Status)) { - FreePool (Buf); - FreePool (ReportDesc); + if (EFI_ERROR(Status)) { + FreePool(Buf); + FreePool(ReportDesc); return Status; } } - FreePool (Buf); - FreePool (ReportDesc); + FreePool(Buf); + FreePool(ReportDesc); // // Create event for delayed recovery, which deals with device error. diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c index 89e540ba7..7c98d0e8e 100644 --- a/MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c +++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c @@ -62,7 +62,7 @@ GrowDepexStack ( // // Free The Old Stack // - FreePool (mDepexEvaluationStack); + FreePool(mDepexEvaluationStack); } // @@ -101,7 +101,7 @@ PushBool ( // Grow the stack // Status = GrowDepexStack (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -233,7 +233,7 @@ CoreIsSchedulable ( // Status = CoreAllEfiServicesAvailable (); DEBUG ((DEBUG_DISPATCH, " All UEFI Services Available = ")); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, "FALSE\n RESULT = FALSE\n")); return FALSE; } @@ -299,7 +299,7 @@ CoreIsSchedulable ( Status = CoreLocateProtocol (&DriverGuid, NULL, &Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = FALSE\n", &DriverGuid)); Status = PushBool (FALSE); } else { @@ -307,7 +307,7 @@ CoreIsSchedulable ( *Iterator = EFI_DEP_REPLACE_TRUE; Status = PushBool (TRUE); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -318,19 +318,19 @@ CoreIsSchedulable ( case EFI_DEP_AND: DEBUG ((DEBUG_DISPATCH, " AND\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PopBool (&Operator2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PushBool ((BOOLEAN)(Operator && Operator2)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -339,19 +339,19 @@ CoreIsSchedulable ( case EFI_DEP_OR: DEBUG ((DEBUG_DISPATCH, " OR\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PopBool (&Operator2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PushBool ((BOOLEAN)(Operator || Operator2)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -360,13 +360,13 @@ CoreIsSchedulable ( case EFI_DEP_NOT: DEBUG ((DEBUG_DISPATCH, " NOT\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PushBool ((BOOLEAN)(!Operator)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -375,7 +375,7 @@ CoreIsSchedulable ( case EFI_DEP_TRUE: DEBUG ((DEBUG_DISPATCH, " TRUE\n")); Status = PushBool (TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -384,7 +384,7 @@ CoreIsSchedulable ( case EFI_DEP_FALSE: DEBUG ((DEBUG_DISPATCH, " FALSE\n")); Status = PushBool (FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -393,7 +393,7 @@ CoreIsSchedulable ( case EFI_DEP_END: DEBUG ((DEBUG_DISPATCH, " END\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -405,7 +405,7 @@ CoreIsSchedulable ( DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = TRUE\n", &DriverGuid)); Status = PushBool (TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c index c310b40b5..2f7fdbd45 100644 --- a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c @@ -260,7 +260,7 @@ CoreGetDepexSectionAndPreProccess ( (UINTN *)&DriverEntry->DepexSize, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_PROTOCOL_ERROR) { // // The section extraction protocol failed so set protocol error flag @@ -431,7 +431,7 @@ CoreDispatcher ( &gEfiEventDxeDispatchGuid, &DxeDispatchEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -467,7 +467,7 @@ CoreDispatcher ( // // Update the driver state to reflect that it's been loaded // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { CoreAcquireDispatcherLock (); if (Status == EFI_SECURITY_VIOLATION) { @@ -538,7 +538,7 @@ CoreDispatcher ( // so that SMM Dispatcher get chance to dispatch SMM Drivers which depend // on UEFI protocols // - if (!EFI_ERROR (ReturnStatus)) { + if (!EFI_ERROR(ReturnStatus)) { CoreSignalEvent (DxeDispatchEvent); } @@ -720,13 +720,13 @@ FvIsBeingProcesssed ( // FvNameGuidIsFound = FALSE; Status = CoreHandleProtocol (FvHandle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get the full FV header based on FVB protocol. // ASSERT (Fvb != NULL); Status = GetFwVolHeader (Fvb, &FwVolHeader); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (FwVolHeader != NULL); if (VerifyFvHeaderChecksum (FwVolHeader) && FwVolHeader->ExtHeaderOffset != 0) { ExtHeaderOffset = (UINT32) FwVolHeader->ExtHeaderOffset; @@ -754,11 +754,11 @@ FvIsBeingProcesssed ( // Read FvNameGuid from FV extension header. // Status = ReadFvbData (Fvb, &LbaIndex, &LbaOffset, sizeof (FvNameGuid), (UINT8 *) &FvNameGuid); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FvNameGuidIsFound = TRUE; } } - CoreFreePool (FwVolHeader); + CoreFreePool(FwVolHeader); } } @@ -818,7 +818,7 @@ CoreFvToDevicePath ( // Remember the device path of the FV // Status = CoreHandleProtocol (FvHandle, &gEfiDevicePathProtocolGuid, (VOID **)&FvDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FileNameDevicePath = NULL; } else { // @@ -1048,7 +1048,7 @@ CoreProcessFvImageFile ( &BufferSize, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Evaluate the authentication status of the Firmware Volume through // Security Architectural Protocol @@ -1061,7 +1061,7 @@ CoreProcessFvImageFile ( FvFileDevicePath ); if (FvFileDevicePath != NULL) { - FreePool (FvFileDevicePath); + FreePool(FvFileDevicePath); } if (Status != EFI_SUCCESS) { @@ -1069,7 +1069,7 @@ CoreProcessFvImageFile ( // Security check failed. The firmware volume should not be used for any purpose. // if (Buffer != NULL) { - FreePool (Buffer); + FreePool(Buffer); } break; } @@ -1113,7 +1113,7 @@ CoreProcessFvImageFile ( // AlignedBuffer = AllocateAlignedPages (EFI_SIZE_TO_PAGES (BufferSize), (UINTN) FvAlignment); if (AlignedBuffer == NULL) { - FreePool (Buffer); + FreePool(Buffer); Status = EFI_OUT_OF_RESOURCES; break; } else { @@ -1134,7 +1134,7 @@ CoreProcessFvImageFile ( CopyMem (AlignedBuffer, Buffer, BufferSize); } FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) AlignedBuffer; - FreePool (Buffer); + FreePool(Buffer); Buffer = NULL; } } @@ -1151,12 +1151,12 @@ CoreProcessFvImageFile ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // ReadSection or Produce FVB failed, Free data buffer // if (Buffer != NULL) { - FreePool (Buffer); + FreePool(Buffer); } if (AlignedBuffer != NULL) { @@ -1236,7 +1236,7 @@ CoreFwVolEventProtocolNotify ( &BufferSize, &FvHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If no more notification events exit // @@ -1263,7 +1263,7 @@ CoreFwVolEventProtocolNotify ( } Status = CoreHandleProtocol (FvHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv); - if (EFI_ERROR (Status) || Fv == NULL) { + if (EFI_ERROR(Status) || Fv == NULL) { // // FvHandle must have Firmware Volume2 protocol thus we should never get here. // @@ -1272,7 +1272,7 @@ CoreFwVolEventProtocolNotify ( } Status = CoreHandleProtocol (FvHandle, &gEfiDevicePathProtocolGuid, (VOID **)&FvDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The Firmware volume doesn't have device path, can't be dispatched. // @@ -1300,7 +1300,7 @@ CoreFwVolEventProtocolNotify ( &Attributes, &Size ); - if (!EFI_ERROR (GetNextFileStatus)) { + if (!EFI_ERROR(GetNextFileStatus)) { if (Type == EFI_FV_FILETYPE_DXE_CORE) { // // If this is the DXE core fill in it's DevicePath & DeviceHandle @@ -1343,12 +1343,12 @@ CoreFwVolEventProtocolNotify ( &SizeOfBuffer, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If SMM depex section is found, this FV image is invalid to be supported. // ASSERT FALSE to report this FV image. // - FreePool (DepexBuffer); + FreePool(DepexBuffer); ASSERT (FALSE); } @@ -1366,7 +1366,7 @@ CoreFwVolEventProtocolNotify ( &SizeOfBuffer, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If no depex section, produce a firmware volume block protocol for it so it gets dispatched from. // @@ -1375,7 +1375,7 @@ CoreFwVolEventProtocolNotify ( // // If depex section is found, this FV image will be dispatched until its depex is evaluated to TRUE. // - FreePool (DepexBuffer); + FreePool(DepexBuffer); CoreAddToDriverList (Fv, FvHandle, &NameGuid, Type); } } else { @@ -1385,7 +1385,7 @@ CoreFwVolEventProtocolNotify ( CoreAddToDriverList (Fv, FvHandle, &NameGuid, Type); } } - } while (!EFI_ERROR (GetNextFileStatus)); + } while (!EFI_ERROR(GetNextFileStatus)); } // @@ -1401,7 +1401,7 @@ CoreFwVolEventProtocolNotify ( &SizeOfBuffer, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AprioriEntryCount = SizeOfBuffer / sizeof (EFI_GUID); } else { AprioriEntryCount = 0; @@ -1433,7 +1433,7 @@ CoreFwVolEventProtocolNotify ( // // Free data allocated by Fv->ReadSection () // - CoreFreePool (AprioriFile); + CoreFreePool(AprioriFile); } } diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMain.h index 6a6485273..eb8337dba 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.h +++ b/MdeModulePkg/Core/Dxe/DxeMain.h @@ -1371,7 +1371,7 @@ CoreInternalAllocatePool ( **/ EFI_STATUS EFIAPI -CoreFreePool ( +CoreFreePool( IN VOID *Buffer ); @@ -1387,7 +1387,7 @@ CoreFreePool ( **/ EFI_STATUS EFIAPI -CoreInternalFreePool ( +CoreInternalFreePool( IN VOID *Buffer, OUT EFI_MEMORY_TYPE *PoolType OPTIONAL ); diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c index 52284e9c6..d6fc2c768 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -253,7 +253,7 @@ DxeMain ( VectorInfoList = (EFI_VECTOR_HANDOFF_INFO *) (GET_GUID_HOB_DATA(GuidHob)); } Status = InitializeCpuExceptionHandlersEx (VectorInfoList, NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Initialize Debug Agent to support source level debug in DXE phase @@ -283,13 +283,13 @@ DxeMain ( // Start the Image Services. // Status = CoreInitializeImageServices (HobStart); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Initialize the Global Coherency Domain Services // Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Call constructor for all libraries @@ -317,19 +317,19 @@ DxeMain ( // Install the DXE Services Table into the EFI System Tables's Configuration Table // Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, gDxeCoreDS); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install the HOB List into the EFI System Tables's Configuration Table // Status = CoreInstallConfigurationTable (&gEfiHobListGuid, HobStart); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install Memory Type Information Table into the EFI System Tables's Configuration Table // Status = CoreInstallConfigurationTable (&gEfiMemoryTypeInformationGuid, &gMemoryTypeInformation); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // If Loading modules At fixed address feature is enabled, install Load moduels at fixed address @@ -338,7 +338,7 @@ DxeMain ( // if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { Status = CoreInstallConfigurationTable (&gLoadFixedAddressConfigurationTableGuid, &gLoadModuleAtFixAddressConfigurationTable); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // // Report Status Code here for DXE_ENTRY_POINT once it is available @@ -419,7 +419,7 @@ DxeMain ( // Initialize the Event Services // Status = CoreInitializeEventServices (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); MemoryProfileInstallProtocol (); @@ -443,7 +443,7 @@ DxeMain ( VectorInfo = AllocateCopyPool (sizeof (EFI_VECTOR_HANDOFF_INFO) * Index, (VOID *) VectorInfoList); ASSERT (VectorInfo != NULL); Status = CoreInstallConfigurationTable (&gEfiVectorHandoffTableGuid, (VOID *) VectorInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // @@ -466,7 +466,7 @@ DxeMain ( &gEfiDecompressProtocolGuid, &gEfiDecompress, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register for the GUIDs of the Architectural Protocols, so the rest of the @@ -479,16 +479,16 @@ DxeMain ( // Produce Firmware Volume Protocols, one for each FV in the HOB list. // Status = FwVolBlockDriverInit (gDxeCoreImageHandle, gDxeCoreST); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = FwVolDriverInit (gDxeCoreImageHandle, gDxeCoreST); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Produce the Section Extraction Protocol // Status = InitializeSectionExtraction (gDxeCoreImageHandle, gDxeCoreST); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Initialize the DXE Dispatcher @@ -528,7 +528,7 @@ DxeMain ( (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_EC_NO_ARCH) ); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Report Status code before transfer control to BDS @@ -750,7 +750,7 @@ CoreExitBootServices ( // Terminate memory services if the MapKey matches // Status = CoreTerminateMemoryMap (MapKey); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Notify other drivers that ExitBootServices fail // @@ -927,7 +927,7 @@ DxeMainUefiDecompress ( } Status = UefiDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c index 29a55d02e..f80c54ab2 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c @@ -127,7 +127,7 @@ GenericProtocolNotify ( // See if the expected protocol is present in the handle database // Status = CoreLocateProtocol (Entry->ProtocolGuid, Entry->Registration, &Protocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } diff --git a/MdeModulePkg/Core/Dxe/Event/Event.c b/MdeModulePkg/Core/Dxe/Event/Event.c index 21db38aaf..b47c2776b 100644 --- a/MdeModulePkg/Core/Dxe/Event/Event.c +++ b/MdeModulePkg/Core/Dxe/Event/Event.c @@ -399,7 +399,7 @@ CoreCreateEventInternal ( break; } } - if(EFI_ERROR (Status)) { + if(EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -768,8 +768,8 @@ CoreCloseEvent ( // clear the Signature of Event before free pool. // Event->Signature = 0; - Status = CoreFreePool (Event); - ASSERT_EFI_ERROR (Status); + Status = CoreFreePool(Event); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Core/Dxe/Event/Timer.c b/MdeModulePkg/Core/Dxe/Event/Timer.c index 7a94712d8..0af475a4f 100644 --- a/MdeModulePkg/Core/Dxe/Event/Timer.c +++ b/MdeModulePkg/Core/Dxe/Event/Timer.c @@ -174,7 +174,7 @@ CoreInitializeTimer ( NULL, &mEfiCheckTimerEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } diff --git a/MdeModulePkg/Core/Dxe/Event/Tpl.c b/MdeModulePkg/Core/Dxe/Event/Tpl.c index 5ff8eb55b..f12433ba9 100644 --- a/MdeModulePkg/Core/Dxe/Event/Tpl.c +++ b/MdeModulePkg/Core/Dxe/Event/Tpl.c @@ -35,7 +35,7 @@ CoreSetInterruptState ( return; } Status = gSmmBase2->InSmm (gSmmBase2, &InSmm); - if (!EFI_ERROR (Status) && !InSmm) { + if (!EFI_ERROR(Status) && !InSmm) { gCpu->EnableInterrupt(gCpu); } } diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c index e2f58c4d8..81296e18d 100644 --- a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c @@ -105,7 +105,7 @@ ReadFvbData ( *StartLba = *StartLba + 1; while (DataSize > 0) { Status = Fvb->GetBlockSize (Fvb, *StartLba, &BlockSize, &NumberOfBlocks); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -115,7 +115,7 @@ ReadFvbData ( BlockIndex = 0; while (BlockIndex < NumberOfBlocks && DataSize >= BlockSize) { Status = Fvb->Read (Fvb, *StartLba + BlockIndex, 0, &BlockSize, Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Data += BlockSize; @@ -141,7 +141,7 @@ ReadFvbData ( // if (DataSize > 0) { Status = Fvb->Read (Fvb, *StartLba + BlockIndex, 0, &DataSize, Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -191,7 +191,7 @@ GetFwVolHeader ( Offset = 0; FvhLength = sizeof (EFI_FIRMWARE_VOLUME_HEADER); Status = ReadFvbData (Fvb, &StartLba, &Offset, FvhLength, (UINT8 *)&TempFvh); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -230,11 +230,11 @@ GetFwVolHeader ( FvhLength = TempFvh.HeaderLength - sizeof (EFI_FIRMWARE_VOLUME_HEADER); Buffer = (UINT8 *)*FwVolHeader + sizeof (EFI_FIRMWARE_VOLUME_HEADER); Status = ReadFvbData (Fvb, &StartLba, &Offset, FvhLength, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Read failed so free buffer // - CoreFreePool (*FwVolHeader); + CoreFreePool(*FwVolHeader); } return Status; @@ -274,10 +274,10 @@ FreeFvDeviceResource ( // // Free the cached file buffer. // - CoreFreePool (FfsFileEntry->FfsHeader); + CoreFreePool(FfsFileEntry->FfsHeader); } - CoreFreePool (FfsFileEntry); + CoreFreePool(FfsFileEntry); FfsFileEntry = (FFS_FILE_LIST_ENTRY *) NextEntry; } @@ -286,13 +286,13 @@ FreeFvDeviceResource ( // // Free the cached FV buffer. // - CoreFreePool (FvDevice->CachedFv); + CoreFreePool(FvDevice->CachedFv); } // // Free Volume Header // - CoreFreePool (FvDevice->FwVolHeader); + CoreFreePool(FvDevice->FwVolHeader); return; } @@ -341,7 +341,7 @@ FvCheck ( FwVolHeader = FvDevice->FwVolHeader; Status = Fvb->GetAttributes (Fvb, &FvbAttributes); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -350,7 +350,7 @@ FvCheck ( FvDevice->IsMemoryMapped = TRUE; Status = Fvb->GetPhysicalAddress (Fvb, &PhysicalAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -396,7 +396,7 @@ FvCheck ( // // Not check EFI_BAD_BUFFER_SIZE, for Size = BlockMap->Length // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -442,7 +442,7 @@ FvCheck ( while (((UINTN) FfsHeader >= (UINTN) FvDevice->CachedFv) && ((UINTN) FfsHeader <= (UINTN) ((UINTN) TopFvAddress - sizeof (EFI_FFS_FILE_HEADER)))) { if (FileCached) { - CoreFreePool (CacheFfsHeader); + CoreFreePool(CacheFfsHeader); FileCached = FALSE; } @@ -553,9 +553,9 @@ FvCheck ( } Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (FileCached) { - CoreFreePool (CacheFfsHeader); + CoreFreePool(CacheFfsHeader); FileCached = FALSE; } FreeFvDeviceResource (FvDevice); @@ -613,7 +613,7 @@ NotifyFwVolBlock ( break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -621,20 +621,20 @@ NotifyFwVolBlock ( // Get the FirmwareVolumeBlock protocol on that handle // Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (Fvb != NULL); // // Make sure the Fv Header is O.K. // Status = GetFwVolHeader (Fvb, &FwVolHeader); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } ASSERT (FwVolHeader != NULL); if (!VerifyFvHeaderChecksum (FwVolHeader)) { - CoreFreePool (FwVolHeader); + CoreFreePool(FwVolHeader); continue; } @@ -642,7 +642,7 @@ NotifyFwVolBlock ( // Check if there is an FV protocol already installed in that handle // Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update Fv to use a new Fvb // @@ -673,7 +673,7 @@ NotifyFwVolBlock ( // FvDevice->AuthenticationStatus = GetFvbAuthenticationStatus (Fvb); - if (!EFI_ERROR (FvCheck (FvDevice))) { + if (!EFI_ERROR(FvCheck (FvDevice))) { // // Install an New FV protocol on the existing handle // @@ -683,12 +683,12 @@ NotifyFwVolBlock ( EFI_NATIVE_INTERFACE, &FvDevice->Fv ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else { // // Free FvDevice Buffer for the corrupt FV image. // - CoreFreePool (FvDevice); + CoreFreePool(FvDevice); } } } diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c b/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c index 2861cbf67..999864ecc 100644 --- a/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c +++ b/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c @@ -132,7 +132,7 @@ FvGetNextFile ( FvDevice = FV_DEVICE_FROM_THIS (This); Status = FvGetVolumeAttributes (This, &FvAttributes); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ return Status; } @@ -311,7 +311,7 @@ FvReadFile ( &LocalAttributes, &FileSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } } while (!CompareGuid (&SearchNameGuid, NameGuid)); @@ -474,7 +474,7 @@ FvReadFileSection ( // FfsEntry = (FFS_FILE_LIST_ENTRY *) FvDevice->LastKey; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (IS_FFS_FILE2 (FfsEntry->FfsHeader)) { @@ -499,7 +499,7 @@ FvReadFileSection ( FileBuffer, &FfsEntry->StreamHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -518,7 +518,7 @@ FvReadFileSection ( FvDevice->IsFfs3Fv ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Inherit the authentication status. // diff --git a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c index 95174c1e4..7808f0426 100644 --- a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c +++ b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c @@ -528,12 +528,12 @@ ProduceFVBProtocolOnBuffer ( // Second, allocate the cache // if (FvbDev->NumBlocks >= (MAX_ADDRESS / sizeof (LBA_CACHE))) { - CoreFreePool (FvbDev); + CoreFreePool(FvbDev); return EFI_OUT_OF_RESOURCES; } FvbDev->LbaCache = AllocatePool (FvbDev->NumBlocks * sizeof (LBA_CACHE)); if (FvbDev->LbaCache == NULL) { - CoreFreePool (FvbDev); + CoreFreePool(FvbDev); return EFI_OUT_OF_RESOURCES; } @@ -561,7 +561,7 @@ ProduceFVBProtocolOnBuffer ( // FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate); if (FvbDev->DevicePath == NULL) { - FreePool (FvbDev); + FreePool(FvbDev); return EFI_OUT_OF_RESOURCES; } ((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.StartingAddress = BaseAddress; @@ -572,7 +572,7 @@ ProduceFVBProtocolOnBuffer ( // FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); if (FvbDev->DevicePath == NULL) { - FreePool (FvbDev); + FreePool(FvbDev); return EFI_OUT_OF_RESOURCES; } CopyGuid ( diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c index 74f3b1b9f..6b3d1e8f8 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -173,7 +173,7 @@ CoreDumpGcdMemorySpaceMap ( )); } DEBUG ((DEBUG_GCD, "\n")); - FreePool (MemorySpaceMap); + FreePool(MemorySpaceMap); ); } @@ -214,7 +214,7 @@ CoreDumpGcdIoSpaceMap ( )); } DEBUG ((DEBUG_GCD, "\n")); - FreePool (IoSpaceMap); + FreePool(IoSpaceMap); ); } @@ -400,7 +400,7 @@ CoreAllocateGcdMapEntry ( *BottomEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY)); mOnGuarding = FALSE; if (*BottomEntry == NULL) { - CoreFreePool (*TopEntry); + CoreFreePool(*TopEntry); return EFI_OUT_OF_RESOURCES; } @@ -523,7 +523,7 @@ CoreMergeGcdMapEntry ( Entry->BaseAddress = AdjacentEntry->BaseAddress; } RemoveEntryList (AdjacentLink); - CoreFreePool (AdjacentEntry); + CoreFreePool(AdjacentEntry); return EFI_SUCCESS; } @@ -553,10 +553,10 @@ CoreCleanupGcdMapEntry ( LIST_ENTRY *Link; if (TopEntry->Signature == 0) { - CoreFreePool (TopEntry); + CoreFreePool(TopEntry); } if (BottomEntry->Signature == 0) { - CoreFreePool (BottomEntry); + CoreFreePool(BottomEntry); } Link = StartLink; @@ -750,7 +750,7 @@ CoreConvertSpace ( // Search for the list of descriptors that cover the range BaseAddress to BaseAddress+Length // Status = CoreSearchGcdMapEntry (BaseAddress, Length, &StartLink, &EndLink, Map); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto Done; @@ -854,7 +854,7 @@ CoreConvertSpace ( // Allocate work space to perform this operation // Status = CoreAllocateGcdMapEntry (&TopEntry, &BottomEntry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto Done; } @@ -894,9 +894,9 @@ CoreConvertSpace ( CpuArchAttributes ); } - if (EFI_ERROR (Status)) { - CoreFreePool (TopEntry); - CoreFreePool (BottomEntry); + if (EFI_ERROR(Status)) { + CoreFreePool(TopEntry); + CoreFreePool(BottomEntry); goto Done; } } @@ -1138,7 +1138,7 @@ CoreAllocateSpace ( // Search for the list of descriptors that cover the range BaseAddress to BaseAddress+Length // Status = CoreSearchGcdMapEntry (*BaseAddress, Length, &StartLink, &EndLink, Map); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; goto Done; } @@ -1152,7 +1152,7 @@ CoreAllocateSpace ( Entry = CR (Link, EFI_GCD_MAP_ENTRY, Link, EFI_GCD_MAP_SIGNATURE); Link = Link->ForwardLink; Status = CoreAllocateSpaceCheckEntry (Operation, Entry, GcdMemoryType, GcdIoType); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -1191,7 +1191,7 @@ CoreAllocateSpace ( } Status = CoreAllocateSpaceCheckEntry (Operation, Entry, GcdMemoryType, GcdIoType); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -1222,7 +1222,7 @@ CoreAllocateSpace ( // Search for the list of descriptors that cover the range BaseAddress to BaseAddress+Length // Status = CoreSearchGcdMapEntry (*BaseAddress, Length, &StartLink, &EndLink, Map); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; goto Done; } @@ -1237,7 +1237,7 @@ CoreAllocateSpace ( while (SubLink != EndLink->ForwardLink) { Entry = CR (SubLink, EFI_GCD_MAP_ENTRY, Link, EFI_GCD_MAP_SIGNATURE); Status = CoreAllocateSpaceCheckEntry (Operation, Entry, GcdMemoryType, GcdIoType); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Link = SubLink; Found = FALSE; break; @@ -1258,7 +1258,7 @@ CoreAllocateSpace ( // Allocate work space to perform this operation // Status = CoreAllocateGcdMapEntry (&TopEntry, &BottomEntry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto Done; } @@ -1283,7 +1283,7 @@ CoreAllocateSpace ( Done: DEBUG ((DEBUG_GCD, " Status = %r", Status)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_GCD, " (BaseAddress = %016lx)", *BaseAddress)); } DEBUG ((DEBUG_GCD, "\n")); @@ -1420,7 +1420,7 @@ CoreAddMemorySpace ( Status = CoreInternalAddMemorySpace (GcdMemoryType, BaseAddress, Length, Capabilities); - if (!EFI_ERROR (Status) && ((GcdMemoryType == EfiGcdMemoryTypeSystemMemory) || (GcdMemoryType == EfiGcdMemoryTypeMoreReliable))) { + if (!EFI_ERROR(Status) && ((GcdMemoryType == EfiGcdMemoryTypeSystemMemory) || (GcdMemoryType == EfiGcdMemoryTypeMoreReliable))) { PageBaseAddress = PageAlignAddress (BaseAddress); PageLength = PageAlignLength (BaseAddress + Length - PageBaseAddress); @@ -1435,7 +1435,7 @@ CoreAddMemorySpace ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CoreAddMemoryDescriptor ( EfiConventionalMemory, PageBaseAddress, @@ -1454,7 +1454,7 @@ CoreAddMemorySpace ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CoreAddMemoryDescriptor ( EfiConventionalMemory, PageBaseAddress, @@ -1573,7 +1573,7 @@ CoreGetMemorySpaceDescriptor ( // Search for the list of descriptors that contain BaseAddress // Status = CoreSearchGcdMapEntry (BaseAddress, 1, &StartLink, &EndLink, &mGcdMemorySpaceMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; } else { ASSERT (StartLink != NULL && EndLink != NULL); @@ -1743,7 +1743,7 @@ CoreGetMemorySpaceMap ( // last time. // if (*MemorySpaceMap != NULL) { - FreePool (*MemorySpaceMap); + FreePool(*MemorySpaceMap); } *MemorySpaceMap = AllocatePool (DescriptorCount * @@ -1960,7 +1960,7 @@ CoreGetIoSpaceDescriptor ( // Search for the list of descriptors that contain BaseAddress // Status = CoreSearchGcdMapEntry (BaseAddress, 1, &StartLink, &EndLink, &mGcdIoSpaceMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; } else { ASSERT (StartLink != NULL && EndLink != NULL); @@ -2530,7 +2530,7 @@ CoreInitializeGcdServices ( // Allocate first memory region from the GCD by the DXE core // Status = CoreGetMemorySpaceDescriptor (MemoryBaseAddress, &Descriptor); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT ((Descriptor.GcdMemoryType == EfiGcdMemoryTypeSystemMemory) || (Descriptor.GcdMemoryType == EfiGcdMemoryTypeMoreReliable)); Status = CoreAllocateMemorySpace ( @@ -2553,7 +2553,7 @@ CoreInitializeGcdServices ( MemoryHob = Hob.MemoryAllocation; BaseAddress = MemoryHob->AllocDescriptor.MemoryBaseAddress; Status = CoreGetMemorySpaceDescriptor (BaseAddress, &Descriptor); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = CoreAllocateMemorySpace ( EfiGcdAllocateAddress, Descriptor.GcdMemoryType, @@ -2563,7 +2563,7 @@ CoreInitializeGcdServices ( gDxeCoreImageHandle, NULL ); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && ((Descriptor.GcdMemoryType == EfiGcdMemoryTypeSystemMemory) || (Descriptor.GcdMemoryType == EfiGcdMemoryTypeMoreReliable))) { CoreAddMemoryDescriptor ( @@ -2676,7 +2676,7 @@ CoreInitializeGcdServices ( ); } - CoreFreePool (MemorySpaceMap); + CoreFreePool(MemorySpaceMap); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c index feabf12fa..6daa40563 100644 --- a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c +++ b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c @@ -69,7 +69,7 @@ CoreConnectController ( // Make sure ControllerHandle is valid // Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -78,7 +78,7 @@ CoreConnectController ( // Check whether the user has permission to start UEFI device drivers. // Status = CoreHandleProtocol (ControllerHandle, &gEfiDevicePathProtocolGuid, (VOID **)&HandleFilePath); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (HandleFilePath != NULL); FilePath = HandleFilePath; TempFilePath = NULL; @@ -99,9 +99,9 @@ CoreConnectController ( FALSE ); if (TempFilePath != NULL) { - FreePool (TempFilePath); + FreePool(TempFilePath); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -139,7 +139,7 @@ CoreConnectController ( // Free the aligned copy of RemainingDevicePath // if (AlignedRemainingDevicePath != NULL) { - CoreFreePool (AlignedRemainingDevicePath); + CoreFreePool(AlignedRemainingDevicePath); } // @@ -155,7 +155,7 @@ CoreConnectController ( // Make sure the DriverBindingHandle is valid // Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Release the protocol lock on the handle database // @@ -225,7 +225,7 @@ CoreConnectController ( // // Free the handle buffer of ControllerHandle's children // - CoreFreePool (ChildHandleBuffer); + CoreFreePool(ChildHandleBuffer); } return ReturnStatus; @@ -269,7 +269,7 @@ AddSortedDriverBindingProtocol ( // Make sure the DriverBindingHandle is valid // Status = CoreValidateHandle (DriverBindingHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -290,7 +290,7 @@ AddSortedDriverBindingProtocol ( &gEfiDriverBindingProtocolGuid, (VOID **) &DriverBinding ); - if (EFI_ERROR (Status) || DriverBinding == NULL) { + if (EFI_ERROR(Status) || DriverBinding == NULL) { continue; } @@ -323,7 +323,7 @@ AddSortedDriverBindingProtocol ( // // If DriverBindingHandle does not support the Driver Binding Protocol then return // - if (EFI_ERROR (Status) || DriverBinding == NULL) { + if (EFI_ERROR(Status) || DriverBinding == NULL) { return; } @@ -423,7 +423,7 @@ CoreConnectSingleController ( &DriverBindingHandleCount, &DriverBindingHandleBuffer ); - if (EFI_ERROR (Status) || (DriverBindingHandleCount == 0)) { + if (EFI_ERROR(Status) || (DriverBindingHandleCount == 0)) { return EFI_NOT_FOUND; } @@ -432,7 +432,7 @@ CoreConnectSingleController ( // SortedDriverBindingProtocols = AllocatePool (sizeof (VOID *) * DriverBindingHandleCount); if (SortedDriverBindingProtocols == NULL) { - CoreFreePool (DriverBindingHandleBuffer); + CoreFreePool(DriverBindingHandleBuffer); return EFI_OUT_OF_RESOURCES; } @@ -460,7 +460,7 @@ CoreConnectSingleController ( NULL, (VOID **) &PlatformDriverOverride ); - if (!EFI_ERROR (Status) && (PlatformDriverOverride != NULL)) { + if (!EFI_ERROR(Status) && (PlatformDriverOverride != NULL)) { DriverImageHandle = NULL; do { Status = PlatformDriverOverride->GetDriver ( @@ -468,7 +468,7 @@ CoreConnectSingleController ( ControllerHandle, &DriverImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AddSortedDriverBindingProtocol ( DriverImageHandle, &NumberOfSortedDriverBindingProtocols, @@ -478,7 +478,7 @@ CoreConnectSingleController ( TRUE ); } - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); } // @@ -493,7 +493,7 @@ CoreConnectSingleController ( &gEfiDriverFamilyOverrideProtocolGuid, (VOID **) &DriverFamilyOverride ); - if (!EFI_ERROR (Status) && (DriverFamilyOverride != NULL)) { + if (!EFI_ERROR(Status) && (DriverFamilyOverride != NULL)) { DriverFamilyOverrideVersion = DriverFamilyOverride->GetVersion (DriverFamilyOverride); if ((HighestIndex == DriverBindingHandleCount) || (DriverFamilyOverrideVersion > HighestVersion)) { HighestVersion = DriverFamilyOverrideVersion; @@ -524,14 +524,14 @@ CoreConnectSingleController ( &gEfiBusSpecificDriverOverrideProtocolGuid, (VOID **) &BusSpecificDriverOverride ); - if (!EFI_ERROR (Status) && (BusSpecificDriverOverride != NULL)) { + if (!EFI_ERROR(Status) && (BusSpecificDriverOverride != NULL)) { DriverImageHandle = NULL; do { Status = BusSpecificDriverOverride->GetDriver ( BusSpecificDriverOverride, &DriverImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AddSortedDriverBindingProtocol ( DriverImageHandle, &NumberOfSortedDriverBindingProtocols, @@ -541,7 +541,7 @@ CoreConnectSingleController ( TRUE ); } - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); } // @@ -562,7 +562,7 @@ CoreConnectSingleController ( // // Free the Driver Binding Handle Buffer // - CoreFreePool (DriverBindingHandleBuffer); + CoreFreePool(DriverBindingHandleBuffer); // // If the number of Driver Binding Protocols has increased since this function started, then return @@ -575,12 +575,12 @@ CoreConnectSingleController ( &NewDriverBindingHandleCount, &NewDriverBindingHandleBuffer ); - CoreFreePool (NewDriverBindingHandleBuffer); + CoreFreePool(NewDriverBindingHandleBuffer); if (NewDriverBindingHandleCount > DriverBindingHandleCount) { // // Free any buffers that were allocated with AllocatePool() // - CoreFreePool (SortedDriverBindingProtocols); + CoreFreePool(SortedDriverBindingProtocols); return EFI_NOT_READY; } @@ -628,7 +628,7 @@ CoreConnectSingleController ( RemainingDevicePath ); PERF_DRIVER_BINDING_SUPPORT_END (DriverBinding->DriverBindingHandle, ControllerHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SortedDriverBindingProtocols[Index] = NULL; DriverFound = TRUE; @@ -644,7 +644,7 @@ CoreConnectSingleController ( ); PERF_DRIVER_BINDING_START_END (DriverBinding->DriverBindingHandle, ControllerHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The driver was successfully started on ControllerHandle, so set a flag // @@ -658,7 +658,7 @@ CoreConnectSingleController ( // // Free any buffers that were allocated with AllocatePool() // - CoreFreePool (SortedDriverBindingProtocols); + CoreFreePool(SortedDriverBindingProtocols); // // If at least one driver was started on ControllerHandle, then return EFI_SUCCESS. @@ -747,7 +747,7 @@ CoreDisconnectController ( // Make sure ControllerHandle is valid // Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -756,7 +756,7 @@ CoreDisconnectController ( // if (ChildHandle != NULL) { Status = CoreValidateHandle (ChildHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -845,7 +845,7 @@ CoreDisconnectController ( &gEfiDriverBindingProtocolGuid, (VOID **)&DriverBinding ); - if (EFI_ERROR (Status) || DriverBinding == NULL) { + if (EFI_ERROR(Status) || DriverBinding == NULL) { Status = EFI_INVALID_PARAMETER; goto Done; } @@ -928,16 +928,16 @@ CoreDisconnectController ( Status = DriverBinding->Stop (DriverBinding, ControllerHandle, ChildrenToStop, ChildBuffer); } } - if (!EFI_ERROR (Status) && ((ChildHandle == NULL) || (ChildBufferCount == ChildrenToStop))) { + if (!EFI_ERROR(Status) && ((ChildHandle == NULL) || (ChildBufferCount == ChildrenToStop))) { Status = DriverBinding->Stop (DriverBinding, ControllerHandle, 0, NULL); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { StopCount++; } } if (ChildBuffer != NULL) { - CoreFreePool (ChildBuffer); + CoreFreePool(ChildBuffer); } } } @@ -951,7 +951,7 @@ CoreDisconnectController ( Done: if (DriverImageHandleBuffer != NULL) { - CoreFreePool (DriverImageHandleBuffer); + CoreFreePool(DriverImageHandleBuffer); } return Status; diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Hand/Handle.c index b2721b3ab..16b6a82b5 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c @@ -276,7 +276,7 @@ CoreUnregisterProtocolNotify ( do { Status = CoreUnregisterProtocolNotifyEvent (Event); - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); return EFI_SUCCESS; } @@ -372,7 +372,7 @@ CoreInstallProtocolInterfaceNotify ( if (*UserHandle != NULL) { Status = CoreHandleProtocol (*UserHandle, Protocol, (VOID **)&ExistingInterface); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } } @@ -429,7 +429,7 @@ CoreInstallProtocolInterfaceNotify ( InsertTailList (&gHandleList, &Handle->AllHandles); } else { Status = CoreValidateHandle (Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG((DEBUG_ERROR, "InstallProtocolInterface: input handle at 0x%x is invalid\n", Handle)); goto Done; } @@ -479,7 +479,7 @@ Done: // Done, unlock the database and return // CoreReleaseProtocolLock (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Return the new handle back to the caller // @@ -489,7 +489,7 @@ Done: // There was an error, clean up // if (Prot != NULL) { - CoreFreePool (Prot); + CoreFreePool(Prot); } DEBUG((DEBUG_ERROR, "InstallProtocolInterface: %g %p failed with %r\n", Protocol, Interface, Status)); } @@ -553,7 +553,7 @@ CoreInstallMultipleProtocolInterfaces ( // Check for duplicate device path and install the protocol interfaces // VA_START (Args, Handle); - for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { + for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR(Status); Index++) { // // If protocol is NULL, then it's the end of the list // @@ -571,7 +571,7 @@ CoreInstallMultipleProtocolInterfaces ( DeviceHandle = NULL; DevicePath = Interface; Status = CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(DevicePath)) { + if (!EFI_ERROR(Status) && (DeviceHandle != NULL) && IsDevicePathEnd(DevicePath)) { Status = EFI_ALREADY_STARTED; continue; } @@ -587,7 +587,7 @@ CoreInstallMultipleProtocolInterfaces ( // // If there was an error, remove all the interfaces that were installed without any errors // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Reset the va_arg back to the first argument. // @@ -648,7 +648,7 @@ CoreDisconnectControllersUsingProtocolInterface ( CoreReleaseProtocolLock (); Status = CoreDisconnectController (UserHandle, OpenData->AgentHandle, NULL); CoreAcquireProtocolLock (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ItemFound = TRUE; } break; @@ -656,7 +656,7 @@ CoreDisconnectControllersUsingProtocolInterface ( } } while (ItemFound); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Attempt to remove BY_HANDLE_PROTOOCL and GET_PROTOCOL and TEST_PROTOCOL Open List items // @@ -666,7 +666,7 @@ CoreDisconnectControllersUsingProtocolInterface ( (EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL | EFI_OPEN_PROTOCOL_GET_PROTOCOL | EFI_OPEN_PROTOCOL_TEST_PROTOCOL)) != 0) { Link = RemoveEntryList (&OpenData->Link); Prot->OpenListCount--; - CoreFreePool (OpenData); + CoreFreePool(OpenData); } else { Link = Link->ForwardLink; } @@ -676,7 +676,7 @@ CoreDisconnectControllersUsingProtocolInterface ( // // If there are errors or still has open items in the list, then reconnect all the drivers and return an error // - if (EFI_ERROR (Status) || (Prot->OpenListCount > 0)) { + if (EFI_ERROR(Status) || (Prot->OpenListCount > 0)) { CoreReleaseProtocolLock (); CoreConnectController (UserHandle, NULL, NULL, TRUE); CoreAcquireProtocolLock (); @@ -724,7 +724,7 @@ CoreUninstallProtocolInterface ( // Check that UserHandle is a valid handle // Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -749,7 +749,7 @@ CoreUninstallProtocolInterface ( UserHandle, Prot ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // One or more drivers refused to release, so return the error // @@ -779,7 +779,7 @@ CoreUninstallProtocolInterface ( // Free the memory // Prot->Signature = 0; - CoreFreePool (Prot); + CoreFreePool(Prot); Status = EFI_SUCCESS; } @@ -789,7 +789,7 @@ CoreUninstallProtocolInterface ( if (IsListEmpty (&Handle->Protocols)) { Handle->Signature = 0; RemoveEntryList (&Handle->AllHandles); - CoreFreePool (Handle); + CoreFreePool(Handle); } Done: @@ -831,7 +831,7 @@ CoreUninstallMultipleProtocolInterfaces ( UINTN Index; VA_START (Args, Handle); - for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { + for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR(Status); Index++) { // // If protocol is NULL, then it's the end of the list // @@ -853,7 +853,7 @@ CoreUninstallMultipleProtocolInterfaces ( // If there was an error, add all the interfaces that were // uninstalled without any errors // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Reset the va_arg back to the first argument. // @@ -892,7 +892,7 @@ CoreGetProtocolInterface ( LIST_ENTRY *Link; Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -1006,7 +1006,7 @@ CoreOpenProtocol ( // Check for invalid UserHandle // Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1016,11 +1016,11 @@ CoreOpenProtocol ( switch (Attributes) { case EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER : Status = CoreValidateHandle (ImageHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (UserHandle == ControllerHandle) { @@ -1030,17 +1030,17 @@ CoreOpenProtocol ( case EFI_OPEN_PROTOCOL_BY_DRIVER : case EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE : Status = CoreValidateHandle (ImageHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } break; case EFI_OPEN_PROTOCOL_EXCLUSIVE : Status = CoreValidateHandle (ImageHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } break; @@ -1121,7 +1121,7 @@ CoreOpenProtocol ( CoreReleaseProtocolLock (); Status = CoreDisconnectController (UserHandle, OpenData->AgentHandle, NULL); CoreAcquireProtocolLock (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_ACCESS_DENIED; goto Done; } else { @@ -1167,7 +1167,7 @@ Done: // Keep Interface unmodified in case of any Error // except EFI_ALREADY_STARTED and EFI_UNSUPPORTED. // - if (!EFI_ERROR (Status) || Status == EFI_ALREADY_STARTED) { + if (!EFI_ERROR(Status) || Status == EFI_ALREADY_STARTED) { // // According to above logic, if 'Prot' is NULL, then the 'Status' must be // EFI_UNSUPPORTED. Here the 'Status' is not EFI_UNSUPPORTED, so 'Prot' @@ -1242,16 +1242,16 @@ CoreCloseProtocol ( // Check for invalid parameters // Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = CoreValidateHandle (AgentHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (ControllerHandle != NULL) { Status = CoreValidateHandle (ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1283,7 +1283,7 @@ CoreCloseProtocol ( if ((OpenData->AgentHandle == AgentHandle) && (OpenData->ControllerHandle == ControllerHandle)) { RemoveEntryList (&OpenData->Link); ProtocolInterface->OpenListCount--; - CoreFreePool (OpenData); + CoreFreePool(OpenData); Status = EFI_SUCCESS; } } @@ -1436,7 +1436,7 @@ CoreProtocolsPerHandle ( EFI_GUID **Buffer; Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Core/Dxe/Hand/Locate.c b/MdeModulePkg/Core/Dxe/Hand/Locate.c index be17f4cbc..3a53f3649 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Locate.c +++ b/MdeModulePkg/Core/Dxe/Hand/Locate.c @@ -464,7 +464,7 @@ CoreLocateDevicePath ( // Get a list of all handles that support the requested protocol // Status = CoreLocateHandleBuffer (ByProtocol, Protocol, NULL, &HandleCount, &Handles); - if (EFI_ERROR (Status) || HandleCount == 0) { + if (EFI_ERROR(Status) || HandleCount == 0) { return EFI_NOT_FOUND; } @@ -472,7 +472,7 @@ CoreLocateDevicePath ( for(Index = 0; Index < HandleCount; Index += 1) { Handle = Handles[Index]; Status = CoreHandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID **)&TmpDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If this handle doesn't support device path, then skip it // @@ -502,7 +502,7 @@ CoreLocateDevicePath ( } } - CoreFreePool (Handles); + CoreFreePool(Handles); // // If there wasn't any match, then no parts of the device path was found. @@ -572,7 +572,7 @@ CoreLocateProtocol ( // Lock the protocol database // Status = CoreAcquireLockOrFail (&gProtocolDatabaseLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } diff --git a/MdeModulePkg/Core/Dxe/Hand/Notify.c b/MdeModulePkg/Core/Dxe/Hand/Notify.c index 553413a35..2fa6aa15b 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Notify.c +++ b/MdeModulePkg/Core/Dxe/Hand/Notify.c @@ -189,7 +189,7 @@ CoreReinstallProtocolInterface ( PROTOCOL_ENTRY *ProtEntry; Status = CoreValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -220,7 +220,7 @@ CoreReinstallProtocolInterface ( UserHandle, Prot ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // One or more drivers refused to release, so return the error // diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 22a87ecf6..5dd81be48 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -143,7 +143,7 @@ PeCoffEmuProtocolNotify ( &BufferSize, &EmuHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If no more notification events exit // @@ -155,7 +155,7 @@ PeCoffEmuProtocolNotify ( &gEdkiiPeCoffImageEmulatorProtocolGuid, (VOID **)&Emulator ); - if (EFI_ERROR (Status) || Emulator == NULL) { + if (EFI_ERROR(Status) || Emulator == NULL) { continue; } @@ -232,7 +232,7 @@ CoreInitializeImageServices ( EFI_NATIVE_INTERFACE, &Image->Info ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mCurrentImage = Image; @@ -450,7 +450,7 @@ GetPeCoffImageFixLoadingAssignedAddress( &Size, &SectionHeader ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (Size != sizeof (EFI_IMAGE_SECTION_HEADER)) { @@ -575,7 +575,7 @@ CoreLoadPeImage ( // Get information about the image being loaded // Status = PeCoffLoaderGetImageInfo (&Image->ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -644,7 +644,7 @@ CoreLoadPeImage ( if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 ) { Status = GetPeCoffImageFixLoadingAssignedAddress (&(Image->ImageContext)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If the code memory is not ready, invoke CoreAllocatePage with AllocateAnyPages to load the driver. // @@ -666,7 +666,7 @@ CoreLoadPeImage ( &Image->ImageContext.ImageAddress ); } - if (EFI_ERROR (Status) && !Image->ImageContext.RelocationsStripped) { + if (EFI_ERROR(Status) && !Image->ImageContext.RelocationsStripped) { Status = CoreAllocatePages ( AllocateAnyPages, (EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType), @@ -675,7 +675,7 @@ CoreLoadPeImage ( ); } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DstBufAlocated = TRUE; @@ -715,7 +715,7 @@ CoreLoadPeImage ( // Load the image from the file into the allocated memory // Status = PeCoffLoaderLoadImage (&Image->ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -738,7 +738,7 @@ CoreLoadPeImage ( // Relocate the image in memory // Status = PeCoffLoaderRelocateImage (&Image->ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -761,7 +761,7 @@ CoreLoadPeImage ( Image->ImageBasePage, EFI_PAGES_TO_SIZE (Image->NumberOfPages), &Image->EntryPoint); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_LOAD | DEBUG_ERROR, "CoreLoadPeImage: Failed to register foreign image with emulator.\n")); goto Done; @@ -872,7 +872,7 @@ Done: } if (Image->ImageContext.FixupData != NULL) { - CoreFreePool (Image->ImageContext.FixupData); + CoreFreePool(Image->ImageContext.FixupData); } return Status; @@ -902,7 +902,7 @@ CoreLoadedImageInfo ( &gEfiLoadedImageProtocolGuid, (VOID **)&LoadedImage ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Image = LOADED_IMAGE_PRIVATE_DATA_FROM_THIS (LoadedImage); } else { DEBUG ((DEBUG_LOAD, "CoreLoadedImageInfo: Not an ImageHandle %p\n", ImageHandle)); @@ -970,14 +970,14 @@ CoreUnloadAndCloseImage ( &HandleCount, &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { Status = CoreProtocolsPerHandle ( HandleBuffer[HandleIndex], &ProtocolGuidArray, &ArrayCount ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) { Status = CoreOpenProtocolInformation ( HandleBuffer[HandleIndex], @@ -985,7 +985,7 @@ CoreUnloadAndCloseImage ( &OpenInfo, &OpenInfoCount ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { if (OpenInfo[OpenInfoIndex].AgentHandle == Image->Handle) { Status = CoreCloseProtocol ( @@ -1007,7 +1007,7 @@ CoreUnloadAndCloseImage ( } } if (HandleBuffer != NULL) { - CoreFreePool (HandleBuffer); + CoreFreePool(HandleBuffer); } } @@ -1043,7 +1043,7 @@ CoreUnloadAndCloseImage ( RemoveEntryList (&Image->RuntimeData->Link); RemoveImageRecord (Image->RuntimeData); } - CoreFreePool (Image->RuntimeData); + CoreFreePool(Image->RuntimeData); } // @@ -1057,18 +1057,18 @@ CoreUnloadAndCloseImage ( // Done with the Image structure // if (Image->Info.FilePath != NULL) { - CoreFreePool (Image->Info.FilePath); + CoreFreePool(Image->Info.FilePath); } if (Image->LoadedImageDevicePath != NULL) { - CoreFreePool (Image->LoadedImageDevicePath); + CoreFreePool(Image->LoadedImageDevicePath); } if (Image->FixupData != NULL) { - CoreFreePool (Image->FixupData); + CoreFreePool(Image->FixupData); } - CoreFreePool (Image); + CoreFreePool(Image); } @@ -1181,7 +1181,7 @@ CoreLoadImageCommon ( FHand.Source = SourceBuffer; FHand.SourceSize = SourceSize; Status = CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &HandleFilePath, &DeviceHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DeviceHandle = NULL; } if (SourceSize > 0) { @@ -1199,20 +1199,20 @@ CoreLoadImageCommon ( // Node = NULL; Status = CoreLocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &HandleFilePath, &DeviceHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ImageIsFromFv = TRUE; } else { HandleFilePath = FilePath; Status = CoreLocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &HandleFilePath, &DeviceHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!BootPolicy) { HandleFilePath = FilePath; Status = CoreLocateDevicePath (&gEfiLoadFile2ProtocolGuid, &HandleFilePath, &DeviceHandle); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { HandleFilePath = FilePath; Status = CoreLocateDevicePath (&gEfiLoadFileProtocolGuid, &HandleFilePath, &DeviceHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ImageIsFromLoadFile = TRUE; Node = HandleFilePath; } @@ -1242,7 +1242,7 @@ CoreLoadImageCommon ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Image = NULL; goto Done; } @@ -1258,7 +1258,7 @@ CoreLoadImageCommon ( FHand.SourceSize, BootPolicy ); - if (!EFI_ERROR (SecurityStatus) && ImageIsFromFv) { + if (!EFI_ERROR(SecurityStatus) && ImageIsFromFv) { // // When Security2 is installed, Security Architectural Protocol must be published. // @@ -1288,7 +1288,7 @@ CoreLoadImageCommon ( // // Check Security Status. // - if (EFI_ERROR (SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) { + if (EFI_ERROR(SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) { if (SecurityStatus == EFI_ACCESS_DENIED) { // // Image was not loaded because the platform policy prohibits the image from being loaded. @@ -1316,7 +1316,7 @@ CoreLoadImageCommon ( FilePath = OriginalFilePath; if (DeviceHandle != NULL) { Status = CoreHandleProtocol (DeviceHandle, &gEfiDevicePathProtocolGuid, (VOID **)&HandleFilePath); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FilePathSize = GetDevicePathSize (HandleFilePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL); FilePath = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *)FilePath) + FilePathSize ); } @@ -1349,7 +1349,7 @@ CoreLoadImageCommon ( &Image->Info, FALSE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1357,7 +1357,7 @@ CoreLoadImageCommon ( // Load the image. If EntryPoint is Null, it will not be set. // Status = CoreLoadPeImage (BootPolicy, &FHand, Image, DstBuffer, EntryPoint, Attribute); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if ((Status == EFI_BUFFER_TOO_SMALL) || (Status == EFI_OUT_OF_RESOURCES)) { if (NumberOfPages != NULL) { *NumberOfPages = Image->NumberOfPages; @@ -1386,7 +1386,7 @@ CoreLoadImageCommon ( &Image->Info, &Image->Info ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1407,7 +1407,7 @@ CoreLoadImageCommon ( EFI_NATIVE_INTERFACE, Image->LoadedImageDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1421,7 +1421,7 @@ CoreLoadImageCommon ( EFI_NATIVE_INTERFACE, (VOID *) (UINTN) Image->ImageContext.HiiResourceData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -1438,21 +1438,21 @@ Done: // If we allocated the Source buffer, free it // if (FHand.FreeBuffer) { - CoreFreePool (FHand.Source); + CoreFreePool(FHand.Source); } if (OriginalFilePath != InputFilePath) { - CoreFreePool (OriginalFilePath); + CoreFreePool(OriginalFilePath); } // // There was an error. If there's an Image structure, free it // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Image != NULL) { CoreUnloadAndCloseImage (Image, (BOOLEAN)(DstBuffer == 0)); Image = NULL; } - } else if (EFI_ERROR (SecurityStatus)) { + } else if (EFI_ERROR(SecurityStatus)) { Status = SecurityStatus; } @@ -1533,7 +1533,7 @@ CoreLoadImage ( ); Handle = NULL; - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // ImageHandle will be valid only Status is success. // @@ -1585,7 +1585,7 @@ CoreStartImage ( if (Image == NULL || Image->Started) { return EFI_INVALID_PARAMETER; } - if (EFI_ERROR (Image->LoadImageStatus)) { + if (EFI_ERROR(Image->LoadImageStatus)) { return Image->LoadImageStatus; } @@ -1657,7 +1657,7 @@ CoreStartImage ( // all the resource in this situation. // DEBUG_CODE_BEGIN (); - if (EFI_ERROR (Image->Status)) { + if (EFI_ERROR(Image->Status)) { DEBUG ((DEBUG_ERROR, "Error: Image at %11p start failed: %r\n", Image->Info.ImageBase, Image->Status)); } DEBUG_CODE_END (); @@ -1674,7 +1674,7 @@ CoreStartImage ( ASSERT (Image->Tpl == gEfiCurrentTpl); CoreRestoreTpl (Image->Tpl); - CoreFreePool (Image->JumpBuffer); + CoreFreePool(Image->JumpBuffer); // // Pop the current start image context @@ -1718,7 +1718,7 @@ CoreStartImage ( // // Caller doesn't want the exit data, free it // - CoreFreePool (Image->ExitData); + CoreFreePool(Image->ExitData); Image->ExitData = NULL; } @@ -1731,7 +1731,7 @@ CoreStartImage ( // If the image returned an error, or if the image is an application // unload it // - if (EFI_ERROR (Image->Status) || Image->Type == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) { + if (EFI_ERROR(Image->Status) || Image->Type == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) { CoreUnloadAndCloseImage (Image, TRUE); // // ImageHandle may be invalid after the image is unloaded, so use NULL handle to record perf log. @@ -1895,7 +1895,7 @@ CoreUnloadImage ( } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // if the Image was not started or Unloaded O.K. then clean up // diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c index 9477b9404..15f2710fb 100644 --- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c +++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c @@ -245,7 +245,7 @@ FindGuardedMemoryMap ( &MapMemory, FALSE ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (MapMemory != 0); SetMem ((VOID *)(UINTN)MapMemory, Size, 0); @@ -277,7 +277,7 @@ FindGuardedMemoryMap ( &MapMemory, FALSE ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (MapMemory != 0); SetMem ((VOID *)(UINTN)MapMemory, Size, 0); @@ -517,7 +517,7 @@ SetGuardPage ( // such as NX memory protection. // Status = gCpu->SetMemoryAttributes (gCpu, BaseAddress, EFI_PAGE_SIZE, EFI_MEMORY_RP); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mOnGuarding = FALSE; } @@ -564,7 +564,7 @@ UnsetGuardPage ( // at the same time. // Status = gCpu->SetMemoryAttributes (gCpu, BaseAddress, EFI_PAGE_SIZE, Attributes); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mOnGuarding = FALSE; } @@ -1317,7 +1317,7 @@ GuardFreedPages ( // alloc/free involved in SetMemoryAttributes(), which might fail this // calling. It's rare case so it's OK to let a few tiny holes be not-guarded. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "Failed to guard freed pages: %p (%lu)\n", BaseAddress, (UINT64)Pages)); } mOnGuarding = FALSE; @@ -1564,7 +1564,7 @@ PromoteGuardedFreePages ( // mOnGuarding = TRUE; Status = gCpu->SetMemoryAttributes (gCpu, Start, EFI_PAGES_TO_SIZE(AvailablePages), 0); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mOnGuarding = FALSE; } diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c index 2ca0417b0..a27004891 100644 --- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c +++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c @@ -404,7 +404,7 @@ BuildDriverInfo ( sizeof (*DriverInfoData) + sizeof (LIST_ENTRY) + PdbSize, (VOID **) &DriverInfoData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ASSERT (DriverInfoData != NULL); @@ -429,7 +429,7 @@ BuildDriverInfo ( // So patch ImageBuffer here to align the EntryPoint. // Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) ImageBase, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DriverInfo->ImageBase = ImageBase + EntryPoint - (PHYSICAL_ADDRESS) (UINTN) EntryPointInImage; } DriverInfo->FileType = FileType; @@ -637,7 +637,7 @@ MemoryProfileInstallProtocol ( &mProfileProtocol, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -852,7 +852,7 @@ UnregisterMemoryProfileImage ( // So patch ImageAddress here to align the EntryPoint. // Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) ImageAddress, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ImageAddress = ImageAddress + (UINTN) DriverEntry->ImageContext.EntryPoint - (UINTN) EntryPointInImage; } if (FileName != NULL) { @@ -877,7 +877,7 @@ UnregisterMemoryProfileImage ( // // Use CoreInternalFreePool() that will not update profile for this FreePool action. // - CoreInternalFreePool (DriverInfoData, NULL); + CoreInternalFreePool(DriverInfoData, NULL); } return EFI_SUCCESS; @@ -1008,7 +1008,7 @@ CoreUpdateProfileAllocate ( sizeof (*AllocInfoData) + ActionStringSize, (VOID **) &AllocInfoData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } ASSERT (AllocInfoData != NULL); @@ -1300,7 +1300,7 @@ CoreUpdateProfileFree ( // // Use CoreInternalFreePool() that will not update profile for this FreePool action. // - CoreInternalFreePool (AllocInfoData, NULL); + CoreInternalFreePool(AllocInfoData, NULL); } while (TRUE); } @@ -1613,7 +1613,7 @@ ProfileProtocolRegisterImage ( DriverEntry.ImageContext.ImageAddress = ImageBase; DriverEntry.ImageContext.ImageSize = ImageSize; Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) ImageBase, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DriverEntry.ImageContext.EntryPoint = (PHYSICAL_ADDRESS) (UINTN) EntryPointInImage; DriverEntry.ImageContext.ImageType = InternalPeCoffGetSubsystem ((VOID *) (UINTN) ImageBase); @@ -1652,7 +1652,7 @@ ProfileProtocolUnregisterImage ( DriverEntry.ImageContext.ImageAddress = ImageBase; DriverEntry.ImageContext.ImageSize = ImageSize; Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) ImageBase, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DriverEntry.ImageContext.EntryPoint = (PHYSICAL_ADDRESS) (UINTN) EntryPointInImage; return UnregisterMemoryProfileImage (&DriverEntry); diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index 1f0e3d94b..aa4609c05 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -613,7 +613,7 @@ CoreAddMemoryDescriptor ( gMemoryTypeInformation[Index].NumberOfPages, &mMemoryTypeStatistics[Type].BaseAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If an error occurs allocating the pages for the current memory type, then // free all the pages allocates for the previous memory types and return. This @@ -1397,7 +1397,7 @@ CoreInternalAllocatePages ( Done: CoreReleaseMemoryLock (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (NeedGuard) { SetGuardForMemory (Start, NumberOfPages); } @@ -1440,7 +1440,7 @@ CoreAllocatePages ( NeedGuard = IsPageTypeToGuard (MemoryType, Type) && !mOnGuarding; Status = CoreInternalAllocatePages (Type, MemoryType, NumberOfPages, Memory, NeedGuard); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CoreUpdateProfile ( (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionAllocatePages, @@ -1563,7 +1563,7 @@ CoreFreePages ( EFI_MEMORY_TYPE MemoryType; Status = CoreInternalFreePages (Memory, NumberOfPages, &MemoryType); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { GuardFreedPagesChecked (Memory, NumberOfPages); CoreUpdateProfile ( (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), diff --git a/MdeModulePkg/Core/Dxe/Mem/Pool.c b/MdeModulePkg/Core/Dxe/Mem/Pool.c index 734fc94bf..9f95792a3 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Pool.c +++ b/MdeModulePkg/Core/Dxe/Mem/Pool.c @@ -241,7 +241,7 @@ CoreInternalAllocatePool ( // Acquire the memory lock and make the allocation // Status = CoreAcquireLockOrFail (&mPoolMemoryLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -276,7 +276,7 @@ CoreAllocatePool ( EFI_STATUS Status; Status = CoreInternalAllocatePool (PoolType, Size, Buffer); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CoreUpdateProfile ( (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionAllocatePool, @@ -315,7 +315,7 @@ CoreAllocatePoolPagesI ( EFI_STATUS Status; Status = CoreAcquireLockOrFail (&gMemoryLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -542,7 +542,7 @@ Done: **/ EFI_STATUS EFIAPI -CoreInternalFreePool ( +CoreInternalFreePool( IN VOID *Buffer, OUT EFI_MEMORY_TYPE *PoolType OPTIONAL ) @@ -570,15 +570,15 @@ CoreInternalFreePool ( **/ EFI_STATUS EFIAPI -CoreFreePool ( +CoreFreePool( IN VOID *Buffer ) { EFI_STATUS Status; EFI_MEMORY_TYPE PoolType; - Status = CoreInternalFreePool (Buffer, &PoolType); - if (!EFI_ERROR (Status)) { + Status = CoreInternalFreePool(Buffer, &PoolType); + if (!EFI_ERROR(Status)) { CoreUpdateProfile ( (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionFreePool, diff --git a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c index a75d41582..6bbd0a393 100644 --- a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c +++ b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c @@ -64,7 +64,7 @@ CoreInitializeDebugImageInfoTable ( RealPages, &Memory ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (PcdGet64 (PcdMaxEfiSystemTablePointerAddress) != 0) { DEBUG ((EFI_D_INFO, "Allocate memory for EFI_SYSTEM_TABLE_POINTER below PcdMaxEfiSystemTablePointerAddress failed. \ Retry to allocate memroy as close to the top of memory as feasible.\n")); @@ -79,8 +79,8 @@ CoreInitializeDebugImageInfoTable ( RealPages, &Memory ); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } @@ -95,7 +95,7 @@ CoreInitializeDebugImageInfoTable ( // Free first unaligned page(s). // Status = CoreFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Memory = AlignedMemory + EFI_PAGES_TO_SIZE (Pages); UnalignedPages = RealPages - Pages - UnalignedPages; @@ -104,7 +104,7 @@ CoreInitializeDebugImageInfoTable ( // Free last unaligned page(s). // Status = CoreFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // @@ -125,7 +125,7 @@ CoreInitializeDebugImageInfoTable ( // Configuration Table // Status = CoreInstallConfigurationTable (&gEfiDebugImageInfoTableGuid, &mDebugInfoTableHeader); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } @@ -206,7 +206,7 @@ CoreNewDebugImageInfoEntry ( // // Free the old table // - CoreFreePool (Table); + CoreFreePool(Table); // // Update the table header // @@ -266,7 +266,7 @@ CoreRemoveDebugImageInfoEntry ( // Found a match. Free up the record, then NULL the pointer to indicate the slot // is free. // - CoreFreePool (Table[Index].NormalImage); + CoreFreePool(Table[Index].NormalImage); Table[Index].NormalImage = NULL; // // Decrease the number of EFI_DEBUG_IMAGE_INFO elements and set the mDebugInfoTable in modified status. diff --git a/MdeModulePkg/Core/Dxe/Misc/InstallConfigurationTable.c b/MdeModulePkg/Core/Dxe/Misc/InstallConfigurationTable.c index ba4e55fcd..2f466d742 100644 --- a/MdeModulePkg/Core/Dxe/Misc/InstallConfigurationTable.c +++ b/MdeModulePkg/Core/Dxe/Misc/InstallConfigurationTable.c @@ -146,7 +146,7 @@ CoreInstallConfigurationTable ( // // Free the old table after updating System Table to the new table pointer. // - CoreFreePool (OldTable); + CoreFreePool(OldTable); } else { // // Update System Table diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c b/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c index ebdeb3507..38263cd47 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c @@ -109,7 +109,7 @@ InstallMemoryAttributesTable ( // memory for the new entry. // Status = gBS->InstallConfigurationTable (&gEfiMemoryAttributesTableGuid, (VOID *) (UINTN) MAX_ADDRESS); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } MemoryMapSize = 0; @@ -134,8 +134,8 @@ InstallMemoryAttributesTable ( &DescriptorSize, &DescriptorVersion ); - if (EFI_ERROR (Status)) { - FreePool (MemoryMap); + if (EFI_ERROR(Status)) { + FreePool(MemoryMap); } } while (Status == EFI_BUFFER_TOO_SMALL); @@ -184,16 +184,16 @@ InstallMemoryAttributesTable ( MemoryMap = NEXT_MEMORY_DESCRIPTOR(MemoryMap, DescriptorSize); } MemoryMap = MemoryMapStart; - FreePool (MemoryMap); + FreePool(MemoryMap); // // Update configuratoin table for MemoryAttributesTable. // Status = gBS->InstallConfigurationTable (&gEfiMemoryAttributesTableGuid, MemoryAttributesTable); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (mMemoryAttributesTable != NULL) { - FreePool (mMemoryAttributesTable); + FreePool(mMemoryAttributesTable); } mMemoryAttributesTable = MemoryAttributesTable; } @@ -275,7 +275,7 @@ CoreInitializeMemoryAttributesTable ( &gEfiEventReadyToBootGuid, &ReadyToBootEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Construct the initial table at EndOfDxe, @@ -291,6 +291,6 @@ CoreInitializeMemoryAttributesTable ( &gEfiEndOfDxeEventGroupGuid, &EndOfDxeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return ; } diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c index 7a24bd078..2e1e0e7e7 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c @@ -124,7 +124,7 @@ GetImageType ( &TempDevicePath, &DeviceHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( DeviceHandle, &gEfiFirmwareVolume2ProtocolGuid, @@ -133,7 +133,7 @@ GetImageType ( NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return IMAGE_FROM_FV; } } @@ -368,13 +368,13 @@ FreeImageRecord ( IMAGE_PROPERTIES_RECORD_CODE_SECTION_SIGNATURE ); RemoveEntryList (&ImageRecordCodeSection->Link); - FreePool (ImageRecordCodeSection); + FreePool(ImageRecordCodeSection); } if (ImageRecord->Link.ForwardLink != NULL) { RemoveEntryList (&ImageRecord->Link); } - FreePool (ImageRecord); + FreePool(ImageRecord); } /** @@ -807,11 +807,11 @@ InitializeDxeNxMemoryProtectionPolicy ( &DescriptorSize, &DescriptorVersion ); - if (EFI_ERROR (Status)) { - FreePool (MemoryMap); + if (EFI_ERROR(Status)) { + FreePool(MemoryMap); } } while (Status == EFI_BUFFER_TOO_SMALL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); StackBase = 0; if (PcdGetBool (PcdCpuStackGuard)) { @@ -899,7 +899,7 @@ InitializeDxeNxMemoryProtectionPolicy ( } MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize); } - FreePool (MemoryMap); + FreePool(MemoryMap); // // Apply the policy for RAM regions that we know are present and @@ -968,7 +968,7 @@ MemoryProtectionCpuArchProtocolNotify ( DEBUG ((DEBUG_INFO, "MemoryProtectionCpuArchProtocolNotify:\n")); Status = CoreLocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gCpu); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -995,7 +995,7 @@ MemoryProtectionCpuArchProtocolNotify ( &NoHandles, &HandleBuffer ); - if (EFI_ERROR (Status) && (NoHandles == 0)) { + if (EFI_ERROR(Status) && (NoHandles == 0)) { goto Done; } @@ -1019,7 +1019,7 @@ MemoryProtectionCpuArchProtocolNotify ( ProtectUefiImage (LoadedImage, LoadedImageDevicePath); } - FreePool (HandleBuffer); + FreePool(HandleBuffer); Done: CoreCloseEvent (Event); @@ -1076,7 +1076,7 @@ DisableNullDetectionAtTheEndOfDxe ( // Disable NULL pointer detection by enabling first 4K page // Status = CoreGetMemorySpaceDescriptor (0, &Desc); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if ((Desc.Capabilities & EFI_MEMORY_RP) == 0) { Status = CoreSetMemorySpaceCapabilities ( @@ -1084,7 +1084,7 @@ DisableNullDetectionAtTheEndOfDxe ( EFI_PAGE_SIZE, Desc.Capabilities | EFI_MEMORY_RP ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Status = CoreSetMemorySpaceAttributes ( @@ -1092,7 +1092,7 @@ DisableNullDetectionAtTheEndOfDxe ( EFI_PAGE_SIZE, Desc.Attributes & ~EFI_MEMORY_RP ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); CoreCloseEvent (Event); DEBUG ((DEBUG_INFO, "DisableNullDetectionAtTheEndOfDxe(): end\r\n")); @@ -1162,7 +1162,7 @@ CoreInitializeMemoryProtection ( &gEfiEndOfDxeEventGroupGuid, &EndOfDxeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return ; diff --git a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c index 53bb6b7c9..655422d29 100644 --- a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c +++ b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c @@ -1300,11 +1300,11 @@ RemoveImageRecord ( IMAGE_PROPERTIES_RECORD_CODE_SECTION_SIGNATURE ); RemoveEntryList (&ImageRecordCodeSection->Link); - FreePool (ImageRecordCodeSection); + FreePool(ImageRecordCodeSection); } RemoveEntryList (&ImageRecord->Link); - FreePool (ImageRecord); + FreePool(ImageRecord); mImagePropertiesPrivateData.ImageRecordCount--; } @@ -1327,7 +1327,7 @@ InstallPropertiesTable ( EFI_STATUS Status; Status = gBS->InstallConfigurationTable (&gEfiPropertiesTableGuid, &mPropertiesTable); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DEBUG ((EFI_D_INFO, "MemoryProtectionAttribute - 0x%016lx\n", mPropertiesTable.MemoryProtectionAttribute)); if ((mPropertiesTable.MemoryProtectionAttribute & EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) == 0) { @@ -1368,6 +1368,6 @@ CoreInitializePropertiesTable ( &gEfiEndOfDxeEventGroupGuid, &EndOfDxeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return ; } diff --git a/MdeModulePkg/Core/Dxe/Misc/SetWatchdogTimer.c b/MdeModulePkg/Core/Dxe/Misc/SetWatchdogTimer.c index a9bf1284f..9795c33c1 100644 --- a/MdeModulePkg/Core/Dxe/Misc/SetWatchdogTimer.c +++ b/MdeModulePkg/Core/Dxe/Misc/SetWatchdogTimer.c @@ -58,7 +58,7 @@ CoreSetWatchdogTimer ( // // Check for errors // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c index d678166db..27f3cebb2 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c @@ -236,7 +236,7 @@ InitializeSectionExtraction ( EFI_NATIVE_INTERFACE, &mCustomGuidedSectionExtractionProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return Status; @@ -357,7 +357,7 @@ OpenSectionStreamEx ( if (SectionStreamLength > 0) { NewStream->StreamBuffer = AllocatePool (SectionStreamLength); if (NewStream->StreamBuffer == NULL) { - CoreFreePool (NewStream); + CoreFreePool(NewStream); return EFI_OUT_OF_RESOURCES; } // @@ -519,7 +519,7 @@ VerifyGuidedSectionGuid ( // Found the recorded GuidedSectionGuid. // Status = CoreLocateProtocol (GuidedSectionGuid, NULL, (VOID **) &Interface); - if (!EFI_ERROR (Status) && Interface != NULL) { + if (!EFI_ERROR(Status) && Interface != NULL) { // // Found the supported Guided Section Extraction Porotocol for the Guided Section. // @@ -572,7 +572,7 @@ NotifyGuidedExtraction ( &NewStreamBufferSize, &AuthenticationStatus ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Make sure we initialize the new stream with the correct @@ -598,14 +598,14 @@ NotifyGuidedExtraction ( AuthenticationStatus, &Context->ChildNode->EncapsulatedStreamHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Close the event when done. // gBS->CloseEvent (Event); Context->ChildNode->Event = NULL; - FreePool (Context); + FreePool(Context); } /** @@ -722,7 +722,7 @@ CreateChildNode ( // Get the CompressionSectionHeader // if (Node->Size < sizeof (EFI_COMPRESSION_SECTION)) { - CoreFreePool (Node); + CoreFreePool(Node); return EFI_NOT_FOUND; } @@ -747,7 +747,7 @@ CreateChildNode ( NewStreamBufferSize = UncompressedLength; NewStreamBuffer = AllocatePool (NewStreamBufferSize); if (NewStreamBuffer == NULL) { - CoreFreePool (Node); + CoreFreePool(Node); return EFI_OUT_OF_RESOURCES; } @@ -765,7 +765,7 @@ CreateChildNode ( // Decompress the stream // Status = CoreLocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (Decompress != NULL); Status = Decompress->GetInfo ( @@ -775,10 +775,10 @@ CreateChildNode ( (UINT32 *)&NewStreamBufferSize, &ScratchSize ); - if (EFI_ERROR (Status) || (NewStreamBufferSize != UncompressedLength)) { - CoreFreePool (Node); - CoreFreePool (NewStreamBuffer); - if (!EFI_ERROR (Status)) { + if (EFI_ERROR(Status) || (NewStreamBufferSize != UncompressedLength)) { + CoreFreePool(Node); + CoreFreePool(NewStreamBuffer); + if (!EFI_ERROR(Status)) { Status = EFI_BAD_BUFFER_SIZE; } return Status; @@ -786,8 +786,8 @@ CreateChildNode ( ScratchBuffer = AllocatePool (ScratchSize); if (ScratchBuffer == NULL) { - CoreFreePool (Node); - CoreFreePool (NewStreamBuffer); + CoreFreePool(Node); + CoreFreePool(NewStreamBuffer); return EFI_OUT_OF_RESOURCES; } @@ -800,10 +800,10 @@ CreateChildNode ( ScratchBuffer, ScratchSize ); - CoreFreePool (ScratchBuffer); - if (EFI_ERROR (Status)) { - CoreFreePool (Node); - CoreFreePool (NewStreamBuffer); + CoreFreePool(ScratchBuffer); + if (EFI_ERROR(Status)) { + CoreFreePool(Node); + CoreFreePool(NewStreamBuffer); return Status; } } @@ -819,9 +819,9 @@ CreateChildNode ( Stream->AuthenticationStatus, &Node->EncapsulatedStreamHandle ); - if (EFI_ERROR (Status)) { - CoreFreePool (Node); - CoreFreePool (NewStreamBuffer); + if (EFI_ERROR(Status)) { + CoreFreePool(Node); + CoreFreePool(NewStreamBuffer); return Status; } break; @@ -847,8 +847,8 @@ CreateChildNode ( &NewStreamBufferSize, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { - CoreFreePool (*ChildNode); + if (EFI_ERROR(Status)) { + CoreFreePool(*ChildNode); return EFI_PROTOCOL_ERROR; } @@ -876,9 +876,9 @@ CreateChildNode ( AuthenticationStatus, &Node->EncapsulatedStreamHandle ); - if (EFI_ERROR (Status)) { - CoreFreePool (*ChildNode); - CoreFreePool (NewStreamBuffer); + if (EFI_ERROR(Status)) { + CoreFreePool(*ChildNode); + CoreFreePool(NewStreamBuffer); return Status; } } else { @@ -918,8 +918,8 @@ CreateChildNode ( &Node->EncapsulatedStreamHandle ); } - if (EFI_ERROR (Status)) { - CoreFreePool (Node); + if (EFI_ERROR(Status)) { + CoreFreePool(Node); return Status; } } @@ -1005,7 +1005,7 @@ FindChildNode ( // So, its size should be >= the size of commen section header. // Status = CreateChildNode (SourceStream, 0, &CurrentChildNode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1055,7 +1055,7 @@ FindChildNode ( // to find the request child node in the rest stream. // if (*SectionInstance == 0) { - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); *FoundChild = RecursedChildNode; *FoundStream = RecursedFoundStream; return EFI_SUCCESS; @@ -1095,11 +1095,11 @@ FindChildNode ( // There's an unparsed child remaining in the stream, so create a new child node // Status = CreateChildNode (SourceStream, NextChildOffset, &CurrentChildNode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { - ASSERT (EFI_ERROR (ErrorStatus)); + ASSERT (EFI_ERROR(ErrorStatus)); return ErrorStatus; } } @@ -1237,7 +1237,7 @@ GetSection ( // Locate target stream // Status = FindStreamNode (SectionStreamHandle, &StreamNode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_INVALID_PARAMETER; goto GetSection_Done; } @@ -1265,7 +1265,7 @@ GetSection ( &ChildStreamNode, &ExtractedAuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto GetSection_Done; } @@ -1348,7 +1348,7 @@ FreeChildNode ( // // Last, free the child node itself // - CoreFreePool (ChildNode); + CoreFreePool(ChildNode); } @@ -1384,7 +1384,7 @@ CloseSectionStream ( // Locate target stream // Status = FindStreamNode (StreamHandleToClose, &StreamNode); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Found the stream, so close it // @@ -1395,9 +1395,9 @@ CloseSectionStream ( FreeChildNode (ChildNode); } if (FreeStreamBuffer) { - CoreFreePool (StreamNode->StreamBuffer); + CoreFreePool(StreamNode->StreamBuffer); } - CoreFreePool (StreamNode); + CoreFreePool(StreamNode); Status = EFI_SUCCESS; } else { Status = EFI_INVALID_PARAMETER; @@ -1524,7 +1524,7 @@ CustomGuidedSectionExtract ( &SectionAttribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "GetInfo from guided section Failed - %r\n", Status)); return Status; } @@ -1546,7 +1546,7 @@ CustomGuidedSectionExtract ( AllocatedOutputBuffer = AllocatePool (OutputBufferSize); if (AllocatedOutputBuffer == NULL) { if (ScratchBuffer != NULL) { - FreePool (ScratchBuffer); + FreePool(ScratchBuffer); } return EFI_OUT_OF_RESOURCES; } @@ -1562,15 +1562,15 @@ CustomGuidedSectionExtract ( ScratchBuffer, AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Decode failed // if (AllocatedOutputBuffer != NULL) { - CoreFreePool (AllocatedOutputBuffer); + CoreFreePool(AllocatedOutputBuffer); } if (ScratchBuffer != NULL) { - CoreFreePool (ScratchBuffer); + CoreFreePool(ScratchBuffer); } DEBUG ((DEBUG_ERROR, "Extract guided section Failed - %r\n", Status)); return Status; @@ -1594,7 +1594,7 @@ CustomGuidedSectionExtract ( // Free unused scratch buffer. // if (ScratchBuffer != NULL) { - CoreFreePool (ScratchBuffer); + CoreFreePool(ScratchBuffer); } return EFI_SUCCESS; diff --git a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c index 6619a6506..67b1e9442 100644 --- a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c +++ b/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c @@ -41,7 +41,7 @@ HandOffToDxeCore ( if (PcdGetBool (PcdSetNxForStack)) { Status = ArmSetMemoryRegionNoExec ((UINTN)BaseOfStack, STACK_SIZE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // @@ -55,7 +55,7 @@ HandOffToDxeCore ( // End of PEI phase singal // Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore. diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c index d48028cea..09ebdc948 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c +++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c @@ -100,8 +100,8 @@ PeimInitializeDxeIpl ( NULL, (VOID **) &Dummy ); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -110,14 +110,14 @@ PeimInitializeDxeIpl ( // and section extraction. // Status = InstallIplPermanentMemoryPpis (NULL, NULL, NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else { // // Install memory discovered PPI notification to install PPIs for // decompression and section extraction. // Status = PeiServicesNotifyPpi (&mMemoryDiscoveredNotifyList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // @@ -281,7 +281,7 @@ DxeLoadCore ( NULL, (VOID **) &S3Resume ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Report Status code that S3Resume PPI can not be found // @@ -290,10 +290,10 @@ DxeLoadCore ( (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_S3_RESUME_PPI_NOT_FOUND) ); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = S3Resume->S3RestoreConfig2 (S3Resume); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else if (BootMode == BOOT_IN_RECOVERY_MODE) { REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_RECOVERY_BEGIN)); Status = PeiServicesLocatePpi ( @@ -303,7 +303,7 @@ DxeLoadCore ( (VOID **) &PeiRecovery ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Locate Recovery PPI Failed.(Status = %r)\n", Status)); // // Report Status code the failure of locating Recovery PPI @@ -317,7 +317,7 @@ DxeLoadCore ( REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_CAPSULE_LOAD)); Status = PeiRecovery->LoadRecoveryCapsule (PeiServices, PeiRecovery); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Load Recovery Capsule Failed.(Status = %r)\n", Status)); // // Report Status code that recovery image can not be found @@ -354,7 +354,7 @@ DxeLoadCore ( // // Whether failed, still goes to Firmware Update boot path. BDS will clear corresponding indicator and reboot later on // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PeiCapsuleOnDisk->LoadCapsuleOnDisk (PeiServices, PeiCapsuleOnDisk); } } @@ -370,7 +370,7 @@ DxeLoadCore ( NULL, (VOID **)&Variable ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DataSize = sizeof (MemoryData); Status = Variable->GetVariable ( Variable, @@ -380,7 +380,7 @@ DxeLoadCore ( &DataSize, &MemoryData ); - if (!EFI_ERROR (Status) && ValidateMemoryTypeInfoVariable(MemoryData, DataSize)) { + if (!EFI_ERROR(Status) && ValidateMemoryTypeInfoVariable(MemoryData, DataSize)) { // // Build the GUID'd HOB for DXE // @@ -407,7 +407,7 @@ DxeLoadCore ( // // These must exist an instance of EFI_PEI_LOAD_FILE_PPI to support to load DxeCore file handle successfully. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = LoadFile->LoadFile ( LoadFile, @@ -417,13 +417,13 @@ DxeLoadCore ( &DxeCoreEntryPoint, &AuthenticationState ); - } while (EFI_ERROR (Status)); + } while (EFI_ERROR(Status)); // // Get the DxeCore File Info from the FileHandle for the DxeCore GUID file name. // Status = PeiServicesFfsGetFileInfo (FileHandle, &DxeCoreFileInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Add HOB for the DXE Core @@ -485,17 +485,17 @@ DxeIplFindDxeCore ( // If some error occurs here, then we cannot find any firmware // volume that may contain DxeCore. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_CORE_EC_DXE_CORRUPT)); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Find the DxeCore file type from the beginning in this firmware volume. // FileHandle = NULL; Status = PeiServicesFfsFindNextFile (EFI_FV_FILETYPE_DXE_CORE, VolumeHandle, &FileHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Find DxeCore FileHandle in this volume, then we skip other firmware volume and // return the FileHandle. @@ -596,7 +596,7 @@ CustomGuidedSectionExtract ( &SectionAttribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "GetInfo from guided section Failed - %r\n", Status)); return Status; } @@ -628,7 +628,7 @@ CustomGuidedSectionExtract ( ScratchBuffer, AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Decode failed // @@ -715,7 +715,7 @@ Decompress ( &DstBufferSize, &ScratchBufferSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // GetInfo failed // @@ -744,7 +744,7 @@ Decompress ( DstBuffer, ScratchBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Decompress failed // diff --git a/MdeModulePkg/Core/DxeIplPeim/Ebc/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ebc/DxeLoadFunc.c index 5da42ff4d..5e1adb086 100644 --- a/MdeModulePkg/Core/DxeIplPeim/Ebc/DxeLoadFunc.c +++ b/MdeModulePkg/Core/DxeIplPeim/Ebc/DxeLoadFunc.c @@ -48,7 +48,7 @@ HandOffToDxeCore ( // End of PEI phase signal // Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore. diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c index 172d7cd1c..402cb60f7 100644 --- a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c +++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c @@ -251,7 +251,7 @@ HandOffToDxeCore ( } Status = PeiServicesAllocatePages (EfiBootServicesData, EFI_SIZE_TO_PAGES (STACK_SIZE), &BaseOfStack); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (FeaturePcdGet(PcdDxeIplSwitchToLongMode)) { // @@ -286,7 +286,7 @@ HandOffToDxeCore ( PERF_EVENT_SIGNAL_BEGIN (gEndOfPeiSignalPpi.Guid); Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); PERF_EVENT_SIGNAL_END (gEndOfPeiSignalPpi.Guid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Paging might be already enabled. To avoid conflict configuration, @@ -307,7 +307,7 @@ HandOffToDxeCore ( EFI_SIZE_TO_PAGES(sizeof (X64_IDT_TABLE) + SizeOfTemplate * IDT_ENTRY_COUNT), &VectorAddress ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Store EFI_PEI_SERVICES** in the 4 bytes immediately preceding IDT to avoid that @@ -410,7 +410,7 @@ HandOffToDxeCore ( PERF_EVENT_SIGNAL_BEGIN (gEndOfPeiSignalPpi.Guid); Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); PERF_EVENT_SIGNAL_END (gEndOfPeiSignalPpi.Guid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (BuildPageTablesIa32Pae) { // diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c index 2867610bf..62237b0ee 100644 --- a/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c +++ b/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c @@ -96,7 +96,7 @@ HandOffToDxeCore ( // End of PEI phase signal // Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (FeaturePcdGet (PcdDxeIplBuildPageTables)) { AsmWriteCr3 (PageTables); diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index ba2fd0cae..8ecba9448 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -66,7 +66,7 @@ DiscoverPeimsAndOrderWithApriori ( FileHandle = NULL; do { Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (PeimCount >= Private->TempPeimCount) { // // Run out of room, grow the buffer. @@ -94,7 +94,7 @@ DiscoverPeimsAndOrderWithApriori ( TempFileHandles[PeimCount++] = FileHandle; } - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); DEBUG (( DEBUG_INFO, @@ -131,12 +131,12 @@ DiscoverPeimsAndOrderWithApriori ( // Read the Apriori file // Status = FvPpi->FindSectionByType (FvPpi, EFI_SECTION_RAW, AprioriFileHandle, (VOID **) &Apriori); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Calculate the number of PEIMs in the Apriori file // Status = FvPpi->GetFileInfo (FvPpi, AprioriFileHandle, &FileInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Private->AprioriCount = FileInfo.BufferSize; if (IS_SECTION2 (FileInfo.Buffer)) { Private->AprioriCount -= sizeof (EFI_COMMON_SECTION_HEADER2); @@ -151,7 +151,7 @@ DiscoverPeimsAndOrderWithApriori ( // quickly from file name to file handle // Status = FvPpi->GetFileInfo (FvPpi, TempFileHandles[Index], &FileInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); CopyMem (&TempFileGuid[Index], &FileInfo.FileName, sizeof(EFI_GUID)); } @@ -790,7 +790,7 @@ PeiCheckAndSwitchStack ( NULL, (VOID**)&TemporaryRamSupportPpi ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Heap Offset // @@ -1094,7 +1094,7 @@ PeiDispatcher ( Private->PeimNeedingDispatch = TRUE; } else { Status = CoreFvHandle->FvPpi->GetFileInfo (CoreFvHandle->FvPpi, PeimFileHandle, &FvFileInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (FvFileInfo.FileType == EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) { // // For Fv type file, Produce new FvInfo PPI and FV hob @@ -1309,7 +1309,7 @@ DepexSatisfied ( EFI_FV_FILE_INFO FileInfo; Status = PeiServicesFfsGetFileInfo (FileHandle, &FileInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, "Evaluate PEI DEPEX for FFS(Unknown)\n")); } else { DEBUG ((DEBUG_DISPATCH, "Evaluate PEI DEPEX for FFS(%g)\n", &FileInfo.FileName)); @@ -1332,7 +1332,7 @@ DepexSatisfied ( (VOID **)&DepexData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If there is no DEPEX, assume the module can be executed // diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index 709db0069..facd74daa 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -484,7 +484,7 @@ PeiInitializeFv ( NULL, (VOID**)&FvPpi ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Get handle of BFV @@ -495,7 +495,7 @@ PeiInitializeFv ( (UINTN)BfvHeader->FvLength, &FvHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); PrivateData->Fv = AllocateZeroPool (sizeof (PEI_CORE_FV_HANDLE) * FV_GROWTH_STEP); ASSERT (PrivateData->Fv != NULL); @@ -523,7 +523,7 @@ PeiInitializeFv ( // additional Fvs to PeiCore. // Status = PeiServicesNotifyPpi (mNotifyOnFvInfoList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } @@ -601,12 +601,12 @@ FirmwareVolmeInfoPpiNotifyCallback ( NULL, (VOID**)&FvPpi ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Process new found FV and get FV handle. // Status = FvPpi->ProcessVolume (FvPpi, FvInfo2Ppi.FvInfo, FvInfo2Ppi.FvInfoSize, &FvHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Fail to process new found FV, FV may be corrupted!\n")); return Status; } @@ -671,14 +671,14 @@ FirmwareVolmeInfoPpiNotifyCallback ( FvHandle, &FileHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = FvPpi->FindSectionByType ( FvPpi, EFI_SECTION_PEI_DEPEX, FileHandle, (VOID**)&DepexData ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (!PeimDispatchReadiness (PeiServices, DepexData)) { // // Dependency is not satisfied. @@ -735,7 +735,7 @@ VerifyGuidedSectionGuid ( // Found the recorded GuidedSectionGuid. // Status = PeiServicesLocatePpi (GuidedSectionGuid, 0, NULL, (VOID **) &Interface); - if (!EFI_ERROR (Status) && Interface != NULL) { + if (!EFI_ERROR(Status) && Interface != NULL) { // // Found the supported Guided Section Extraction Ppi for the Guided Section. // @@ -878,7 +878,7 @@ ProcessSection ( &TempAuthenticationStatus, IsFfs3Fv ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *OutputBuffer = TempOutputBuffer; *AuthenticationStatus = TempAuthenticationStatus | Authentication; return EFI_SUCCESS; @@ -926,7 +926,7 @@ ProcessSection ( } } else if (Section->Type == EFI_SECTION_COMPRESSION) { Status = PeiServicesLocatePpi (&gEfiPeiDecompressPpiGuid, 0, NULL, (VOID **) &DecompressPpi); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = DecompressPpi->Decompress ( DecompressPpi, (CONST EFI_COMPRESSION_SECTION*) Section, @@ -936,7 +936,7 @@ ProcessSection ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Authentication & EFI_AUTH_STATUS_NOT_TESTED) == 0) { // // Update cache section data. @@ -962,7 +962,7 @@ ProcessSection ( &TempAuthenticationStatus, IsFfs3Fv ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *OutputBuffer = TempOutputBuffer; *AuthenticationStatus = TempAuthenticationStatus | Authentication; return EFI_SUCCESS; @@ -1446,7 +1446,7 @@ ProcessFvFile ( (VOID **)&FvHeader ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -1505,10 +1505,10 @@ ProcessFvFile ( } Status = ParentFvPpi->GetVolumeInfo (ParentFvPpi, ParentFvHandle, &ParentFvImageInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = ParentFvPpi->GetFileInfo (ParentFvPpi, ParentFvFileHandle, &FileInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install FvInfo(2) Ppi @@ -1729,7 +1729,7 @@ PeiFfsFvPpiFindFileByName ( // if (PrivateData->Fv[Index].FvPpi != NULL) { Status = FindFileEx (PrivateData->Fv[Index].FvHandle, FileName, 0, FileHandle, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *FvHandle = PrivateData->Fv[Index].FvHandle; break; } @@ -1871,7 +1871,7 @@ PeiFfsFvPpiGetFileInfo2 ( } Status = PeiFfsFvPpiGetFileInfo (This, FileHandle, (EFI_FV_FILE_INFO *) FileInfo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FileInfo->AuthenticationStatus = CoreFvHandle->AuthenticationStatus; } @@ -2051,7 +2051,7 @@ PeiFfsFvPpiFindSectionByType2 ( &ExtractedAuthenticationStatus, FwVolInstance->IsFfs3Fv ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Inherit the authentication status. // @@ -2137,14 +2137,14 @@ PeiReinitializeFv ( &OldDescriptor, &OldFfsFvPpi ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Re-install the EFI_PEI_FIRMWARE_VOLUME_PPI for build-in Ffs2 // which is shadowed from flash to permanent memory within PeiCore image. // Status = PeiServicesReInstallPpi (OldDescriptor, &mPeiFfs2FvPpiList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Fixup all FvPpi pointers for the implementation in flash to permanent memory. @@ -2165,14 +2165,14 @@ PeiReinitializeFv ( &OldDescriptor, &OldFfsFvPpi ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Re-install the EFI_PEI_FIRMWARE_VOLUME_PPI for build-in Ffs3 // which is shadowed from flash to permanent memory within PeiCore image. // Status = PeiServicesReInstallPpi (OldDescriptor, &mPeiFfs3FvPpiList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Fixup all FvPpi pointers for the implementation in flash to permanent memory. @@ -2333,7 +2333,7 @@ ThirdPartyFvPpiNotifyCallback ( do { Status = FindUnknownFormatFvInfo (PrivateData, NotifyDescriptor->Guid, &FvInfo, &FvInfoSize, &AuthenticationStatus); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -2341,7 +2341,7 @@ ThirdPartyFvPpiNotifyCallback ( // Process new found FV and get FV handle. // Status = FvPpi->ProcessVolume (FvPpi, FvInfo, FvInfoSize, &FvHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Fail to process the FV 0x%p, FV may be corrupted!\n", FvInfo)); continue; } @@ -2408,14 +2408,14 @@ ThirdPartyFvPpiNotifyCallback ( FvHandle, &FileHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = FvPpi->FindSectionByType ( FvPpi, EFI_SECTION_PEI_DEPEX, FileHandle, (VOID**)&DepexData ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (!PeimDispatchReadiness (PeiServices, DepexData)) { // // Dependency is not satisfied. diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c index d553d9128..416f58529 100644 --- a/MdeModulePkg/Core/Pei/Image/Image.c +++ b/MdeModulePkg/Core/Pei/Image/Image.c @@ -186,7 +186,7 @@ GetPeCoffImageFixLoadingAssignedAddress( &Size, &SectionHeader ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -285,7 +285,7 @@ LoadAndRelocatePeCoffImage ( ImageContext.ImageRead = PeiImageRead; Status = PeCoffLoaderGetImageInfo (&ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -313,7 +313,7 @@ LoadAndRelocatePeCoffImage ( // Get file type first // Status = PeiServicesFfsGetFileInfo (FileHandle, &FileInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Check whether the file type is PEI module. @@ -360,7 +360,7 @@ LoadAndRelocatePeCoffImage ( if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 && (Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) { Status = GetPeCoffImageFixLoadingAssignedAddress(&ImageContext, Private); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED ERROR: Failed to load module at fixed address. \n")); // // The PEIM is not assiged valid address, try to allocate page to load it. @@ -374,7 +374,7 @@ LoadAndRelocatePeCoffImage ( EFI_SIZE_TO_PAGES ((UINT32) AlignImageSize), &ImageContext.ImageAddress); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Adjust the Image Address to make sure it is section alignment. // @@ -416,7 +416,7 @@ LoadAndRelocatePeCoffImage ( // Load the image to our new buffer // Status = PeCoffLoaderLoadImage (&ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (ImageContext.ImageError == IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) { DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet with section alignment 0x%x.\n", (VOID*)(UINTN)ImageContext.ImageAddress, ImageContext.SectionAlignment)); } @@ -426,7 +426,7 @@ LoadAndRelocatePeCoffImage ( // Relocate the image in our new buffer // Status = PeCoffLoaderRelocateImage (&ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -509,7 +509,7 @@ PeiLoadImageLoadImage ( // // If we didn't find a first exe section, try to find the second exe section. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = PeiServicesFfsFindSectionData3 ( SearchType2, 0, @@ -517,7 +517,7 @@ PeiLoadImageLoadImage ( &Pe32Data, AuthenticationState ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // PEI core only carry the loader function for TE and PE32 executables // If this two section does not exist, just return. @@ -539,10 +539,10 @@ PeiLoadImageLoadImage ( &ImageEntryPoint ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -774,7 +774,7 @@ PeiLoadImage ( NULL, (VOID **)&LoadFile ); - if (!EFI_ERROR (PpiStatus)) { + if (!EFI_ERROR(PpiStatus)) { Status = LoadFile->LoadFile ( LoadFile, FileHandle, @@ -783,7 +783,7 @@ PeiLoadImage ( EntryPoint, AuthenticationState ); - if (!EFI_ERROR (Status) || Status == EFI_WARN_BUFFER_TOO_SMALL) { + if (!EFI_ERROR(Status) || Status == EFI_WARN_BUFFER_TOO_SMALL) { // // The shadowed PEIM must be relocatable. // @@ -806,7 +806,7 @@ PeiLoadImage ( } } Index++; - } while (!EFI_ERROR (PpiStatus)); + } while (!EFI_ERROR(PpiStatus)); return PpiStatus; } diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c index 706837890..63ffa90bd 100644 --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c @@ -591,7 +591,7 @@ PeiAllocatePages ( // Try to find free memory by searching memory allocation HOBs. // Status = FindFreeMemoryFromMemoryAllocationHob (MemoryType, Pages, Granularity, Memory); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return Status; } DEBUG ((EFI_D_ERROR, "AllocatePages failed: No 0x%lx Pages is available.\n", (UINT64) Pages)); @@ -801,9 +801,9 @@ PeiAllocatePool ( (UINT16)(sizeof (EFI_HOB_MEMORY_POOL) + Size), (VOID **)&Hob ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *Buffer = NULL; } else { *Buffer = Hob + 1; diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c index 33f056ea8..a8e212c43 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -96,7 +96,7 @@ ShadowPeiCore ( NULL, (VOID **) &PeiCoreFvLocationPpi ); - if (!EFI_ERROR (Status) && (PeiCoreFvLocationPpi->PeiCoreFvLocation != NULL)) { + if (!EFI_ERROR(Status) && (PeiCoreFvLocationPpi->PeiCoreFvLocation != NULL)) { // // If PeiCoreFvLocation present, the PEI Core should be found from indicated FV // @@ -117,7 +117,7 @@ ShadowPeiCore ( PrivateData->Fv[PeiCoreFvIndex].FvHandle, &PeiCoreFileHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Shadow PEI Core into memory so it will run faster @@ -129,7 +129,7 @@ ShadowPeiCore ( &EntryPoint, &AuthenticationState ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Compute the PeiCore's function address after shaowed PeiCore. @@ -427,7 +427,7 @@ PeiCore ( NULL, (VOID**)&TemporaryRamDonePpi ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Disable the use of Temporary RAM after the transition from Temporary RAM to Permanent RAM is complete. // @@ -474,9 +474,9 @@ PeiCore ( NULL, (VOID **)&TempPtr.DxeIpl ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Report status code to indicate DXE IPL PPI could not be found. // @@ -499,7 +499,7 @@ PeiCore ( // // Should never reach here. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); CpuDeadLoop(); UNREACHABLE (); diff --git a/MdeModulePkg/Core/Pei/Ppi/Ppi.c b/MdeModulePkg/Core/Pei/Ppi/Ppi.c index 964aee690..be1939432 100644 --- a/MdeModulePkg/Core/Pei/Ppi/Ppi.c +++ b/MdeModulePkg/Core/Pei/Ppi/Ppi.c @@ -795,13 +795,13 @@ ProcessPpiListFromSec ( // It is a notification PPI. // Status = InternalPeiNotifyPpi (PeiServices, (CONST EFI_PEI_NOTIFY_DESCRIPTOR *) PpiList, TRUE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else { // // It is a normal PPI. // Status = InternalPeiInstallPpi (PeiServices, PpiList, TRUE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) == EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) { @@ -821,11 +821,11 @@ ProcessPpiListFromSec ( // into the PPI database and before dispatching any PEIMs. // Status = PeiLocatePpi (PeiServices, &gEfiSecHobDataPpiGuid, 0, NULL, (VOID **) &SecHobDataPpi); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = SecHobDataPpi->GetHobs (SecHobDataPpi, &SecHobList); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PeiInstallSecHobData (PeiServices, SecHobList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } } diff --git a/MdeModulePkg/Core/Pei/Reset/Reset.c b/MdeModulePkg/Core/Pei/Reset/Reset.c index 0c3cfad03..2fc13d8f0 100644 --- a/MdeModulePkg/Core/Pei/Reset/Reset.c +++ b/MdeModulePkg/Core/Pei/Reset/Reset.c @@ -44,7 +44,7 @@ PeiResetSystem ( NULL, (VOID **)&ResetPpi ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return ResetPpi->ResetSystem (PeiServices); } @@ -96,7 +96,7 @@ PeiResetSystem2 ( NULL, (VOID **)&Reset2Ppi ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Reset2Ppi->ResetSystem (ResetType, ResetStatus, DataSize, ResetData); return; } diff --git a/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c b/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c index 482f8d8a0..df4040fa4 100644 --- a/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c +++ b/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c @@ -48,7 +48,7 @@ PeiReportStatusCode ( (VOID **)&StatusCodePpi ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = StatusCodePpi->ReportStatusCode ( PeiServices, CodeType, diff --git a/MdeModulePkg/Core/PiSmmCore/Dependency.c b/MdeModulePkg/Core/PiSmmCore/Dependency.c index dfd4537f8..700817a92 100644 --- a/MdeModulePkg/Core/PiSmmCore/Dependency.c +++ b/MdeModulePkg/Core/PiSmmCore/Dependency.c @@ -72,7 +72,7 @@ GrowDepexStack ( // // Free The Old Stack // - FreePool (mDepexEvaluationStack); + FreePool(mDepexEvaluationStack); } // @@ -109,7 +109,7 @@ PushBool ( // Grow the stack // Status = GrowDepexStack (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -241,14 +241,14 @@ SmmIsSchedulable ( CopyMem (&DriverGuid, Iterator + 1, sizeof (EFI_GUID)); Status = SmmLocateProtocol (&DriverGuid, NULL, &Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // For SMM Driver, it may depend on uefi protocols // Status = gBS->LocateProtocol (&DriverGuid, NULL, &Interface); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = FALSE\n", &DriverGuid)); Status = PushBool (FALSE); } else { @@ -256,7 +256,7 @@ SmmIsSchedulable ( *Iterator = EFI_DEP_REPLACE_TRUE; Status = PushBool (TRUE); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -267,19 +267,19 @@ SmmIsSchedulable ( case EFI_DEP_AND: DEBUG ((DEBUG_DISPATCH, " AND\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PopBool (&Operator2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PushBool ((BOOLEAN)(Operator && Operator2)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -288,19 +288,19 @@ SmmIsSchedulable ( case EFI_DEP_OR: DEBUG ((DEBUG_DISPATCH, " OR\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PopBool (&Operator2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PushBool ((BOOLEAN)(Operator || Operator2)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -309,13 +309,13 @@ SmmIsSchedulable ( case EFI_DEP_NOT: DEBUG ((DEBUG_DISPATCH, " NOT\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } Status = PushBool ((BOOLEAN)(!Operator)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -324,7 +324,7 @@ SmmIsSchedulable ( case EFI_DEP_TRUE: DEBUG ((DEBUG_DISPATCH, " TRUE\n")); Status = PushBool (TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -333,7 +333,7 @@ SmmIsSchedulable ( case EFI_DEP_FALSE: DEBUG ((DEBUG_DISPATCH, " FALSE\n")); Status = PushBool (FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -342,7 +342,7 @@ SmmIsSchedulable ( case EFI_DEP_END: DEBUG ((DEBUG_DISPATCH, " END\n")); Status = PopBool (&Operator); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } @@ -353,7 +353,7 @@ SmmIsSchedulable ( CopyMem (&DriverGuid, Iterator + 1, sizeof (EFI_GUID)); DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = TRUE\n", &DriverGuid)); Status = PushBool (TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n")); return FALSE; } diff --git a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c index 1c88c8fb1..1f2b157d3 100644 --- a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c +++ b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c @@ -248,7 +248,7 @@ GetPeCoffImageFixLoadingAssignedAddress( &Size, &SectionHeader ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -358,7 +358,7 @@ SmmLoadImage ( // FilePath = OriginalFilePath; Status = gBS->HandleProtocol (DeviceHandle, &gEfiDevicePathProtocolGuid, (VOID **)&HandleFilePath); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FilePathSize = GetDevicePathSize (HandleFilePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL); FilePath = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *)FilePath) + FilePathSize ); } @@ -376,7 +376,7 @@ SmmLoadImage ( &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Try reading TE section secondly // @@ -393,9 +393,9 @@ SmmLoadImage ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Buffer != NULL) { - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); } return Status; } @@ -418,7 +418,7 @@ SmmLoadImage ( // Only on images that have been read using Firmware Volume protocol. // All SMM images are from FV protocol. // - if (!EFI_ERROR (SecurityStatus) && (mSecurity != NULL)) { + if (!EFI_ERROR(SecurityStatus) && (mSecurity != NULL)) { SecurityStatus = mSecurity->FileAuthenticationState ( mSecurity, AuthenticationStatus, @@ -426,7 +426,7 @@ SmmLoadImage ( ); } - if (EFI_ERROR (SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) { + if (EFI_ERROR(SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) { Status = SecurityStatus; return Status; } @@ -441,9 +441,9 @@ SmmLoadImage ( // Get information about the image being loaded // Status = PeCoffLoaderGetImageInfo (&ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Buffer != NULL) { - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); } return Status; } @@ -456,7 +456,7 @@ SmmLoadImage ( // Get the fixed loading address assigned by Build tool // Status = GetPeCoffImageFixLoadingAssignedAddress (&ImageContext); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Since the memory range to load Smm core alreay been cut out, so no need to allocate and free this range // following statements is to bypass SmmFreePages @@ -477,9 +477,9 @@ SmmLoadImage ( PageCount, &DstBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Buffer != NULL) { - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); } return Status; } @@ -495,9 +495,9 @@ SmmLoadImage ( PageCount, &DstBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Buffer != NULL) { - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); } return Status; } @@ -514,9 +514,9 @@ SmmLoadImage ( // Load the image to our new buffer // Status = PeCoffLoaderLoadImage (&ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Buffer != NULL) { - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); } SmmFreePages (DstBuffer, PageCount); return Status; @@ -526,9 +526,9 @@ SmmLoadImage ( // Relocate the image in our new buffer // Status = PeCoffLoaderRelocateImage (&ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Buffer != NULL) { - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); } SmmFreePages (DstBuffer, PageCount); return Status; @@ -550,9 +550,9 @@ SmmLoadImage ( // Allocate a Loaded Image Protocol in EfiBootServicesData // Status = gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_LOADED_IMAGE_PROTOCOL), (VOID **)&DriverEntry->LoadedImage); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Buffer != NULL) { - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); } SmmFreePages (DstBuffer, PageCount); return Status; @@ -577,9 +577,9 @@ SmmLoadImage ( // Make an EfiBootServicesData buffer copy of FilePath // Status = gBS->AllocatePool (EfiBootServicesData, GetDevicePathSize (FilePath), (VOID **)&DriverEntry->LoadedImage->FilePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Buffer != NULL) { - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); } SmmFreePages (DstBuffer, PageCount); return Status; @@ -595,11 +595,11 @@ SmmLoadImage ( // Make a buffer copy of FilePath // Status = SmmAllocatePool (EfiRuntimeServicesData, GetDevicePathSize(FilePath), (VOID **)&DriverEntry->SmmLoadedImage.FilePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Buffer != NULL) { - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); } - gBS->FreePool (DriverEntry->LoadedImage->FilePath); + gBS->FreePool(DriverEntry->LoadedImage->FilePath); SmmFreePages (DstBuffer, PageCount); return Status; } @@ -696,7 +696,7 @@ SmmLoadImage ( // used the UEFI Boot Services AllocatePool() function // Status = gBS->FreePool(Buffer); - if (!EFI_ERROR (Status) && EFI_ERROR (SecurityStatus)) { + if (!EFI_ERROR(Status) && EFI_ERROR(SecurityStatus)) { Status = SecurityStatus; } return Status; @@ -773,7 +773,7 @@ SmmGetDepexSectionAndPreProccess ( (UINTN *)&DriverEntry->DepexSize, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_PROTOCOL_ERROR) { // // The section extraction protocol failed so set protocol error flag @@ -862,7 +862,7 @@ SmmDispatcher ( // // Update the driver state to reflect that it's been loaded // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The SMM Driver could not be loaded, and do not attempt to load or start it again. // Take driver from Scheduled to Initialized. @@ -912,11 +912,11 @@ SmmDispatcher ( &gEfiLoadedImageProtocolGuid, DriverEntry->LoadedImage ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (DriverEntry->LoadedImage->FilePath != NULL) { - gBS->FreePool (DriverEntry->LoadedImage->FilePath); + gBS->FreePool(DriverEntry->LoadedImage->FilePath); } - gBS->FreePool (DriverEntry->LoadedImage); + gBS->FreePool(DriverEntry->LoadedImage); } Status = SmmUninstallProtocolInterface ( DriverEntry->SmmImageHandle, @@ -925,7 +925,7 @@ SmmDispatcher ( ); if (!EFI_ERROR(Status)) { if (DriverEntry->SmmLoadedImage.FilePath != NULL) { - SmmFreePool (DriverEntry->SmmLoadedImage.FilePath); + SmmFreePool(DriverEntry->SmmLoadedImage.FilePath); } } } @@ -1143,7 +1143,7 @@ SmmFvToDevicePath ( // Remember the device path of the FV // Status = gBS->HandleProtocol (FvHandle, &gEfiDevicePathProtocolGuid, (VOID **)&FvDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FileNameDevicePath = NULL; } else { // @@ -1277,7 +1277,7 @@ SmmDriverDispatchHandler ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -1297,7 +1297,7 @@ SmmDriverDispatchHandler ( FvIsBeingProcesssed (FvHandle); Status = gBS->HandleProtocol (FvHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // FvHandle must have a Firmware Volume2 Protocol thus we should never get here. // @@ -1306,7 +1306,7 @@ SmmDriverDispatchHandler ( } Status = gBS->HandleProtocol (FvHandle, &gEfiDevicePathProtocolGuid, (VOID **)&FvDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The Firmware volume doesn't have device path, can't be dispatched. // @@ -1333,7 +1333,7 @@ SmmDriverDispatchHandler ( &Attributes, &Size ); - if (!EFI_ERROR (GetNextFileStatus)) { + if (!EFI_ERROR(GetNextFileStatus)) { if (Type == EFI_FV_FILETYPE_SMM_CORE) { // // If this is the SMM core fill in it's DevicePath & DeviceHandle @@ -1354,7 +1354,7 @@ SmmDriverDispatchHandler ( GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath), (VOID **)&mSmmCoreLoadedImage->FilePath ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); CopyMem (mSmmCoreLoadedImage->FilePath, &mFvDevicePath, GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath)); mSmmCoreLoadedImage->DeviceHandle = FvHandle; @@ -1375,7 +1375,7 @@ SmmDriverDispatchHandler ( GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath), (VOID **)&mSmmCoreDriverEntry->SmmLoadedImage.FilePath ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); CopyMem (mSmmCoreDriverEntry->SmmLoadedImage.FilePath, &mFvDevicePath, GetDevicePathSize((EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath)); mSmmCoreDriverEntry->SmmLoadedImage.DeviceHandle = FvHandle; @@ -1384,7 +1384,7 @@ SmmDriverDispatchHandler ( SmmAddToDriverList (Fv, FvHandle, &NameGuid); } } - } while (!EFI_ERROR (GetNextFileStatus)); + } while (!EFI_ERROR(GetNextFileStatus)); } // @@ -1401,7 +1401,7 @@ SmmDriverDispatchHandler ( &SizeOfBuffer, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { AprioriEntryCount = SizeOfBuffer / sizeof (EFI_GUID); } else { AprioriEntryCount = 0; @@ -1434,7 +1434,7 @@ SmmDriverDispatchHandler ( // The UEFI Boot Services FreePool() function must be used because Fv->ReadSection // used the UEFI Boot Services AllocatePool() function // - gBS->FreePool (AprioriFile); + gBS->FreePool(AprioriFile); } // @@ -1454,7 +1454,7 @@ SmmDriverDispatchHandler ( // request the SMM Dispatcher to be restarted. // *(UINT8 *)CommBuffer = COMM_BUFFER_SMM_DISPATCH_RESTART; - } else if (!EFI_ERROR (Status)) { + } else if (!EFI_ERROR(Status)) { // // Set the flag to show that the SMM Dispatcher executed without errors // diff --git a/MdeModulePkg/Core/PiSmmCore/Handle.c b/MdeModulePkg/Core/PiSmmCore/Handle.c index f8dbe4644..cf823199a 100644 --- a/MdeModulePkg/Core/PiSmmCore/Handle.c +++ b/MdeModulePkg/Core/PiSmmCore/Handle.c @@ -237,7 +237,7 @@ SmmInstallProtocolInterfaceNotify ( if (*UserHandle != NULL) { Status = SmmHandleProtocol (*UserHandle, Protocol, (VOID **)&ExistingInterface); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } } @@ -283,7 +283,7 @@ SmmInstallProtocolInterfaceNotify ( InsertTailList (&gHandleList, &Handle->AllHandles); } else { Status = SmmValidateHandle (Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG((DEBUG_ERROR, "SmmInstallProtocolInterface: input handle at 0x%x is invalid\n", Handle)); goto Done; } @@ -323,7 +323,7 @@ SmmInstallProtocolInterfaceNotify ( Status = EFI_SUCCESS; Done: - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Return the new handle back to the caller // @@ -333,7 +333,7 @@ Done: // There was an error, clean up // if (Prot != NULL) { - FreePool (Prot); + FreePool(Prot); } DEBUG((DEBUG_ERROR, "SmmInstallProtocolInterface: %g %p failed with %r\n", Protocol, Interface, Status)); } @@ -376,7 +376,7 @@ SmmUninstallProtocolInterface ( // Check that UserHandle is a valid handle // Status = SmmValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -405,7 +405,7 @@ SmmUninstallProtocolInterface ( // Free the memory // Prot->Signature = 0; - FreePool (Prot); + FreePool(Prot); Status = EFI_SUCCESS; } @@ -415,7 +415,7 @@ SmmUninstallProtocolInterface ( if (IsListEmpty (&Handle->Protocols)) { Handle->Signature = 0; RemoveEntryList (&Handle->AllHandles); - FreePool (Handle); + FreePool(Handle); } return Status; } @@ -442,7 +442,7 @@ SmmGetProtocolInterface ( LIST_ENTRY *Link; Status = SmmValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -507,7 +507,7 @@ SmmHandleProtocol ( // Check for invalid UserHandle // Status = SmmValidateHandle (UserHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Core/PiSmmCore/HeapGuard.c b/MdeModulePkg/Core/PiSmmCore/HeapGuard.c index 29cd00f38..7a74a4a79 100644 --- a/MdeModulePkg/Core/PiSmmCore/HeapGuard.c +++ b/MdeModulePkg/Core/PiSmmCore/HeapGuard.c @@ -215,7 +215,7 @@ PageAlloc ( Status = SmmInternalAllocatePages (AllocateAnyPages, EfiRuntimeServicesData, Pages, &Memory, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Memory = 0; } @@ -519,7 +519,7 @@ SetGuardPage ( EFI_PAGE_SIZE, EFI_MEMORY_RP ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mOnGuarding = FALSE; } } @@ -549,7 +549,7 @@ UnsetGuardPage ( EFI_PAGE_SIZE, EFI_MEMORY_RP ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mOnGuarding = FALSE; } } @@ -1377,7 +1377,7 @@ VerifyMemoryGuard ( EFI_PAGE_SIZE, &Attribute ); - if (EFI_ERROR (Status) || (Attribute & EFI_MEMORY_RP) == 0) { + if (EFI_ERROR(Status) || (Attribute & EFI_MEMORY_RP) == 0) { DEBUG ((DEBUG_ERROR, "Head Guard is not set at: %016lx (%016lX)!!!\r\n", Address, Attribute)); DumpGuardedMemoryBitmap (); @@ -1392,7 +1392,7 @@ VerifyMemoryGuard ( EFI_PAGE_SIZE, &Attribute ); - if (EFI_ERROR (Status) || (Attribute & EFI_MEMORY_RP) == 0) { + if (EFI_ERROR(Status) || (Attribute & EFI_MEMORY_RP) == 0) { DEBUG ((DEBUG_ERROR, "Tail Guard is not set at: %016lx (%016lX)!!!\r\n", Address, Attribute)); DumpGuardedMemoryBitmap (); diff --git a/MdeModulePkg/Core/PiSmmCore/InstallConfigurationTable.c b/MdeModulePkg/Core/PiSmmCore/InstallConfigurationTable.c index 57f31fa98..ef89c9cce 100644 --- a/MdeModulePkg/Core/PiSmmCore/InstallConfigurationTable.c +++ b/MdeModulePkg/Core/PiSmmCore/InstallConfigurationTable.c @@ -142,7 +142,7 @@ SmmInstallConfigurationTable ( // // Free the old table after updating System Table to the new table pointer. // - FreePool (OldTable); + FreePool(OldTable); } else { // // Update System Table diff --git a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c index d6123da3a..5e89ad52d 100644 --- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c +++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c @@ -1220,8 +1220,8 @@ PublishMemoryAttributesTable ( &DescriptorSize, &DescriptorVersion ); - if (EFI_ERROR (Status)) { - FreePool (MemoryMap); + if (EFI_ERROR(Status)) { + FreePool(MemoryMap); } } while (Status == EFI_BUFFER_TOO_SMALL); @@ -1255,7 +1255,7 @@ PublishMemoryAttributesTable ( } Status = gSmst->SmmInstallConfigurationTable (gSmst, &gEdkiiPiSmmMemoryAttributesTableGuid, MemoryAttributesTable, MemoryAttributesTableSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } @@ -1281,7 +1281,7 @@ SmmInstallImageRecord ( &NoHandles, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -1291,7 +1291,7 @@ SmmInstallImageRecord ( &gEfiLoadedImageProtocolGuid, (VOID **)&LoadedImage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } DEBUG ((DEBUG_VERBOSE, "LoadedImage - 0x%x 0x%x ", LoadedImage->ImageBase, LoadedImage->ImageSize)); @@ -1309,7 +1309,7 @@ SmmInstallImageRecord ( SmmInsertImageRecord (&DriverEntry); } - FreePool (HandleBuffer); + FreePool(HandleBuffer); } /** @@ -1362,7 +1362,7 @@ SmmCoreInitializeMemoryAttributesTable ( SmmInstallMemoryAttributesTable, &Registration ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return ; } diff --git a/MdeModulePkg/Core/PiSmmCore/Notify.c b/MdeModulePkg/Core/PiSmmCore/Notify.c index 8e078f757..013920901 100644 --- a/MdeModulePkg/Core/PiSmmCore/Notify.c +++ b/MdeModulePkg/Core/PiSmmCore/Notify.c @@ -128,7 +128,7 @@ SmmRegisterProtocolNotify ( // ProtNotify->Signature = 0; RemoveEntryList (&ProtNotify->Link); - FreePool (ProtNotify); + FreePool(ProtNotify); return EFI_SUCCESS; } } diff --git a/MdeModulePkg/Core/PiSmmCore/Page.c b/MdeModulePkg/Core/PiSmmCore/Page.c index 1f05bddcc..1a639fa99 100644 --- a/MdeModulePkg/Core/PiSmmCore/Page.c +++ b/MdeModulePkg/Core/PiSmmCore/Page.c @@ -112,8 +112,8 @@ AllocateMemoryMapEntry ( TRUE, FALSE ); - ASSERT_EFI_ERROR (Status); - if(!EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if(!EFI_ERROR(Status)) { FreeDescriptorEntries = (MEMORY_MAP *)(UINTN)Mem; //DEBUG((DEBUG_INFO, "New FreeDescriptorEntries - 0x%x\n", FreeDescriptorEntries)); // @@ -717,7 +717,7 @@ SmmAllocatePages ( NeedGuard = IsPageTypeToGuard (MemoryType, Type); Status = SmmInternalAllocatePages (Type, MemoryType, NumberOfPages, Memory, NeedGuard); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SmmCoreUpdateProfile ( (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionAllocatePages, @@ -918,7 +918,7 @@ SmmFreePages ( IsGuarded = IsHeapGuardEnabled () && IsMemoryGuarded (Memory); Status = SmmInternalFreePages (Memory, NumberOfPages, IsGuarded); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SmmCoreUpdateProfile ( (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionFreePages, diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c index b5676f21b..e9c9bb89e 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c @@ -381,7 +381,7 @@ SmmReadyToLockHandler ( // Print a message on a debug build if the SMM CPU I/O 2 Protocol is not installed // DEBUG_CODE_BEGIN (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "\nSMM: SmmCpuIo Arch Protocol not present!!\n")); } DEBUG_CODE_END (); @@ -389,7 +389,7 @@ SmmReadyToLockHandler ( // // Assert if the CPU I/O 2 Protocol is not installed // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Display any drivers that were not dispatched because dependency expression @@ -461,7 +461,7 @@ SmmEndOfDxeHandler ( NULL, (VOID **)&SxDispatch ); - if (!EFI_ERROR (Status) && (SxDispatch != NULL)) { + if (!EFI_ERROR(Status) && (SxDispatch != NULL)) { // // Register a S3 entry callback function to // determine if it will be during S3 resume. @@ -474,7 +474,7 @@ SmmEndOfDxeHandler ( &EntryRegisterContext, &S3EntryHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -524,7 +524,7 @@ SmmS3SmmInitDoneHandler ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Uninstall the protocol here because the comsumer just hook the @@ -535,7 +535,7 @@ SmmS3SmmInitDoneHandler ( &gEdkiiS3SmmInitDoneGuid, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -583,7 +583,7 @@ SmmEndOfS3ResumeHandler ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Uninstall the protocol here because the comsumer just hook the @@ -594,7 +594,7 @@ SmmEndOfS3ResumeHandler ( &gEdkiiEndOfS3ResumeGuid, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mDuringS3Resume = FALSE; return Status; @@ -762,7 +762,7 @@ SmmCoreInstallLoadedImage ( // Allocate a Loaded Image Protocol in EfiBootServicesData // Status = gBS->AllocatePool (EfiBootServicesData, sizeof(EFI_LOADED_IMAGE_PROTOCOL), (VOID **)&mSmmCoreLoadedImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem (mSmmCoreLoadedImage, sizeof (EFI_LOADED_IMAGE_PROTOCOL)); // @@ -787,7 +787,7 @@ SmmCoreInstallLoadedImage ( &gEfiLoadedImageProtocolGuid, mSmmCoreLoadedImage, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Allocate a Loaded Image Protocol in SMM @@ -889,7 +889,7 @@ SmmMain ( mSmmCoreSmiHandlers[Index].HandlerType, &mSmmCoreSmiHandlers[Index].DispatchHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } mAcpiS3Enable = PcdGetBool (PcdAcpiS3Enable); @@ -903,7 +903,7 @@ SmmMain ( mSmmCoreS3SmiHandlers[Index].HandlerType, &mSmmCoreS3SmiHandlers[Index].DispatchHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h index 0908e7f4e..b4d378d80 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h @@ -425,7 +425,7 @@ SmmInternalAllocatePool ( **/ EFI_STATUS EFIAPI -SmmFreePool ( +SmmFreePool( IN VOID *Buffer ); @@ -440,7 +440,7 @@ SmmFreePool ( **/ EFI_STATUS EFIAPI -SmmInternalFreePool ( +SmmInternalFreePool( IN VOID *Buffer ); diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c index 1cf8c9322..c86173dba 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c @@ -517,7 +517,7 @@ SmmCommunicationCommunicate ( // Generate Software SMI // Status = mSmmControl2->Trigger (mSmmControl2, NULL, NULL, FALSE, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -672,7 +672,7 @@ SmmIplDxeDispatchEventNotify ( // so no need to reset the SMRAM to UC in MTRR. // Status = mSmmAccess->Close (mSmmAccess); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Print debug message that the SMRAM window is now closed. @@ -702,7 +702,7 @@ SmmIplSmmConfigurationEventNotify ( // Make sure this notification is for this handler // Status = gBS->LocateProtocol (Context, NULL, (VOID **)&SmmConfiguration); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -710,7 +710,7 @@ SmmIplSmmConfigurationEventNotify ( // Register the SMM Entry Point provided by the SMM Core with the SMM COnfiguration protocol // Status = SmmConfiguration->RegisterSmmEntry (SmmConfiguration, gSmmCorePrivate->SmmEntryPoint); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Set flag to indicate that the SMM Entry Point has been registered which @@ -755,7 +755,7 @@ SmmIplReadyToLockEventNotify ( // if (CompareGuid ((EFI_GUID *)Context, &gEfiDxeSmmReadyToLockProtocolGuid)) { Status = gBS->LocateProtocol (&gEfiDxeSmmReadyToLockProtocolGuid, NULL, &Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } } else { @@ -885,7 +885,7 @@ GetPeCoffImageFixLoadingAssignedAddress( &Size, &SectionHeader ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -959,7 +959,7 @@ ExecuteSmmCoreFromSmram ( &SourceBuffer, &SourceSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -973,7 +973,7 @@ ExecuteSmmCoreFromSmram ( // Get information about the image being loaded // Status = PeCoffLoaderGetImageInfo (&ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -985,7 +985,7 @@ ExecuteSmmCoreFromSmram ( // Get the fixed loading address assigned by Build tool // Status = GetPeCoffImageFixLoadingAssignedAddress (&ImageContext); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Since the memory range to load SMM CORE will be cut out in SMM core, so no need to allocate and free this range // @@ -1050,12 +1050,12 @@ ExecuteSmmCoreFromSmram ( // Load the image to our new buffer // Status = PeCoffLoaderLoadImage (&ImageContext); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Relocate the image in our new buffer // Status = PeCoffLoaderRelocateImage (&ImageContext); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Flush the instruction cache so the image data are written before we execute it // @@ -1084,7 +1084,7 @@ ExecuteSmmCoreFromSmram ( // // Always free memory allocted by GetFileBufferByFilePath () // - FreePool (SourceBuffer); + FreePool(SourceBuffer); return Status; } @@ -1375,7 +1375,7 @@ GetFullSmramRanges ( ASSERT (FullSmramRanges != NULL); Status = mSmmAccess->GetCapabilities (mSmmAccess, &Size, FullSmramRanges); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return FullSmramRanges; } @@ -1432,7 +1432,7 @@ GetFullSmramRanges ( SmramRanges = (EFI_SMRAM_DESCRIPTOR *) AllocatePool (Size); ASSERT (SmramRanges != NULL); Status = mSmmAccess->GetCapabilities (mSmmAccess, &Size, SmramRanges); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); do { Rescan = FALSE; @@ -1505,9 +1505,9 @@ GetFullSmramRanges ( ASSERT (*FullSmramRangeCount == TempSmramRangeCount); *FullSmramRangeCount += AdditionSmramRangeCount; - FreePool (SmramRanges); - FreePool (SmramReservedRanges); - FreePool (TempSmramRanges); + FreePool(SmramRanges); + FreePool(SmramReservedRanges); + FreePool(TempSmramRanges); return FullSmramRanges; } @@ -1554,13 +1554,13 @@ SmmIplEntry ( // Get SMM Access Protocol // Status = gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (VOID **)&mSmmAccess); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Get SMM Control2 Protocol // Status = gBS->LocateProtocol (&gEfiSmmControl2ProtocolGuid, NULL, (VOID **)&mSmmControl2); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); gSmmCorePrivate->SmramRanges = GetFullSmramRanges (&gSmmCorePrivate->SmramRangeCount); @@ -1568,7 +1568,7 @@ SmmIplEntry ( // Open all SMRAM ranges // Status = mSmmAccess->Open (mSmmAccess); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Print debug message that the SMRAM window is now open. @@ -1614,7 +1614,7 @@ SmmIplEntry ( mSmramCacheBase, &MemDesc ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if ((MemDesc.Capabilities & SMRAM_CAPABILITIES) != SMRAM_CAPABILITIES) { gDS->SetMemorySpaceCapabilities ( mSmramCacheBase, @@ -1630,7 +1630,7 @@ SmmIplEntry ( // CpuArch = NULL; Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&CpuArch); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { MemDesc.Attributes &= ~(MEMORY_CACHE_ATTRIBUTES | MEMORY_PAGE_ATTRIBUTES); MemDesc.Attributes |= EFI_MEMORY_WB; Status = gDS->SetMemorySpaceAttributes ( @@ -1638,7 +1638,7 @@ SmmIplEntry ( mSmramCacheSize, MemDesc.Attributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "SMM IPL failed to set SMRAM window to EFI_MEMORY_WB\n")); } @@ -1671,7 +1671,7 @@ SmmIplEntry ( &gLoadFixedAddressConfigurationTableGuid, (VOID **) &mLMFAConfigurationTable ); - if (!EFI_ERROR (Status) && mLMFAConfigurationTable != NULL) { + if (!EFI_ERROR(Status) && mLMFAConfigurationTable != NULL) { mLMFAConfigurationTable->SmramBase = mCurrentSmramRange->CpuStart; // // Print the SMRAM base @@ -1700,7 +1700,7 @@ SmmIplEntry ( &gSmmCorePrivate->SmramRanges[gSmmCorePrivate->SmramRangeCount - 1], gSmmCorePrivate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Print error message that the SMM Core failed to be loaded and executed. // @@ -1715,7 +1715,7 @@ SmmIplEntry ( mSmramCacheSize, EFI_MEMORY_UC ); - if (EFI_ERROR (SetAttrStatus)) { + if (EFI_ERROR(SetAttrStatus)) { DEBUG ((DEBUG_WARN, "SMM IPL failed to reset SMRAM window to EFI_MEMORY_UC\n")); } } @@ -1731,12 +1731,12 @@ SmmIplEntry ( // If the SMM Core could not be loaded then close SMRAM window, free allocated // resources, and return an error so SMM IPL will be unloaded. // - if (mCurrentSmramRange == NULL || EFI_ERROR (Status)) { + if (mCurrentSmramRange == NULL || EFI_ERROR(Status)) { // // Close all SMRAM ranges // Status = mSmmAccess->Close (mSmmAccess); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Print debug message that the SMRAM window is now closed. @@ -1746,7 +1746,7 @@ SmmIplEntry ( // // Free all allocated resources // - FreePool (gSmmCorePrivate->SmramRanges); + FreePool(gSmmCorePrivate->SmramRanges); return EFI_UNSUPPORTED; } @@ -1760,7 +1760,7 @@ SmmIplEntry ( &gEfiSmmCommunicationProtocolGuid, &mSmmCommunication, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Create the set of protocol and event notififcations that the SMM IPL requires @@ -1783,7 +1783,7 @@ SmmIplEntry ( mSmmIplEvents[Index].Guid, &mSmmIplEvents[Index].Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c b/MdeModulePkg/Core/PiSmmCore/Pool.c index a503ff51f..89f358663 100644 --- a/MdeModulePkg/Core/PiSmmCore/Pool.c +++ b/MdeModulePkg/Core/PiSmmCore/Pool.c @@ -70,7 +70,7 @@ SmmInitializeMemoryServices ( &gLoadFixedAddressConfigurationTableGuid, (VOID **) &LMFAConfigurationTable ); - if (!EFI_ERROR (Status) && LMFAConfigurationTable != NULL) { + if (!EFI_ERROR(Status) && LMFAConfigurationTable != NULL) { gLoadModuleAtFixAddressSmramBase = LMFAConfigurationTable->SmramBase; } @@ -141,7 +141,7 @@ InternalAllocPoolByIndex ( Status = SmmInternalAllocatePages (AllocateAnyPages, PoolType, EFI_SIZE_TO_PAGES (MAX_POOL_SIZE << 1), &Address, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } Hdr = (FREE_POOL_HEADER *) (UINTN) Address; @@ -150,7 +150,7 @@ InternalAllocPoolByIndex ( RemoveEntryList (&Hdr->Link); } else { Status = InternalAllocPoolByIndex (PoolType, PoolIndex + 1, &Hdr); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Hdr->Header.Signature = 0; Hdr->Header.Size >>= 1; Hdr->Header.Available = TRUE; @@ -163,7 +163,7 @@ InternalAllocPoolByIndex ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Hdr->Header.Signature = POOL_HEAD_SIGNATURE; Hdr->Header.Size = MIN_POOL_SIZE << PoolIndex; Hdr->Header.Available = FALSE; @@ -266,7 +266,7 @@ SmmInternalAllocatePool ( NoPages = EFI_SIZE_TO_PAGES (Size); Status = SmmInternalAllocatePages (AllocateAnyPages, PoolType, NoPages, &Address, NeedGuard); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -332,7 +332,7 @@ SmmAllocatePool ( EFI_STATUS Status; Status = SmmInternalAllocatePool (PoolType, Size, Buffer); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SmmCoreUpdateProfile ( (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionAllocatePool, @@ -356,7 +356,7 @@ SmmAllocatePool ( **/ EFI_STATUS EFIAPI -SmmInternalFreePool ( +SmmInternalFreePool( IN VOID *Buffer ) { @@ -428,14 +428,14 @@ SmmInternalFreePool ( **/ EFI_STATUS EFIAPI -SmmFreePool ( +SmmFreePool( IN VOID *Buffer ) { EFI_STATUS Status; - Status = SmmInternalFreePool (Buffer); - if (!EFI_ERROR (Status)) { + Status = SmmInternalFreePool(Buffer); + if (!EFI_ERROR(Status)) { SmmCoreUpdateProfile ( (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionFreePool, diff --git a/MdeModulePkg/Core/PiSmmCore/Smi.c b/MdeModulePkg/Core/PiSmmCore/Smi.c index f8bd9f49e..4ffcbfd66 100644 --- a/MdeModulePkg/Core/PiSmmCore/Smi.c +++ b/MdeModulePkg/Core/PiSmmCore/Smi.c @@ -311,7 +311,7 @@ SmiHandlerUnRegister ( SmiEntry = SmiHandler->SmiEntry; RemoveEntryList (&SmiHandler->Link); - FreePool (SmiHandler); + FreePool(SmiHandler); if (SmiEntry == NULL) { // @@ -326,7 +326,7 @@ SmiHandlerUnRegister ( // RemoveEntryList (&SmiEntry->AllEntries); - FreePool (SmiEntry); + FreePool(SmiEntry); } return EFI_SUCCESS; diff --git a/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c b/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c index 0323617dc..822624ae5 100644 --- a/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c +++ b/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c @@ -377,7 +377,7 @@ DumpSmiChildContext ( Str = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL *)(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT *)Context) + 1), TRUE, TRUE); DEBUG ((DEBUG_INFO, " UsbDevicePath - %s\n", Str)); if (Str != NULL) { - FreePool (Str); + FreePool(Str); } } else { DEBUG ((DEBUG_INFO, " Context - ")); @@ -1030,7 +1030,7 @@ RegisterSmiHandlerProfileHandler ( &gSmiHandlerProfileGuid, &DispatchHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); BuildSmiHandlerProfileDatabase(); } @@ -1225,9 +1225,9 @@ SmiHandlerProfileRegisterHandler ( SmiEntry = SmmCoreFindHardwareSmiEntry (HandlerGuid, TRUE); if (SmiEntry == NULL) { if (SmiHandler->Context != NULL) { - FreePool (SmiHandler->Context); + FreePool(SmiHandler->Context); } - FreePool (SmiHandler); + FreePool(SmiHandler); return EFI_OUT_OF_RESOURCES; } @@ -1309,7 +1309,7 @@ SmiHandlerProfileUnregisterHandler ( if (SearchContext != NULL) { if (CompareGuid (HandlerGuid, &gEfiSmmUsbDispatch2ProtocolGuid)) { - FreePool (SearchContext); + FreePool(SearchContext); } } @@ -1320,13 +1320,13 @@ SmiHandlerProfileUnregisterHandler ( RemoveEntryList (&SmiHandler->Link); if (SmiHandler->Context != NULL) { - FreePool (SmiHandler->Context); + FreePool(SmiHandler->Context); } - FreePool (SmiHandler); + FreePool(SmiHandler); if (IsListEmpty (&SmiEntry->SmiHandlers)) { RemoveEntryList (&SmiEntry->AllEntries); - FreePool (SmiEntry); + FreePool(SmiEntry); } return EFI_SUCCESS; @@ -1352,7 +1352,7 @@ SmmCoreInitializeSmiHandlerProfile ( SmmReadyToLockInSmiHandlerProfile, &Registration ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Handle = NULL; Status = gSmst->SmmInstallProtocolInterface ( @@ -1361,7 +1361,7 @@ SmmCoreInitializeSmiHandlerProfile ( EFI_NATIVE_INTERFACE, &mSmiHandlerProfile ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } diff --git a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c index 49c4a3758..5040300c2 100644 --- a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c +++ b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c @@ -405,7 +405,7 @@ BuildDriverInfo ( sizeof (*DriverInfoData) + sizeof (LIST_ENTRY) + PdbSize, (VOID **) &DriverInfoData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ASSERT (DriverInfoData != NULL); @@ -430,7 +430,7 @@ BuildDriverInfo ( // So patch ImageBuffer here to align the EntryPoint. // Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) ImageBase, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DriverInfo->ImageBase = ImageBase + EntryPoint - (PHYSICAL_ADDRESS) (UINTN) EntryPointInImage; } DriverInfo->FileType = FileType; @@ -481,7 +481,7 @@ RegisterImageToDxe ( FilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)TempBuffer; Status = gBS->LocateProtocol (&gEdkiiMemoryProfileGuid, NULL, (VOID **) &ProfileProtocol); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { EfiInitializeFwVolDevicepathNode (FilePath, FileName); SetDevicePathEndNode (FilePath + 1); @@ -520,7 +520,7 @@ UnregisterImageFromDxe ( FilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)TempBuffer; Status = gBS->LocateProtocol (&gEdkiiMemoryProfileGuid, NULL, (VOID *) &ProfileProtocol); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { EfiInitializeFwVolDevicepathNode (FilePath, FileName); SetDevicePathEndNode (FilePath + 1); @@ -702,7 +702,7 @@ SmramProfileInstallProtocol ( EFI_NATIVE_INTERFACE, &mSmmProfileProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -948,7 +948,7 @@ UnregisterSmramProfileImage ( // So patch ImageAddress here to align the EntryPoint. // Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) ImageAddress, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ImageAddress = ImageAddress + (UINTN) DriverEntry->ImageEntryPoint - (UINTN) EntryPointInImage; } if (FileName != NULL) { @@ -973,7 +973,7 @@ UnregisterSmramProfileImage ( // // Use SmmInternalFreePool() that will not update profile for this FreePool action. // - SmmInternalFreePool (DriverInfoData); + SmmInternalFreePool(DriverInfoData); } return EFI_SUCCESS; @@ -1127,7 +1127,7 @@ SmmCoreUpdateProfileAllocate ( sizeof (*AllocInfoData) + ActionStringSize, (VOID **) &AllocInfoData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } ASSERT (AllocInfoData != NULL); @@ -1420,7 +1420,7 @@ SmmCoreUpdateProfileFree ( // // Use SmmInternalFreePool() that will not update profile for this FreePool action. // - SmmInternalFreePool (AllocInfoData); + SmmInternalFreePool(AllocInfoData); } while (TRUE); } @@ -1960,7 +1960,7 @@ SmramProfileProtocolRegisterImage ( DriverEntry.ImageBuffer = ImageBase; DriverEntry.NumberOfPage = EFI_SIZE_TO_PAGES ((UINTN) ImageSize); Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) DriverEntry.ImageBuffer, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DriverEntry.ImageEntryPoint = (PHYSICAL_ADDRESS) (UINTN) EntryPointInImage; return RegisterSmramProfileImage (&DriverEntry, FALSE); @@ -2002,7 +2002,7 @@ SmramProfileProtocolUnregisterImage ( DriverEntry.ImageBuffer = ImageBase; DriverEntry.NumberOfPage = EFI_SIZE_TO_PAGES ((UINTN) ImageSize); Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) DriverEntry.ImageBuffer, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DriverEntry.ImageEntryPoint = (PHYSICAL_ADDRESS) (UINTN) EntryPointInImage; return UnregisterSmramProfileImage (&DriverEntry, FALSE); @@ -2252,11 +2252,11 @@ SmramProfileHandlerRegisterImage ( DriverEntry.ImageBuffer = SmramProfileParameterRegisterImage->ImageBuffer; DriverEntry.NumberOfPage = (UINTN) SmramProfileParameterRegisterImage->NumberOfPage; Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) DriverEntry.ImageBuffer, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DriverEntry.ImageEntryPoint = (PHYSICAL_ADDRESS) (UINTN) EntryPointInImage; Status = RegisterSmramProfileImage (&DriverEntry, FALSE); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SmramProfileParameterRegisterImage->Header.ReturnStatus = 0; } } @@ -2281,11 +2281,11 @@ SmramProfileHandlerUnregisterImage ( DriverEntry.ImageBuffer = SmramProfileParameterUnregisterImage->ImageBuffer; DriverEntry.NumberOfPage = (UINTN) SmramProfileParameterUnregisterImage->NumberOfPage; Status = InternalPeCoffGetEntryPoint ((VOID *) (UINTN) DriverEntry.ImageBuffer, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DriverEntry.ImageEntryPoint = (PHYSICAL_ADDRESS) (UINTN) EntryPointInImage; Status = UnregisterSmramProfileImage (&DriverEntry, FALSE); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SmramProfileParameterUnregisterImage->Header.ReturnStatus = 0; } } @@ -2447,7 +2447,7 @@ RegisterSmramProfileHandler ( &gEdkiiMemoryProfileGuid, &DispatchHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } //////////////////// diff --git a/MdeModulePkg/Core/RuntimeDxe/Runtime.c b/MdeModulePkg/Core/RuntimeDxe/Runtime.c index c52b2b7ec..72a822b22 100644 --- a/MdeModulePkg/Core/RuntimeDxe/Runtime.c +++ b/MdeModulePkg/Core/RuntimeDxe/Runtime.c @@ -304,7 +304,7 @@ RuntimeDriverSetVirtualAddressMap ( VirtImageBase = (EFI_PHYSICAL_ADDRESS) (UINTN) RuntimeImage->ImageBase; Status = RuntimeDriverConvertPointer (0, (VOID **) &VirtImageBase); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); PeCoffLoaderRelocateImageForRuntime ( (EFI_PHYSICAL_ADDRESS) (UINTN) RuntimeImage->ImageBase, @@ -391,7 +391,7 @@ RuntimeDriverInitialize ( &gEfiLoadedImageProtocolGuid, (VOID**)&MyLoadedImage ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mMyImageBase = MyLoadedImage->ImageBase; // @@ -410,7 +410,7 @@ RuntimeDriverInitialize ( &mRuntime, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c index 3ac31f672..d9d0a92b9 100644 --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c @@ -157,7 +157,7 @@ TranslateBmpToGopBlt ( BmpHeader->BitPerPixel, &DataSizePerLine ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BmpImage... PixelWidth:0x%x BitPerPixel:0x%x\n", @@ -168,7 +168,7 @@ TranslateBmpToGopBlt ( } Status = SafeUint32Add (DataSizePerLine, 31, &DataSizePerLine); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BmpImage... DataSizePerLine:0x%x\n", @@ -185,7 +185,7 @@ TranslateBmpToGopBlt ( &BltBufferSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BmpImage... DataSizePerLine:0x%x PixelHeight:0x%x\n", @@ -201,7 +201,7 @@ TranslateBmpToGopBlt ( &DataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BmpImage... PixelHeight:0x%x DataSizePerLine:0x%x\n", @@ -272,7 +272,7 @@ TranslateBmpToGopBlt ( &BltBufferSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BltBuffer needed size... PixelWidth:0x%x PixelHeight:0x%x\n", @@ -289,7 +289,7 @@ TranslateBmpToGopBlt ( &BltBufferSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BltBuffer needed size... PixelWidth x PixelHeight:0x%x struct size:0x%x\n", @@ -404,7 +404,7 @@ TranslateBmpToGopBlt ( // Other bit format BMP is not supported. // if (IsAllocated) { - FreePool (*GopBlt); + FreePool(*GopBlt); *GopBlt = NULL; } DEBUG ((DEBUG_ERROR, "Bmp Bit format not supported. 0x%X\n", BmpHeader->BitPerPixel)); @@ -485,7 +485,7 @@ TranslateGopBltToBmp ( // First check PixelWidth * 3 + PaddingSize doesn't overflow // Status = SafeUint32Mult (PixelWidth, 3, &BmpSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateGopBltToBmp: GopBlt is too large. PixelHeight:0x%x PixelWidth:0x%x\n", @@ -495,7 +495,7 @@ TranslateGopBltToBmp ( return RETURN_UNSUPPORTED; } Status = SafeUint32Add (BmpSize, PaddingSize, &BmpSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateGopBltToBmp: GopBlt is too large. PixelHeight:0x%x PixelWidth:0x%x\n", @@ -509,7 +509,7 @@ TranslateGopBltToBmp ( // Second check (mLogoWidth * 3 + PaddingSize) * mLogoHeight + sizeof (BMP_IMAGE_HEADER) doesn't overflow // Status = SafeUint32Mult (BmpSize, PixelHeight, &BmpSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateGopBltToBmp: GopBlt is too large. PixelHeight:0x%x PixelWidth:0x%x\n", @@ -519,7 +519,7 @@ TranslateGopBltToBmp ( return RETURN_UNSUPPORTED; } Status = SafeUint32Add (BmpSize, sizeof (BMP_IMAGE_HEADER), &BmpSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "TranslateGopBltToBmp: GopBlt is too large. PixelHeight:0x%x PixelWidth:0x%x\n", diff --git a/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c index 4079472e8..6b14cb407 100644 --- a/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c +++ b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c @@ -561,7 +561,7 @@ ReallocateReservedPool ( **/ VOID EFIAPI -FreePool ( +FreePool( IN VOID *Buffer ) { diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c index 134660f28..96fda88c1 100644 --- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c +++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c @@ -64,7 +64,7 @@ BootLogoEnableLogo ( UINTN BufferSize; Status = gBS->LocateProtocol (&gEdkiiPlatformLogoProtocolGuid, NULL, (VOID **) &PlatformLogo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -73,17 +73,17 @@ BootLogoEnableLogo ( // Try to open GOP first // Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput); - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { + if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { GraphicsOutput = NULL; // // Open GOP failed, try to open UGA // Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **) &UgaDraw); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { UgaDraw = NULL; } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -91,7 +91,7 @@ BootLogoEnableLogo ( // Try to open Boot Logo Protocol. // Status = gBS->LocateProtocol (&gEfiBootLogoProtocolGuid, NULL, (VOID **) &BootLogo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BootLogo = NULL; } @@ -99,7 +99,7 @@ BootLogoEnableLogo ( // Try to open Boot Logo 2 Protocol. // Status = gBS->LocateProtocol (&gEdkiiBootLogo2ProtocolGuid, NULL, (VOID **) &BootLogo2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BootLogo2 = NULL; } @@ -115,7 +115,7 @@ BootLogoEnableLogo ( } else { ASSERT (UgaDraw != NULL); Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } } @@ -143,12 +143,12 @@ BootLogoEnableLogo ( &OffsetX, &OffsetY ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); } Blt = Image.Bitmap; @@ -237,7 +237,7 @@ BootLogoEnableLogo ( // // Report displayed Logo information. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { NumberOfLogos++; if (NumberOfLogos == 1) { @@ -269,7 +269,7 @@ BootLogoEnableLogo ( // No logo displayed. // if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); } return Status; @@ -289,7 +289,7 @@ BootLogoEnableLogo ( // More than one Logo displayed, get merged BltBuffer using VideoToBuffer operation. // if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); } // @@ -334,7 +334,7 @@ BootLogoEnableLogo ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Attempt to register logo with Boot Logo 2 Protocol first // @@ -345,7 +345,7 @@ BootLogoEnableLogo ( // If Boot Logo 2 Protocol is not available or registration with Boot Logo 2 // Protocol failed, then attempt to register logo with Boot Logo Protocol // - if (EFI_ERROR (Status) && BootLogo != NULL) { + if (EFI_ERROR(Status) && BootLogo != NULL) { Status = BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight); } // @@ -354,7 +354,7 @@ BootLogoEnableLogo ( // Status = EFI_SUCCESS; } - FreePool (LogoBlt); + FreePool(LogoBlt); return Status; } @@ -427,15 +427,15 @@ BootLogoUpdateProgress ( UgaDraw = NULL; Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput); - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { + if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { GraphicsOutput = NULL; Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **) &UgaDraw); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { UgaDraw = NULL; } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -452,7 +452,7 @@ BootLogoUpdateProgress ( &ColorDepth, &RefreshRate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } } else { diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c index 28592f9f4..8edef5b3a 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c @@ -154,7 +154,7 @@ BmmSetConsoleMode ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -163,7 +163,7 @@ BmmSetConsoleMode ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -211,7 +211,7 @@ BmmSetConsoleMode ( &SizeOfInfo, &Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Info->HorizontalResolution == NewHorizontalResolution) && (Info->VerticalResolution == NewVerticalResolution)) { if ((GraphicsOutput->Mode->Info->HorizontalResolution == NewHorizontalResolution) && @@ -220,12 +220,12 @@ BmmSetConsoleMode ( // Current resolution is same with required resolution, check if text mode need be set // Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (CurrentColumn == NewColumns && CurrentRow == NewRows) { // // If current text mode is same with required text mode. Do nothing // - FreePool (Info); + FreePool(Info); return EFI_SUCCESS; } else { // @@ -239,15 +239,15 @@ BmmSetConsoleMode ( // Required text mode is supported, set it. // Status = SimpleTextOut->SetMode (SimpleTextOut, Index); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Update text mode PCD. // Status = PcdSet32S (PcdConOutColumn, mBmmSetupTextModeColumn); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutRow, mBmmSetupTextModeRow); - ASSERT_EFI_ERROR (Status); - FreePool (Info); + ASSERT_EFI_ERROR(Status); + FreePool(Info); return EFI_SUCCESS; } } @@ -256,7 +256,7 @@ BmmSetConsoleMode ( // // If required text mode is not supported, return error. // - FreePool (Info); + FreePool(Info); return EFI_UNSUPPORTED; } } @@ -266,13 +266,13 @@ BmmSetConsoleMode ( // In this case, the driver which produces simple text out need be restarted. // Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber); - if (!EFI_ERROR (Status)) { - FreePool (Info); + if (!EFI_ERROR(Status)) { + FreePool(Info); break; } } } - FreePool (Info); + FreePool(Info); } } @@ -288,13 +288,13 @@ BmmSetConsoleMode ( // Set PCD to Inform Consplitter to change text mode. // Status = PcdSet32S (PcdVideoHorizontalResolution, NewHorizontalResolution); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdVideoVerticalResolution, NewVerticalResolution); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutColumn, NewColumns); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutRow, NewRows); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Video mode is changed, so restart graphics console driver and higher level driver. @@ -308,7 +308,7 @@ BmmSetConsoleMode ( &HandleCount, &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleCount; Index++) { gBS->DisconnectController (HandleBuffer[Index], NULL, NULL); } @@ -316,7 +316,7 @@ BmmSetConsoleMode ( gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } } @@ -349,7 +349,7 @@ UiDevicePathToStr ( NULL, (VOID **) &DevPathToText ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ToText = DevPathToText->ConvertDevicePathToText ( DevPath, FALSE, @@ -426,7 +426,7 @@ BmmExtractDevicePathFromHiiHandle ( } Status = gHiiDatabase->GetPackageListHandle (gHiiDatabase, Handle, &DriverHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -517,7 +517,7 @@ UpdateProgress( ReturnString = StrStr (Configuration, StringPtr); } - FreePool (StringPtr); + FreePool(StringPtr); return ReturnString; } @@ -695,7 +695,7 @@ BootMaintExtractConfig ( ASSERT (ConfigRequest != NULL); AllocatedRequest = TRUE; UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); } Status = gHiiConfigRouting->BlockToConfig ( @@ -710,7 +710,7 @@ BootMaintExtractConfig ( // Free the allocated config request string. // if (AllocatedRequest) { - FreePool (ConfigRequest); + FreePool(ConfigRequest); ConfigRequest = NULL; } // @@ -800,7 +800,7 @@ BootMaintRouteConfig ( NULL, (VOID **)&ConfigRouting ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -822,7 +822,7 @@ BootMaintRouteConfig ( &BufferSize, Progress ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Compare new and old BMM configuration data and only do action for modified item to // avoid setting unnecessary non-volatile variable @@ -833,7 +833,7 @@ BootMaintRouteConfig ( // if (CompareMem (&NewBmmData->BootNext, &OldBmmData->BootNext, sizeof (NewBmmData->BootNext)) != 0) { Status = Var_UpdateBootNext (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, BootNext); goto Exit; } @@ -854,7 +854,7 @@ BootMaintRouteConfig ( } Status = Var_DelBootOption (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, BootOptionDel); goto Exit; } @@ -862,7 +862,7 @@ BootMaintRouteConfig ( if (CompareMem (NewBmmData->BootOptionOrder, OldBmmData->BootOptionOrder, sizeof (NewBmmData->BootOptionOrder)) != 0) { Status = Var_UpdateBootOrder (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, BootOptionOrder); goto Exit; } @@ -876,7 +876,7 @@ BootMaintRouteConfig ( sizeof(UINT16), &(NewBmmData->BootTimeOut) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, BootTimeOut); goto Exit; } @@ -897,7 +897,7 @@ BootMaintRouteConfig ( NewBmmData->DriverOptionDelMark[Index] = FALSE; } Status = Var_DelDriverOption (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, DriverOptionDel); goto Exit; } @@ -905,7 +905,7 @@ BootMaintRouteConfig ( if (CompareMem (NewBmmData->DriverOptionOrder, OldBmmData->DriverOptionOrder, sizeof (NewBmmData->DriverOptionOrder)) != 0) { Status = Var_UpdateDriverOrder (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, DriverOptionOrder); goto Exit; } @@ -913,7 +913,7 @@ BootMaintRouteConfig ( if (CompareMem (&NewBmmData->ConsoleOutMode, &OldBmmData->ConsoleOutMode, sizeof (NewBmmData->ConsoleOutMode)) != 0){ Status = Var_UpdateConMode(Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, ConsoleOutMode); goto Exit; } @@ -951,15 +951,15 @@ BootMaintRouteConfig ( Offset = OFFSET_OF (BMM_FAKE_NV_DATA, COMFlowControl); } Status = Var_UpdateConsoleInpOption (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } Status = Var_UpdateConsoleOutOption (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } Status = Var_UpdateErrorOutOption (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } } @@ -968,7 +968,7 @@ BootMaintRouteConfig ( // if (CompareMem (NewBmmData->ConsoleInCheck, OldBmmData->ConsoleInCheck, sizeof (NewBmmData->ConsoleInCheck)) != 0){ Status = Var_UpdateConsoleInpOption(); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, ConsoleInCheck); goto Exit; } @@ -976,7 +976,7 @@ BootMaintRouteConfig ( if (CompareMem (NewBmmData->ConsoleOutCheck, OldBmmData->ConsoleOutCheck, sizeof (NewBmmData->ConsoleOutCheck)) != 0){ Status = Var_UpdateConsoleOutOption(); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, ConsoleOutCheck); goto Exit; } @@ -984,7 +984,7 @@ BootMaintRouteConfig ( if (CompareMem (NewBmmData->ConsoleErrCheck, OldBmmData->ConsoleErrCheck, sizeof (NewBmmData->ConsoleErrCheck)) != 0){ Status = Var_UpdateErrorOutOption(); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, ConsoleErrCheck); goto Exit; } @@ -994,7 +994,7 @@ BootMaintRouteConfig ( CompareMem (NewBmmData->BootOptionalData, OldBmmData->BootOptionalData, sizeof (NewBmmData->BootOptionalData)) != 0) { Status = Var_UpdateBootOption (Private); NewBmmData->BootOptionChanged = FALSE; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (CompareMem (NewBmmData->BootDescriptionData, OldBmmData->BootDescriptionData, sizeof (NewBmmData->BootDescriptionData)) != 0) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, BootDescriptionData); } else { @@ -1016,7 +1016,7 @@ BootMaintRouteConfig ( ); NewBmmData->DriverOptionChanged = FALSE; NewBmmData->ForceReconnect = TRUE; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (CompareMem (NewBmmData->DriverDescriptionData, OldBmmData->DriverDescriptionData, sizeof (NewBmmData->DriverDescriptionData)) != 0) { Offset = OFFSET_OF (BMM_FAKE_NV_DATA, DriverDescriptionData); } else { @@ -1587,7 +1587,7 @@ BmmInitialBootModeInfo ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -1596,7 +1596,7 @@ BmmInitialBootModeInfo ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -1665,7 +1665,7 @@ BootMaintenanceManagerUiLibConstructor ( &mBmmCallbackInfo->BmmConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Post our Boot Maint VFR binary to the HII database. @@ -1683,7 +1683,7 @@ BootMaintenanceManagerUiLibConstructor ( // Locate Formbrowser2 protocol // Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &mBmmCallbackInfo->FormBrowser2); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Create LoadOption in BmmCallbackInfo for Driver Callback @@ -1762,7 +1762,7 @@ BootMaintenanceManagerUiLibDestructor ( NULL ); - FreePool (mBmmCallbackInfo->LoadContext); + FreePool(mBmmCallbackInfo->LoadContext); mBmmCallbackInfo->BmmDriverHandle = NULL; return EFI_SUCCESS; diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c index 656106fc2..37fe82232 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c @@ -271,7 +271,7 @@ ExtractDevicePathFromHandle ( } Status = gHiiDatabase->GetPackageListHandle (gHiiDatabase, Handle, &DriverHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -309,7 +309,7 @@ IsRequiredDriver ( BOOLEAN RetVal; Status = HiiGetFormSetFromHiiHandle(HiiHandle, &Buffer,&BufferSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -339,7 +339,7 @@ IsRequiredDriver ( } } - FreePool (Buffer); + FreePool(Buffer); return RetVal; } @@ -377,7 +377,7 @@ BmmListThirdPartyDrivers ( BOOLEAN EmptyLineAfter; if (gHiiDriverList != NULL) { - FreePool (gHiiDriverList); + FreePool(gHiiDriverList); } HiiHandles = HiiGetHiiHandles (NULL); @@ -403,13 +403,13 @@ BmmListThirdPartyDrivers ( // EmptyLineAfter = FALSE; if (SpecialHandlerFn (String, &NewName, &EmptyLineAfter)) { - FreePool (String); + FreePool(String); String = NewName; DriverListPtr[Count].EmptyLineAfter = EmptyLineAfter; } } DriverListPtr[Count].PromptId = HiiSetString (HiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); String = HiiGetString (HiiHandles[Index], TokenHelp, NULL); if (String == NULL) { @@ -417,12 +417,12 @@ BmmListThirdPartyDrivers ( ASSERT (String != NULL); } DriverListPtr[Count].HelpId = HiiSetString (HiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); DevicePathStr = ExtractDevicePathFromHandle(HiiHandles[Index]); if (DevicePathStr != NULL){ DriverListPtr[Count].DevicePathId = HiiSetString (HiiHandle, 0, DevicePathStr, NULL); - FreePool (DevicePathStr); + FreePool(DevicePathStr); } else { DriverListPtr[Count].DevicePathId = 0; } @@ -441,7 +441,7 @@ BmmListThirdPartyDrivers ( } } - FreePool (HiiHandles); + FreePool(HiiHandles); Index = 0; while (gHiiDriverList[Index].PromptId != 0) { diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c index 53f0ef3d1..f5c7d4374 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c @@ -55,8 +55,8 @@ BmmSetupResetReminder ( CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, StringBuffer1, StringBuffer2, NULL); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); - FreePool (StringBuffer1); - FreePool (StringBuffer2); + FreePool(StringBuffer1); + FreePool(StringBuffer2); gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); } @@ -122,7 +122,7 @@ BOpt_CreateMenuEntry ( MenuEntry->VariableContext = AllocateZeroPool (ContextSize); if (MenuEntry->VariableContext == NULL) { - FreePool (MenuEntry); + FreePool(MenuEntry); return NULL; } @@ -154,18 +154,18 @@ BOpt_DestroyMenuEntry ( switch (MenuEntry->ContextSelection) { case BM_LOAD_CONTEXT_SELECT: LoadContext = (BM_LOAD_CONTEXT *) MenuEntry->VariableContext; - FreePool (LoadContext->FilePathList); + FreePool(LoadContext->FilePathList); if (LoadContext->OptionalData != NULL) { - FreePool (LoadContext->OptionalData); + FreePool(LoadContext->OptionalData); } - FreePool (LoadContext); + FreePool(LoadContext); break; case BM_FILE_CONTEXT_SELECT: FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext; if (!FileContext->IsRoot) { - FreePool (FileContext->DevicePath); + FreePool(FileContext->DevicePath); } else { if (FileContext->FHandle != NULL) { FileContext->FHandle->Close (FileContext->FHandle); @@ -173,41 +173,41 @@ BOpt_DestroyMenuEntry ( } if (FileContext->FileName != NULL) { - FreePool (FileContext->FileName); + FreePool(FileContext->FileName); } if (FileContext->Info != NULL) { - FreePool (FileContext->Info); + FreePool(FileContext->Info); } - FreePool (FileContext); + FreePool(FileContext); break; case BM_CONSOLE_CONTEXT_SELECT: ConsoleContext = (BM_CONSOLE_CONTEXT *) MenuEntry->VariableContext; - FreePool (ConsoleContext->DevicePath); - FreePool (ConsoleContext); + FreePool(ConsoleContext->DevicePath); + FreePool(ConsoleContext); break; case BM_TERMINAL_CONTEXT_SELECT: TerminalContext = (BM_TERMINAL_CONTEXT *) MenuEntry->VariableContext; - FreePool (TerminalContext->DevicePath); - FreePool (TerminalContext); + FreePool(TerminalContext->DevicePath); + FreePool(TerminalContext); break; case BM_HANDLE_CONTEXT_SELECT: HandleContext = (BM_HANDLE_CONTEXT *) MenuEntry->VariableContext; - FreePool (HandleContext); + FreePool(HandleContext); break; default: break; } - FreePool (MenuEntry->DisplayString); + FreePool(MenuEntry->DisplayString); if (MenuEntry->HelpString != NULL) { - FreePool (MenuEntry->HelpString); + FreePool(MenuEntry->HelpString); } - FreePool (MenuEntry); + FreePool(MenuEntry); } /** @@ -328,7 +328,7 @@ BOpt_GetBootOptions ( GetEfiGlobalVariable2 (L"BootNext", (VOID **) &BootNext, &BootNextSize); if (BootNext != NULL) { if (BootNextSize != sizeof (UINT16)) { - FreePool (BootNext); + FreePool(BootNext); BootNext = NULL; } } @@ -453,15 +453,15 @@ BOpt_GetBootOptions ( InsertTailList (&BootOptionMenu.Head, &NewMenuEntry->Link); MenuCount++; - FreePool (LoadOptionFromVar); + FreePool(LoadOptionFromVar); } EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount); if (BootNext != NULL) { - FreePool (BootNext); + FreePool(BootNext); } if (BootOrderList != NULL) { - FreePool (BootOrderList); + FreePool(BootOrderList); } BootOptionMenu.MenuNumber = MenuCount; @@ -512,7 +512,7 @@ BOpt_FindDrivers ( &NoDevicePathHandles, &DevicePathHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -540,7 +540,7 @@ BOpt_FindDrivers ( NewMenuEntry = BOpt_CreateMenuEntry (BM_HANDLE_CONTEXT_SELECT); if (NULL == NewMenuEntry) { - FreePool (DevicePathHandle); + FreePool(DevicePathHandle); return EFI_OUT_OF_RESOURCES; } @@ -558,7 +558,7 @@ BOpt_FindDrivers ( } if (DevicePathHandle != NULL) { - FreePool (DevicePathHandle); + FreePool(DevicePathHandle); } DriverMenu.MenuNumber = OptionNumber; @@ -783,12 +783,12 @@ BOpt_GetDriverOptions ( } InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link); - FreePool (LoadOptionFromVar); + FreePool(LoadOptionFromVar); } if (DriverOrderList != NULL) { - FreePool (DriverOrderList); + FreePool(DriverOrderList); } DriverOptionMenu.MenuNumber = Index; diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c index 7a53b5877..7c9f42a92 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c @@ -47,11 +47,11 @@ MatchDevicePaths ( // return success // if (CompareMem (Single, DevicePathInst, Size) == 0) { - FreePool (DevicePathInst); + FreePool(DevicePathInst); return TRUE; } - FreePool (DevicePathInst); + FreePool(DevicePathInst); DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size); } @@ -300,7 +300,7 @@ RetrieveUartUid ( &gEfiDevicePathProtocolGuid, (VOID **) &DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -429,7 +429,7 @@ LocateSerialIo ( &NoHandles, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No serial ports present // @@ -466,7 +466,7 @@ LocateSerialIo ( if ((Acpi != NULL) && IsIsaSerialNode (Acpi)) { NewMenuEntry = BOpt_CreateMenuEntry (BM_TERMINAL_CONTEXT_SELECT); if (NewMenuEntry == NULL) { - FreePool (Handles); + FreePool(Handles); return EFI_OUT_OF_RESOURCES; } @@ -524,7 +524,7 @@ LocateSerialIo ( } } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } // @@ -569,7 +569,7 @@ LocateSerialIo ( (EFI_DEVICE_PATH_PROTOCOL *) &Vendor ); if (NewMenuEntry->HelpString != NULL) { - FreePool (NewMenuEntry->HelpString); + FreePool(NewMenuEntry->HelpString); } // // NewMenuEntry->HelpString = UiDevicePathToStr (NewDevicePath); diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c index e2b444cc4..1c1465841 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c @@ -695,7 +695,7 @@ UpdateConModePage ( // for (Mode = 0; Mode < MaxMode; Mode++) { Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } ValidMode++; @@ -721,7 +721,7 @@ UpdateConModePage ( // for (Mode = 0; Mode < MaxMode; Mode++) { Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -776,7 +776,7 @@ UpdateConModePage ( ); HiiFreeOpCodeHandle (OptionsOpCodeHandle); - FreePool (ModeToken); + FreePool(ModeToken); UpdatePageEnd (CallbackData); } @@ -1037,7 +1037,7 @@ UpdateOptionPage( } StringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); if(FormId == FORM_BOOT_ADD_ID){ if (!CallbackData->BmmFakeNvData.BootOptionChanged) { diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c index e28f76b8d..b0326925b 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c @@ -41,7 +41,7 @@ Var_DelBootOption ( } Status = EfiBootManagerDeleteLoadOptionVariable (NewMenuEntry->OptionNumber,LoadOptionTypeBoot); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Index2++; @@ -96,7 +96,7 @@ Var_DelDriverOption ( continue; } Status = EfiBootManagerDeleteLoadOptionVariable (NewMenuEntry->OptionNumber,LoadOptionTypeDriver); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -153,7 +153,7 @@ Var_UpdateConsoleOption ( GetEfiGlobalVariable2 (ConsoleName, (VOID**)&ConDevicePath, NULL); if (ConDevicePath != NULL) { EfiLibDeleteVariable (ConsoleName, &gEfiGlobalVariableGuid); - FreePool (ConDevicePath); + FreePool(ConDevicePath); ConDevicePath = NULL; }; @@ -211,7 +211,7 @@ Var_UpdateConsoleOption ( GetDevicePathSize (ConDevicePath), ConDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -339,12 +339,12 @@ Var_UpdateDriverOption ( OptionalDesData, OptionalDataSize ); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ return Status; } Status = EfiBootManagerAddLoadOptionVariable (&LoadOption,(UINTN) -1 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiBootManagerFreeLoadOption(&LoadOption); return Status; } @@ -457,12 +457,12 @@ Var_UpdateBootOption ( OptionalData, OptionalDataSize ); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ return Status; } Status = EfiBootManagerAddLoadOptionVariable (&LoadOption,(UINTN) -1 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiBootManagerFreeLoadOption(&LoadOption); return Status; } @@ -626,7 +626,7 @@ Var_UpdateBootOrder ( BootOrderSize, BootOrder ); - FreePool (BootOrder); + FreePool(BootOrder); BOpt_FreeMenu (&BootOptionMenu); BOpt_GetBootOptions (CallbackData); @@ -675,7 +675,7 @@ Var_UpdateDriverOrder ( // if (DriverOrderList != NULL) { EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid); - FreePool (DriverOrderList); + FreePool(DriverOrderList); } ASSERT (DriverOptionMenu.MenuNumber <= (sizeof (CallbackData->BmmFakeNvData.DriverOptionOrder) / sizeof (CallbackData->BmmFakeNvData.DriverOptionOrder[0]))); @@ -690,7 +690,7 @@ Var_UpdateDriverOrder ( DriverOrderListSize, NewDriverOrderList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -722,7 +722,7 @@ Var_UpdateConMode ( Status = gST->ConOut->QueryMode (gST->ConOut, Mode, &(ModeInfo.Column), &(ModeInfo.Row)); if (!EFI_ERROR(Status)) { Status = PcdSet32S (PcdSetupConOutColumn, (UINT32) ModeInfo.Column); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PcdSet32S (PcdSetupConOutRow, (UINT32) ModeInfo.Row); } } diff --git a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c index 13b40e11b..89d174a56 100644 --- a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c +++ b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c @@ -118,7 +118,7 @@ BmSetConsoleMode ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -127,7 +127,7 @@ BmSetConsoleMode ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -175,7 +175,7 @@ BmSetConsoleMode ( &SizeOfInfo, &Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Info->HorizontalResolution == NewHorizontalResolution) && (Info->VerticalResolution == NewVerticalResolution)) { if ((GraphicsOutput->Mode->Info->HorizontalResolution == NewHorizontalResolution) && @@ -184,12 +184,12 @@ BmSetConsoleMode ( // Current resolution is same with required resolution, check if text mode need be set // Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (CurrentColumn == NewColumns && CurrentRow == NewRows) { // // If current text mode is same with required text mode. Do nothing // - FreePool (Info); + FreePool(Info); return EFI_SUCCESS; } else { // @@ -203,15 +203,15 @@ BmSetConsoleMode ( // Required text mode is supported, set it. // Status = SimpleTextOut->SetMode (SimpleTextOut, Index); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Update text mode PCD. // Status = PcdSet32S (PcdConOutColumn, mBmSetupTextModeColumn); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutRow, mBmSetupTextModeRow); - ASSERT_EFI_ERROR (Status); - FreePool (Info); + ASSERT_EFI_ERROR(Status); + FreePool(Info); return EFI_SUCCESS; } } @@ -220,7 +220,7 @@ BmSetConsoleMode ( // // If required text mode is not supported, return error. // - FreePool (Info); + FreePool(Info); return EFI_UNSUPPORTED; } } @@ -230,13 +230,13 @@ BmSetConsoleMode ( // In this case, the driver which produces simple text out need be restarted. // Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber); - if (!EFI_ERROR (Status)) { - FreePool (Info); + if (!EFI_ERROR(Status)) { + FreePool(Info); break; } } } - FreePool (Info); + FreePool(Info); } } @@ -252,13 +252,13 @@ BmSetConsoleMode ( // Set PCD to Inform Consplitter to change text mode. // Status = PcdSet32S (PcdVideoHorizontalResolution, NewHorizontalResolution); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdVideoVerticalResolution, NewVerticalResolution); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutColumn, NewColumns); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet32S (PcdConOutRow, NewRows); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Video mode is changed, so restart graphics console driver and higher level driver. @@ -272,7 +272,7 @@ BmSetConsoleMode ( &HandleCount, &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleCount; Index++) { gBS->DisconnectController (HandleBuffer[Index], NULL, NULL); } @@ -280,7 +280,7 @@ BmSetConsoleMode ( gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } } @@ -324,8 +324,8 @@ BmSetupResetReminder ( CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, StringBuffer1, StringBuffer2, NULL); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); - FreePool (StringBuffer1); - FreePool (StringBuffer2); + FreePool(StringBuffer1); + FreePool(StringBuffer2); gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); } @@ -373,7 +373,7 @@ GroupMultipleLegacyBootOption4SameType ( for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) { UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", BootOrder[Index]); Status = EfiBootManagerVariableToLoadOption (OptionName, &BootOption); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if ((DevicePathType (BootOption.FilePath) == BBS_DEVICE_PATH) && (DevicePathSubType (BootOption.FilePath) == BBS_BBS_DP)) { @@ -417,7 +417,7 @@ GroupMultipleLegacyBootOption4SameType ( BootOrderSize, BootOrder ); - FreePool (BootOrder); + FreePool(BootOrder); } /** @@ -446,7 +446,7 @@ BmDevicePathToStr ( NULL, (VOID **) &DevPathToText ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ToText = DevPathToText->ConvertDevicePathToText ( DevPath, FALSE, @@ -713,7 +713,7 @@ BmInitialBootModeInfo ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GraphicsOutput = NULL; } @@ -722,7 +722,7 @@ BmInitialBootModeInfo ( &gEfiSimpleTextOutProtocolGuid, (VOID**)&SimpleTextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SimpleTextOut = NULL; } @@ -831,7 +831,7 @@ BootManagerCallback ( EfiBootManagerBoot (&BootOption[QuestionId - 1]); BmSetConsoleMode (TRUE); - if (EFI_ERROR (BootOption[QuestionId - 1].Status)) { + if (EFI_ERROR(BootOption[QuestionId - 1].Status)) { gST->ConOut->OutputString ( gST->ConOut, HiiGetString (gBootManagerPrivate.HiiHandle, STRING_TOKEN (STR_ANY_KEY_CONTINUE), NULL) @@ -876,7 +876,7 @@ BootManagerUiLibConstructor ( &gBootManagerPrivate.ConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Publish our HII data @@ -920,7 +920,7 @@ BootManagerUiLibDestructor ( &gBootManagerPrivate.ConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); HiiRemovePackages (gBootManagerPrivate.HiiHandle); diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c index c59a3c004..4727218be 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c @@ -63,7 +63,7 @@ DisplayPageFrame ( } Status = ScreenDiemensionInfoValidate (FormData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -536,7 +536,7 @@ CreateDialog ( if (Key != NULL) { Status = WaitForKeyStroke (&KeyValue); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (!EFI_ERROR(Status)) { CopyMem(Key, &KeyValue, sizeof(EFI_INPUT_KEY)); } @@ -746,7 +746,7 @@ ClearLines ( gST->ConOut->SetCursorPosition (gST->ConOut, LeftColumn, TopRow); - FreePool (Buffer); + FreePool(Buffer); } // diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c index d770a0f87..d63509cfa 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c @@ -118,7 +118,7 @@ PrintBannerInfo ( break; } - FreePool (StrFrontPageBanner); + FreePool(StrFrontPageBanner); } } } @@ -195,7 +195,7 @@ PrintFramework ( TitleStr, gScreenDimensions.RightColumn - 1 - TitleColumn ); - FreePool (TitleStr); + FreePool(TitleStr); Character = BOXDRAW_UP_RIGHT; PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 1, Character); @@ -234,7 +234,7 @@ PrintFramework ( Character = BOXDRAW_UP_LEFT; PrintCharAt ((UINTN) -1, (UINTN) -1, Character); - FreePool (Buffer); + FreePool(Buffer); } /** @@ -743,29 +743,29 @@ FreeLibStrings ( VOID ) { - FreePool (gEnterString); - FreePool (gEnterCommitString); - FreePool (gEnterEscapeString); - FreePool (gEscapeString); - FreePool (gMoveHighlight); - FreePool (gDecNumericInput); - FreePool (gHexNumericInput); - FreePool (gToggleCheckBox); + FreePool(gEnterString); + FreePool(gEnterCommitString); + FreePool(gEnterEscapeString); + FreePool(gEscapeString); + FreePool(gMoveHighlight); + FreePool(gDecNumericInput); + FreePool(gHexNumericInput); + FreePool(gToggleCheckBox); - FreePool (gAreYouSure); - FreePool (gYesResponse); - FreePool (gNoResponse); - FreePool (gPlusString); - FreePool (gMinusString); - FreePool (gAdjustNumber); - FreePool (gSaveChanges); + FreePool(gAreYouSure); + FreePool(gYesResponse); + FreePool(gNoResponse); + FreePool(gPlusString); + FreePool(gMinusString); + FreePool(gAdjustNumber); + FreePool(gSaveChanges); - FreePool (gLibEmptyString); + FreePool(gLibEmptyString); - FreePool (gNvUpdateMessage); - FreePool (gInputErrorMessage); + FreePool(gNvUpdateMessage); + FreePool(gInputErrorMessage); - FreePool (mSpaceBuffer); + FreePool(mSpaceBuffer); } /** @@ -786,7 +786,7 @@ WaitForKeyStroke ( while (TRUE) { Status = gST->ConIn->ReadKeyStroke (gST->ConIn, Key); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } @@ -939,8 +939,8 @@ PrintInternal ( Out->OutputString (Out, &mSpaceBuffer[SPACE_BUFFER_SIZE - Width + PrintWidth]); } - FreePool (Buffer); - FreePool (BackupBuffer); + FreePool(Buffer); + FreePool(BackupBuffer); return TotalCount; } diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c index 5cc527679..5926089f1 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c @@ -83,7 +83,7 @@ DmExtractDevicePathFromHiiHandle ( } Status = gHiiDatabase->GetPackageListHandle (gHiiDatabase, Handle, &DriverHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } // @@ -328,7 +328,7 @@ IsMacAddressDevicePath ( } if (Buffer != NULL) { - FreePool (Buffer); + FreePool(Buffer); } return ReturnVal; @@ -371,14 +371,14 @@ IsNeedAddNetworkMenu ( *ItemCount = 0; Status = gHiiDatabase->GetPackageListHandle (gHiiDatabase, Handle, &DriverHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } // // Get the device path by the got Driver handle . // Status = gBS->HandleProtocol (DriverHandle, &gEfiDevicePathProtocolGuid, (VOID **) &DevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } TmpDevicePath = DevicePath; @@ -402,7 +402,7 @@ IsNeedAddNetworkMenu ( // TmpDevicePath = DevicePath; Status = gBS->LocateDevicePath(&gEfiDevicePathProtocolGuid, &TmpDevicePath, &ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -421,7 +421,7 @@ IsNeedAddNetworkMenu ( &OpenInfoBuffer, &EntryCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -442,7 +442,7 @@ IsNeedAddNetworkMenu ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -475,7 +475,7 @@ IsNeedAddNetworkMenu ( Done: if (OpenInfoBuffer != NULL) { - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); } return IsNeedAdd; } @@ -543,8 +543,8 @@ CreateDeviceManagerForm( NewStringTitle = AllocatePool (NewStringLen); UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, mSelectedMacAddrString); HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); - FreePool (String); - FreePool (NewStringTitle); + FreePool(String); + FreePool(NewStringTitle); } // @@ -584,7 +584,7 @@ CreateDeviceManagerForm( // for (Index = 0; HiiHandles[Index] != NULL; Index++) { Status = HiiGetFormSetFromHiiHandle(HiiHandles[Index], &Buffer,&BufferSize); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ continue; } Ptr = (UINT8 *)Buffer; @@ -609,7 +609,7 @@ CreateDeviceManagerForm( ASSERT (String != NULL); } Token = HiiSetString (HiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); String = HiiGetString (HiiHandles[Index], ((EFI_IFR_FORM_SET *)Ptr)->Help, NULL); if (String == NULL) { @@ -617,7 +617,7 @@ CreateDeviceManagerForm( ASSERT (String != NULL); } TokenHelp = HiiSetString (HiiHandle, 0, String, NULL); - FreePool (String); + FreePool(String); FormSetGuid = ((EFI_IFR_FORM_SET *)Ptr)->Guid; @@ -722,7 +722,7 @@ CreateDeviceManagerForm( HiiFreeOpCodeHandle (StartOpCodeHandle); HiiFreeOpCodeHandle (EndOpCodeHandle); - FreePool (HiiHandles); + FreePool(HiiHandles); } /** @@ -878,7 +878,7 @@ DeviceManagerUiLibConstructor ( &gDeviceManagerPrivate.ConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Publish our HII data. @@ -925,7 +925,7 @@ DeviceManagerUiLibDestructor( &gDeviceManagerPrivate.ConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); HiiRemovePackages (gDeviceManagerPrivate.HiiHandle); diff --git a/MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.c b/MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.c index 5f3ae6ab7..88e609c04 100644 --- a/MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.c +++ b/MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.c @@ -147,7 +147,7 @@ FindDim ( NULL, (VOID **)&BootLogo ); - if ((BootLogo == NULL) || (EFI_ERROR (Status))) { + if ((BootLogo == NULL) || (EFI_ERROR(Status))) { DEBUG ((DEBUG_ERROR, "Failed to locate gEdkiiBootLogo2ProtocolGuid. No Progress bar support. \n", Status)); return; } @@ -163,7 +163,7 @@ FindDim ( &Width, &Height ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failed to Get Boot Logo Status = %r. No Progress bar support. \n", Status)); return; } @@ -287,7 +287,7 @@ FindDim ( // mBlockBitmap = AllocatePool (mBlockWidth * mBlockHeight * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (mBlockBitmap == NULL) { - FreePool (mProgressBarBackground); + FreePool(mProgressBarBackground); DEBUG ((DEBUG_ERROR, "Failed to allocate block\n")); return; } @@ -298,8 +298,8 @@ FindDim ( if ((mBlockHeight > Height) || (mBlockWidth > Width) || (mBlockHeight < 1) || (mBlockWidth < 1)) { DEBUG ((DEBUG_ERROR, "DisplayUpdateProgressLib - Progress - Failed to get valid width and height.\n")); DEBUG ((DEBUG_ERROR, "DisplayUpdateProgressLib - Progress - mBlockHeight: 0x%X mBlockWidth: 0x%X.\n", mBlockHeight, mBlockWidth)); - FreePool (mProgressBarBackground); - FreePool (mBlockBitmap); + FreePool(mProgressBarBackground); + FreePool(mBlockBitmap); return; } @@ -362,9 +362,9 @@ DisplayUpdateProgress ( &gEfiGraphicsOutputProtocolGuid, (VOID**)&mGop ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->LocateProtocol (&gEfiGraphicsOutputProtocolGuid, NULL, (VOID **)&mGop); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mGop = NULL; DEBUG ((DEBUG_ERROR, "Show Progress Function could not locate GOP. Status = %r\n", Status)); return EFI_NOT_READY; diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c index 4c32c6cdc..8f1cfc195 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c @@ -87,7 +87,7 @@ ValidateCapsuleNameCapsuleIntegrity ( // if (CapsuleNamePtr != CapsuleNameBufEnd) { if (CapsuleNameBufStart != (UINT8 *)CapsuleHeader + CapsuleHeader->HeaderSize) { - FreePool (CapsuleNameBufStart); + FreePool(CapsuleNameBufStart); } return NULL; } @@ -95,7 +95,7 @@ ValidateCapsuleNameCapsuleIntegrity ( CapsuleNameBuf = AllocatePool (*CapsuleNameNum * sizeof (EFI_PHYSICAL_ADDRESS)); if (CapsuleNameBuf == NULL) { if (CapsuleNameBufStart != (UINT8 *)CapsuleHeader + CapsuleHeader->HeaderSize) { - FreePool (CapsuleNameBufStart); + FreePool(CapsuleNameBufStart); } return NULL; } @@ -348,7 +348,7 @@ GetBootOptionByNumber( ZeroMem (&BootOption, sizeof (EFI_BOOT_MANAGER_LOAD_OPTION)); Status = EfiBootManagerVariableToLoadOption (BootOptionName, &BootOption); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *OptionBuf = AllocatePool (sizeof (EFI_BOOT_MANAGER_LOAD_OPTION)); if (*OptionBuf != NULL) { CopyMem (*OptionBuf, &BootOption, sizeof (EFI_BOOT_MANAGER_LOAD_OPTION)); @@ -510,7 +510,7 @@ GetEfiSysPartitionFromActiveBootOption( CurFullPath = EfiBootManagerGetNextLoadOptionDevicePath(DevicePath, CurFullPath); if (PreFullPath != NULL) { - FreePool (PreFullPath); + FreePool(PreFullPath); } if (CurFullPath == NULL) { @@ -1266,7 +1266,7 @@ BuildGatherList ( ERREXIT: if (BlockDescriptors1 != NULL) { - FreePool (BlockDescriptors1); + FreePool(BlockDescriptors1); } return Status; @@ -1751,7 +1751,7 @@ RelocateCapsuleToRam ( // 1. Load all Capsule On Disks into memory // Status = GetAllCapsuleOnDisk (MaxRetry, &CapsuleOnDiskBuf, &CapsuleOnDiskNum, &Handle, NULL); - if (EFI_ERROR (Status) || CapsuleOnDiskNum == 0 || CapsuleOnDiskBuf == NULL) { + if (EFI_ERROR(Status) || CapsuleOnDiskNum == 0 || CapsuleOnDiskBuf == NULL) { DEBUG ((DEBUG_ERROR, "GetAllCapsuleOnDisk Status - 0x%x\n", Status)); return EFI_NOT_FOUND; } @@ -1768,7 +1768,7 @@ RelocateCapsuleToRam ( CapsuleSize = AllocateZeroPool ((CapsuleOnDiskNum + 1) * sizeof (UINTN)); if (CapsuleSize == NULL) { DEBUG ((DEBUG_ERROR, "Fail to allocate memory for capsules.\n")); - FreePool (CapsuleBuffer); + FreePool(CapsuleBuffer); return EFI_OUT_OF_RESOURCES; } @@ -1781,8 +1781,8 @@ RelocateCapsuleToRam ( FileNameCapsule = AllocateZeroPool (sizeof (EFI_CAPSULE_HEADER) + TotalStringSize); if (FileNameCapsule == NULL) { DEBUG ((DEBUG_ERROR, "Fail to allocate memory for name capsule.\n")); - FreePool (CapsuleBuffer); - FreePool (CapsuleSize); + FreePool(CapsuleBuffer); + FreePool(CapsuleSize); return EFI_OUT_OF_RESOURCES; } @@ -1805,10 +1805,10 @@ RelocateCapsuleToRam ( // 3. Build Gather list for the capsules // Status = BuildGatherList (CapsuleBuffer, CapsuleSize, CapsuleOnDiskNum + 1, &BlockDescriptors); - if (EFI_ERROR (Status) || BlockDescriptors == NULL) { - FreePool (CapsuleBuffer); - FreePool (CapsuleSize); - FreePool (FileNameCapsule); + if (EFI_ERROR(Status) || BlockDescriptors == NULL) { + FreePool(CapsuleBuffer); + FreePool(CapsuleSize); + FreePool(FileNameCapsule); return EFI_OUT_OF_RESOURCES; } @@ -1964,7 +1964,7 @@ CoDRemoveTempFile ( EXIT: if (LoadOptionNumber != NULL) { - FreePool (LoadOptionNumber); + FreePool(LoadOptionNumber); } if (RootDir != NULL) { diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c index 95aa9de08..b876fae18 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c @@ -380,7 +380,7 @@ DisplayCapsuleImage ( // Try to open GOP // Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->LocateProtocol(&gEfiGraphicsOutputProtocolGuid, NULL, (VOID **)&GraphicsOutput); if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; @@ -403,7 +403,7 @@ DisplayCapsuleImage ( &Width ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -621,7 +621,7 @@ DumpAllFmpInfo ( FreePool(FmpImageInfoBuf); } - FreePool (HandleBuffer); + FreePool(HandleBuffer); return ; } @@ -696,7 +696,7 @@ GetFmpHandleBufferByType ( if (HandleBuf != NULL) { MatchedHandleBuffer = AllocateZeroPool (sizeof(EFI_HANDLE) * NumberOfHandles); if (MatchedHandleBuffer == NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); return EFI_OUT_OF_RESOURCES; } } @@ -706,9 +706,9 @@ GetFmpHandleBufferByType ( MatchedResetRequiredBuffer = AllocateZeroPool (sizeof(BOOLEAN) * NumberOfHandles); if (MatchedResetRequiredBuffer == NULL) { if (MatchedHandleBuffer != NULL) { - FreePool (MatchedHandleBuffer); + FreePool(MatchedHandleBuffer); } - FreePool (HandleBuffer); + FreePool(HandleBuffer); return EFI_OUT_OF_RESOURCES; } } @@ -790,7 +790,7 @@ GetFmpHandleBufferByType ( FreePool(FmpImageInfoBuf); } - FreePool (HandleBuffer); + FreePool(HandleBuffer); if (MatchedNumberOfHandles == 0) { return EFI_NOT_FOUND; @@ -919,7 +919,7 @@ SetFmpImageData ( &gEdkiiFirmwareManagementProgressProtocolGuid, (VOID **)&mFmpProgress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mFmpProgress = NULL; } @@ -953,7 +953,7 @@ SetFmpImageData ( // ProgressCallback = UpdateImageProgress; Status = UpdateImageProgress (0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ProgressCallback = NULL; } @@ -1098,7 +1098,7 @@ RecordFmpCapsuleStatus ( // Update corresponding ESRT entry LastAttemp Status // Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL, (VOID **)&EsrtProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -1591,7 +1591,7 @@ DxeCapsuleLibConstructor ( &gEfiEndOfDxeEventGroupGuid, &mDxeCapsuleLibEndOfDxeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); InitCapsuleVariable(); @@ -1619,7 +1619,7 @@ DxeCapsuleLibDestructor ( // Close the End of DXE event. // Status = gBS->CloseEvent (mDxeCapsuleLibEndOfDxeEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c index f2cd0ad3e..7771a8437 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c @@ -266,7 +266,7 @@ InitCapsulePtr ( mCapsuleStatusArray = (EFI_STATUS *) AllocateZeroPool (sizeof (EFI_STATUS) * mCapsuleTotalNumber); if (mCapsuleStatusArray == NULL) { DEBUG ((DEBUG_ERROR, "Allocate mCapsuleStatusArray fail!\n")); - FreePool (mCapsulePtr); + FreePool(mCapsulePtr); mCapsulePtr = NULL; mCapsuleTotalNumber = 0; return ; @@ -276,8 +276,8 @@ InitCapsulePtr ( CapsuleNameCapsulePtr = (VOID **) AllocateZeroPool (sizeof (VOID *) * CapsuleNameCapsuleTotalNumber); if (CapsuleNameCapsulePtr == NULL) { DEBUG ((DEBUG_ERROR, "Allocate CapsuleNameCapsulePtr fail!\n")); - FreePool (mCapsulePtr); - FreePool (mCapsuleStatusArray); + FreePool(mCapsulePtr); + FreePool(mCapsuleStatusArray); mCapsulePtr = NULL; mCapsuleStatusArray = NULL; mCapsuleTotalNumber = 0; @@ -313,9 +313,9 @@ InitCapsulePtr ( mCapsuleNamePtr = (CHAR16 **) AllocateZeroPool (sizeof (CHAR16 *) * mCapsuleTotalNumber); if (mCapsuleNamePtr == NULL) { DEBUG ((DEBUG_ERROR, "Allocate mCapsuleNamePtr fail!\n")); - FreePool (mCapsulePtr); - FreePool (mCapsuleStatusArray); - FreePool (CapsuleNameCapsulePtr); + FreePool(mCapsulePtr); + FreePool(mCapsuleStatusArray); + FreePool(CapsuleNameCapsulePtr); mCapsulePtr = NULL; mCapsuleStatusArray = NULL; mCapsuleTotalNumber = 0; @@ -334,7 +334,7 @@ InitCapsulePtr ( mCapsuleNamePtr = NULL; } - FreePool (CapsuleNameCapsulePtr); + FreePool(CapsuleNameCapsulePtr); } /** @@ -395,7 +395,7 @@ PopulateCapsuleInConfigurationTable ( CapsuleGuidCache = (EFI_GUID *) AllocateZeroPool (sizeof (EFI_GUID) * mCapsuleTotalNumber); if (CapsuleGuidCache == NULL) { DEBUG ((DEBUG_ERROR, "Allocate CapsuleGuidCache fail!\n")); - FreePool (CapsulePtrCache); + FreePool(CapsulePtrCache); return ; } @@ -462,7 +462,7 @@ PopulateCapsuleInConfigurationTable ( CapsuleTable->CapsuleArrayNumber = CapsuleNumber; CopyMem(&CapsuleTable->CapsulePtr[0], CapsulePtrCache, CapsuleNumber * sizeof(VOID*)); Status = gBS->InstallConfigurationTable (&CapsuleGuidCache[CacheIndex], (VOID*)CapsuleTable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "InstallConfigurationTable (%g) fail!\n", &CapsuleGuidCache[CacheIndex])); } } diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c index 0ec5f2067..d5e1d82a6 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c @@ -255,7 +255,7 @@ RecordFmpCapsuleStatusVariable ( if (DevicePathStr != NULL) { CopyMem ((UINT8 *)CapsuleResultVariableFmp + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP) + CapFileNameSize, DevicePathStr, DevicePathStrSize); - FreePool (DevicePathStr); + FreePool(DevicePathStr); DevicePathStr = NULL; } @@ -263,7 +263,7 @@ RecordFmpCapsuleStatusVariable ( if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) != 0) { Status = WriteNewCapsuleResultVariable(CapsuleResultVariable, CapsuleResultVariableSize); } - FreePool (CapsuleResultVariable); + FreePool(CapsuleResultVariable); return Status; } @@ -366,7 +366,7 @@ InitCapsuleLastVariable ( ); } else { if (CapsuleResult != NULL) { - FreePool (CapsuleResult); + FreePool(CapsuleResult); } } } @@ -418,7 +418,7 @@ InitCapsuleUpdateVariable ( 0, (VOID *)NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // There is no capsule variables, quit // @@ -446,9 +446,9 @@ InitCapsuleRelocationInfo ( // if (!CoDCheckCapsuleOnDiskFlag()) { Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = VariableLock->RequestToLock (VariableLock, COD_RELOCATION_INFO_VAR_NAME, &gEfiCapsuleVendorGuid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } } diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c index f94044a40..858546067 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c @@ -123,7 +123,7 @@ DxeRuntimeCapsuleLibConstructor ( &gEfiEventVirtualAddressChangeGuid, &mDxeRuntimeCapsuleLibVirtualAddressChangeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register notify function to cache the FMP capsule GUIDs at ReadyToBoot. @@ -136,7 +136,7 @@ DxeRuntimeCapsuleLibConstructor ( &gEfiEventReadyToBootGuid, &mDxeRuntimeCapsuleLibReadyToBootEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -162,13 +162,13 @@ DxeRuntimeCapsuleLibDestructor ( // Close the VirtualAddressChange event. // Status = gBS->CloseEvent (mDxeRuntimeCapsuleLibVirtualAddressChangeEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Close the ReadyToBoot event. // Status = gBS->CloseEvent (mDxeRuntimeCapsuleLibReadyToBootEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationServices.h b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationServices.h index 73b3569b6..620dd6a22 100644 --- a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationServices.h +++ b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationServices.h @@ -93,7 +93,7 @@ CoreAllocatePool ( **/ EFI_STATUS EFIAPI -CoreFreePool ( +CoreFreePool( IN VOID *Buffer ); diff --git a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c index 8f2985f4f..9f7086e5a 100644 --- a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c @@ -46,7 +46,7 @@ InternalAllocatePages ( } Status = CoreAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return (VOID *) (UINTN) Memory; @@ -187,7 +187,7 @@ FreePages ( if (Pages != 0) { /* Status = */CoreFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); } -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } /** @@ -242,7 +242,7 @@ InternalAllocateAlignedPages ( ASSERT (RealPages > Pages); Status = CoreAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -252,7 +252,7 @@ InternalAllocateAlignedPages ( // Free first unaligned page(s). // Status = CoreFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Memory = AlignedMemory + EFI_PAGES_TO_SIZE (Pages); UnalignedPages = RealPages - Pages - UnalignedPages; @@ -261,14 +261,14 @@ InternalAllocateAlignedPages ( // Free last unaligned page(s). // Status = CoreFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } else { // // Do not over-allocate pages in this case. // Status = CoreAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = (UINTN) Memory; @@ -429,7 +429,7 @@ FreeAlignedPages ( if (Pages != 0) { /* Status = */ CoreFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); } -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } /** @@ -457,7 +457,7 @@ InternalAllocatePool ( Memory = NULL; Status = CoreAllocatePool (MemoryType, AllocationSize, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Memory = NULL; } return Memory; @@ -890,7 +890,7 @@ InternalReallocatePool ( NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); - FreePool (OldBuffer); + FreePool(OldBuffer); } return NewBuffer; } @@ -1046,13 +1046,13 @@ ReallocateReservedPool ( **/ VOID EFIAPI -FreePool ( +FreePool( IN VOID *Buffer ) { // EFI_STATUS Status; -/* Status = */ CoreFreePool (Buffer); -// ASSERT_EFI_ERROR (Status); +/* Status = */ CoreFreePool(Buffer); +// ASSERT_EFI_ERROR(Status); } diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 0d507c445..0bcffcd5f 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -158,16 +158,16 @@ IsKnownTokens ( return FALSE; } - if (AsciiStrCmp (Token, SEC_TOK) == 0 || - AsciiStrCmp (Token, PEI_TOK) == 0 || - AsciiStrCmp (Token, DXE_TOK) == 0 || - AsciiStrCmp (Token, BDS_TOK) == 0 || - AsciiStrCmp (Token, DRIVERBINDING_START_TOK) == 0 || - AsciiStrCmp (Token, DRIVERBINDING_SUPPORT_TOK) == 0 || - AsciiStrCmp (Token, DRIVERBINDING_STOP_TOK) == 0 || - AsciiStrCmp (Token, LOAD_IMAGE_TOK) == 0 || - AsciiStrCmp (Token, START_IMAGE_TOK) == 0 || - AsciiStrCmp (Token, PEIM_TOK) == 0) { + if (AsciiStrCmp(Token, SEC_TOK) == 0 || + AsciiStrCmp(Token, PEI_TOK) == 0 || + AsciiStrCmp(Token, DXE_TOK) == 0 || + AsciiStrCmp(Token, BDS_TOK) == 0 || + AsciiStrCmp(Token, DRIVERBINDING_START_TOK) == 0 || + AsciiStrCmp(Token, DRIVERBINDING_SUPPORT_TOK) == 0 || + AsciiStrCmp(Token, DRIVERBINDING_STOP_TOK) == 0 || + AsciiStrCmp(Token, LOAD_IMAGE_TOK) == 0 || + AsciiStrCmp(Token, START_IMAGE_TOK) == 0 || + AsciiStrCmp(Token, PEIM_TOK) == 0) { return TRUE; } else { return FALSE; @@ -240,7 +240,7 @@ AllocateBootPerformanceTable ( SmmBootRecordDataSize = 0; ReservedMemSize = 0; Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &Communication); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Initialize communicate buffer // Get the prepared Reserved Memory Range @@ -249,7 +249,7 @@ AllocateBootPerformanceTable ( &gEdkiiPiSmmCommunicationRegionTableGuid, (VOID **) &SmmCommRegionTable ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (SmmCommRegionTable != NULL); SmmCommMemRegion = (EFI_MEMORY_DESCRIPTOR *) (SmmCommRegionTable + 1); for (Index = 0; Index < SmmCommRegionTable->NumberOfEntries; Index ++) { @@ -283,7 +283,7 @@ AllocateBootPerformanceTable ( SmmCommData->BootRecordData = NULL; Status = Communication->Communicate (Communication, SmmBootRecordCommBuffer, &CommSize); - if (!EFI_ERROR (Status) && !EFI_ERROR (SmmCommData->ReturnStatus) && SmmCommData->BootRecordSize != 0) { + if (!EFI_ERROR(Status) && !EFI_ERROR(SmmCommData->ReturnStatus) && SmmCommData->BootRecordSize != 0) { // // Get all boot records // @@ -296,7 +296,7 @@ AllocateBootPerformanceTable ( SmmCommData->BootRecordSize = ReservedMemSize - SMM_BOOT_RECORD_COMM_SIZE; while (SmmCommData->BootRecordOffset < SmmBootRecordDataSize) { Status = Communication->Communicate (Communication, SmmBootRecordCommBuffer, &CommSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT_EFI_ERROR(SmmCommData->ReturnStatus); if (SmmCommData->BootRecordOffset + SmmCommData->BootRecordSize > SmmBootRecordDataSize) { CopyMem ((UINT8 *) SmmBootRecordData + SmmCommData->BootRecordOffset, SmmCommData->BootRecordData, SmmBootRecordDataSize - SmmCommData->BootRecordOffset); @@ -331,14 +331,14 @@ AllocateBootPerformanceTable ( &Size, &PerformanceVariable ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->AllocatePages ( AllocateAddress, EfiReservedMemoryType, EFI_SIZE_TO_PAGES (BootPerformanceDataSize), &PerformanceVariable.BootPerformanceTablePointer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { mAcpiBootPerformanceTable = (BOOT_PERFORMANCE_TABLE *) (UINTN) PerformanceVariable.BootPerformanceTablePointer; } } @@ -359,7 +359,7 @@ AllocateBootPerformanceTable ( if (mAcpiBootPerformanceTable == NULL) { if (SmmCommData != NULL && SmmBootRecordData != NULL) { - FreePool (SmmBootRecordData); + FreePool(SmmBootRecordData); } return EFI_OUT_OF_RESOURCES; } @@ -380,7 +380,7 @@ AllocateBootPerformanceTable ( CopyMem (BootPerformanceData, mPerformancePointer, mPerformanceLength); mAcpiBootPerformanceTable->Header.Length += mPerformanceLength; BootPerformanceData = BootPerformanceData + mPerformanceLength; - FreePool (mPerformancePointer); + FreePool(mPerformancePointer); mPerformancePointer = NULL; mPerformanceLength = 0; mMaxPerformanceLength = 0; @@ -390,7 +390,7 @@ AllocateBootPerformanceTable ( // Fill Boot records from SMM drivers. // CopyMem (BootPerformanceData, SmmBootRecordData, SmmBootRecordDataSize); - FreePool (SmmBootRecordData); + FreePool(SmmBootRecordData); mAcpiBootPerformanceTable->Header.Length = (UINT32) (mAcpiBootPerformanceTable->Header.Length + SmmBootRecordDataSize); BootPerformanceData = BootPerformanceData + SmmBootRecordDataSize; } @@ -477,7 +477,7 @@ GetModuleInfoFromHandle ( (VOID**) &LoadedImage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Try Handle as Controller Handle // @@ -489,7 +489,7 @@ GetModuleInfoFromHandle ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get Image protocol from ImageHandle // @@ -502,7 +502,7 @@ GetModuleInfoFromHandle ( } } - if (!EFI_ERROR (Status) && LoadedImage != NULL) { + if (!EFI_ERROR(Status) && LoadedImage != NULL) { // // Get Module Guid from DevicePath. // @@ -559,7 +559,7 @@ GetModuleInfoFromHandle ( &gEfiComponentName2ProtocolGuid, (VOID **) &ComponentName2 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get the current platform language setting // @@ -572,7 +572,7 @@ GetModuleInfoFromHandle ( mPlatformLanguage != NULL ? mPlatformLanguage : "en-US", &StringPtr ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < BufferSize - 1 && StringPtr[Index] != 0; Index++) { NameString[Index] = (CHAR8) StringPtr[Index]; } @@ -599,7 +599,7 @@ GetModuleInfoFromHandle ( &StringSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Method 3. Get the name string from FFS UI section // @@ -607,7 +607,7 @@ GetModuleInfoFromHandle ( NameString[Index] = (CHAR8) StringPtr[Index]; } NameString[Index] = 0; - FreePool (StringPtr); + FreePool(StringPtr); } } @@ -662,25 +662,25 @@ GetFpdtRecordId ( // Token to PerfId. // if (String != NULL) { - if (AsciiStrCmp (String, START_IMAGE_TOK) == 0) { // "StartImage:" + if (AsciiStrCmp(String, START_IMAGE_TOK) == 0) { // "StartImage:" if (Attribute == PerfStartEntry) { *ProgressID = MODULE_START_ID; } else { *ProgressID = MODULE_END_ID; } - } else if (AsciiStrCmp (String, LOAD_IMAGE_TOK) == 0) { // "LoadImage:" + } else if (AsciiStrCmp(String, LOAD_IMAGE_TOK) == 0) { // "LoadImage:" if (Attribute == PerfStartEntry) { *ProgressID = MODULE_LOADIMAGE_START_ID; } else { *ProgressID = MODULE_LOADIMAGE_END_ID; } - } else if (AsciiStrCmp (String, DRIVERBINDING_START_TOK) == 0) { // "DB:Start:" + } else if (AsciiStrCmp(String, DRIVERBINDING_START_TOK) == 0) { // "DB:Start:" if (Attribute == PerfStartEntry) { *ProgressID = MODULE_DB_START_ID; } else { *ProgressID = MODULE_DB_END_ID; } - } else if (AsciiStrCmp (String, DRIVERBINDING_SUPPORT_TOK) == 0) { // "DB:Support:" + } else if (AsciiStrCmp(String, DRIVERBINDING_SUPPORT_TOK) == 0) { // "DB:Support:" if (PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { return RETURN_UNSUPPORTED; } @@ -689,7 +689,7 @@ GetFpdtRecordId ( } else { *ProgressID = MODULE_DB_SUPPORT_END_ID; } - } else if (AsciiStrCmp (String, DRIVERBINDING_STOP_TOK) == 0) { // "DB:Stop:" + } else if (AsciiStrCmp(String, DRIVERBINDING_STOP_TOK) == 0) { // "DB:Stop:" if (PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { return RETURN_UNSUPPORTED; } @@ -698,9 +698,9 @@ GetFpdtRecordId ( } else { *ProgressID = MODULE_DB_STOP_END_ID; } - } else if (AsciiStrCmp (String, PEI_TOK) == 0 || // "PEI" - AsciiStrCmp (String, DXE_TOK) == 0 || // "DXE" - AsciiStrCmp (String, BDS_TOK) == 0) { // "BDS" + } else if (AsciiStrCmp(String, PEI_TOK) == 0 || // "PEI" + AsciiStrCmp(String, DXE_TOK) == 0 || // "DXE" + AsciiStrCmp(String, BDS_TOK) == 0) { // "BDS" if (Attribute == PerfStartEntry) { *ProgressID = PERF_CROSSMODULE_START_ID; } else { @@ -820,7 +820,7 @@ GetDeviceInfoFromHandleAndUpdateLength ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // This will produce the size of the unicode string, which is twice as large as the ASCII one // This must be an even number, so ok to divide by 2 @@ -965,7 +965,7 @@ InsertFpdtRecord ( // Get ProgressID form the String Token. // Status = GetFpdtRecordId (Attribute, CallerIdentifier, String, &ProgressId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } PerfId = ProgressId; @@ -976,7 +976,7 @@ InsertFpdtRecord ( // 2. Get the buffer to store the FPDT record. // Status = GetFpdtRecordPtr (FPDT_MAX_PERF_RECORD_SIZE, &FpdtRecordPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1383,7 +1383,7 @@ DxeCorePerformanceLibConstructor ( &mPerformanceMeasurementInterface, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register ReadyToBoot event to report StatusCode data @@ -1397,10 +1397,10 @@ DxeCorePerformanceLibConstructor ( &ReadyToBootEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, (VOID **) &PerformanceProperty); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Install configuration table for performance property. // @@ -1411,7 +1411,7 @@ DxeCorePerformanceLibConstructor ( &mPerformanceProperty.TimerEndValue ); Status = gBS->InstallConfigurationTable (&gPerformanceProtocolGuid, &mPerformanceProperty); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return EFI_SUCCESS; diff --git a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c index 048b4ff38..534ab268a 100644 --- a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c +++ b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c @@ -177,7 +177,7 @@ Crc32GuidedSectionHandler ( // Check whether there exists EFI_SECURITY_POLICY_PROTOCOL_GUID. // Status = gBS->LocateProtocol (&gEfiSecurityPolicyProtocolGuid, NULL, &DummyInterface); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If SecurityPolicy Protocol exist, AUTH platform override bit is set. // diff --git a/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c b/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c index 7f3ccb06d..2cad4a2ca 100644 --- a/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c +++ b/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c @@ -233,7 +233,7 @@ GetDebugPrintErrorLevel ( // Variable will not be read again by this module. // mGlobalErrorLevelInitialized = TRUE; - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If the EFI Varible exists, then set this module's module's mask to // the global debug print error level mask value. @@ -304,7 +304,7 @@ SetDebugPrintErrorLevel ( Size, &GlobalErrorLevel ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If the EFI Variable was updated, then update the mask value for this // module and return TRUE. diff --git a/MdeModulePkg/Library/DxeFileExplorerProtocol/DxeFileExplorerProtocol.c b/MdeModulePkg/Library/DxeFileExplorerProtocol/DxeFileExplorerProtocol.c index 2a7837a00..14bf6ea57 100644 --- a/MdeModulePkg/Library/DxeFileExplorerProtocol/DxeFileExplorerProtocol.c +++ b/MdeModulePkg/Library/DxeFileExplorerProtocol/DxeFileExplorerProtocol.c @@ -48,7 +48,7 @@ FileExplorerConstructor ( NULL, (VOID**) &mProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (mProtocol != NULL); return Status; diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c index 9774670d7..900fc1152 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -405,7 +405,7 @@ HttpParseUrl ( switch (State) { case UrlParserStateMax: - FreePool (Parser); + FreePool(Parser); return EFI_INVALID_PARAMETER; case UrlParserSchemeColon: @@ -467,8 +467,8 @@ HttpParseUrl ( // if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_AUTHORITY)) != 0) { Status = NetHttpParseAuthority (Url, FoundAt, Parser); - if (EFI_ERROR (Status)) { - FreePool (Parser); + if (EFI_ERROR(Status)) { + FreePool(Parser); return Status; } } @@ -527,8 +527,8 @@ HttpUrlGetHostName ( Name, &ResultLength ); - if (EFI_ERROR (Status)) { - FreePool (Name); + if (EFI_ERROR(Status)) { + FreePool(Name); return Status; } @@ -587,14 +587,14 @@ HttpUrlGetIp4 ( Ip4String, &ResultLength ); - if (EFI_ERROR (Status)) { - FreePool (Ip4String); + if (EFI_ERROR(Status)) { + FreePool(Ip4String); return Status; } Ip4String[ResultLength] = '\0'; Status = NetLibAsciiStrToIp4 (Ip4String, Ip4Address); - FreePool (Ip4String); + FreePool(Ip4String); return Status; } @@ -663,14 +663,14 @@ HttpUrlGetIp6 ( Ip6String, &ResultLength ); - if (EFI_ERROR (Status)) { - FreePool (Ip6String); + if (EFI_ERROR(Status)) { + FreePool(Ip6String); return Status; } Ip6String[ResultLength] = '\0'; Status = NetLibAsciiStrToIp6 (Ip6String, Ip6Address); - FreePool (Ip6String); + FreePool(Ip6String); return Status; } @@ -729,7 +729,7 @@ HttpUrlGetPort ( PortString, &ResultLength ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -753,7 +753,7 @@ HttpUrlGetPort ( *Port = (UINT16) Data; ON_EXIT: - FreePool (PortString); + FreePool(PortString); return Status; } @@ -807,8 +807,8 @@ HttpUrlGetPath ( PathStr, &ResultLength ); - if (EFI_ERROR (Status)) { - FreePool (PathStr); + if (EFI_ERROR(Status)) { + FreePool(PathStr); return Status; } @@ -829,7 +829,7 @@ HttpUrlFreeParser ( IN VOID *UrlParser ) { - FreePool (UrlParser); + FreePool(UrlParser); } /** @@ -1101,7 +1101,7 @@ HttpInitMsgParser ( // 3. Check whether the message has a Content-Length header field. // Status = HttpIoParseContentLengthHeader (HeaderCount, Headers, &Parser->ContentLength); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Parser->ContentLengthIsValid = TRUE; } // @@ -1171,7 +1171,7 @@ HttpParseMessageBody ( 0, Parser->Context ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1207,7 +1207,7 @@ HttpParseMessageBody ( MIN (BodyLength, Parser->ContentLength - Parser->ParsedBodyLength), Parser->Context ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1222,7 +1222,7 @@ HttpParseMessageBody ( 0, Parser->Context ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1311,7 +1311,7 @@ HttpParseMessageBody ( 0, Parser->Context ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1341,7 +1341,7 @@ HttpParseMessageBody ( LengthForCallback, Parser->Context ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1461,7 +1461,7 @@ HttpFreeMsgParser ( IN VOID *MsgParser ) { - FreePool (MsgParser); + FreePool(MsgParser); } @@ -1525,10 +1525,10 @@ HttpSetFieldNameAndValue ( } if (HttpHeader->FieldName != NULL) { - FreePool (HttpHeader->FieldName); + FreePool(HttpHeader->FieldName); } if (HttpHeader->FieldValue != NULL) { - FreePool (HttpHeader->FieldValue); + FreePool(HttpHeader->FieldValue); } FieldNameSize = AsciiStrSize (FieldName); @@ -1542,7 +1542,7 @@ HttpSetFieldNameAndValue ( FieldValueSize = AsciiStrSize (FieldValue); HttpHeader->FieldValue = AllocateZeroPool (FieldValueSize); if (HttpHeader->FieldValue == NULL) { - FreePool (HttpHeader->FieldName); + FreePool(HttpHeader->FieldName); return EFI_OUT_OF_RESOURCES; } CopyMem (HttpHeader->FieldValue, FieldValue, FieldValueSize); @@ -1689,14 +1689,14 @@ HttpFreeHeaderFields ( if (HeaderFields != NULL) { for (Index = 0; Index < FieldCount; Index++) { if (HeaderFields[Index].FieldName != NULL) { - FreePool (HeaderFields[Index].FieldName); + FreePool(HeaderFields[Index].FieldName); } if (HeaderFields[Index].FieldValue != NULL) { - FreePool (HeaderFields[Index].FieldValue); + FreePool(HeaderFields[Index].FieldValue); } } - FreePool (HeaderFields); + FreePool(HeaderFields); } } @@ -1773,7 +1773,7 @@ HttpGenRequestMessage ( (VOID **) &HttpUtilitiesProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR,"Failed to locate Http Utilities protocol. Status = %r.\n", Status)); return Status; } @@ -1805,9 +1805,9 @@ HttpGenRequestMessage ( &HttpHdr ); - FreePool (AppendList); + FreePool(AppendList); - if (EFI_ERROR (Status) || HttpHdr == NULL){ + if (EFI_ERROR(Status) || HttpHdr == NULL){ return Status; } } @@ -1923,14 +1923,14 @@ Exit: if (!Success) { if (*RequestMsg != NULL) { - FreePool (*RequestMsg); + FreePool(*RequestMsg); } *RequestMsg = NULL; return Status; } if (HttpHdr != NULL) { - FreePool (HttpHdr); + FreePool(HttpHdr); } return EFI_SUCCESS; @@ -2070,7 +2070,7 @@ HttpIsValidHttpHeader ( continue; } - if (AsciiStrCmp (FieldName, DeleteList[Index]) == 0) { + if (AsciiStrCmp(FieldName, DeleteList[Index]) == 0) { return FALSE; } } diff --git a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c index 22b96b05d..cfff5e2d7 100644 --- a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c +++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c @@ -50,7 +50,7 @@ IpmiSubmitCommand ( NULL, (VOID **) &mIpmiProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Dxe Ipmi Protocol is not installed. So, IPMI device is not present. // @@ -68,7 +68,7 @@ IpmiSubmitCommand ( ResponseData, ResponseDataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } return EFI_SUCCESS; diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index 90d2e3e64..816fef4c4 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -162,7 +162,7 @@ SyslogLocateSnp ( &Handles ); - if (EFI_ERROR (Status) || (HandleCount == 0)) { + if (EFI_ERROR(Status) || (HandleCount == 0)) { return NULL; } @@ -188,7 +188,7 @@ SyslogLocateSnp ( Snp = NULL; } - FreePool (Handles); + FreePool(Handles); return Snp; } @@ -242,13 +242,13 @@ SyslogSendPacket ( &TimeoutEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->SetTimer (TimeoutEvent, TimerRelative, NET_SYSLOG_TX_TIMEOUT); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -276,7 +276,7 @@ SyslogSendPacket ( // Snp->GetStatus (Snp, NULL, (VOID **) &TxBuf); - if (!EFI_ERROR (gBS->CheckEvent (TimeoutEvent))) { + if (!EFI_ERROR(gBS->CheckEvent (TimeoutEvent))) { Status = EFI_TIMEOUT; break; } @@ -384,7 +384,7 @@ SyslogBuildPacket ( // Pri = ((NET_SYSLOG_FACILITY & 31) << 3) | (Level & 7); Status = gRT->GetTime (&Time, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return 0; } @@ -554,10 +554,10 @@ NetDebugOutput ( Status = SyslogSendPacket (Packet, Len); } - FreePool (Packet); + FreePool(Packet); ON_EXIT: - FreePool (Message); + FreePool(Message); return Status; } /** @@ -1170,7 +1170,7 @@ NetDestroyLinkList ( Entry = GetFirstNode (List); while (!IsNull (List, Entry)) { Status = CallBack (Entry, Context); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1292,7 +1292,7 @@ NetMapClean ( RemoveEntryList (&Item->Link); Map->Count--; - gBS->FreePool (Item); + gBS->FreePool(Item); } ASSERT ((Map->Count == 0) && IsListEmpty (&Map->Used)); @@ -1301,7 +1301,7 @@ NetMapClean ( Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link); RemoveEntryList (&Item->Link); - gBS->FreePool (Item); + gBS->FreePool(Item); } ASSERT (IsListEmpty (&Map->Recycled)); @@ -1744,7 +1744,7 @@ NetMapIterate ( Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link); Result = CallBack (Map, Item, Arg); - if (EFI_ERROR (Result)) { + if (EFI_ERROR(Result)) { return Result; } } @@ -1793,7 +1793,7 @@ NetLibDefaultUnload ( &DeviceHandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1803,7 +1803,7 @@ NetLibDefaultUnload ( &gEfiDriverBindingProtocolGuid, (VOID **) &DriverBinding ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -1837,7 +1837,7 @@ NetLibDefaultUnload ( &gEfiComponentNameProtocolGuid, (VOID **) &ComponentName ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallProtocolInterface ( DriverBinding->DriverBindingHandle, &gEfiComponentNameProtocolGuid, @@ -1850,7 +1850,7 @@ NetLibDefaultUnload ( &gEfiComponentName2ProtocolGuid, (VOID **) &ComponentName2 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallProtocolInterface ( DriverBinding->DriverBindingHandle, &gEfiComponentName2ProtocolGuid, @@ -1863,7 +1863,7 @@ NetLibDefaultUnload ( // Free the buffer containing the list of handles from the handle database // if (DeviceHandleBuffer != NULL) { - gBS->FreePool (DeviceHandleBuffer); + gBS->FreePool(DeviceHandleBuffer); } return EFI_SUCCESS; @@ -1915,7 +1915,7 @@ NetLibCreateServiceChild ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1969,7 +1969,7 @@ NetLibDestroyServiceChild ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2013,7 +2013,7 @@ NetLibGetSnpHandle ( // SnpInstance = NULL; Status = gBS->HandleProtocol (ServiceHandle, &gEfiSimpleNetworkProtocolGuid, (VOID **) &SnpInstance); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Snp != NULL) { *Snp = SnpInstance; } @@ -2030,7 +2030,7 @@ NetLibGetSnpHandle ( SnpHandle = NULL; Status = gBS->LocateDevicePath (&gEfiSimpleNetworkProtocolGuid, &DevicePath, &SnpHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Failed to find SNP handle // @@ -2038,7 +2038,7 @@ NetLibGetSnpHandle ( } Status = gBS->HandleProtocol (SnpHandle, &gEfiSimpleNetworkProtocolGuid, (VOID **) &SnpInstance); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Snp != NULL) { *Snp = SnpInstance; } @@ -2148,7 +2148,7 @@ NetLibGetVlanHandle ( Handle = NULL; } - FreePool (VlanDevicePath); + FreePool(VlanDevicePath); return Handle; } @@ -2211,7 +2211,7 @@ NetLibGetMacAddress ( &gEfiManagedNetworkServiceBindingProtocolGuid, (VOID **) &MnpSb ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2219,7 +2219,7 @@ NetLibGetMacAddress ( // Create a MNP child // Status = MnpSb->CreateChild (MnpSb, &MnpChildHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2231,7 +2231,7 @@ NetLibGetMacAddress ( &gEfiManagedNetworkProtocolGuid, (VOID **) &Mnp ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { MnpSb->DestroyChild (MnpSb, MnpChildHandle); return Status; } @@ -2240,7 +2240,7 @@ NetLibGetMacAddress ( // Try to get SNP mode from MNP // Status = Mnp->GetModeData (Mnp, NULL, &SnpModeData); - if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_NOT_STARTED)) { MnpSb->DestroyChild (MnpSb, MnpChildHandle); return Status; } @@ -2305,7 +2305,7 @@ NetLibGetMacString ( // Get MAC address of the network device // Status = NetLibGetMacAddress (ServiceHandle, &MacAddress, &HwAddressSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2430,7 +2430,7 @@ NetLibDetectMedia ( // Invoke Snp->GetStatus() to refresh MediaPresent field in SNP mode data // Status = Snp->GetStatus (Snp, &InterruptStatus, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2485,10 +2485,10 @@ NetLibDetectMedia ( // Shutdown/Stop the simple network // Status = Snp->Shutdown (Snp); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Snp->Stop (Snp); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -2496,10 +2496,10 @@ NetLibDetectMedia ( // Start/Initialize the simple network // Status = Snp->Start (Snp); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Snp->Initialize (Snp, 0, 0); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -2521,7 +2521,7 @@ NetLibDetectMedia ( ); if (MCastFilter != NULL) { - FreePool (MCastFilter); + FreePool(MCastFilter); } return Status; @@ -2535,7 +2535,7 @@ NetLibDetectMedia ( // SNP not start yet, start it // Status = Snp->Start (Snp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } } @@ -2544,7 +2544,7 @@ NetLibDetectMedia ( // Initialize the simple network // Status = Snp->Initialize (Snp, 0, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Exit; } @@ -2568,7 +2568,7 @@ Exit: } if (MCastFilter != NULL) { - FreePool (MCastFilter); + FreePool(MCastFilter); } return Status; @@ -2638,11 +2638,11 @@ NetLibDetectMediaWaitTimeout ( &gEfiAdapterInformationProtocolGuid, (VOID *) &Aip ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { MediaPresent = TRUE; Status = NetLibDetectMedia (ServiceHandle, &MediaPresent); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (MediaPresent) { *MediaState = EFI_SUCCESS; } else { @@ -2662,10 +2662,10 @@ NetLibDetectMediaWaitTimeout ( (VOID **) &MediaInfo, &DataSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *MediaState = MediaInfo->MediaState; - FreePool (MediaInfo); + FreePool(MediaInfo); if (*MediaState != EFI_NOT_READY || Timeout < MEDIA_STATE_DETECT_TIME_INTERVAL) { return EFI_SUCCESS; @@ -2673,7 +2673,7 @@ NetLibDetectMediaWaitTimeout ( } else { if (MediaInfo != NULL) { - FreePool (MediaInfo); + FreePool(MediaInfo); } if (Status == EFI_UNSUPPORTED) { @@ -2683,7 +2683,7 @@ NetLibDetectMediaWaitTimeout ( // MediaPresent = TRUE; Status = NetLibDetectMedia (ServiceHandle, &MediaPresent); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (MediaPresent) { *MediaState = EFI_SUCCESS; } else { @@ -2703,7 +2703,7 @@ NetLibDetectMediaWaitTimeout ( Timer = NULL; TimeRemained = Timeout; Status = gBS->CreateEvent (EVT_TIMER, TPL_CALLBACK, NULL, NULL, &Timer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -2713,14 +2713,14 @@ NetLibDetectMediaWaitTimeout ( TimerRelative, MEDIA_STATE_DETECT_TIME_INTERVAL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent(Timer); return EFI_DEVICE_ERROR; } do { TimerStatus = gBS->CheckEvent (Timer); - if (!EFI_ERROR (TimerStatus)) { + if (!EFI_ERROR(TimerStatus)) { TimeRemained -= MEDIA_STATE_DETECT_TIME_INTERVAL; Status = Aip->GetInformation ( @@ -2729,14 +2729,14 @@ NetLibDetectMediaWaitTimeout ( (VOID **) &MediaInfo, &DataSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *MediaState = MediaInfo->MediaState; - FreePool (MediaInfo); + FreePool(MediaInfo); } else { if (MediaInfo != NULL) { - FreePool (MediaInfo); + FreePool(MediaInfo); } gBS->CloseEvent(Timer); return Status; @@ -2789,12 +2789,12 @@ NetLibDefaultAddressIsStatic ( // Get Ip4Config2 policy. // Status = gBS->HandleProtocol (Controller, &gEfiIp4Config2ProtocolGuid, (VOID **) &Ip4Config2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } Status = Ip4Config2->GetData (Ip4Config2, Ip4Config2DataTypePolicy, &DataSize, &Policy); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ON_EXIT; } @@ -2962,7 +2962,7 @@ NetLibGetNicHandle ( &OpenCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -2975,7 +2975,7 @@ NetLibGetNicHandle ( } } - gBS->FreePool (OpenBuffer); + gBS->FreePool(OpenBuffer); return Handle; } @@ -3261,12 +3261,12 @@ NetLibGetSystemGuid ( SmbiosTable = NULL; Status = EfiGetSystemConfigurationTable (&gEfiSmbios3TableGuid, (VOID **) &Smbios30Table); - if (!(EFI_ERROR (Status) || Smbios30Table == NULL)) { + if (!(EFI_ERROR(Status) || Smbios30Table == NULL)) { Smbios.Hdr = (SMBIOS_STRUCTURE *) (UINTN) Smbios30Table->TableAddress; SmbiosEnd.Raw = (UINT8 *) (UINTN) (Smbios30Table->TableAddress + Smbios30Table->TableMaximumSize); } else { Status = EfiGetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID **) &SmbiosTable); - if (EFI_ERROR (Status) || SmbiosTable == NULL) { + if (EFI_ERROR(Status) || SmbiosTable == NULL) { return EFI_NOT_FOUND; } Smbios.Hdr = (SMBIOS_STRUCTURE *) (UINTN) SmbiosTable->TableAddress; diff --git a/MdeModulePkg/Library/DxeNetLib/NetBuffer.c b/MdeModulePkg/Library/DxeNetLib/NetBuffer.c index d0e2b9f2a..fe7e3979a 100644 --- a/MdeModulePkg/Library/DxeNetLib/NetBuffer.c +++ b/MdeModulePkg/Library/DxeNetLib/NetBuffer.c @@ -77,7 +77,7 @@ NetbufAllocStruct ( FreeNbuf: - FreePool (Nbuf); + FreePool(Nbuf); return NULL; } @@ -132,7 +132,7 @@ NetbufAlloc ( return Nbuf; FreeNBuf: - FreePool (Nbuf); + FreePool(Nbuf); return NULL; } @@ -170,7 +170,7 @@ NetbufFreeVector ( // first block since it is allocated by us // if ((Vector->Flag & NET_VECTOR_OWN_FIRST) != 0) { - gBS->FreePool (Vector->Block[0].Bulk); + gBS->FreePool(Vector->Block[0].Bulk); } Vector->Free (Vector->Arg); @@ -180,11 +180,11 @@ NetbufFreeVector ( // Free each memory block associated with the Vector // for (Index = 0; Index < Vector->BlockNum; Index++) { - gBS->FreePool (Vector->Block[Index].Bulk); + gBS->FreePool(Vector->Block[Index].Bulk); } } - FreePool (Vector); + FreePool(Vector); } @@ -218,7 +218,7 @@ NetbufFree ( // all the sharing of Nbuf increse Vector's RefCnt by one // NetbufFreeVector (Nbuf->Vector); - FreePool (Nbuf); + FreePool(Nbuf); } } @@ -685,7 +685,7 @@ NetbufGetFragment ( FreeChild: - FreePool (Child); + FreePool(Child); return NULL; } @@ -868,7 +868,7 @@ NetbufFromExt ( FreeFirstBlock: if (FirstBlock != NULL) { - FreePool (FirstBlock); + FreePool(FirstBlock); } return NULL; } @@ -989,7 +989,7 @@ NetbufFromBufList ( } Nbuf = NetbufFromExt (Fragment, Current, HeadSpace, HeaderLen, ExtFree, Arg); - FreePool (Fragment); + FreePool(Fragment); return Nbuf; } @@ -1394,7 +1394,7 @@ NetbufQueFree ( if (NbufQue->RefCnt == 0) { NetbufQueFlush (NbufQue); - FreePool (NbufQue); + FreePool(NbufQue); } } @@ -1887,10 +1887,10 @@ NetIpSecNetbufFree ( // allocated by us // if ((Nbuf->Vector->Flag & NET_VECTOR_OWN_FIRST) != 0) { - FreePool (Nbuf->Vector->Block[0].Bulk); + FreePool(Nbuf->Vector->Block[0].Bulk); } - FreePool (Nbuf->Vector); - FreePool (Nbuf); + FreePool(Nbuf->Vector); + FreePool(Nbuf); } } diff --git a/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c b/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c index d2fdd2806..fb71f1b95 100644 --- a/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c +++ b/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c @@ -48,7 +48,7 @@ GetPerformanceMeasurementProtocol ( } Status = gBS->LocateProtocol (&gEdkiiPerformanceMeasurementProtocolGuid, NULL, (VOID **) &PerformanceMeasurement); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (PerformanceMeasurement != NULL); // // Cache PerformanceMeasurement Protocol. @@ -96,7 +96,7 @@ StartPerformanceMeasurementEx ( CONST CHAR8* String; Status = GetPerformanceMeasurementProtocol (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_NOT_FOUND; } @@ -155,7 +155,7 @@ EndPerformanceMeasurementEx ( CONST CHAR8* String; Status = GetPerformanceMeasurementProtocol (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_NOT_FOUND; } @@ -401,7 +401,7 @@ LogPerformanceMeasurement ( EFI_STATUS Status; Status = GetPerformanceMeasurementProtocol (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c index 3a051fd58..5884b358b 100644 --- a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c +++ b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c @@ -65,7 +65,7 @@ PrintLibConstructor ( NULL, (VOID**) &mPrint2SProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (mPrint2SProtocol != NULL); return Status; diff --git a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c index 92559a54f..0031446d8 100644 --- a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c @@ -49,7 +49,7 @@ InternalGetReportStatusCode ( // if (gBS != NULL && gBS->LocateProtocol != NULL) { Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**) &mReportStatusCodeLibStatusCodeProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mReportStatusCodeLibStatusCodeProtocol = NULL; } } @@ -549,7 +549,7 @@ ReportStatusCodeEx ( // Free the allocated buffer // if (StatusCodeData != (EFI_STATUS_CODE_DATA *)Buffer) { - gBS->FreePool (StatusCodeData); + gBS->FreePool(StatusCodeData); } return Status; diff --git a/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c b/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c index a97c3ff28..4c97398a8 100644 --- a/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c +++ b/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c @@ -167,7 +167,7 @@ RegisterSecurityHandler ( // Allocate more resources for new handler. // Status = ReallocateSecurityHandlerTable(); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return Status; } @@ -267,7 +267,7 @@ ExecuteSecurityHandlers ( // FileBuffer = GetFileBufferByFilePath (TRUE, FilePath, &FileSize, &AuthenticationStatus); } - if ((FileBuffer != NULL) && (!EFI_ERROR (Status))) { + if ((FileBuffer != NULL) && (!EFI_ERROR(Status))) { // // LoadFile () may cause the device path of the Handle be updated. // @@ -281,16 +281,16 @@ ExecuteSecurityHandlers ( FileBuffer, FileSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } if (FileBuffer != NULL) { - FreePool (FileBuffer); + FreePool(FileBuffer); } if (FilePathToVerfiy != FilePath) { - FreePool (FilePathToVerfiy); + FreePool(FilePathToVerfiy); } return Status; @@ -429,7 +429,7 @@ RegisterSecurity2Handler ( // Allocate more resources for new handler. // Status = ReallocateSecurity2HandlerTable(); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return Status; } @@ -536,7 +536,7 @@ ExecuteSecurity2Handlers ( FileSize, BootPolicy ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c index 58e491025..65e83bded 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c @@ -236,7 +236,7 @@ LibCallback ( NewFileName = HiiGetString (gFileExplorerPrivate.FeHiiHandle, Value->string, NULL); if (NewFileName != NULL) { StrCpyS (mNewFileName, MAX_FILE_NAME_LEN, NewFileName); - FreePool (NewFileName); + FreePool(NewFileName); NewFileName = NULL; } else { return EFI_INVALID_PARAMETER; @@ -247,7 +247,7 @@ LibCallback ( NewFolderName = HiiGetString (gFileExplorerPrivate.FeHiiHandle, Value->string, NULL); if (NewFolderName != NULL) { StrCpyS (mNewFolderName, MAX_FOLDER_NAME_LEN, NewFolderName); - FreePool (NewFolderName); + FreePool(NewFolderName); NewFolderName = NULL; } else { return EFI_INVALID_PARAMETER; @@ -275,7 +275,7 @@ LibCallback ( if (QuestionId >= FILE_OPTION_OFFSET) { LibGetDevicePath(QuestionId); Status = LibUpdateFileExplorer (QuestionId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -308,7 +308,7 @@ LibCreateMenuEntry ( MenuEntry->VariableContext = AllocateZeroPool (sizeof (FILE_CONTEXT)); if (MenuEntry->VariableContext == NULL) { - FreePool (MenuEntry); + FreePool(MenuEntry); return NULL; } @@ -368,7 +368,7 @@ LibDestroyMenuEntry ( if (!FileContext->IsRoot) { if (FileContext->DevicePath != NULL) { - FreePool (FileContext->DevicePath); + FreePool(FileContext->DevicePath); } } else { if (FileContext->FileHandle != NULL) { @@ -377,19 +377,19 @@ LibDestroyMenuEntry ( } if (FileContext->FileName != NULL) { - FreePool (FileContext->FileName); + FreePool(FileContext->FileName); } - FreePool (FileContext); + FreePool(FileContext); if (MenuEntry->DisplayString != NULL) { - FreePool (MenuEntry->DisplayString); + FreePool(MenuEntry->DisplayString); } if (MenuEntry->HelpString != NULL) { - FreePool (MenuEntry->HelpString); + FreePool(MenuEntry->HelpString); } - FreePool (MenuEntry); + FreePool(MenuEntry); } @@ -449,7 +449,7 @@ LibOpenRoot ( // // Open the root directory of the volume // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Volume->OpenVolume ( Volume, &File @@ -458,7 +458,7 @@ LibOpenRoot ( // // Done // - return EFI_ERROR (Status) ? NULL : File; + return EFI_ERROR(Status) ? NULL : File; } /** @@ -487,7 +487,7 @@ LibDevicePathToStr ( NULL, (VOID **) &DevPathToText ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ToText = DevPathToText->ConvertDevicePathToText ( DevPath, FALSE, @@ -654,7 +654,7 @@ LibIsSupportedFileType ( IsSupported = (StrStr (gFileExplorerPrivate.FileType, TmpStr) == NULL ? FALSE : TRUE); - FreePool (TmpStr); + FreePool(TmpStr); return IsSupported; } @@ -743,7 +743,7 @@ LibAppendFileName ( Ptr++; } - FreePool (TmpStr); + FreePool(TmpStr); return Str; } @@ -786,7 +786,7 @@ LibFindFileSystem ( &NoSimpleFsHandles, &SimpleFsHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Find all the instances of the File System prototocol // @@ -796,7 +796,7 @@ LibFindFileSystem ( // MenuEntry = LibCreateMenuEntry (); if (NULL == MenuEntry) { - FreePool (SimpleFsHandle); + FreePool(SimpleFsHandle); return EFI_OUT_OF_RESOURCES; } @@ -847,7 +847,7 @@ LibFindFileSystem ( ); if (Info != NULL) - FreePool (Info); + FreePool(Info); OptionNumber++; InsertTailList (&gFileExplorerPrivate.FsOptionMenu->Head, &MenuEntry->Link); @@ -855,7 +855,7 @@ LibFindFileSystem ( } if (NoSimpleFsHandles != 0) { - FreePool (SimpleFsHandle); + FreePool(SimpleFsHandle); } gFileExplorerPrivate.FsOptionMenu->MenuNumber = OptionNumber; @@ -896,7 +896,7 @@ LibGetFileHandleFromMenu ( EFI_FILE_READ_ONLY, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -944,12 +944,12 @@ LibGetFileHandleFromDevicePath ( // DevicePathNode = RootDirectory; Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &DevicePathNode, &Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID**)&Volume); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -957,7 +957,7 @@ LibGetFileHandleFromDevicePath ( // Open the Volume to get the File System handle // Status = Volume->OpenVolume (Volume, &FileHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -991,7 +991,7 @@ LibGetFileHandleFromDevicePath ( // our way down each device path node and close the previous node // DevicePathNode = TempDevicePathNode; - while (!EFI_ERROR (Status) && !IsDevicePathEnd (DevicePathNode)) { + while (!EFI_ERROR(Status) && !IsDevicePathEnd (DevicePathNode)) { if (DevicePathType (DevicePathNode) != MEDIA_DEVICE_PATH || DevicePathSubType (DevicePathNode) != MEDIA_FILEPATH_DP) { Status = EFI_UNSUPPORTED; @@ -1017,7 +1017,7 @@ LibGetFileHandleFromDevicePath ( Status = EFI_OUT_OF_RESOURCES; goto Done; } - FreePool (*ParentFileName); + FreePool(*ParentFileName); *ParentFileName = TempPath; } @@ -1029,7 +1029,7 @@ LibGetFileHandleFromDevicePath ( DevicePathNode = NextDevicePathNode (DevicePathNode); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1039,10 +1039,10 @@ LibGetFileHandleFromDevicePath ( Done: if (TempDevicePathNode != NULL) { - FreePool (TempDevicePathNode); + FreePool(TempDevicePathNode); } - if ((FileHandle != NULL) && (EFI_ERROR (Status))) { + if ((FileHandle != NULL) && (EFI_ERROR(Status))) { FileHandle->Close (FileHandle); } @@ -1086,7 +1086,7 @@ LibCreateNewFile ( EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE| EFI_FILE_MODE_CREATE, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FileHandle->Close (FileHandle); return Status; } @@ -1098,7 +1098,7 @@ LibCreateNewFile ( EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE| EFI_FILE_MODE_CREATE, EFI_FILE_DIRECTORY ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FileHandle->Close (FileHandle); return Status; } @@ -1164,7 +1164,7 @@ LibFindFiles ( for (;;) { BufferSize = DirBufferSize; Status = FileHandle->Read (FileHandle, &BufferSize, DirInfo); - if (EFI_ERROR (Status) || BufferSize == 0) { + if (EFI_ERROR(Status) || BufferSize == 0) { Status = EFI_SUCCESS; break; } @@ -1236,7 +1236,7 @@ LibFindFiles ( Done: - FreePool (DirInfo); + FreePool(DirInfo); return Status; } @@ -1414,7 +1414,7 @@ LibUpdateFileExplorer ( LibFreeMenu (gFileExplorerPrivate.FsOptionMenu); LibGetFileHandleFromMenu (NewMenuEntry, &FileHandle); Status = LibFindFiles (FileHandle, NewFileContext->FileName, NewFileContext->DeviceHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { LibUpdateFileExplorePage (); } else { LibFreeMenu (gFileExplorerPrivate.FsOptionMenu); @@ -1447,7 +1447,7 @@ LibGetDevicePath ( NewFileContext = (FILE_CONTEXT *) NewMenuEntry->VariableContext; if (gFileExplorerPrivate.RetDevicePath != NULL) { - FreePool (gFileExplorerPrivate.RetDevicePath); + FreePool(gFileExplorerPrivate.RetDevicePath); } gFileExplorerPrivate.RetDevicePath = DuplicateDevicePath (NewFileContext->DevicePath); } @@ -1506,13 +1506,13 @@ ChooseFile ( Status = LibFindFileSystem(); } else { Status = LibGetFileHandleFromDevicePath(RootDirectory, &FileHandle, &FileName, &DeviceHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = LibFindFiles (FileHandle, FileName, DeviceHandle); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1532,17 +1532,17 @@ Done: if ((Status == EFI_SUCCESS) && (File != NULL)) { *File = gFileExplorerPrivate.RetDevicePath; } else if (gFileExplorerPrivate.RetDevicePath != NULL) { - FreePool (gFileExplorerPrivate.RetDevicePath); + FreePool(gFileExplorerPrivate.RetDevicePath); } if (gFileExplorerPrivate.FileType != NULL) { - FreePool (gFileExplorerPrivate.FileType); + FreePool(gFileExplorerPrivate.FileType); } LibFreeMenu (gFileExplorerPrivate.FsOptionMenu); if (FileName != NULL) { - FreePool (FileName); + FreePool(FileName); } return Status; @@ -1585,7 +1585,7 @@ FileExplorerLibConstructor ( if (Status == EFI_ALREADY_STARTED) { return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1605,7 +1605,7 @@ FileExplorerLibConstructor ( // Locate Formbrowser2 protocol // Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &gFileExplorerPrivate.FormBrowser2); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); InitializeListHead (&gFileExplorerPrivate.FsOptionMenu->Head); @@ -1640,13 +1640,13 @@ FileExplorerLibDestructor ( &gFileExplorerPrivate.FeConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); HiiRemovePackages (gFileExplorerPrivate.FeHiiHandle); gFileExplorerPrivate.FeDriverHandle = NULL; } - FreePool (gHiiVendorDevicePath); + FreePool(gHiiVendorDevicePath); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c b/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c index ac3fea342..2217bfd68 100644 --- a/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c +++ b/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c @@ -174,7 +174,7 @@ LzmaArchGuidedSectionExtraction ( // // After decompress, the data need to be converted to the raw data. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = LzmaUefiDecompressGetInfo ( Source, (UINT32) SourceSize, @@ -182,7 +182,7 @@ LzmaArchGuidedSectionExtraction ( &ScratchBufferSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { x86_Convert_Init(X86State); x86_Convert(*OutputBuffer, OutputBufferSize, 0, &X86State, 0); } diff --git a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c index 807426898..b80c4a540 100644 --- a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c +++ b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c @@ -193,16 +193,16 @@ RegisterNonDiscoverableMmioDevice ( &gEdkiiNonDiscoverableDeviceProtocolGuid, Device, &gEfiDevicePathProtocolGuid, DevicePath, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeDevicePath; } return EFI_SUCCESS; FreeDevicePath: - FreePool (DevicePath); + FreePool(DevicePath); FreeDevice: - FreePool (Device); + FreePool(Device); return Status; } diff --git a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c index 05a7dab99..31f43885e 100644 --- a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c +++ b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c @@ -94,7 +94,7 @@ DebugBPrint ( NULL, (VOID **)&DebugPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -307,7 +307,7 @@ DebugAssert ( NULL, (VOID **)&DebugPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings // diff --git a/MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.c b/MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.c index e545be206..d1bce0419 100644 --- a/MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.c +++ b/MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.c @@ -45,7 +45,7 @@ PeiDebugPrintHobLibConstructor ( NULL, (VOID **)&Variable ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Size = sizeof (GlobalErrorLevel); Status = Variable->GetVariable ( Variable, @@ -55,7 +55,7 @@ PeiDebugPrintHobLibConstructor ( &Size, &GlobalErrorLevel ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Build the GUID'ed HOB for DXE // diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c index fa6b30905..aec8afb49 100644 --- a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c +++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c @@ -51,7 +51,7 @@ IpmiSubmitCommand ( NULL, (VOID **) &IpmiPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Ipmi Ppi is not installed. So, IPMI device is not present. // @@ -68,7 +68,7 @@ IpmiSubmitCommand ( ResponseData, ResponseDataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } return EFI_SUCCESS; diff --git a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c index ddae0d381..da0bc1d80 100644 --- a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c +++ b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c @@ -126,16 +126,16 @@ IsKnownTokens ( return FALSE; } - if (AsciiStrCmp (Token, SEC_TOK) == 0 || - AsciiStrCmp (Token, PEI_TOK) == 0 || - AsciiStrCmp (Token, DXE_TOK) == 0 || - AsciiStrCmp (Token, BDS_TOK) == 0 || - AsciiStrCmp (Token, DRIVERBINDING_START_TOK) == 0 || - AsciiStrCmp (Token, DRIVERBINDING_SUPPORT_TOK) == 0 || - AsciiStrCmp (Token, DRIVERBINDING_STOP_TOK) == 0 || - AsciiStrCmp (Token, LOAD_IMAGE_TOK) == 0 || - AsciiStrCmp (Token, START_IMAGE_TOK) == 0 || - AsciiStrCmp (Token, PEIM_TOK) == 0) { + if (AsciiStrCmp(Token, SEC_TOK) == 0 || + AsciiStrCmp(Token, PEI_TOK) == 0 || + AsciiStrCmp(Token, DXE_TOK) == 0 || + AsciiStrCmp(Token, BDS_TOK) == 0 || + AsciiStrCmp(Token, DRIVERBINDING_START_TOK) == 0 || + AsciiStrCmp(Token, DRIVERBINDING_SUPPORT_TOK) == 0 || + AsciiStrCmp(Token, DRIVERBINDING_STOP_TOK) == 0 || + AsciiStrCmp(Token, LOAD_IMAGE_TOK) == 0 || + AsciiStrCmp(Token, START_IMAGE_TOK) == 0 || + AsciiStrCmp(Token, PEIM_TOK) == 0) { return TRUE; } else { return FALSE; @@ -199,20 +199,20 @@ GetFpdtRecordId ( // When PcdEdkiiFpdtStringRecordEnableOnly is TRUE, all records are with type of FPDT_DYNAMIC_STRING_EVENT_TYPE. // if (String != NULL) { - if (AsciiStrCmp (String, LOAD_IMAGE_TOK) == 0) { // "LoadImage:" + if (AsciiStrCmp(String, LOAD_IMAGE_TOK) == 0) { // "LoadImage:" if (Attribute == PerfStartEntry) { *ProgressID = MODULE_LOADIMAGE_START_ID; } else { *ProgressID = MODULE_LOADIMAGE_END_ID; } - } else if (AsciiStrCmp (String, SEC_TOK) == 0 || // "SEC" - AsciiStrCmp (String, PEI_TOK) == 0) { // "PEI" + } else if (AsciiStrCmp(String, SEC_TOK) == 0 || // "SEC" + AsciiStrCmp(String, PEI_TOK) == 0) { // "PEI" if (Attribute == PerfStartEntry) { *ProgressID = PERF_CROSSMODULE_START_ID; } else { *ProgressID = PERF_CROSSMODULE_END_ID; } - } else if (AsciiStrCmp (String, PEIM_TOK) == 0) { // "PEIM" + } else if (AsciiStrCmp(String, PEIM_TOK) == 0) { // "PEIM" if (Attribute == PerfStartEntry) { *ProgressID = MODULE_START_ID; } else { @@ -344,7 +344,7 @@ InsertFpdtRecord ( } } else if (PerfId == 0) { Status = GetFpdtRecordId (Attribute, CallerIdentifier, String, &PerfId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -354,7 +354,7 @@ InsertFpdtRecord ( // 2. Get the buffer to store the FPDT record. // Status = GetFpdtRecordPtr (PEI_MAX_RECORD_SIZE, &FpdtRecordPtr, &PeiPerformanceLogHeader); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c index 5ea2760dd..a32d4762f 100644 --- a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c @@ -69,7 +69,7 @@ InternalReportStatusCode ( ); if (Status == EFI_NOT_AVAILABLE_YET) { Status = OemHookStatusCodeInitialize (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return OemHookStatusCodeReport (Type, Value, Instance, (EFI_GUID *) CallerId, Data); } } diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c index df7756781..5e3d8e1ea 100644 --- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c +++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c @@ -196,7 +196,7 @@ ScriptIoRead ( } Status = BuildLoopData (Width, Address, &AddressStride, &BufferStride); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -302,7 +302,7 @@ ScriptIoWrite ( } Status = BuildLoopData (Width, Address, &AddressStride, &BufferStride); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -432,7 +432,7 @@ ScriptMemoryRead ( Out.Buf = Buffer; Status = BuildLoopData (Width, Address, &AddressStride, &BufferStride); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -533,7 +533,7 @@ ScriptMemoryWrite ( In.Buf = Buffer; Status = BuildLoopData (Width, Address, &AddressStride, &BufferStride); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -665,7 +665,7 @@ ScriptPciCfg2Read ( PciAddress = PCI_ADDRESS_ENCODE (Segment, Address); Status = BuildLoopData (Width, PciAddress, &AddressStride, &BufferStride); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -755,7 +755,7 @@ ScriptPciCfg2Write ( PciAddress = PCI_ADDRESS_ENCODE (Segment, Address); Status = BuildLoopData (Width, PciAddress, &AddressStride, &BufferStride); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -919,7 +919,7 @@ BootScriptExecuteIoReadWrite ( 1, &Data ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Data = (Data & AndMask) | OrMask; Status = ScriptIoWrite ( (S3_BOOT_SCRIPT_LIB_WIDTH) IoReadWrite.Width, @@ -963,7 +963,7 @@ BootScriptExecuteMemoryReadWrite ( 1, &Data ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Data = (Data & AndMask) | OrMask; Status = ScriptMemoryWrite ( (S3_BOOT_SCRIPT_LIB_WIDTH) MemReadWrite.Width, @@ -1007,7 +1007,7 @@ BootScriptExecutePciCfgReadWrite ( 1, &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1158,7 +1158,7 @@ BootScriptExecuteMemPoll ( 1, &Data ); - if ((!EFI_ERROR (Status)) && (Data & AndMask) == OrMask) { + if ((!EFI_ERROR(Status)) && (Data & AndMask) == OrMask) { return EFI_SUCCESS; } @@ -1172,7 +1172,7 @@ BootScriptExecuteMemPoll ( 1, &Data ); - if ((!EFI_ERROR (Status)) && (Data & AndMask) == OrMask) { + if ((!EFI_ERROR(Status)) && (Data & AndMask) == OrMask) { return EFI_SUCCESS; } } @@ -1358,7 +1358,7 @@ BootScriptExecuteIoPoll ( 1, &Data ); - if ((!EFI_ERROR (Status)) && (Data & AndMask) == OrMask) { + if ((!EFI_ERROR(Status)) && (Data & AndMask) == OrMask) { return EFI_SUCCESS; } for (LoopTimes = 0; LoopTimes < IoPoll.Delay; LoopTimes++) { @@ -1370,7 +1370,7 @@ BootScriptExecuteIoPoll ( 1, &Data ); - if ((!EFI_ERROR (Status)) &&(Data & AndMask) == OrMask) { + if ((!EFI_ERROR(Status)) &&(Data & AndMask) == OrMask) { return EFI_SUCCESS; } } @@ -1448,7 +1448,7 @@ BootScriptExecutePciCfg2ReadWrite ( 1, &Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1495,7 +1495,7 @@ BootScriptPciCfgPoll ( 1, &Data ); - if ((!EFI_ERROR (Status)) &&(Data & AndMask) == OrMask) { + if ((!EFI_ERROR(Status)) &&(Data & AndMask) == OrMask) { return EFI_SUCCESS; } @@ -1508,7 +1508,7 @@ BootScriptPciCfgPoll ( 1, &Data ); - if ((!EFI_ERROR (Status)) && + if ((!EFI_ERROR(Status)) && (Data & AndMask) == OrMask) { return EFI_SUCCESS; } @@ -1557,7 +1557,7 @@ BootScriptPciCfg2Poll ( 1, &Data ); - if ((!EFI_ERROR (Status)) && (Data & AndMask) == OrMask) { + if ((!EFI_ERROR(Status)) && (Data & AndMask) == OrMask) { return EFI_SUCCESS; } @@ -1572,7 +1572,7 @@ BootScriptPciCfg2Poll ( 1, &Data ); - if ((!EFI_ERROR (Status)) && (Data & AndMask) == OrMask) { + if ((!EFI_ERROR(Status)) && (Data & AndMask) == OrMask) { return EFI_SUCCESS; } } @@ -1761,7 +1761,7 @@ S3BootScriptExecute ( return EFI_UNSUPPORTED; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "S3BootScriptDone - %r\n", Status)); return Status; } diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c index c11672753..e091d96f1 100644 --- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c +++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c @@ -190,10 +190,10 @@ SaveBootScriptDataToLockBox ( (VOID *)mS3BootScriptTablePtr->TableBase, EFI_PAGES_TO_SIZE (mS3BootScriptTablePtr->TableMemoryPageNumber) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SetLockBoxAttributes (&mBootScriptDataGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Just need save TableBase. @@ -204,10 +204,10 @@ SaveBootScriptDataToLockBox ( (VOID *)&mS3BootScriptTablePtr->TableBase, sizeof(mS3BootScriptTablePtr->TableBase) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SetLockBoxAttributes (&mBootScriptTableBaseGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -236,7 +236,7 @@ S3BootScriptEventCallBack ( NULL, &Interface ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -335,7 +335,7 @@ SaveBootTimeDataToLockBox ( NULL, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Save BootScriptDataBootTime @@ -346,7 +346,7 @@ SaveBootTimeDataToLockBox ( (VOID *) mS3BootScriptTablePtr->TableBase, mS3BootScriptTablePtr->BootTimeScriptLength ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -370,10 +370,10 @@ SaveSmmPriviateDataToLockBoxAtRuntime ( (VOID *) mS3BootScriptTablePtr, sizeof (SCRIPT_TABLE_PRIVATE_DATA) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SetLockBoxAttributes (&mBootScriptSmmPrivateDataGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Set BackFromS3 flag back to FALSE to indicate that now is not back from S3. @@ -448,12 +448,12 @@ S3BootScriptLibInitialize ( EFI_SIZE_TO_PAGES(sizeof(SCRIPT_TABLE_PRIVATE_DATA)), &Buffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mS3BootScriptTableAllocated = TRUE; S3TablePtr = (VOID *) (UINTN) Buffer; Status = PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, (UINT64) (UINTN)S3TablePtr); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem (S3TablePtr, sizeof(SCRIPT_TABLE_PRIVATE_DATA)); // // Create event to notify the library system enter the SmmLocked phase. @@ -473,11 +473,11 @@ S3BootScriptLibInitialize ( // Get InSmm, we need to register SmmReadyToLock if this library is linked to SMM driver. // Status = gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid, NULL, (VOID**) &SmmBase2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_SUCCESS; } Status = SmmBase2->InSmm (SmmBase2, &InSmm); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_SUCCESS; } if (!InSmm) { @@ -487,7 +487,7 @@ S3BootScriptLibInitialize ( // Good, we are in SMM // Status = SmmBase2->GetSmstLocation (SmmBase2, &mBootScriptSmst); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_SUCCESS; } @@ -501,11 +501,11 @@ S3BootScriptLibInitialize ( sizeof(SCRIPT_TABLE_PRIVATE_DATA), (VOID **) &S3TableSmmPtr ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mS3BootScriptTableSmmAllocated = TRUE; Status = PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, (UINT64) (UINTN)S3TableSmmPtr); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem (S3TableSmmPtr, sizeof(SCRIPT_TABLE_PRIVATE_DATA)); // @@ -516,14 +516,14 @@ S3BootScriptLibInitialize ( S3BootScriptSmmAtRuntimeCallBack, &mRegistrationSmmExitBootServices ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = mBootScriptSmst->SmmRegisterProtocolNotify ( &gEdkiiSmmLegacyBootProtocolGuid, S3BootScriptSmmAtRuntimeCallBack, &mRegistrationSmmLegacyBoot ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } mS3BootScriptTableSmmPtr = S3TableSmmPtr; @@ -535,7 +535,7 @@ S3BootScriptLibInitialize ( S3BootScriptSmmEventCallBack, &mRegistrationSmmReadyToLock ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return RETURN_SUCCESS; } @@ -569,7 +569,7 @@ S3BootScriptLibDeinitialize ( // Close the DxeSmmReadyToLock event. // Status = gBS->CloseEvent (mEventDxeSmmReadyToLock); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (mBootScriptSmst != NULL) { @@ -582,7 +582,7 @@ S3BootScriptLibDeinitialize ( NULL, &mRegistrationSmmExitBootServices ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (mRegistrationSmmLegacyBoot != NULL) { // @@ -593,7 +593,7 @@ S3BootScriptLibDeinitialize ( NULL, &mRegistrationSmmLegacyBoot ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (mRegistrationSmmReadyToLock != NULL) { // @@ -604,7 +604,7 @@ S3BootScriptLibDeinitialize ( NULL, &mRegistrationSmmReadyToLock ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -613,15 +613,15 @@ S3BootScriptLibDeinitialize ( // if (mS3BootScriptTableAllocated) { Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) mS3BootScriptTablePtr, EFI_SIZE_TO_PAGES(sizeof(SCRIPT_TABLE_PRIVATE_DATA))); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, 0); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if ((mBootScriptSmst != NULL) && mS3BootScriptTableSmmAllocated) { - Status = mBootScriptSmst->SmmFreePool (mS3BootScriptTableSmmPtr); - ASSERT_EFI_ERROR (Status); + Status = mBootScriptSmst->SmmFreePool(mS3BootScriptTableSmmPtr); + ASSERT_EFI_ERROR(Status); Status = PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, 0); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return RETURN_SUCCESS; @@ -665,7 +665,7 @@ S3BootScriptGetBootTimeEntryAddAddress ( ); if (EFI_ERROR(Status)) { - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return 0; } // @@ -697,7 +697,7 @@ S3BootScriptGetBootTimeEntryAddAddress ( ); if (EFI_ERROR(Status)) { - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return 0; } @@ -777,7 +777,7 @@ RestoreBootTimeDataFromLockBox ( (VOID *) mS3BootScriptTablePtr->TableBase, &LockBoxLength ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Update the data to BootScriptData LockBox. @@ -788,7 +788,7 @@ RestoreBootTimeDataFromLockBox ( (VOID *) mS3BootScriptTablePtr->TableBase, LockBoxLength ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Update TableLength. @@ -877,7 +877,7 @@ SyncBootScript ( (VOID *)((UINTN)mS3BootScriptTablePtr->TableBase + ScriptOffset), TotalScriptLength - ScriptOffset ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Now the length field is updated, need sync to lockbox. @@ -889,7 +889,7 @@ SyncBootScript ( &TotalScriptLength, sizeof (TotalScriptLength) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -946,7 +946,7 @@ S3BootScriptCloseTable ( (UINTN)TableLength, (VOID **) &Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return 0; } CopyMem (Buffer, S3TableBase, TableLength); @@ -1530,7 +1530,7 @@ S3BootScriptSaveSmbusExecute ( } Status = CheckParameters (SmBusAddress, Operation, &BufferLength, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2278,7 +2278,7 @@ S3BootScriptLabel ( CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); if (ScriptHeader.OpCode == S3_BOOT_SCRIPT_LIB_LABEL_OPCODE) { - if (AsciiStrCmp ((CHAR8 *)(UINTN)(Script+sizeof(EFI_BOOT_SCRIPT_INFORMATION)), Label) == 0) { + if (AsciiStrCmp((CHAR8 *)(UINTN)(Script+sizeof(EFI_BOOT_SCRIPT_INFORMATION)), Label) == 0) { (*Position) = Script; return EFI_SUCCESS; } diff --git a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c index fd20a779c..6e3d454b2 100644 --- a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c @@ -82,7 +82,7 @@ InternalAllocatePages ( } Status = SmmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return (VOID *) (UINTN) Memory; @@ -220,7 +220,7 @@ FreePages ( // Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -275,7 +275,7 @@ InternalAllocateAlignedPages ( ASSERT (RealPages > Pages); Status = SmmAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -285,7 +285,7 @@ InternalAllocateAlignedPages ( // Free first unaligned page(s). // Status = SmmFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Memory = AlignedMemory + EFI_PAGES_TO_SIZE (Pages); UnalignedPages = RealPages - Pages - UnalignedPages; @@ -294,14 +294,14 @@ InternalAllocateAlignedPages ( // Free last unaligned page(s). // Status = SmmFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } else { // // Do not over-allocate pages in this case. // Status = SmmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = (UINTN) Memory; @@ -459,7 +459,7 @@ FreeAlignedPages ( // Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -487,7 +487,7 @@ InternalAllocatePool ( Memory = NULL; Status = SmmAllocatePool (MemoryType, AllocationSize, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Memory = NULL; } return Memory; @@ -881,7 +881,7 @@ InternalReallocatePool ( NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); - FreePool (OldBuffer); + FreePool(OldBuffer); } return NewBuffer; } @@ -1024,7 +1024,7 @@ ReallocateReservedPool ( **/ VOID EFIAPI -FreePool ( +FreePool( IN VOID *Buffer ) { @@ -1035,15 +1035,15 @@ FreePool ( // When Buffer is in SMRAM range, it should be allocated by SmmAllocatePool() service. // So, SmmFreePool() service is used to free it. // - Status = SmmFreePool (Buffer); + Status = SmmFreePool(Buffer); } else { // // When Buffer is out of SMRAM range, it should be allocated by gBS->AllocatePool() service. // So, gBS->FreePool() service is used to free it. // - Status = gBS->FreePool (Buffer); + Status = gBS->FreePool(Buffer); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -1079,7 +1079,7 @@ PiSmmCoreMemoryAllocationLibConstructor ( mSmmCoreMemoryAllocLibSmramRangeCount = SmmCorePrivate->SmramRangeCount; Size = mSmmCoreMemoryAllocLibSmramRangeCount * sizeof (EFI_SMRAM_DESCRIPTOR); Status = gBS->AllocatePool (EfiBootServicesData, Size, (VOID **) &mSmmCoreMemoryAllocLibSmramRanges); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (mSmmCoreMemoryAllocLibSmramRanges != NULL); CopyMem (mSmmCoreMemoryAllocLibSmramRanges, SmmCorePrivate->SmramRanges, Size); @@ -1098,8 +1098,8 @@ PiSmmCoreMemoryAllocationLibConstructor ( // // Free the temporarily used BootServicesData. // - Status = gBS->FreePool (BootServicesData); - ASSERT_EFI_ERROR (Status); + Status = gBS->FreePool(BootServicesData); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationServices.h b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationServices.h index 789fcf2c0..913313313 100644 --- a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationServices.h +++ b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationServices.h @@ -178,7 +178,7 @@ SmmAllocatePool ( **/ EFI_STATUS EFIAPI -SmmFreePool ( +SmmFreePool( IN VOID *Buffer ); diff --git a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryProfileLib.c b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryProfileLib.c index 32ef22256..bfbd0623b 100644 --- a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryProfileLib.c +++ b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryProfileLib.c @@ -57,7 +57,7 @@ PiSmmCoreMemoryProfileLibConstructor ( NULL, (VOID **)&mLibProfileProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mLibProfileProtocol = NULL; } diff --git a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c index 968c044a3..b60a683a7 100644 --- a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c +++ b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c @@ -70,7 +70,7 @@ InternalGetVarErrorFlag ( &Size, &ErrorFlag ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "%s - not found\n", VAR_ERROR_FLAG_NAME)); return VAR_ERROR_FLAG_NO_ERROR; } @@ -111,7 +111,7 @@ IsUserVariable ( Guid, &Property ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No property, it is user variable. // @@ -225,7 +225,7 @@ CreateUserVariableNode ( Status = gRT->GetNextVariableName (&VarNameSize, VarName, &Guid); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (IsUserVariable (VarName, &Guid)) { DataSize = MaxDataSize; GetVariableStatus = gRT->GetVariable (VarName, &Guid, &Attributes, &DataSize, Data); @@ -235,7 +235,7 @@ CreateUserVariableNode ( MaxDataSize = DataSize; GetVariableStatus = gRT->GetVariable (VarName, &Guid, &Attributes, &DataSize, Data); } - ASSERT_EFI_ERROR (GetVariableStatus); + ASSERT_EFI_ERROR(GetVariableStatus); if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) { UserVariableNode = FindUserVariableNodeByGuid (&Guid); @@ -278,8 +278,8 @@ CreateUserVariableNode ( ASSERT (mUserVariableCount <= MAX_USER_VARIABLE_COUNT); DEBUG ((EFI_D_INFO, "PlatformVarCleanup - User variable count: 0x%04x\n", mUserVariableCount)); - FreePool (VarName); - FreePool (Data); + FreePool(VarName); + FreePool(Data); } /** @@ -308,14 +308,14 @@ DestroyUserVariableNode ( RemoveEntryList (&UserVariableNameNode->Link); - FreePool (UserVariableNameNode->Name); - FreePool (UserVariableNameNode->PromptString); - FreePool (UserVariableNameNode->HelpString); - FreePool (UserVariableNameNode); + FreePool(UserVariableNameNode->Name); + FreePool(UserVariableNameNode->PromptString); + FreePool(UserVariableNameNode->HelpString); + FreePool(UserVariableNameNode); } - FreePool (UserVariableNode->PromptString); - FreePool (UserVariableNode); + FreePool(UserVariableNode->PromptString); + FreePool(UserVariableNode); } } @@ -378,8 +378,8 @@ CreateTimeBasedPayload ( ZeroMem (&Time, sizeof (EFI_TIME)); Status = gRT->GetTime (&Time, NULL); - if (EFI_ERROR (Status)) { - FreePool (NewData); + if (EFI_ERROR(Status)) { + FreePool(NewData); return Status; } Time.Pad1 = 0; @@ -395,7 +395,7 @@ CreateTimeBasedPayload ( CopyGuid (&DescriptorData->AuthInfo.CertType, &gEfiCertPkcs7Guid); if (Payload != NULL) { - FreePool (Payload); + FreePool(Payload); } *DataSize = DescriptorSize + PayloadSize; @@ -463,8 +463,8 @@ CreateCounterBasedPayload ( DescriptorData = (EFI_VARIABLE_AUTHENTICATION *) (NewData); Status = gBS->GetNextMonotonicCount (&MonotonicCount); - if (EFI_ERROR (Status)) { - FreePool (NewData); + if (EFI_ERROR(Status)) { + FreePool(NewData); return Status; } DescriptorData->MonotonicCount = MonotonicCount; @@ -475,7 +475,7 @@ CreateCounterBasedPayload ( CopyGuid (&DescriptorData->AuthInfo.CertType, &gEfiCertTypeRsa2048Sha256Guid); if (Payload != NULL) { - FreePool (Payload); + FreePool(Payload); } *DataSize = DescriptorSize + PayloadSize; @@ -520,22 +520,22 @@ DeleteUserVariable ( DataSize = 0; Data = NULL; Status = CreateTimeBasedPayload (&DataSize, &Data); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gRT->SetVariable (UserVariableNameNode->Name, &UserVariableNode->Guid, UserVariableNameNode->Attributes, DataSize, Data); - FreePool (Data); + FreePool(Data); } } else if ((UserVariableNameNode->Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) { DataSize = 0; Data = NULL; Status = CreateCounterBasedPayload (&DataSize, &Data); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gRT->SetVariable (UserVariableNameNode->Name, &UserVariableNode->Guid, UserVariableNameNode->Attributes, DataSize, Data); - FreePool (Data); + FreePool(Data); } } else { Status = gRT->SetVariable (UserVariableNameNode->Name, &UserVariableNode->Guid, 0, 0, NULL); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UserVariableNameNode->Deleted = TRUE; } else { DEBUG ((EFI_D_INFO, "PlatformVarCleanup - Delete variable fail: %g:%s\n", &UserVariableNode->Guid, UserVariableNameNode->Name)); @@ -615,7 +615,7 @@ VariableCleanupHiiExtractConfig ( ASSERT (ConfigRequest != NULL); AllocatedRequest = TRUE; UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); } Status = Private->ConfigRouting->BlockToConfig ( @@ -626,13 +626,13 @@ VariableCleanupHiiExtractConfig ( Results, Progress ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Free the allocated config request string. // if (AllocatedRequest) { - FreePool (ConfigRequest); + FreePool(ConfigRequest); ConfigRequest = NULL; } // @@ -863,7 +863,7 @@ VariableCleanupHiiRouteConfig ( &BufferSize, Progress ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DeleteUserVariable (FALSE, &Private->VariableCleanupData); // @@ -1077,7 +1077,7 @@ PlatformVarCleanup ( // Locate FormBrowser2 protocol. // Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &FormBrowser2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1096,7 +1096,7 @@ PlatformVarCleanup ( NULL, (VOID **) &Private->ConfigRouting ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1111,7 +1111,7 @@ PlatformVarCleanup ( &Private->ConfigAccess, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1163,7 +1163,7 @@ Done: HiiRemovePackages (Private->HiiHandle); } - FreePool (Private); + FreePool(Private); // // Destroyed the created user variable nodes @@ -1241,7 +1241,7 @@ PlatformVarCleanupLibConstructor ( &gEfiEndOfDxeEventGroupGuid, &mPlatVarCleanupLibEndOfDxeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -1268,7 +1268,7 @@ PlatformVarCleanupLibDestructor ( // Close the End of DXE event. // Status = gBS->CloseEvent (mPlatVarCleanupLibEndOfDxeEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c index dc7fcf7a2..c533db416 100644 --- a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c @@ -58,7 +58,7 @@ InternalGetReportStatusCode ( // if (gBS != NULL && gBS->LocateProtocol != NULL) { Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**) &mReportStatusCodeLibStatusCodeProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mReportStatusCodeLibStatusCodeProtocol = NULL; } } @@ -143,7 +143,7 @@ ReportStatusCodeLibConstructor ( &gEfiEventVirtualAddressChangeGuid, &mReportStatusCodeLibVirtualAddressChangeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register notify function for EVT_SIGNAL_EXIT_BOOT_SERVICES @@ -156,7 +156,7 @@ ReportStatusCodeLibConstructor ( &gEfiEventExitBootServicesGuid, &mReportStatusCodeLibExitBootServicesEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -184,10 +184,10 @@ ReportStatusCodeLibDestructor ( ASSERT (gBS != NULL); Status = gBS->CloseEvent (mReportStatusCodeLibVirtualAddressChangeEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CloseEvent (mReportStatusCodeLibExitBootServicesEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -679,7 +679,7 @@ ReportStatusCodeEx ( // Free the allocated buffer // if (StatusCodeData != (EFI_STATUS_CODE_DATA *) StatusCodeBuffer) { - gBS->FreePool (StatusCodeData); + gBS->FreePool(StatusCodeData); } return Status; diff --git a/MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.c b/MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.c index 29b3f7ebd..98b96a935 100644 --- a/MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.c +++ b/MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.c @@ -174,7 +174,7 @@ RuntimeResetSystemLibConstruct ( &gEfiEventVirtualAddressChangeGuid, &mRuntimeResetSystemLibVirtualAddressChangeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -202,7 +202,7 @@ RuntimeResetSystemLibDeconstruct ( ASSERT (gBS != NULL); Status = gBS->CloseEvent (mRuntimeResetSystemLibVirtualAddressChangeEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c index 5f07464c4..a0c3c8fab 100644 --- a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c +++ b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c @@ -132,16 +132,16 @@ IsKnownTokens ( return FALSE; } - if (AsciiStrCmp (Token, SEC_TOK) == 0 || - AsciiStrCmp (Token, PEI_TOK) == 0 || - AsciiStrCmp (Token, DXE_TOK) == 0 || - AsciiStrCmp (Token, BDS_TOK) == 0 || - AsciiStrCmp (Token, DRIVERBINDING_START_TOK) == 0 || - AsciiStrCmp (Token, DRIVERBINDING_SUPPORT_TOK) == 0 || - AsciiStrCmp (Token, DRIVERBINDING_STOP_TOK) == 0 || - AsciiStrCmp (Token, LOAD_IMAGE_TOK) == 0 || - AsciiStrCmp (Token, START_IMAGE_TOK) == 0 || - AsciiStrCmp (Token, PEIM_TOK) == 0) { + if (AsciiStrCmp(Token, SEC_TOK) == 0 || + AsciiStrCmp(Token, PEI_TOK) == 0 || + AsciiStrCmp(Token, DXE_TOK) == 0 || + AsciiStrCmp(Token, BDS_TOK) == 0 || + AsciiStrCmp(Token, DRIVERBINDING_START_TOK) == 0 || + AsciiStrCmp(Token, DRIVERBINDING_SUPPORT_TOK) == 0 || + AsciiStrCmp(Token, DRIVERBINDING_STOP_TOK) == 0 || + AsciiStrCmp(Token, LOAD_IMAGE_TOK) == 0 || + AsciiStrCmp(Token, START_IMAGE_TOK) == 0 || + AsciiStrCmp(Token, PEIM_TOK) == 0) { return TRUE; } else { return FALSE; @@ -204,13 +204,13 @@ GetFpdtRecordId ( // Token to Id. // if (String != NULL) { - if (AsciiStrCmp (String, START_IMAGE_TOK) == 0) { // "StartImage:" + if (AsciiStrCmp(String, START_IMAGE_TOK) == 0) { // "StartImage:" if (Attribute == PerfStartEntry) { *ProgressID = MODULE_START_ID; } else { *ProgressID = MODULE_END_ID; } - } else if (AsciiStrCmp (String, LOAD_IMAGE_TOK) == 0) { // "LoadImage:" + } else if (AsciiStrCmp(String, LOAD_IMAGE_TOK) == 0) { // "LoadImage:" if (Attribute == PerfStartEntry) { *ProgressID = MODULE_LOADIMAGE_START_ID; } else { @@ -311,7 +311,7 @@ GetModuleInfoFromHandle ( (VOID**) &LoadedImage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Try Handle as Controller Handle // @@ -323,7 +323,7 @@ GetModuleInfoFromHandle ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get Image protocol from ImageHandle // @@ -336,7 +336,7 @@ GetModuleInfoFromHandle ( } } - if (!EFI_ERROR (Status) && LoadedImage != NULL) { + if (!EFI_ERROR(Status) && LoadedImage != NULL) { // // Get Module Guid from DevicePath. // @@ -399,7 +399,7 @@ GetModuleInfoFromHandle ( &StringSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Method 3. Get the name string from FFS UI section // @@ -407,7 +407,7 @@ GetModuleInfoFromHandle ( NameString[Index] = (CHAR8) StringPtr[Index]; } NameString[Index] = 0; - FreePool (StringPtr); + FreePool(StringPtr); } } @@ -554,7 +554,7 @@ InsertFpdtRecord ( // Get ProgressID form the String Token. // Status = GetFpdtRecordId (Attribute, CallerIdentifier, String, &ProgressId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } PerfId = ProgressId; @@ -565,7 +565,7 @@ InsertFpdtRecord ( // 2. Get the buffer to store the FPDT record. // Status = GetFpdtRecordPtr (FPDT_MAX_PERF_RECORD_SIZE, &FpdtRecordPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -849,7 +849,7 @@ InitializeSmmCorePerformanceLib ( EFI_NATIVE_INTERFACE, &mPerformanceMeasurementInterface ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gSmst->SmmRegisterProtocolNotify ( &gEdkiiSmmReadyToBootProtocolGuid, @@ -857,7 +857,7 @@ InitializeSmmCorePerformanceLib ( &SmmReadyToBootRegistration ); Status = EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, (VOID **) &PerformanceProperty); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Install configuration table for performance property. // @@ -868,7 +868,7 @@ InitializeSmmCorePerformanceLib ( &mPerformanceProperty.TimerEndValue ); Status = gBS->InstallConfigurationTable (&gPerformanceProtocolGuid, &mPerformanceProperty); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -911,7 +911,7 @@ SmmCorePerformanceLibConstructor ( NULL, &Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register for protocol notifications on this event @@ -922,7 +922,7 @@ SmmCorePerformanceLibConstructor ( &Registration ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c index 0af2fab29..6cc5a57a2 100644 --- a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c +++ b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c @@ -51,7 +51,7 @@ IpmiSubmitCommand ( NULL, (VOID **) &mIpmiProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Smm Ipmi Protocol is not installed. So, IPMI device is not present. // @@ -69,7 +69,7 @@ IpmiSubmitCommand ( ResponseData, ResponseDataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } return EFI_SUCCESS; diff --git a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.c b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.c index 2cbffe889..b6de95b62 100644 --- a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.c +++ b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.c @@ -48,7 +48,7 @@ LockBoxGetSmmCommProtocol ( NULL, (VOID **)&mLockBoxSmmCommProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mLockBoxSmmCommProtocol = NULL; } return mLockBoxSmmCommProtocol; @@ -91,7 +91,7 @@ LockBoxGetSmmCommBuffer ( &gEdkiiPiSmmCommunicationRegionTableGuid, (VOID **) &PiSmmCommunicationRegionTable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mLockBoxSmmCommBuffer = NULL; return mLockBoxSmmCommBuffer; } @@ -188,7 +188,7 @@ SaveLockBox ( &CommBuffer[0], &CommSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = (EFI_STATUS)LockBoxParameterSave->Header.ReturnStatus; @@ -270,7 +270,7 @@ SetLockBoxAttributes ( &CommBuffer[0], &CommSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = (EFI_STATUS)LockBoxParameterSetAttributes->Header.ReturnStatus; @@ -361,7 +361,7 @@ UpdateLockBox ( &CommBuffer[0], &CommSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = (EFI_STATUS)LockBoxParameterUpdate->Header.ReturnStatus; @@ -455,7 +455,7 @@ RestoreLockBox ( &CommBuffer[0], &CommSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (Length != NULL) { *Length = (UINTN)LockBoxParameterRestore->Length; @@ -524,7 +524,7 @@ RestoreAllLockBoxInPlace ( &CommBuffer[0], &CommSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = (EFI_STATUS)LockBoxParameterRestoreAllInPlace->Header.ReturnStatus; diff --git a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c index fe1059d8f..651d0268d 100644 --- a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c +++ b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c @@ -259,8 +259,8 @@ InternalRestoreLockBoxFromSmram ( NULL, (VOID **)&SmmAccess ); - if (!EFI_ERROR (Status)) { - for (Index = 0; !EFI_ERROR (Status); Index++) { + if (!EFI_ERROR(Status)) { + for (Index = 0; !EFI_ERROR(Status); Index++) { Status = SmmAccess->Open ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); } } @@ -360,8 +360,8 @@ InternalRestoreAllLockBoxInPlaceFromSmram ( NULL, (VOID **)&SmmAccess ); - if (!EFI_ERROR (Status)) { - for (Index = 0; !EFI_ERROR (Status); Index++) { + if (!EFI_ERROR(Status)) { + for (Index = 0; !EFI_ERROR(Status); Index++) { Status = SmmAccess->Open ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); } } @@ -558,7 +558,7 @@ RestoreLockBox ( NULL, (VOID **)&SmmCommunicationPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SmmLockBoxPeiLib LocatePpi - (%r)\n", Status)); Status = InternalRestoreLockBoxFromSmram (Guid, Buffer, Length); DEBUG ((DEBUG_INFO, "SmmLockBoxPeiLib RestoreLockBox - Exit (%r)\n", Status)); @@ -679,7 +679,7 @@ RestoreAllLockBoxInPlace ( NULL, (VOID **)&SmmCommunicationPpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SmmLockBoxPeiLib LocatePpi - (%r)\n", Status)); Status = InternalRestoreAllLockBoxInPlaceFromSmram (); DEBUG ((DEBUG_INFO, "SmmLockBoxPeiLib RestoreAllLockBoxInPlace - Exit (%r)\n", Status)); @@ -724,7 +724,7 @@ RestoreAllLockBoxInPlace ( Status = InternalRestoreAllLockBoxInPlaceFromSmram (); LockBoxParameterRestoreAllInPlace->Header.ReturnStatus = (UINT64)Status; } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = (EFI_STATUS)LockBoxParameterRestoreAllInPlace->Header.ReturnStatus; if (Status != EFI_SUCCESS) { diff --git a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.c b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.c index 4cc0e8b78..75dfacd4d 100644 --- a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.c +++ b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.c @@ -147,7 +147,7 @@ SmmLockBoxSmmEndOfDxeNotify ( NULL, (VOID **)&SxDispatch ); - if (!EFI_ERROR (Status) && (SxDispatch != NULL)) { + if (!EFI_ERROR(Status) && (SxDispatch != NULL)) { // // Register a S3 entry callback function to // determine if it will be during S3 resume. @@ -160,7 +160,7 @@ SmmLockBoxSmmEndOfDxeNotify ( &EntryRegisterContext, &S3EntryHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return EFI_SUCCESS; @@ -217,7 +217,7 @@ SmmLockBoxSmmConstructor ( SmmLockBoxSmmReadyToLockNotify, &mSmmLockBoxRegistrationSmmReadyToLock ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register SmmEndOfDxe notification. @@ -227,7 +227,7 @@ SmmLockBoxSmmConstructor ( SmmLockBoxSmmEndOfDxeNotify, &mSmmLockBoxRegistrationSmmEndOfDxe ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register EndOfS3Resume notification. @@ -237,7 +237,7 @@ SmmLockBoxSmmConstructor ( SmmLockBoxEndOfS3ResumeNotify, &mSmmLockBoxRegistrationEndOfS3Resume ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Check if gEfiSmmLockBoxCommunicationGuid is installed by someone @@ -269,7 +269,7 @@ SmmLockBoxSmmConstructor ( &mSmmLockBoxContext, sizeof(mSmmLockBoxContext) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mSmmConfigurationTableInstalled = TRUE; DEBUG ((DEBUG_INFO, "SmmLockBoxSmmLib SmmLockBoxContext - %x\n", (UINTN)&mSmmLockBoxContext)); @@ -308,7 +308,7 @@ SmmLockBoxSmmDestructor ( NULL, 0 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DEBUG ((DEBUG_INFO, "SmmLockBoxSmmLib uninstall SmmLockBoxCommunication configuration table\n")); } @@ -321,7 +321,7 @@ SmmLockBoxSmmDestructor ( NULL, &mSmmLockBoxRegistrationSmmReadyToLock ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (mSmmLockBoxRegistrationSmmEndOfDxe != NULL) { // @@ -332,7 +332,7 @@ SmmLockBoxSmmDestructor ( NULL, &mSmmLockBoxRegistrationSmmEndOfDxe ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (mSmmLockBoxRegistrationEndOfS3Resume != NULL) { // @@ -343,7 +343,7 @@ SmmLockBoxSmmDestructor ( NULL, &mSmmLockBoxRegistrationEndOfS3Resume ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return EFI_SUCCESS; @@ -459,8 +459,8 @@ SaveLockBox ( EFI_SIZE_TO_PAGES (Length), &SmramBuffer ); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SmmLockBoxSmmLib SaveLockBox - Exit (%r)\n", EFI_OUT_OF_RESOURCES)); return EFI_OUT_OF_RESOURCES; } @@ -473,8 +473,8 @@ SaveLockBox ( sizeof(*LockBox), (VOID **)&LockBox ); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { gSmst->SmmFreePages (SmramBuffer, EFI_SIZE_TO_PAGES (Length)); DEBUG ((DEBUG_INFO, "SmmLockBoxSmmLib SaveLockBox - Exit (%r)\n", EFI_OUT_OF_RESOURCES)); return EFI_OUT_OF_RESOURCES; @@ -668,7 +668,7 @@ UpdateLockBox ( EFI_SIZE_TO_PAGES (Offset + Length), &SmramBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SmmLockBoxSmmLib UpdateLockBox - Exit (%r)\n", EFI_OUT_OF_RESOURCES)); return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/MemoryAllocationLib.c b/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/MemoryAllocationLib.c index 27a6748f5..1b68f5a53 100644 --- a/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/MemoryAllocationLib.c +++ b/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/MemoryAllocationLib.c @@ -64,7 +64,7 @@ SmmMemoryAllocationLibConstructor ( NULL, (VOID **)&SmmAccess ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Get SMRAM range information @@ -77,7 +77,7 @@ SmmMemoryAllocationLibConstructor ( ASSERT (mSmramRanges != NULL); Status = SmmAccess->GetCapabilities (SmmAccess, &Size, mSmramRanges); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mSmramRangeCount = Size / sizeof (EFI_SMRAM_DESCRIPTOR); @@ -100,7 +100,7 @@ SmmMemoryAllocationLibDestructor ( IN EFI_SYSTEM_TABLE *SystemTable ) { - FreePool (mSmramRanges); + FreePool(mSmramRanges); return EFI_SUCCESS; } @@ -159,7 +159,7 @@ InternalAllocatePages ( } Status = gSmst->SmmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return (VOID *) (UINTN) Memory; @@ -297,7 +297,7 @@ FreePages ( // Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -353,7 +353,7 @@ InternalAllocateAlignedPages ( ASSERT (RealPages > Pages); Status = gSmst->SmmAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -363,7 +363,7 @@ InternalAllocateAlignedPages ( // Free first unaligned page(s). // Status = gSmst->SmmFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Memory = AlignedMemory + EFI_PAGES_TO_SIZE (Pages); UnalignedPages = RealPages - Pages - UnalignedPages; @@ -372,14 +372,14 @@ InternalAllocateAlignedPages ( // Free last unaligned page(s). // Status = gSmst->SmmFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } else { // // Do not over-allocate pages in this case. // Status = gSmst->SmmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = (UINTN) Memory; @@ -540,7 +540,7 @@ FreeAlignedPages ( // Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -567,7 +567,7 @@ InternalAllocatePool ( VOID *Memory; Status = gSmst->SmmAllocatePool (MemoryType, AllocationSize, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Memory = NULL; } return Memory; @@ -967,7 +967,7 @@ InternalReallocatePool ( NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); - FreePool (OldBuffer); + FreePool(OldBuffer); } return NewBuffer; } @@ -1111,7 +1111,7 @@ ReallocateReservedPool ( **/ VOID EFIAPI -FreePool ( +FreePool( IN VOID *Buffer ) { @@ -1122,13 +1122,13 @@ FreePool ( // When Buffer is in SMRAM range, it should be allocated by gSmst->SmmAllocatePool() service. // So, gSmst->SmmFreePool() service is used to free it. // - Status = gSmst->SmmFreePool (Buffer); + Status = gSmst->SmmFreePool(Buffer); } else { // // When Buffer is out of SMRAM range, it should be allocated by gBS->AllocatePool() service. // So, gBS->FreePool() service is used to free it. // - Status = gBS->FreePool (Buffer); + Status = gBS->FreePool(Buffer); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } diff --git a/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryProfileLib.c b/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryProfileLib.c index 83ffcf510..f4b3320db 100644 --- a/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryProfileLib.c +++ b/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryProfileLib.c @@ -57,7 +57,7 @@ SmmMemoryProfileLibConstructor ( NULL, (VOID **)&mLibProfileProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mLibProfileProtocol = NULL; } @@ -66,7 +66,7 @@ SmmMemoryProfileLibConstructor ( NULL, (VOID **)&mLibSmmProfileProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mLibSmmProfileProtocol = NULL; } diff --git a/MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.c b/MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.c index 797d72f67..deb588f0e 100644 --- a/MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.c +++ b/MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.c @@ -69,7 +69,7 @@ GetPerformanceMeasurementProtocol ( } Status = gSmst->SmmLocateProtocol (&gEdkiiSmmPerformanceMeasurementProtocolGuid, NULL, (VOID **) &PerformanceMeasurement); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (PerformanceMeasurement != NULL); // // Cache PerformanceMeasurement Protocol. @@ -116,7 +116,7 @@ StartPerformanceMeasurementEx ( CONST CHAR8* String; Status = GetPerformanceMeasurementProtocol (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_NOT_FOUND; } @@ -175,7 +175,7 @@ EndPerformanceMeasurementEx ( CONST CHAR8* String; Status = GetPerformanceMeasurementProtocol (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_NOT_FOUND; } @@ -420,7 +420,7 @@ LogPerformanceMeasurement ( EFI_STATUS Status; Status = GetPerformanceMeasurementProtocol (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c index 3a1772538..acfc6b40d 100644 --- a/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c @@ -37,7 +37,7 @@ InternalGetReportStatusCode ( EFI_STATUS Status; Status = gSmst->SmmLocateProtocol (&gEfiSmmStatusCodeProtocolGuid, NULL, (VOID**)&mStatusCodeProtocol); - if (!EFI_ERROR (Status) && mStatusCodeProtocol != NULL) { + if (!EFI_ERROR(Status) && mStatusCodeProtocol != NULL) { return mStatusCodeProtocol->ReportStatusCode; } return NULL; @@ -467,7 +467,7 @@ ReportStatusCodeEx ( // // Free the allocated buffer // - FreePool (StatusCodeData); + FreePool(StatusCodeData); return Status; } diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index a432990d5..e3df0aa98 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -116,7 +116,7 @@ BmFindBootOptionInVariable ( ); Status = EfiBootManagerVariableToLoadOption (OptionName, &BootOption); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (OptionToFind->OptionNumber == BootOption.OptionNumber); if ((OptionToFind->Attributes == BootOption.Attributes) && (StrCmp (OptionToFind->Description, BootOption.Description) == 0) && @@ -175,7 +175,7 @@ BmAdjustFvFilePath ( // FvFileNode = FilePath; Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &FvFileNode, &FvHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return DuplicateDevicePath (FilePath); } @@ -198,7 +198,7 @@ BmAdjustFvFilePath ( ); NewDevicePath = AppendDevicePathNode (DevicePathFromHandle (LoadedImage->DeviceHandle), FvFileNode); FullPath = BmAdjustFvFilePath (NewDevicePath); - FreePool (NewDevicePath); + FreePool(NewDevicePath); if (FullPath != NULL) { return FullPath; } @@ -222,14 +222,14 @@ BmAdjustFvFilePath ( } NewDevicePath = AppendDevicePathNode (DevicePathFromHandle (FvHandles[Index]), FvFileNode); FullPath = BmAdjustFvFilePath (NewDevicePath); - FreePool (NewDevicePath); + FreePool(NewDevicePath); if (FullPath != NULL) { break; } } if (FvHandles != NULL) { - FreePool (FvHandles); + FreePool(FvHandles); } return FullPath; } @@ -255,7 +255,7 @@ BmIsFvFilePath ( Node = DevicePath; Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &Node, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return TRUE; } @@ -301,7 +301,7 @@ BmMatchUsbClass ( // Check Vendor Id and Product Id. // Status = UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -324,7 +324,7 @@ BmMatchUsbClass ( // Protocol in Interface Descriptor instead. // Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -391,7 +391,7 @@ BmMatchUsbWwid ( // Check Vendor Id and Product Id. // Status = UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } if ((DevDesc.IdVendor != UsbWwid->VendorId) || @@ -403,7 +403,7 @@ BmMatchUsbWwid ( // Check Interface Number. // Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } if (IfDesc.InterfaceNumber != UsbWwid->InterfaceNumber) { @@ -423,7 +423,7 @@ BmMatchUsbWwid ( TableSize = 0; LangIdTable = NULL; Status = UsbIo->UsbGetSupportedLanguages (UsbIo, &LangIdTable, &TableSize); - if (EFI_ERROR (Status) || (TableSize == 0) || (LangIdTable == NULL)) { + if (EFI_ERROR(Status) || (TableSize == 0) || (LangIdTable == NULL)) { return FALSE; } @@ -447,18 +447,18 @@ BmMatchUsbWwid ( DevDesc.StrSerialNumber, &SerialNumberStr ); - if (EFI_ERROR (Status) || (SerialNumberStr == NULL)) { + if (EFI_ERROR(Status) || (SerialNumberStr == NULL)) { continue; } Length = StrLen (SerialNumberStr); if ((Length >= CompareLen) && (CompareMem (SerialNumberStr + Length - CompareLen, CompareStr, CompareLen * sizeof (CHAR16)) == 0)) { - FreePool (SerialNumberStr); + FreePool(SerialNumberStr); return TRUE; } - FreePool (SerialNumberStr); + FreePool(SerialNumberStr); } return FALSE; @@ -505,7 +505,7 @@ BmFindUsbDevice ( UsbIoHandleCount, &UsbIoHandles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *UsbIoHandleCount = 0; UsbIoHandles = NULL; } @@ -521,7 +521,7 @@ BmFindUsbDevice ( ); UsbIoDevicePath = DevicePathFromHandle (UsbIoHandles[Index]); Matched = FALSE; - if (!EFI_ERROR (Status) && (UsbIoDevicePath != NULL)) { + if (!EFI_ERROR(Status) && (UsbIoDevicePath != NULL)) { // // Compare starting part of UsbIoHandle's device path with ParentDevicePath. @@ -601,7 +601,7 @@ BmExpandUsbDevicePath ( continue; } NextFullPath = BmGetNextLoadOptionDevicePath (FilePath, NULL); - FreePool (FilePath); + FreePool(FilePath); if (NextFullPath == NULL) { // // No BlockIo or SimpleFileSystem under FilePath. @@ -612,13 +612,13 @@ BmExpandUsbDevicePath ( break; } else { GetNext = (BOOLEAN)(CompareMem (NextFullPath, FullPath, GetDevicePathSize (NextFullPath)) == 0); - FreePool (NextFullPath); + FreePool(NextFullPath); NextFullPath = NULL; } } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } return NextFullPath; @@ -652,7 +652,7 @@ BmExpandFileDevicePath ( EfiBootManagerConnectAll (); Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleFileSystemProtocolGuid, NULL, &HandleCount, &Handles); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { HandleCount = 0; Handles = NULL; } @@ -666,7 +666,7 @@ BmExpandFileDevicePath ( for (MediaType = 0; MediaType < 3; MediaType++) { for (Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol (Handles[Index], &gEfiBlockIoProtocolGuid, (VOID *) &BlockIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BlockIo = NULL; } if ((MediaType == 0 && BlockIo != NULL && BlockIo->Media->RemovableMedia) || @@ -678,7 +678,7 @@ BmExpandFileDevicePath ( break; } else { GetNext = (BOOLEAN)(CompareMem (NextFullPath, FullPath, GetDevicePathSize (NextFullPath)) == 0); - FreePool (NextFullPath); + FreePool(NextFullPath); NextFullPath = NULL; } } @@ -689,7 +689,7 @@ BmExpandFileDevicePath ( } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } return NextFullPath; @@ -722,7 +722,7 @@ BmExpandUriDevicePath ( EfiBootManagerConnectAll (); Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiLoadFileProtocolGuid, NULL, &HandleCount, &Handles); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { HandleCount = 0; Handles = NULL; } @@ -746,15 +746,15 @@ BmExpandUriDevicePath ( RamDiskDevicePath = BmGetRamDiskDevicePath (NextFullPath); if (RamDiskDevicePath != NULL) { BmDestroyRamDisk (RamDiskDevicePath); - FreePool (RamDiskDevicePath); + FreePool(RamDiskDevicePath); } - FreePool (NextFullPath); + FreePool(NextFullPath); NextFullPath = NULL; } } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } return NextFullPath; @@ -778,7 +778,7 @@ BmCachePartitionDevicePath ( if (BmMatchDevicePaths (*CachedDevicePath, DevicePath)) { TempDevicePath = *CachedDevicePath; *CachedDevicePath = BmDelPartMatchInstance (*CachedDevicePath, DevicePath); - FreePool (TempDevicePath); + FreePool(TempDevicePath); } if (*CachedDevicePath == NULL) { @@ -789,7 +789,7 @@ BmCachePartitionDevicePath ( TempDevicePath = *CachedDevicePath; *CachedDevicePath = AppendDevicePathInstance (DevicePath, *CachedDevicePath); if (TempDevicePath != NULL) { - FreePool (TempDevicePath); + FreePool(TempDevicePath); } // @@ -860,7 +860,7 @@ BmExpandPartitionDevicePath ( // Delete the invalid 'HDDP' variable. // if ((CachedDevicePath != NULL) && !IsDevicePathValid (CachedDevicePath, CachedDevicePathSize)) { - FreePool (CachedDevicePath); + FreePool(CachedDevicePath); CachedDevicePath = NULL; Status = gRT->SetVariable ( L"HDDP", @@ -869,7 +869,7 @@ BmExpandPartitionDevicePath ( 0, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } FullPath = NULL; @@ -889,7 +889,7 @@ BmExpandPartitionDevicePath ( // e.g. ACPI() /PCI()/ATA()/Partition() // Status = EfiBootManagerConnectDevicePath (Instance, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { TempDevicePath = AppendDevicePath (Instance, NextDevicePathNode (FilePath)); // // TempDevicePath = ACPI()/PCI()/ATA()/Partition() @@ -902,7 +902,7 @@ BmExpandPartitionDevicePath ( // For simplicity, only #1 is returned. // FullPath = BmGetNextLoadOptionDevicePath (TempDevicePath, NULL); - FreePool (TempDevicePath); + FreePool(TempDevicePath); if (FullPath != NULL) { // @@ -923,8 +923,8 @@ BmExpandPartitionDevicePath ( ); } - FreePool (Instance); - FreePool (CachedDevicePath); + FreePool(Instance); + FreePool(CachedDevicePath); return FullPath; } } @@ -943,7 +943,7 @@ BmExpandPartitionDevicePath ( // EfiBootManagerConnectAll (); Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &BlockIoHandleCount, &BlockIoBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BlockIoHandleCount = 0; BlockIoBuffer = NULL; } @@ -962,7 +962,7 @@ BmExpandPartitionDevicePath ( // TempDevicePath = AppendDevicePath (BlockIoDevicePath, NextDevicePathNode (FilePath)); FullPath = BmGetNextLoadOptionDevicePath (TempDevicePath, NULL); - FreePool (TempDevicePath); + FreePool(TempDevicePath); if (FullPath != NULL) { BmCachePartitionDevicePath (&CachedDevicePath, BlockIoDevicePath); @@ -985,10 +985,10 @@ BmExpandPartitionDevicePath ( } if (CachedDevicePath != NULL) { - FreePool (CachedDevicePath); + FreePool(CachedDevicePath); } if (BlockIoBuffer != NULL) { - FreePool (BlockIoBuffer); + FreePool(BlockIoBuffer); } return FullPath; } @@ -1029,7 +1029,7 @@ BmExpandMediaDevicePath ( // TempDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &TempDevicePath, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (IsDevicePathEnd (TempDevicePath)); NextFullPath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME); @@ -1039,13 +1039,13 @@ BmExpandMediaDevicePath ( if (GetNext) { return NextFullPath; } else { - FreePool (NextFullPath); + FreePool(NextFullPath); return NULL; } } Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &TempDevicePath, &Handle); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // For device boot option only pointing to the removable device handle, @@ -1062,8 +1062,8 @@ BmExpandMediaDevicePath ( // Block IO read/write will success. // Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return NULL; } Buffer = AllocatePool (BlockIo->Media->BlockSize); @@ -1075,7 +1075,7 @@ BmExpandMediaDevicePath ( BlockIo->Media->BlockSize, Buffer ); - FreePool (Buffer); + FreePool(Buffer); } // @@ -1105,14 +1105,14 @@ BmExpandMediaDevicePath ( break; } else { GetNext = (BOOLEAN)(CompareMem (NextFullPath, FullPath, GetDevicePathSize (NextFullPath)) == 0); - FreePool (NextFullPath); + FreePool(NextFullPath); NextFullPath = NULL; } } } if (SimpleFileSystemHandles != NULL) { - FreePool (SimpleFileSystemHandles); + FreePool(SimpleFileSystemHandles); } return NextFullPath; @@ -1187,7 +1187,7 @@ BmExpandNetworkFileSystem ( &HandleCount, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Handles = NULL; HandleCount = 0; } @@ -1196,7 +1196,7 @@ BmExpandNetworkFileSystem ( for (Index = 0; Index < HandleCount; Index++) { Node = DevicePathFromHandle (Handles[Index]); Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &Node, &Handle); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && (Handle == LoadFileHandle) && (DevicePathType (Node) == MEDIA_DEVICE_PATH) && (DevicePathSubType (Node) == MEDIA_RAM_DISK_DP)) { // @@ -1208,7 +1208,7 @@ BmExpandNetworkFileSystem ( } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } if (Index == HandleCount) { @@ -1247,7 +1247,7 @@ BmGetRamDiskDevicePath ( Node = FilePath; Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &Node, &Handle); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && (DevicePathType (Node) == MEDIA_DEVICE_PATH) && (DevicePathSubType (Node) == MEDIA_RAM_DISK_DP) ) { @@ -1296,7 +1296,7 @@ BmGetRamDiskMemoryInfo ( // Get the buffer occupied by RAM Disk. // Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &RamDiskDevicePath, &Handle); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return NULL; } @@ -1339,13 +1339,13 @@ BmDestroyRamDisk ( // if (mRamDisk == NULL) { Status = gBS->LocateProtocol (&gEfiRamDiskProtocolGuid, NULL, (VOID *) &mRamDisk); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return; } } /* Status = */mRamDisk->Unregister (RamDiskDevicePath); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); FreePages (RamDiskBuffer, RamDiskSizeInPages); } @@ -1378,7 +1378,7 @@ BmExpandLoadFile ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return NULL; } @@ -1407,7 +1407,7 @@ BmExpandLoadFile ( } Status = LoadFile->LoadFile (LoadFile, FilePath, TRUE, &BufferSize, FileBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreePages (FileBuffer, EFI_SIZE_TO_PAGES (BufferSize)); return NULL; } @@ -1459,7 +1459,7 @@ BmExpandLoadFiles ( // Node = FilePath; Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &Node, &Handle); - if (!EFI_ERROR (Status) && IsDevicePathEnd (Node)) { + if (!EFI_ERROR(Status) && IsDevicePathEnd (Node)) { // // When wide match happens, pass full device path to LoadFile (), // otherwise, pass remaining device path to LoadFile (). @@ -1478,7 +1478,7 @@ BmExpandLoadFiles ( &HandleCount, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Handles = NULL; HandleCount = 0; } @@ -1489,7 +1489,7 @@ BmExpandLoadFiles ( } } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } } @@ -1560,11 +1560,11 @@ BmGetNextLoadOptionDevicePath ( // Node = FilePath; Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &Node, &Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &Node, &Handle); } - if (!EFI_ERROR (Status) && IsDevicePathEnd (Node)) { + if (!EFI_ERROR(Status) && IsDevicePathEnd (Node)) { return BmExpandMediaDevicePath (FilePath, FullPath); } @@ -1596,7 +1596,7 @@ BmGetNextLoadOptionDevicePath ( } else { Node = FilePath; Status = gBS->LocateDevicePath (&gEfiUsbIoProtocolGuid, &Node, &Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Only expand the USB WWID/Class device path // when FilePath doesn't point to a physical UsbIo controller. @@ -1646,7 +1646,7 @@ BmGetNextLoadOptionDevicePath ( // Node = FilePath; Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &Node, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return DuplicateDevicePath (FilePath); } @@ -1674,7 +1674,7 @@ BmIsBootManagerMenuFilePath ( EFI_STATUS Status; Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &DevicePath, &FvHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { NameGuid = EfiGetNameGuidFromFwVolDevicePathNode ((CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) DevicePath); if (NameGuid != NULL) { return CompareGuid (NameGuid, PcdGetPtr (PcdBootManagerMenuFile)); @@ -1783,7 +1783,7 @@ EfiBootManagerBoot ( OptionNumber = BmFindBootOptionInVariable (BootOption); if (OptionNumber == LoadOptionNumberUnassigned) { Status = BmGetFreeOptionNumber (LoadOptionTypeBoot, &Uint16); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Save the BootOption->OptionNumber to restore later // @@ -1794,7 +1794,7 @@ EfiBootManagerBoot ( BootOption->OptionNumber = OriginalOptionNumber; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "[Bds] Failed to create Boot#### for a temporary boot - %r!\n", Status)); BootOption->Status = Status; return ; @@ -1874,13 +1874,13 @@ EfiBootManagerBoot ( ); } if (FileBuffer != NULL) { - FreePool (FileBuffer); + FreePool(FileBuffer); } if (FilePath != NULL) { - FreePool (FilePath); + FreePool(FilePath); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Report Status Code with the failure status to indicate that the failure to load boot option // @@ -1891,7 +1891,7 @@ EfiBootManagerBoot ( // if (RamDiskDevicePath != NULL) { BmDestroyRamDisk (RamDiskDevicePath); - FreePool (RamDiskDevicePath); + FreePool(RamDiskDevicePath); } return; } @@ -1916,7 +1916,7 @@ EfiBootManagerBoot ( NULL, &LegacyBootEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ); mBmLegacyBoot (BootOption); @@ -1932,7 +1932,7 @@ EfiBootManagerBoot ( // Provide the image with its load options // Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &ImageInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (!BmIsAutoCreateBootOption (BootOption)) { ImageInfo->LoadOptionsSize = BootOption->OptionalDataSize; @@ -1961,7 +1961,7 @@ EfiBootManagerBoot ( Status = gBS->StartImage (ImageHandle, &BootOption->ExitDataSize, &BootOption->ExitData); DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Image Return Status = %r\n", Status)); BootOption->Status = Status; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Report Status Code with the failure status to indicate that boot failure // @@ -1974,7 +1974,7 @@ EfiBootManagerBoot ( // if (RamDiskDevicePath != NULL) { BmDestroyRamDisk (RamDiskDevicePath); - FreePool (RamDiskDevicePath); + FreePool(RamDiskDevicePath); } // @@ -1987,9 +1987,9 @@ EfiBootManagerBoot ( // BootLogo = NULL; Status = gBS->LocateProtocol (&gEfiBootLogoProtocolGuid, NULL, (VOID **) &BootLogo); - if (!EFI_ERROR (Status) && (BootLogo != NULL)) { + if (!EFI_ERROR(Status) && (BootLogo != NULL)) { Status = BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // @@ -2118,7 +2118,7 @@ BmEnumerateBootOptions ( &gEfiBlockIoProtocolGuid, (VOID **) &BlkIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -2154,14 +2154,14 @@ BmEnumerateBootOptions ( NULL, 0 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - FreePool (Description); + FreePool(Description); } } if (HandleCount != 0) { - FreePool (Handles); + FreePool(Handles); } // @@ -2180,7 +2180,7 @@ BmEnumerateBootOptions ( &gEfiBlockIoProtocolGuid, (VOID **) &BlkIo ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Skip if the file system handle supports a BlkIo protocol, which we've handled in above // @@ -2204,12 +2204,12 @@ BmEnumerateBootOptions ( NULL, 0 ); - ASSERT_EFI_ERROR (Status); - FreePool (Description); + ASSERT_EFI_ERROR(Status); + FreePool(Description); } if (HandleCount != 0) { - FreePool (Handles); + FreePool(Handles); } // @@ -2248,12 +2248,12 @@ BmEnumerateBootOptions ( NULL, 0 ); - ASSERT_EFI_ERROR (Status); - FreePool (Description); + ASSERT_EFI_ERROR(Status); + FreePool(Description); } if (HandleCount != 0) { - FreePool (Handles); + FreePool(Handles); } BmMakeBootOptionDescriptionUnique (BootOptions, *BootOptionCount); @@ -2311,7 +2311,7 @@ EfiBootManagerRefreshAllBootOption ( // // Deleting variable with current variable implementation shouldn't fail. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) break; } } @@ -2384,7 +2384,7 @@ BmRegisterBootManagerMenu ( } } if (HandleCount != 0) { - FreePool (Handles); + FreePool(Handles); } if (DevicePath == NULL) { @@ -2397,9 +2397,9 @@ BmRegisterBootManagerMenu ( &DataSize ); if (Data != NULL) { - FreePool (Data); + FreePool(Data); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_WARN, "[Bds]BootManagerMenu FFS section can not be found, skip its boot option registration\n")); return EFI_NOT_FOUND; } @@ -2414,7 +2414,7 @@ BmRegisterBootManagerMenu ( (VOID **) &Description, &DescriptionLength ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Description = NULL; } @@ -2424,8 +2424,8 @@ BmRegisterBootManagerMenu ( &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage ); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } DevicePath = AppendDevicePathNode ( @@ -2445,15 +2445,15 @@ BmRegisterBootManagerMenu ( NULL, 0 ); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } if (DevicePath) { - FreePool (DevicePath); + FreePool(DevicePath); } if (Description != NULL) { - FreePool (Description); + FreePool(Description); } /* DEBUG_CODE ( @@ -2505,7 +2505,7 @@ EfiBootManagerGetBootManagerMenu ( BootOptions[Index].OptionalData, BootOptions[Index].OptionalDataSize ); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); break; } diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c index aa891feb1..453ad40cf 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c @@ -158,7 +158,7 @@ BmGetDescriptionFromDiskInfo ( &gEfiDiskInfoProtocolGuid, (VOID **) &DiskInfo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -170,7 +170,7 @@ BmGetDescriptionFromDiskInfo ( &IdentifyData, &BufferSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Description = AllocateZeroPool ((ModelNameLength + SerialNumberLength + 2) * sizeof (CHAR16)); ASSERT (Description != NULL); for (Index = 0; Index + 1 < ModelNameLength; Index += 2) { @@ -198,7 +198,7 @@ BmGetDescriptionFromDiskInfo ( &InquiryData, &BufferSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Description = AllocateZeroPool ((VENDOR_IDENTIFICATION_LENGTH + PRODUCT_IDENTIFICATION_LENGTH + 2) * sizeof (CHAR16)); ASSERT (Description != NULL); @@ -278,14 +278,14 @@ BmGetUsbDescription ( &gEfiUsbIoProtocolGuid, (VOID **) &UsbIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } NullChar = L'\0'; Status = UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -295,7 +295,7 @@ BmGetUsbDescription ( DevDesc.StrManufacturer, &Manufacturer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Manufacturer = &NullChar; } @@ -305,7 +305,7 @@ BmGetUsbDescription ( DevDesc.StrProduct, &Product ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Product = &NullChar; } @@ -315,7 +315,7 @@ BmGetUsbDescription ( DevDesc.StrSerialNumber, &SerialNumber ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { SerialNumber = &NullChar; } @@ -338,13 +338,13 @@ BmGetUsbDescription ( StrCatS (Description, DescMaxSize/sizeof(CHAR16), SerialNumber); if (Manufacturer != &NullChar) { - FreePool (Manufacturer); + FreePool(Manufacturer); } if (Product != &NullChar) { - FreePool (Product); + FreePool(Product); } if (SerialNumber != &NullChar) { - FreePool (SerialNumber); + FreePool(SerialNumber); } BmEliminateExtraSpaces (Description); @@ -381,7 +381,7 @@ BmGetNetworkDescription ( Handle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -393,7 +393,7 @@ BmGetNetworkDescription ( Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status) || (DevicePath == NULL)) { + if (EFI_ERROR(Status) || (DevicePath == NULL)) { return NULL; } @@ -517,7 +517,7 @@ BmGetLoadFileDescription ( EFI_LOAD_FILE_PROTOCOL *LoadFile; Status = gBS->HandleProtocol (Handle, &gEfiLoadFileProtocolGuid, (VOID **)&LoadFile); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -526,7 +526,7 @@ BmGetLoadFileDescription ( // Description = NULL; Status = gBS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID **)&FilePath); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DevicePathNode = FilePath; while (!IsDevicePathEnd (DevicePathNode)) { if (DevicePathNode->Type == MEDIA_DEVICE_PATH && DevicePathNode->SubType == MEDIA_FILEPATH_DP) { @@ -568,12 +568,12 @@ BmGetNvmeDescription ( UINTN Index; Status = gBS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID **) &DevicePath.DevPath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } Status = gBS->LocateDevicePath (&gEfiNvmExpressPassThruProtocolGuid, &DevicePath.DevPath, &Handle); - if (EFI_ERROR (Status) || + if (EFI_ERROR(Status) || (DevicePathType (DevicePath.DevPath) != MESSAGING_DEVICE_PATH) || (DevicePathSubType (DevicePath.DevPath) != MSG_NVME_NAMESPACE_DP)) { // @@ -586,7 +586,7 @@ BmGetNvmeDescription ( // Send ADMIN_IDENTIFY command to NVME controller to get the model and serial number. // Status = gBS->HandleProtocol (Handle, &gEfiNvmExpressPassThruProtocolGuid, (VOID **) &NvmePassthru); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem (&CommandPacket, sizeof(EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET)); ZeroMem (&Command, sizeof(EFI_NVM_EXPRESS_COMMAND)); @@ -616,7 +616,7 @@ BmGetNvmeDescription ( &CommandPacket, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -670,7 +670,7 @@ BmGetMiscDescription ( case BmMessageAtapiBoot: case BmMessageSataBoot: Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Assume a removable SATA device should be the DVD/CD device // @@ -687,7 +687,7 @@ BmGetMiscDescription ( case BmHardwareDeviceBoot: Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Description = BlockIo->Media->RemovableMedia ? L"Removable Disk" : L"Hard Drive"; } else { Description = L"Misc Device"; @@ -696,7 +696,7 @@ BmGetMiscDescription ( default: Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID **) &Fs); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Description = L"Non-Block Boot Device"; } else { Description = L"Misc Device"; @@ -789,7 +789,7 @@ BmGetBootDescription ( ASSERT (Temp != NULL); StrCpyS (Temp, (StrSize (DefaultDescription) + sizeof (mBmUefiPrefix)) / sizeof (CHAR16), mBmUefiPrefix); StrCatS (Temp, (StrSize (DefaultDescription) + sizeof (mBmUefiPrefix)) / sizeof (CHAR16), DefaultDescription); - FreePool (DefaultDescription); + FreePool(DefaultDescription); DefaultDescription = Temp; break; } @@ -806,7 +806,7 @@ BmGetBootDescription ( Entry = CR (Link, BM_BOOT_DESCRIPTION_ENTRY, Link, BM_BOOT_DESCRIPTION_ENTRY_SIGNATURE); Description = Entry->Handler (Handle, DefaultDescription); if (Description != NULL) { - FreePool (DefaultDescription); + FreePool(DefaultDescription); return Description; } } @@ -859,7 +859,7 @@ BmMakeBootOptionDescriptionUnique ( if (!Visited[Index] && StrCmp (BootOptions[Base].Description, BootOptions[Index].Description) == 0) { Visited[Index] = TRUE; MatchCount++; - FreePool (BootOptions[Index].Description); + FreePool(BootOptions[Index].Description); BootOptions[Index].Description = AllocatePool (DescriptionSize + MaxSuffixSize); UnicodeSPrint ( BootOptions[Index].Description, DescriptionSize + MaxSuffixSize, @@ -871,5 +871,5 @@ BmMakeBootOptionDescriptionUnique ( } } - FreePool (Visited); + FreePool(Visited); } diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmConnect.c b/MdeModulePkg/Library/UefiBootManagerLib/BmConnect.c index d4a263b8f..868391758 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmConnect.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmConnect.c @@ -42,7 +42,7 @@ BmConnectAllDriversToAllControllers ( } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } // @@ -53,7 +53,7 @@ BmConnectAllDriversToAllControllers ( // Status = gDS->Dispatch (); - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); } /** @@ -134,7 +134,7 @@ EfiBootManagerConnectDevicePath ( // RemainingDevicePath = DevicePathToConnect; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Handle == PreviousHandle) { // // If no forward progress is made try invoking the Dispatcher. @@ -155,7 +155,7 @@ EfiBootManagerConnectDevicePath ( } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PreviousHandle = Handle; // // Connect all drivers that apply to Handle and RemainingDevicePath, @@ -183,9 +183,9 @@ EfiBootManagerConnectDevicePath ( // // Loop until RemainingDevicePath is an empty device path // - } while (!EFI_ERROR (Status) && !IsDevicePathEnd (RemainingDevicePath)); + } while (!EFI_ERROR(Status) && !IsDevicePathEnd (RemainingDevicePath)); - ASSERT (EFI_ERROR (Status) || IsDevicePathEnd (RemainingDevicePath)); + ASSERT (EFI_ERROR(Status) || IsDevicePathEnd (RemainingDevicePath)); return Status; } @@ -222,7 +222,7 @@ EfiBootManagerDisconnectAll ( } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } } @@ -278,19 +278,19 @@ BmConnectUsbShortFormDevicePath ( &HandleCount, &Handles ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol ( Handles[Index], &gEfiPciIoProtocolGuid, (VOID **) &PciIo ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Check whether the Pci device is the wanted usb host controller // Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && ((PCI_CLASS_SERIAL == Class[2]) && (PCI_CLASS_SERIAL_USB == Class[1])) ) { Status = gBS->ConnectController ( @@ -307,7 +307,7 @@ BmConnectUsbShortFormDevicePath ( } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } } diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c b/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c index d89331784..cd7e64310 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c @@ -49,7 +49,7 @@ BmGetVideoController ( &RootBridgeHandleCount, &RootBridgeHandleBuffer ); - if (EFI_ERROR (Status) || (RootBridgeHandleCount == 0)) { + if (EFI_ERROR(Status) || (RootBridgeHandleCount == 0)) { return NULL; } @@ -67,13 +67,13 @@ BmGetVideoController ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } for (Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID **) &PciIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Check for all video controller // @@ -84,20 +84,20 @@ BmGetVideoController ( sizeof (Pci) / sizeof (UINT32), &Pci ); - if (!EFI_ERROR (Status) && IS_PCI_VGA (&Pci)) { + if (!EFI_ERROR(Status) && IS_PCI_VGA (&Pci)) { // TODO: use IS_PCI_DISPLAY?? VideoController = HandleBuffer[Index]; break; } } } - FreePool (HandleBuffer); + FreePool(HandleBuffer); if (VideoController != NULL) { break; } } - FreePool (RootBridgeHandleBuffer); + FreePool(RootBridgeHandleBuffer); return VideoController; } @@ -136,7 +136,7 @@ EfiBootManagerGetGopDevicePath ( &ProtocolBuffer, &ProtocolBufferCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -149,7 +149,7 @@ EfiBootManagerGetGopDevicePath ( &OpenInfoBuffer, &EntryCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -166,7 +166,7 @@ EfiBootManagerGetGopDevicePath ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -185,13 +185,13 @@ EfiBootManagerGetGopDevicePath ( NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Append the device path to GOP pool when there is GOP protocol installed. // TempDevicePath = GopPool; GopPool = AppendDevicePathInstance (GopPool, DevicePath); - gBS->FreePool (TempDevicePath); + gBS->FreePool(TempDevicePath); } } @@ -203,16 +203,16 @@ EfiBootManagerGetGopDevicePath ( TempDevicePath = GopPool; ReturnDevicePath = EfiBootManagerGetGopDevicePath (OpenInfoBuffer[Index].ControllerHandle); GopPool = AppendDevicePathInstance (GopPool, ReturnDevicePath); - gBS->FreePool (ReturnDevicePath); - gBS->FreePool (TempDevicePath); + gBS->FreePool(ReturnDevicePath); + gBS->FreePool(TempDevicePath); } } } - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); } - FreePool (ProtocolBuffer); + FreePool(ProtocolBuffer); return GopPool; } @@ -258,7 +258,7 @@ EfiBootManagerConnectVideoController ( } EfiBootManagerUpdateConsoleVariable (ConOut, Gop, NULL); - FreePool (Gop); + FreePool(Gop); // // Necessary for ConPlatform and ConSplitter driver to start up again after ConOut is updated. @@ -342,8 +342,8 @@ BmUpdateSystemTableConsole ( if (Instance == NULL) { DEBUG ((EFI_D_ERROR, "[Bds] No valid console instance is found for %s!\n", VarName)); // We should not ASSERT when all the console devices are removed. - // ASSERT_EFI_ERROR (EFI_NOT_FOUND); - FreePool (FullDevicePath); + // ASSERT_EFI_ERROR(EFI_NOT_FOUND); + FreePool(FullDevicePath); return FALSE; } @@ -356,8 +356,8 @@ BmUpdateSystemTableConsole ( &Instance, &NewHandle ); - FreePool (FullInstance); - if (!EFI_ERROR (Status)) { + FreePool(FullInstance); + if (!EFI_ERROR(Status)) { // // Get the console protocol on this console device handle // @@ -366,7 +366,7 @@ BmUpdateSystemTableConsole ( ConsoleGuid, &Interface ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update new console handle in System Table. // @@ -381,7 +381,7 @@ BmUpdateSystemTableConsole ( TextOut->SetMode (TextOut, 0); } } - FreePool (FullDevicePath); + FreePool(FullDevicePath); return TRUE; } } @@ -391,7 +391,7 @@ BmUpdateSystemTableConsole ( // // No any available console devcie found. // - FreePool (FullDevicePath); + FreePool(FullDevicePath); return FALSE; } @@ -550,7 +550,7 @@ EfiBootManagerConnectConsoleVariable ( // Instance = GetNextDevicePathInstance (&CopyOfDevicePath, &Size); if (Instance == NULL) { - FreePool (StartDevicePath); + FreePool(StartDevicePath); return EFI_UNSUPPORTED; } @@ -570,7 +570,7 @@ EfiBootManagerConnectConsoleVariable ( ((DevicePathSubType (Instance) == MSG_USB_CLASS_DP) || (DevicePathSubType (Instance) == MSG_USB_WWID_DP)) ) { Status = BmConnectUsbShortFormDevicePath (Instance); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DeviceExist = TRUE; } } else { @@ -591,13 +591,13 @@ EfiBootManagerConnectConsoleVariable ( // SetDevicePathEndNode (Next); Status = EfiBootManagerConnectDevicePath (Instance, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->ConnectController (Handle, NULL, NULL, TRUE); } } else { Status = EfiBootManagerConnectDevicePath (Instance, NULL); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Delete the instance from the console varialbe // @@ -609,7 +609,7 @@ EfiBootManagerConnectConsoleVariable ( FreePool(Instance); } while (CopyOfDevicePath != NULL); - FreePool (StartDevicePath); + FreePool(StartDevicePath); if (!DeviceExist) { return EFI_NOT_FOUND; @@ -713,20 +713,20 @@ EfiBootManagerConnectAllDefaultConsoles ( OneConnected = FALSE; Status = EfiBootManagerConnectConsoleVariable (ConOut); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { OneConnected = TRUE; } PERF_EVENT ("ConOutReady"); Status = EfiBootManagerConnectConsoleVariable (ConIn); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { OneConnected = TRUE; } PERF_EVENT ("ConInReady"); Status = EfiBootManagerConnectConsoleVariable (ErrOut); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { OneConnected = TRUE; } PERF_EVENT ("ErrOutReady"); diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c index 52e35e451..dba8323da 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c @@ -60,18 +60,18 @@ BmGetControllerName ( &gEfiComponentName2ProtocolGuid, (VOID **) &ComponentName ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->HandleProtocol ( DriverHealthHandle, &gEfiComponentNameProtocolGuid, (VOID **) &ComponentName ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Iso639Language = TRUE; } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { GetEfiGlobalVariable2 (Iso639Language ? L"Lang" : L"PlatformLang", (VOID**)&LanguageVariable, NULL); BestLanguage = GetBestLanguage( ComponentName->SupportedLanguages, @@ -81,7 +81,7 @@ BmGetControllerName ( NULL ); if (LanguageVariable != NULL) { - FreePool (LanguageVariable); + FreePool(LanguageVariable); } Status = ComponentName->GetControllerName ( @@ -93,7 +93,7 @@ BmGetControllerName ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return AllocateCopyPool (StrSize (ControllerName), ControllerName); } else { return ConvertDevicePathToText ( @@ -140,12 +140,12 @@ BmDisplayMessages ( if (String != NULL) { Print (L" %s\n", String); DEBUG ((EFI_D_INFO, " %s\n", String)); - FreePool (String); + FreePool(String); } } if (ControllerName != NULL) { - FreePool (ControllerName); + FreePool(ControllerName); } } @@ -211,7 +211,7 @@ BmGetSingleControllerHealthStatus ( &gEfiDriverHealthProtocolGuid, (VOID **) &DriverHealth ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (ControllerHandle == NULL) { @@ -219,7 +219,7 @@ BmGetSingleControllerHealthStatus ( // If ControllerHandle is NULL, the return the cumulative health status of the driver // Status = DriverHealth->GetHealthStatus (DriverHealth, NULL, NULL, &HealthStatus, NULL, NULL); - if (!EFI_ERROR (Status) && HealthStatus == EfiDriverHealthStatusHealthy) { + if (!EFI_ERROR(Status) && HealthStatus == EfiDriverHealthStatusHealthy) { *DriverHealthInfo = ReallocatePool ( (*Count) * sizeof (EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO), (*Count + 1) * sizeof (EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO), @@ -245,7 +245,7 @@ BmGetSingleControllerHealthStatus ( // Collect the health status with the optional HII message list // Status = DriverHealth->GetHealthStatus (DriverHealth, ControllerHandle, ChildHandle, &HealthStatus, &MessageList, &FormHiiHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *DriverHealthInfo = ReallocatePool ( (*Count) * sizeof (EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO), (*Count + 1) * sizeof (EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO), @@ -323,7 +323,7 @@ EfiBootManagerGetDriverHealthInfo ( return NULL; } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (DriverHealthHandles != NULL); // @@ -335,7 +335,7 @@ EfiBootManagerGetDriverHealthInfo ( // Get the cumulative health status of the driver // Status = BmGetSingleControllerHealthStatus (&DriverHealthInfo, Count, DriverHealthHandles[DriverHealthIndex], NULL, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -354,14 +354,14 @@ EfiBootManagerGetDriverHealthInfo ( &HandleCount, &Handles ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // // Loop through all the controller handles in the handle database // for (ControllerIndex = 0; ControllerIndex < HandleCount; ControllerIndex++) { Status = BmGetSingleControllerHealthStatus (&DriverHealthInfo, Count, DriverHealthHandles[DriverHealthIndex], Handles[ControllerIndex], NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -370,7 +370,7 @@ EfiBootManagerGetDriverHealthInfo ( // for (ChildIndex = 0; ChildIndex < HandleCount; ChildIndex++) { Status = BmGetSingleControllerHealthStatus (&DriverHealthInfo, Count, DriverHealthHandles[DriverHealthIndex], Handles[ControllerIndex], Handles[ChildIndex]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } } @@ -380,10 +380,10 @@ EfiBootManagerGetDriverHealthInfo ( Status = EFI_SUCCESS; if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } if (DriverHealthHandles != NULL) { - FreePool (DriverHealthHandles); + FreePool(DriverHealthHandles); } return DriverHealthInfo; @@ -409,10 +409,10 @@ EfiBootManagerFreeDriverHealthInfo ( for (Index = 0; Index < Count; Index++) { if (DriverHealthInfo[Index].MessageList != NULL) { - FreePool (DriverHealthInfo[Index].MessageList); + FreePool(DriverHealthInfo[Index].MessageList); } } - return gBS->FreePool (DriverHealthInfo); + return gBS->FreePool(DriverHealthInfo); } /** @@ -448,7 +448,7 @@ BmRepairAllControllers ( } Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &FormBrowser2); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); MaxRepairCount = PcdGet32 (PcdMaxRepairCount); RepairCount = 0; @@ -477,7 +477,7 @@ BmRepairAllControllers ( DriverHealthInfo[Index].ChildHandle, BmRepairNotify ); - if (!EFI_ERROR (Status) && !ConfigurationRequired) { + if (!EFI_ERROR(Status) && !ConfigurationRequired) { Status = DriverHealthInfo[Index].DriverHealth->GetHealthStatus ( DriverHealthInfo[Index].DriverHealth, DriverHealthInfo[Index].ControllerHandle, @@ -486,7 +486,7 @@ BmRepairAllControllers ( NULL, NULL ); - if (!EFI_ERROR (Status) && (HealthStatus == EfiDriverHealthStatusConfigurationRequired)) { + if (!EFI_ERROR(Status) && (HealthStatus == EfiDriverHealthStatusConfigurationRequired)) { ConfigurationRequired = TRUE; } } @@ -506,11 +506,11 @@ BmRepairAllControllers ( NULL, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } } - FreePool (HiiHandles); + FreePool(HiiHandles); } } @@ -527,7 +527,7 @@ BmRepairAllControllers ( if (DriverHealthInfo[Index].HealthStatus == EfiDriverHealthStatusReconnectRequired) { Status = gBS->DisconnectController (DriverHealthInfo[Index].ControllerHandle, NULL, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Disconnect failed. Need to promote reconnect to a reboot. // @@ -563,7 +563,7 @@ BmRepairAllControllers ( mBmHealthStatusText[DriverHealthInfo[Index].HealthStatus] )); if (ControllerName != NULL) { - FreePool (ControllerName); + FreePool(ControllerName); } } EfiBootManagerFreeDriverHealthInfo (DriverHealthInfo, Count); diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c index fdba29af4..99b46786e 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c @@ -85,7 +85,7 @@ BmIsKeyOptionValid ( // Check CRC for Boot Option // gBS->CalculateCrc32 (BootOption, BootOptionSize, &Crc); - FreePool (BootOption); + FreePool(BootOption); return (BOOLEAN) (KeyOption->BootOptionCrc == Crc); } @@ -181,7 +181,7 @@ BmCollectKeyOptions ( Param->KeyOptions[Index].OptionNumber = OptionNumber; Param->KeyOptionCount++; } - FreePool (KeyOption); + FreePool(KeyOption); } } @@ -388,7 +388,7 @@ BmHotkeyCallback ( // Received the whole key stroke sequence // Status = gBS->SignalEvent (mBmHotkeyTriggered); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (!Hotkey->IsContinue) { // @@ -400,7 +400,7 @@ BmHotkeyCallback ( ); Status = EfiBootManagerVariableToLoadOption (OptionName, &mBmHotkeyBootOption); DEBUG ((EFI_D_INFO, "[Bds]Hotkey for %s pressed - %r\n", OptionName, Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mBmHotkeyBootOption.OptionNumber = LoadOptionNumberUnassigned; } } else { @@ -450,7 +450,7 @@ BmGetActiveConsoleIn ( NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Handles = AllocateCopyPool (sizeof (EFI_HANDLE), &gST->ConsoleInHandle); if (Handles != NULL) { *Count = 1; @@ -493,7 +493,7 @@ BmUnregisterHotkeyNotify ( Handles = BmGetActiveConsoleIn (&HandleCount); for (Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol (Handles[Index], &gEfiSimpleTextInputExProtocolGuid, (VOID **) &TxtInEx); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); for (KeyIndex = 0; KeyIndex < Hotkey->CodeCount; KeyIndex++) { Status = TxtInEx->RegisterKeyNotify ( TxtInEx, @@ -501,7 +501,7 @@ BmUnregisterHotkeyNotify ( BmHotkeyCallback, &NotifyHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = TxtInEx->UnregisterKeyNotify (TxtInEx, NotifyHandle); DEBUG ((EFI_D_INFO, "[Bds]UnregisterKeyNotify: %04x/%04x %r\n", Hotkey->KeyData[KeyIndex].Key.ScanCode, Hotkey->KeyData[KeyIndex].Key.UnicodeChar, Status)); } @@ -509,7 +509,7 @@ BmUnregisterHotkeyNotify ( } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } return EFI_SUCCESS; @@ -550,7 +550,7 @@ BmRegisterHotkeyNotify ( Hotkey->KeyData[Index].KeyState.KeyToggleState, Status )); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // some of the hotkey registry failed // do not unregister all in case we have both CTRL-ALT-P and CTRL-ALT-P-R @@ -682,14 +682,14 @@ BmProcessKeyOption ( for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { Status = gBS->HandleProtocol (Handles[HandleIndex], &gEfiSimpleTextInputExProtocolGuid, (VOID **) &TxtInEx); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) continue; BmRegisterHotkeyNotify (TxtInEx, Hotkey); } } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } EfiReleaseLock (&mBmHotkeyLock); @@ -725,7 +725,7 @@ BmTxtInExCallback ( &BufferSize, &Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If no more notification events exist // @@ -737,7 +737,7 @@ BmTxtInExCallback ( &gEfiSimpleTextInputExProtocolGuid, (VOID **) &TxtInEx ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register the hot key notification for the existing items in the list @@ -766,7 +766,7 @@ BmFreeKeyOptions ( ) { if (KeyOptions != NULL) { - FreePool (KeyOptions); + FreePool(KeyOptions); return EFI_SUCCESS; } else { return EFI_NOT_FOUND; @@ -804,7 +804,7 @@ EfiBootManagerRegisterContinueKeyOption ( Status = BmInitializeKeyFields (Modifier, Args, &KeyOption); VA_END (Args); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { mBmContinueKeyOption = AllocateCopyPool (sizeof (EFI_BOOT_MANAGER_KEY_OPTION), &KeyOption); ASSERT (mBmContinueKeyOption != NULL); if (mBmHotkeyServiceStarted) { @@ -839,7 +839,7 @@ BmStopHotkeyService ( Hotkey = BM_HOTKEY_FROM_LINK (Link); BmUnregisterHotkeyNotify (Hotkey); Link = RemoveEntryList (Link); - FreePool (Hotkey); + FreePool(Hotkey); } EfiReleaseLock (&mBmHotkeyLock); } @@ -870,7 +870,7 @@ EfiBootManagerStartHotkeyService ( if ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_KEY) != 0) { mBmHotkeySupportCount = ((*BootOptionSupport & EFI_BOOT_OPTION_SUPPORT_COUNT) >> LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT)); } - FreePool (BootOptionSupport); + FreePool(BootOptionSupport); } if (mBmHotkeySupportCount == 0) { @@ -885,7 +885,7 @@ EfiBootManagerStartHotkeyService ( NULL, &mBmHotkeyTriggered ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (HotkeyTriggered != NULL) { *HotkeyTriggered = mBmHotkeyTriggered; @@ -922,7 +922,7 @@ EfiBootManagerStartHotkeyService ( NULL, &Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mBmHotkeyServiceStarted = TRUE; return Status; @@ -974,13 +974,13 @@ EfiBootManagerAddKeyOptionVariable ( ZeroMem (&KeyOption, sizeof (EFI_BOOT_MANAGER_KEY_OPTION)); KeyOption.BootOption = BootOptionNumber; Status = gBS->CalculateCrc32 (BootOption, BootOptionSize, &KeyOption.BootOptionCrc); - ASSERT_EFI_ERROR (Status); - FreePool (BootOption); + ASSERT_EFI_ERROR(Status); + FreePool(BootOption); VA_START (Args, Modifier); Status = BmInitializeKeyFields (Modifier, Args, &KeyOption); VA_END (Args); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1020,7 +1020,7 @@ EfiBootManagerAddKeyOptionVariable ( BmSizeOfKeyOption (&KeyOption), &KeyOption ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Return the Key Option in case needed by caller // @@ -1076,7 +1076,7 @@ EfiBootManagerDeleteKeyOptionVariable ( Status = BmInitializeKeyFields (Modifier, Args, &KeyOption); VA_END (Args); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1110,7 +1110,7 @@ EfiBootManagerDeleteKeyOptionVariable ( if (Match) { Link = RemoveEntryList (Link); - FreePool (Hotkey); + FreePool(Hotkey); } else { Link = GetNextNode (&mBmHotkeyList, Link); } diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c index 07592f8eb..09a97c12c 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c @@ -59,12 +59,12 @@ BmForEachVariable ( if (Status == EFI_NOT_FOUND) { break; } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Visitor (Name, &Guid, Context); } - FreePool (Name); + FreePool(Name); } /** @@ -129,11 +129,11 @@ BmGetFreeOptionNumber ( } } if (OptionOrder != NULL) { - FreePool (OptionOrder); + FreePool(OptionOrder); } if (BootNext != NULL) { - FreePool (BootNext); + FreePool(BootNext); } // @@ -237,9 +237,9 @@ structure. // Lock the PlatformRecovery#### // Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = VariableLock->RequestToLock (VariableLock, OptionName, &gEfiGlobalVariableGuid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } VariableAttributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; } @@ -251,7 +251,7 @@ structure. VariableSize, Variable ); - FreePool (Variable); + FreePool(Variable); return Status; } @@ -294,7 +294,7 @@ BmAddOptionNumberToOrderVariable ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Position = MIN (Position, OptionOrderSize / sizeof (UINT16)); NewOptionOrder = AllocatePool (OptionOrderSize + sizeof (UINT16)); @@ -312,11 +312,11 @@ BmAddOptionNumberToOrderVariable ( OptionOrderSize + sizeof (UINT16), NewOptionOrder ); - FreePool (NewOptionOrder); + FreePool(NewOptionOrder); } if (OptionOrder != NULL) { - FreePool (OptionOrder); + FreePool(OptionOrder); } return Status; @@ -368,7 +368,7 @@ EfiBootManagerAddLoadOptionVariable ( // if (Option->OptionNumber == LoadOptionNumberUnassigned) { Status = BmGetFreeOptionNumber (Option->OptionType, &OptionNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Option->OptionNumber = OptionNumber; @@ -379,12 +379,12 @@ EfiBootManagerAddLoadOptionVariable ( } Status = BmAddOptionNumberToOrderVariable (mBmLoadOptionOrderName[Option->OptionType], (UINT16) Option->OptionNumber, Position); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Save the Boot#### or Driver#### variable // Status = EfiBootManagerLoadOptionToVariable (Option); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Remove the #### from *Order variable when the Driver####/SysPrep####/Boot#### cannot be saved. // @@ -446,9 +446,9 @@ EfiBootManagerSortLoadOptionVariable ( // // Changing the *Order content without increasing its size with current variable implementation shouldn't fail. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - FreePool (OptionOrder); + FreePool(OptionOrder); EfiBootManagerFreeLoadOptions (LoadOption, LoadOptionCount); } @@ -595,7 +595,7 @@ EfiBootManagerDeleteLoadOptionVariable ( } } if (OptionOrder != NULL) { - FreePool (OptionOrder); + FreePool(OptionOrder); } } @@ -895,7 +895,7 @@ EfiBootManagerVariableToLoadOptionEx ( // Validate *#### variable data. // if (!BmValidateOption(Variable, VariableSize)) { - FreePool (Variable); + FreePool(Variable); return EFI_INVALID_PARAMETER; } @@ -945,11 +945,11 @@ EfiBootManagerVariableToLoadOptionEx ( OptionalData, OptionalDataSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); CopyGuid (&Option->VendorGuid, VendorGuid); - FreePool (Variable); + FreePool(Variable); return Status; } @@ -1009,7 +1009,7 @@ BmCollectLoadOptions ( OptionType == LoadOptionTypePlatformRecovery )) { Status = EfiBootManagerVariableToLoadOptionEx (Name, Guid, &Option); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < Param->OptionCount; Index++) { if (Param->Options[Index].OptionNumber > Option.OptionNumber) { break; @@ -1080,7 +1080,7 @@ EfiBootManagerGetLoadOptions ( UnicodeSPrint (OptionName, sizeof (OptionName), L"%s%04x", mBmLoadOptionName[LoadOptionType], OptionNumber); Status = EfiBootManagerVariableToLoadOption (OptionName, &Options[OptionIndex]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "[Bds] %s doesn't exist - Update ****Order variable to remove the reference!!", OptionName)); EfiBootManagerDeleteLoadOptionVariable (OptionNumber, LoadOptionType); } else { @@ -1090,7 +1090,7 @@ EfiBootManagerGetLoadOptions ( } if (OptionOrder != NULL) { - FreePool (OptionOrder); + FreePool(OptionOrder); } if (OptionIndex < *OptionCount) { @@ -1134,13 +1134,13 @@ EfiBootManagerFreeLoadOption ( } if (LoadOption->Description != NULL) { - FreePool (LoadOption->Description); + FreePool(LoadOption->Description); } if (LoadOption->FilePath != NULL) { - FreePool (LoadOption->FilePath); + FreePool(LoadOption->FilePath); } if (LoadOption->OptionalData != NULL) { - FreePool (LoadOption->OptionalData); + FreePool(LoadOption->OptionalData); } return EFI_SUCCESS; @@ -1174,7 +1174,7 @@ EfiBootManagerFreeLoadOptions ( EfiBootManagerFreeLoadOption (&Option[Index]); } - FreePool (Option); + FreePool(Option); return EFI_SUCCESS; } @@ -1296,7 +1296,7 @@ BmGetNextLoadOptionBuffer ( // Only free the full path created *inside* this routine // if ((PreFullPath != NULL) && (PreFullPath != *FullPath)) { - FreePool (PreFullPath); + FreePool(PreFullPath); } if (CurFullPath == NULL) { break; @@ -1309,13 +1309,13 @@ BmGetNextLoadOptionBuffer ( RamDiskDevicePath = BmGetRamDiskDevicePath (FilePath); if (RamDiskDevicePath != NULL) { BmDestroyRamDisk (RamDiskDevicePath); - FreePool (RamDiskDevicePath); + FreePool(RamDiskDevicePath); } // // Free the invalid load option buffer. // - FreePool (FileBuffer); + FreePool(FileBuffer); FileBuffer = NULL; } } while (FileBuffer == NULL); @@ -1396,7 +1396,7 @@ EfiBootManagerProcessLoadOption ( PreFullPath = CurFullPath; FileBuffer = BmGetNextLoadOptionBuffer (LoadOption->OptionType, LoadOption->FilePath, &CurFullPath, &FileSize); if (PreFullPath != NULL) { - FreePool (PreFullPath); + FreePool(PreFullPath); } if (FileBuffer == NULL) { break; @@ -1409,11 +1409,11 @@ EfiBootManagerProcessLoadOption ( FileSize, &ImageHandle ); - FreePool (FileBuffer); + FreePool(FileBuffer); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **)&ImageInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ImageInfo->LoadOptionsSize = LoadOption->OptionalDataSize; ImageInfo->LoadOptions = LoadOption->OptionalData; @@ -1440,7 +1440,7 @@ EfiBootManagerProcessLoadOption ( } if (CurFullPath != NULL) { - FreePool (CurFullPath); + FreePool(CurFullPath); } return Status; diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c b/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c index 6b8fb4d92..561cf36f2 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c @@ -104,11 +104,11 @@ BmMatchDevicePaths ( // return success // if (CompareMem (Single, DevicePathInst, Size) == 0) { - FreePool (DevicePathInst); + FreePool(DevicePathInst); return TRUE; } - FreePool (DevicePathInst); + FreePool(DevicePathInst); DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size); } @@ -183,7 +183,7 @@ BmSetMemoryTypeInformationVariable ( &gEfiMemoryTypeInformationGuid, (VOID **) &CurrentMemoryTypeInformation ); - if (EFI_ERROR (Status) || CurrentMemoryTypeInformation == NULL) { + if (EFI_ERROR(Status) || CurrentMemoryTypeInformation == NULL) { return; } @@ -269,7 +269,7 @@ BmSetMemoryTypeInformationVariable ( PreviousMemoryTypeInformation ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If the Memory Type Information settings have been modified and the boot option belongs to boot category, // then reset the platform so the new Memory Type Information setting will be used to guarantee that an S4 @@ -286,7 +286,7 @@ BmSetMemoryTypeInformationVariable ( DEBUG ((EFI_D_ERROR, "Memory Type Information settings cannot be saved. OS S4 may fail!\n")); } } - FreePool (PreviousMemoryTypeInformation); + FreePool(PreviousMemoryTypeInformation); } /** @@ -342,7 +342,7 @@ BmSetVariableAndReportStatusCodeOnError ( DataSize, Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { NameSize = StrSize (VariableName); SetVariableStatus = AllocatePool (sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize); if (SetVariableStatus != NULL) { @@ -364,7 +364,7 @@ BmSetVariableAndReportStatusCodeOnError ( sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize ); - FreePool (SetVariableStatus); + FreePool(SetVariableStatus); } } @@ -387,7 +387,7 @@ BmPrintDp ( Str = ConvertDevicePathToText (DevicePath, FALSE, FALSE); DEBUG ((EFI_D_INFO, "%s", Str)); if (Str != NULL) { - FreePool (Str); + FreePool(Str); } } @@ -454,7 +454,7 @@ EfiBootManagerDispatchDeferredImages ( &HandleCount, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -462,7 +462,7 @@ EfiBootManagerDispatchDeferredImages ( LoadCount = 0; for (Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol (Handles[Index], &gEfiDeferredImageLoadProtocolGuid, (VOID **) &DeferredImage); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -478,7 +478,7 @@ EfiBootManagerDispatchDeferredImages ( &ImageSize, &BootOption ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } ImageCount++; @@ -493,7 +493,7 @@ EfiBootManagerDispatchDeferredImages ( 0, &ImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { LoadCount++; // // Before calling the image, enable the Watchdog Timer for @@ -510,7 +510,7 @@ EfiBootManagerDispatchDeferredImages ( } } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } if (ImageCount == 0) { diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c b/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c index b2f372324..369c75880 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c @@ -74,11 +74,11 @@ HiiGetSupportedLanguages ( // Retrieve the supported languages string // Status = gHiiString->GetLanguages (gHiiString, HiiHandle, SupportedLanguages, &LanguageSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free the buffer and return NULL if the supported languages can not be retrieved. // - FreePool (SupportedLanguages); + FreePool(SupportedLanguages); return NULL; } diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c index 5f39d1d49..27e60f886 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c @@ -86,8 +86,8 @@ InternalHiiExtractGuidFromHiiHandle ( Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &BufferSize, HiiPackageList); } - if (EFI_ERROR (Status)) { - FreePool (HiiPackageList); + if (EFI_ERROR(Status)) { + FreePool(HiiPackageList); return Status; } @@ -96,7 +96,7 @@ InternalHiiExtractGuidFromHiiHandle ( // CopyGuid (Guid, &HiiPackageList->PackageListGuid); - FreePool (HiiPackageList); + FreePool(HiiPackageList); return EFI_SUCCESS; } @@ -224,14 +224,14 @@ HiiAddPackages ( DeviceHandle, &HiiHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { HiiHandle = NULL; } // // Free the allocated package list // - FreePool (PackageListHeader); + FreePool(PackageListHeader); // // Return the new HII Handle @@ -261,7 +261,7 @@ HiiRemovePackages ( return; } /* Status = */gHiiDatabase->RemovePackageList (gHiiDatabase, HiiHandle); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } @@ -346,11 +346,11 @@ HiiGetHiiHandles ( &HandleBufferLength, HiiHandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free the buffer and return NULL if the HII handles can not be retrieved. // - FreePool (HiiHandleBuffer); + FreePool(HiiHandleBuffer); return NULL; } @@ -362,7 +362,7 @@ HiiGetHiiHandles ( } else { for (Index1 = 0, Index2 = 0; HiiHandleBuffer[Index1] != NULL; Index1++) { Status = InternalHiiExtractGuidFromHiiHandle (HiiHandleBuffer[Index1], &Guid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (CompareGuid (&Guid, PackageListGuid)) { HiiHandleBuffer[Index2++] = HiiHandleBuffer[Index1]; } @@ -371,7 +371,7 @@ HiiGetHiiHandles ( HiiHandleBuffer[Index2] = NULL; return HiiHandleBuffer; } else { - FreePool (HiiHandleBuffer); + FreePool(HiiHandleBuffer); return NULL; } } @@ -423,7 +423,7 @@ HiiGetFormSetFromHiiHandle( PackageListSize = 0; HiiPackageList = NULL; Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &PackageListSize, HiiPackageList); - if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) { + if (EFI_ERROR(Status) && (Status != EFI_BUFFER_TOO_SMALL)) { return Status; } @@ -433,7 +433,7 @@ HiiGetFormSetFromHiiHandle( } Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &PackageListSize, HiiPackageList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Get Form package from this HII package List @@ -494,7 +494,7 @@ HiiGetFormSetFromHiiHandle( } } Done: - FreePool (HiiPackageList); + FreePool(HiiPackageList); *BufferSize = TempSize; *Buffer = (EFI_IFR_FORM_SET *)FormSetBuffer; @@ -581,7 +581,7 @@ InternalHiiBlockToConfig ( &ConfigResp, &Progress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return ConfigResp; @@ -624,7 +624,7 @@ InternalHiiBrowserCallback ( // if (mUefiFormBrowser2 == NULL) { Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &mUefiFormBrowser2); - if (EFI_ERROR (Status) || mUefiFormBrowser2 == NULL) { + if (EFI_ERROR(Status) || mUefiFormBrowser2 == NULL) { return NULL; } } @@ -649,7 +649,7 @@ InternalHiiBrowserCallback ( VariableName ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // No Resluts Data, only allocate one char for '\0' // @@ -681,7 +681,7 @@ InternalHiiBrowserCallback ( VariableGuid, VariableName ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -1104,14 +1104,14 @@ GetValueFromRequest ( // Get Offset // Status = InternalHiiGetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } *VarValue = 0; CopyMem (VarValue, TmpBuffer, (((Length + 1) / 2) < sizeof (UINT64)) ? ((Length + 1) / 2) : sizeof (UINT64)); - FreePool (TmpBuffer); + FreePool(TmpBuffer); return EFI_SUCCESS; } @@ -1352,7 +1352,7 @@ ValidateQuestionFromVfr ( } Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -1444,7 +1444,7 @@ ValidateQuestionFromVfr ( } Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -1624,7 +1624,7 @@ ValidateQuestionFromVfr ( } Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -1923,7 +1923,7 @@ GetBlockDataInfo ( // Get Offset // Status = InternalHiiGetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Offset = 0; @@ -1932,7 +1932,7 @@ GetBlockDataInfo ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINT16)) ? ((Length + 1) / 2) : sizeof (UINT16) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); TmpBuffer = NULL; StringPtr += Length; @@ -1946,7 +1946,7 @@ GetBlockDataInfo ( // Get Width // Status = InternalHiiGetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Width = 0; @@ -1955,7 +1955,7 @@ GetBlockDataInfo ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINT16)) ? ((Length + 1) / 2) : sizeof (UINT16) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); TmpBuffer = NULL; StringPtr += Length; @@ -1974,7 +1974,7 @@ GetBlockDataInfo ( // Get Value // Status = InternalHiiGetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2004,7 +2004,7 @@ GetBlockDataInfo ( // Update the Block with configuration info // CopyMem (DataBuffer + Offset, TmpBuffer, Width); - FreePool (TmpBuffer); + FreePool(TmpBuffer); TmpBuffer = NULL; // @@ -2027,7 +2027,7 @@ GetBlockDataInfo ( if (NewBlockData->Width > BlockData->Width) { BlockData->Width = NewBlockData->Width; } - FreePool (NewBlockData); + FreePool(NewBlockData); break; } else if (NewBlockData->Offset < BlockData->Offset) { // @@ -2068,7 +2068,7 @@ GetBlockDataInfo ( BlockData->Width = (UINT16) (NewBlockData->Offset + NewBlockData->Width - BlockData->Offset); } RemoveEntryList (Link->ForwardLink); - FreePool (NewBlockData); + FreePool(NewBlockData); continue; } Link = Link->ForwardLink; @@ -2080,7 +2080,7 @@ GetBlockDataInfo ( Done: if (DataBuffer != NULL) { - FreePool (DataBuffer); + FreePool(DataBuffer); } if (BlockArray != NULL) { @@ -2090,9 +2090,9 @@ Done: while (!IsListEmpty (&BlockArray->Entry)) { BlockData = BASE_CR (BlockArray->Entry.ForwardLink, IFR_BLOCK_DATA, Entry); RemoveEntryList (&BlockData->Entry); - FreePool (BlockData); + FreePool(BlockData); } - FreePool (BlockArray); + FreePool(BlockArray); } return Status; @@ -2140,7 +2140,7 @@ InternalHiiValidateCurrentSetting ( // if (StrStr (ConfigResp, L"&OFFSET=") != NULL) { Status = GetBlockDataInfo(ConfigResp, &CurrentBlockArray, &VarBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } NameValueType = FALSE; @@ -2174,7 +2174,7 @@ InternalHiiValidateCurrentSetting ( ); if (VarBuffer != NULL) { - FreePool (VarBuffer); + FreePool(VarBuffer); } if (CurrentBlockArray != NULL) { @@ -2184,9 +2184,9 @@ InternalHiiValidateCurrentSetting ( while (!IsListEmpty (&CurrentBlockArray->Entry)) { BlockData = BASE_CR (CurrentBlockArray->Entry.ForwardLink, IFR_BLOCK_DATA, Entry); RemoveEntryList (&BlockData->Entry); - FreePool (BlockData); + FreePool(BlockData); } - FreePool (CurrentBlockArray); + FreePool(CurrentBlockArray); } return Status; @@ -2309,7 +2309,7 @@ InternalHiiIfrValueAction ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -2331,7 +2331,7 @@ InternalHiiIfrValueAction ( } StringPtr += StrLen (L"GUID="); Status = InternalHiiGetBufferFromString (StringPtr, GUID_CONFIG_STRING_TYPE, (UINT8 **) &VarGuid); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2347,7 +2347,7 @@ InternalHiiIfrValueAction ( } StringPtr += StrLen (L"&NAME="); Status = InternalHiiGetBufferFromString (StringPtr, NAME_CONFIG_STRING_TYPE, (UINT8 **) &VarName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2363,7 +2363,7 @@ InternalHiiIfrValueAction ( } StringPtr += StrLen (L"&PATH="); Status = InternalHiiGetBufferFromString (StringPtr, PATH_CONFIG_STRING_TYPE, (UINT8 **) &DevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2372,7 +2372,7 @@ InternalHiiIfrValueAction ( // TempDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &TempDevicePath, &DriverHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2393,7 +2393,7 @@ InternalHiiIfrValueAction ( } HiiHandle = HiiHandleBuffer[Index]; - FreePool (HiiHandleBuffer); + FreePool(HiiHandleBuffer); if (HiiHandle == NULL) { // @@ -2430,7 +2430,7 @@ InternalHiiIfrValueAction ( // Get PackageList on HiiHandle // Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, HiiHandle, &PackageListLength, HiiPackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2451,7 +2451,7 @@ InternalHiiIfrValueAction ( // // The required setting can't be found. So, it is not required to be validated and set. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_SUCCESS; goto NextConfigAltResp; } @@ -2478,7 +2478,7 @@ InternalHiiIfrValueAction ( Status = InternalHiiValidateCurrentSetting (ConfigResp, HiiPackageList, PackageListLength, VarGuid, VarName, HiiHandle); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2487,25 +2487,25 @@ NextConfigAltResp: // Free the allocated pacakge buffer and the got ConfigResp string. // if (HiiPackageList != NULL) { - FreePool (HiiPackageList); + FreePool(HiiPackageList); HiiPackageList = NULL; } if (ConfigResp != NULL) { - FreePool (ConfigResp); + FreePool(ConfigResp); ConfigResp = NULL; } // // Free the allocated buffer. // - FreePool (VarGuid); + FreePool(VarGuid); VarGuid = NULL; - FreePool (VarName); + FreePool(VarName); VarName = NULL; - FreePool (DevicePath); + FreePool(DevicePath); DevicePath = NULL; // @@ -2549,7 +2549,7 @@ NextConfigAltResp: // // Free the allocated ConfigAltHdr string // - FreePool (ConfigAltHdr); + FreePool(ConfigAltHdr); if (*StringPtr == L'\0') { break; } @@ -2570,30 +2570,30 @@ NextConfigAltResp: Done: if (VarGuid != NULL) { - FreePool (VarGuid); + FreePool(VarGuid); } if (VarName != NULL) { - FreePool (VarName); + FreePool(VarName); } if (DevicePath != NULL) { - FreePool (DevicePath); + FreePool(DevicePath); } if (ConfigResp != NULL) { - FreePool (ConfigResp); + FreePool(ConfigResp); } if (ConfigAltResp != NULL) { - FreePool (ConfigAltResp); + FreePool(ConfigAltResp); } if (HiiPackageList != NULL) { - FreePool (HiiPackageList); + FreePool(HiiPackageList); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -2777,7 +2777,7 @@ HiiIsConfigHdrMatch ( // // Free the string // - FreePool (CompareConfigHdr); + FreePool(CompareConfigHdr); return Result; } @@ -2831,7 +2831,7 @@ HiiGetBrowserData ( // // Free the allocated buffer // - FreePool (ResultsData); + FreePool(ResultsData); if (ConfigResp == NULL) { return FALSE; } @@ -2849,9 +2849,9 @@ HiiGetBrowserData ( // // Free the allocated buffer // - FreePool (ConfigResp); + FreePool(ConfigResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -2925,7 +2925,7 @@ HiiSetBrowserData ( // Convert to // ConfigResp = InternalHiiBlockToConfig (ConfigRequest, Buffer, BufferSize); - FreePool (ConfigRequest); + FreePool(ConfigRequest); if (ConfigResp == NULL) { return FALSE; } @@ -2934,7 +2934,7 @@ HiiSetBrowserData ( // Set data in the uncommitted browser state information // ResultsData = InternalHiiBrowserCallback (VariableGuid, VariableName, ConfigResp + StrLen(mConfigHdrTemplate) + 1); - FreePool (ConfigResp); + FreePool(ConfigResp); return (BOOLEAN)(ResultsData != NULL); } @@ -2989,7 +2989,7 @@ HiiAllocateOpCodeHandle ( } OpCodeBuffer->Buffer = (UINT8 *)AllocatePool (HII_LIB_OPCODE_ALLOCATION_SIZE); if (OpCodeBuffer->Buffer == NULL) { - FreePool (OpCodeBuffer); + FreePool(OpCodeBuffer); return NULL; } OpCodeBuffer->BufferSize = HII_LIB_OPCODE_ALLOCATION_SIZE; @@ -3019,9 +3019,9 @@ HiiFreeOpCodeHandle ( OpCodeBuffer = (HII_LIB_OPCODE_BUFFER *)OpCodeHandle; if (OpCodeBuffer->Buffer != NULL) { - FreePool (OpCodeBuffer->Buffer); + FreePool(OpCodeBuffer->Buffer); } - FreePool (OpCodeBuffer); + FreePool(OpCodeBuffer); } /** @@ -4382,7 +4382,7 @@ HiiUpdateForm ( } Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, HiiHandle, &BufferSize, HiiPackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Finish; } @@ -4472,15 +4472,15 @@ HiiUpdateForm ( Finish: if (HiiPackageList != NULL) { - FreePool (HiiPackageList); + FreePool(HiiPackageList); } if (UpdatePackageList != NULL) { - FreePool (UpdatePackageList); + FreePool(UpdatePackageList); } if (TempPackage != NULL) { - FreePool (TempPackage); + FreePool(TempPackage); } return Status; diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiString.c b/MdeModulePkg/Library/UefiHiiLib/HiiString.c index 498f245dc..08f42228f 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiString.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiString.c @@ -120,7 +120,7 @@ HiiSetString ( // // If there was an error, then break out of the loop and return a StringId of 0 // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -128,9 +128,9 @@ HiiSetString ( // // Free the buffer of supported languages // - FreePool (AllocatedLanguages); + FreePool(AllocatedLanguages); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return (EFI_STRING_ID)(0); } else { return StringId; @@ -184,7 +184,7 @@ HiiGetPackageString ( } HiiHandle = HiiHandleBuffer[0]; - FreePool (HiiHandleBuffer); + FreePool(HiiHandleBuffer); return HiiGetString (HiiHandle, StringId, Language); } @@ -319,11 +319,11 @@ HiiGetString ( &StringSize, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free the buffer and return NULL if the supported languages can not be retrieved. // - FreePool (String); + FreePool(String); String = NULL; } @@ -332,13 +332,13 @@ Error: // Free allocated buffers // if (SupportedLanguages != NULL) { - FreePool (SupportedLanguages); + FreePool(SupportedLanguages); } if (PlatformLanguage != NULL) { - FreePool (PlatformLanguage); + FreePool(PlatformLanguage); } if (BestLanguage != NULL) { - FreePool (BestLanguage); + FreePool(BestLanguage); } // diff --git a/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c b/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c index b08c8e5e0..8ed49b690 100644 --- a/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c +++ b/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c @@ -85,19 +85,19 @@ UefiHiiServicesLibConstructor ( // Retrieve the pointer to the UEFI HII String Protocol // /* Status = */gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &gHiiString); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // Retrieve the pointer to the UEFI HII Database Protocol // /* Status = */gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &gHiiDatabase); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // Retrieve the pointer to the UEFI HII Config Routing Protocol // /* Status = */gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &gHiiConfigRouting); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // Retrieve the pointer to the optional UEFI HII Font Protocol diff --git a/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/DxeMemoryProfileLib.c b/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/DxeMemoryProfileLib.c index fadf0b7f6..6f0c4b5e6 100644 --- a/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/DxeMemoryProfileLib.c +++ b/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/DxeMemoryProfileLib.c @@ -40,7 +40,7 @@ MemoryProfileLibConstructor ( NULL, (VOID **) &mLibProfileProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mLibProfileProtocol = NULL; } diff --git a/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/MemoryAllocationLib.c b/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/MemoryAllocationLib.c index ca63df00a..0c2d4cf6b 100644 --- a/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/MemoryAllocationLib.c +++ b/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/MemoryAllocationLib.c @@ -45,7 +45,7 @@ InternalAllocatePages ( } Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return (VOID *) (UINTN) Memory; @@ -184,7 +184,7 @@ FreePages ( ASSERT (Pages != 0); Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -239,7 +239,7 @@ InternalAllocateAlignedPages ( ASSERT (RealPages > Pages); Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -249,7 +249,7 @@ InternalAllocateAlignedPages ( // Free first unaligned page(s). // Status = gBS->FreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Memory = AlignedMemory + EFI_PAGES_TO_SIZE (Pages); UnalignedPages = RealPages - Pages - UnalignedPages; @@ -258,14 +258,14 @@ InternalAllocateAlignedPages ( // Free last unaligned page(s). // Status = gBS->FreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } else { // // Do not over-allocate pages in this case. // Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = (UINTN) Memory; @@ -424,7 +424,7 @@ FreeAlignedPages ( ASSERT (Pages != 0); Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -450,7 +450,7 @@ InternalAllocatePool ( VOID *Memory; Status = gBS->AllocatePool (MemoryType, AllocationSize, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Memory = NULL; } return Memory; @@ -883,7 +883,7 @@ InternalReallocatePool ( NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); - FreePool (OldBuffer); + FreePool(OldBuffer); } return NewBuffer; } @@ -1039,13 +1039,13 @@ ReallocateReservedPool ( **/ VOID EFIAPI -FreePool ( +FreePool( IN VOID *Buffer ) { EFI_STATUS Status; - Status = gBS->FreePool (Buffer); - ASSERT_EFI_ERROR (Status); + Status = gBS->FreePool(Buffer); + ASSERT_EFI_ERROR(Status); } diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c index 3d787b8f7..e0708b4c8 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c @@ -384,7 +384,7 @@ InternalVarCheckAllocatePool ( VOID *Memory; Status = gBS->AllocatePool (MemoryType, AllocationSize, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Memory = NULL; } return Memory; @@ -433,14 +433,14 @@ InternalVarCheckAllocateZeroPool ( **/ VOID EFIAPI -InternalVarCheckFreePool ( +InternalVarCheckFreePool( IN VOID *Buffer ) { EFI_STATUS Status; - Status = gBS->FreePool (Buffer); - ASSERT_EFI_ERROR (Status); + Status = gBS->FreePool(Buffer); + ASSERT_EFI_ERROR(Status); } /** @@ -476,7 +476,7 @@ InternalVarCheckReallocatePool ( NewBuffer = InternalVarCheckAllocateZeroPool (NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); - InternalVarCheckFreePool (OldBuffer); + InternalVarCheckFreePool(OldBuffer); } return NewBuffer; } @@ -516,7 +516,7 @@ MergeHiiQuestion ( // Do not to merge Hii Question from Fv to Hii Question from Hii Database. // if (FromFv) { - InternalVarCheckFreePool (HiiQuestion); + InternalVarCheckFreePool(HiiQuestion); return; } @@ -609,7 +609,7 @@ MergeHiiQuestion ( } HiiVariableNode->HiiQuestionArray[ArrayIndex] = NewHiiQuestion; - InternalVarCheckFreePool (HiiQuestion1); + InternalVarCheckFreePool(HiiQuestion1); } break; @@ -734,7 +734,7 @@ MergeHiiQuestion ( } HiiVariableNode->HiiQuestionArray[ArrayIndex] = NewHiiQuestion; - InternalVarCheckFreePool (HiiQuestion1); + InternalVarCheckFreePool(HiiQuestion1); } break; @@ -748,7 +748,7 @@ MergeHiiQuestion ( // // Hii Question 2 has been merged with Hii Question 1. // - InternalVarCheckFreePool (HiiQuestion2); + InternalVarCheckFreePool(HiiQuestion2); } /** @@ -1439,12 +1439,12 @@ DestroyHiiVariableNode ( // for (Index = 0; Index < HiiVariableNode->HiiVariable->Size * (UINTN) 8; Index++) { if (HiiVariableNode->HiiQuestionArray[Index] != NULL) { - InternalVarCheckFreePool (HiiVariableNode->HiiQuestionArray[Index]); + InternalVarCheckFreePool(HiiVariableNode->HiiQuestionArray[Index]); } } - InternalVarCheckFreePool (HiiVariableNode->HiiQuestionArray); - InternalVarCheckFreePool (HiiVariableNode->HiiVariable); - InternalVarCheckFreePool (HiiVariableNode); + InternalVarCheckFreePool(HiiVariableNode->HiiQuestionArray); + InternalVarCheckFreePool(HiiVariableNode->HiiVariable); + InternalVarCheckFreePool(HiiVariableNode); } } @@ -1571,7 +1571,7 @@ VarCheckHiiGen ( DestroyHiiVariableNode (); if (mVarName != NULL) { - InternalVarCheckFreePool (mVarName); + InternalVarCheckFreePool(mVarName); } #ifdef DUMP_VAR_CHECK_HII diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h index 02783c431..c1196b366 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h @@ -69,7 +69,7 @@ InternalVarCheckAllocateZeroPool ( **/ VOID EFIAPI -InternalVarCheckFreePool ( +InternalVarCheckFreePool( IN VOID *Buffer ); diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c index f32499e34..0b93efc5e 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c @@ -185,7 +185,7 @@ ParseFfs ( &FileAttributes, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -199,9 +199,9 @@ ParseFfs ( &Size, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = SearchVfrBinInFfs (Buffer, 0, Size, &VfrBinBaseAddress, &NumberofMatchingVfrBin); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SectionBuffer = NULL; Status = Fv2->ReadSection ( Fv2, @@ -212,7 +212,7 @@ ParseFfs ( &SectionSize, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO , "FfsNameGuid - %g\n", DriverGuid)); DEBUG ((DEBUG_INFO , "NumberofMatchingVfrBin - 0x%02x\n", NumberofMatchingVfrBin)); @@ -225,13 +225,13 @@ ParseFfs ( VarCheckParseHiiPackage ((UINT8 *) (UINTN) SectionBuffer + VfrBinBaseAddress[VfrBinIndex] + sizeof (UINT32), TRUE); } - FreePool (SectionBuffer); + FreePool(SectionBuffer); } - InternalVarCheckFreePool (VfrBinBaseAddress); + InternalVarCheckFreePool(VfrBinBaseAddress); } - FreePool (Buffer); + FreePool(Buffer); } return TRUE; @@ -270,7 +270,7 @@ ParseFv ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -284,7 +284,7 @@ ParseFv ( &gEfiFirmwareVolume2ProtocolGuid, (VOID **) &Fv2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DEBUG_CODE ( EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *Fvb2; @@ -296,9 +296,9 @@ ParseFv ( &gEfiFirmwareVolumeBlock2ProtocolGuid, (VOID **) &Fvb2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = Fvb2->GetPhysicalAddress (Fvb2, &FvAddress); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO , "FvAddress - 0x%08x\n", FvAddress)); FvSize = ((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) FvAddress)->FvLength; DEBUG ((DEBUG_INFO , "FvSize - 0x%08x\n", FvSize)); @@ -322,14 +322,14 @@ ParseFv ( &FileAttributes, &Size ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } ParseFfs (Fv2, &NameGuid); } - InternalVarCheckFreePool (Key); + InternalVarCheckFreePool(Key); } else { // // Only parse drivers in the VFR drivers list. @@ -343,13 +343,13 @@ ParseFv ( // Found the driver in the FV. // RemoveEntryList (&VfrDriverInfo->Link); - InternalVarCheckFreePool (VfrDriverInfo); + InternalVarCheckFreePool(VfrDriverInfo); } } } } - FreePool (HandleBuffer); + FreePool(HandleBuffer); } /** @@ -392,7 +392,7 @@ DestroyVfrDriverList ( VfrDriverLink = mVfrDriverList.ForwardLink; VfrDriverInfo = VAR_CHECK_VFR_DRIVER_INFO_FROM_LINK (VfrDriverLink); RemoveEntryList (&VfrDriverInfo->Link); - InternalVarCheckFreePool (VfrDriverInfo); + InternalVarCheckFreePool(VfrDriverInfo); } } diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromHii.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromHii.c index b113ff8fa..d7ef67dfb 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromHii.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromHii.c @@ -27,7 +27,7 @@ VarCheckHiiGenFromHiiDatabase ( // Locate HII Database protocol // Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &HiiDatabase); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -43,14 +43,14 @@ VarCheckHiiGenFromHiiDatabase ( // Allocate buffer to hold the HII Database. // Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesData, EFI_SIZE_TO_PAGES (BufferSize), &BufferAddress); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Buffer = (VOID *) (UINTN) BufferAddress; // // Export HII Database into the buffer. // Status = HiiDatabase->ExportPackageLists (HiiDatabase, 0, &BufferSize, Buffer); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DEBUG ((DEBUG_INFO , "VarCheckHiiGenDxeFromHii - HII Database exported at 0x%x, size = 0x%x\n", Buffer, BufferSize)); diff --git a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c index 470d78244..66b9a369a 100644 --- a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c +++ b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c @@ -319,7 +319,7 @@ VarCheckLibInitializeAtEndOfDxe ( // mVarCheckLibEndOfDxeCallbackCount = 0; mVarCheckLibEndOfDxeCallbackMaxCount = 0; - FreePool ((VOID *) mVarCheckLibEndOfDxeCallback); + FreePool((VOID *) mVarCheckLibEndOfDxeCallback); mVarCheckLibEndOfDxeCallback = NULL; } @@ -332,7 +332,7 @@ VarCheckLibInitializeAtEndOfDxe ( // mVarCheckLibAddressPointerCount = 0; mVarCheckLibAddressPointerMaxCount = 0; - FreePool ((VOID *) mVarCheckLibAddressPointer); + FreePool((VOID *) mVarCheckLibAddressPointer); mVarCheckLibAddressPointer = NULL; } return NULL; @@ -528,8 +528,8 @@ VarCheckLibVariablePropertySet ( (UINTN) Entry ); - if (EFI_ERROR (Status)) { - FreePool (Entry); + if (EFI_ERROR(Status)) { + FreePool(Entry); } } @@ -655,7 +655,7 @@ VarCheckLibSetVariableCheck ( DataSize, Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "Variable Check handler fail %r - %g:%s\n", Status, VendorGuid, VariableName)); return Status; } diff --git a/MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLibNullClass.c b/MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLibNullClass.c index 9a3f9187c..6899ac6bb 100644 --- a/MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLibNullClass.c +++ b/MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLibNullClass.c @@ -422,7 +422,7 @@ LocateVarCheckPcdBin ( (VOID **) &VarCheckPcdBin, &VarCheckPcdBinSize ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // AllocateRuntimeZeroPool () from MemoryAllocateLib is used for runtime access // in SetVariable check handler. @@ -434,7 +434,7 @@ LocateVarCheckPcdBin ( // ASSERT ((((UINTN) mVarCheckPcdBin) & (HEADER_ALIGNMENT - 1)) == 0); mVarCheckPcdBinSize = VarCheckPcdBinSize; - FreePool (VarCheckPcdBin); + FreePool(VarCheckPcdBin); DEBUG ((EFI_D_INFO, "VarCheckPcdBin - at 0x%x size = 0x%x\n", mVarCheckPcdBin, mVarCheckPcdBinSize)); diff --git a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c index e3bf04a54..8f84e6178 100644 --- a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c +++ b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c @@ -854,7 +854,7 @@ SetVariableCheckHandlerUefiDefined ( DataSize, Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "UEFI Variable Check function fail %r - %g:%s\n", Status, VendorGuid, VariableName)); return Status; } diff --git a/MdeModulePkg/Logo/Logo.c b/MdeModulePkg/Logo/Logo.c index c647253ec..675422db8 100644 --- a/MdeModulePkg/Logo/Logo.c +++ b/MdeModulePkg/Logo/Logo.c @@ -107,14 +107,14 @@ InitializeLogo ( NULL, (VOID **) &HiiDatabase ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->LocateProtocol ( &gEfiHiiImageExProtocolGuid, NULL, (VOID **) &mHiiImageEx ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Retrieve HII package list from ImageHandle @@ -127,7 +127,7 @@ InitializeLogo ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "HII Image Package with logo not found in PE/COFF resource section\n")); return Status; } @@ -141,7 +141,7 @@ InitializeLogo ( NULL, &mHiiHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Handle = NULL; Status = gBS->InstallMultipleProtocolInterfaces ( &Handle, diff --git a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c index 8d376af41..8c14253ea 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c +++ b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c @@ -57,7 +57,7 @@ LocateFvInstanceWithTables ( &NumberOfHandles, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Defined errors at this time are not found and out of resources. // @@ -80,7 +80,7 @@ LocateFvInstanceWithTables ( &gEfiFirmwareVolume2ProtocolGuid, (VOID**) &FvInstance ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // See if it has the ACPI storage file @@ -112,7 +112,7 @@ LocateFvInstanceWithTables ( // // Free any allocated buffers // - gBS->FreePool (HandleBuffer); + gBS->FreePool(HandleBuffer); return Status; } @@ -183,7 +183,7 @@ AcpiPlatformEntryPoint ( // Find the AcpiTable protocol // Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID**)&AcpiTable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -191,7 +191,7 @@ AcpiPlatformEntryPoint ( // Locate the firmware volume protocol // Status = LocateFvInstanceWithTables (&FwVol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } // @@ -235,7 +235,7 @@ AcpiPlatformEntryPoint ( // // Free memory allocated by ReadSection // - gBS->FreePool (CurrentTable); + gBS->FreePool(CurrentTable); if (EFI_ERROR(Status)) { return EFI_ABORTED; diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c index b1cba20c8..70f5ff926 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c @@ -166,7 +166,7 @@ SdtNotifyAcpiList ( &AcpiTableInstance->TableList, &Table ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Find the notify @@ -350,7 +350,7 @@ SdtUnregisterNotify ( // Remove it from list and free the node. // RemoveEntryList (&(CurrentNotifyList->Link)); - FreePool (CurrentNotifyList); + FreePool(CurrentNotifyList); return EFI_SUCCESS; } @@ -438,7 +438,7 @@ SdtOpenSdtTable ( &AcpiTableInstance->TableList, &Table ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -528,7 +528,7 @@ SdtOpenEx ( AmlHandle->Size = AmlGetObjectSize (AmlByteEncoding, Buffer, BufferSize); if (AmlHandle->Size == 0) { - FreePool (AmlHandle); + FreePool(AmlHandle); return EFI_INVALID_PARAMETER; } @@ -568,7 +568,7 @@ Open ( } Status = SdtGetMaxAmlBufferSize (Buffer, &MaxSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -610,12 +610,12 @@ Close ( // if (AmlHandle->Modified) { Status = SdtUpdateAmlChecksum (AmlHandle->Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } } - FreePool (AmlHandle); + FreePool(AmlHandle); return EFI_SUCCESS; } @@ -677,7 +677,7 @@ GetOption ( // Parse option // Status = AmlParseOptionHandleCommon (AmlHandle, (AML_OP_PARSE_INDEX)Index, DataType, (VOID **)Data, DataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -741,7 +741,7 @@ SetOption ( // Parse option // Status = AmlParseOptionHandleCommon (AmlHandle, (AML_OP_PARSE_INDEX)Index, &DataType, &OrgData, &OrgDataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (DataType == EFI_ACPI_DATA_TYPE_NONE) { @@ -816,7 +816,7 @@ GetChild ( return EFI_INVALID_PARAMETER; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (Buffer == NULL) { @@ -855,7 +855,7 @@ SdtFindPathFromNonRoot ( // For non-root handle, we need search from THIS node instead of ROOT. // Status = AmlFindPath (AmlHandle, AmlPath, &Buffer, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (Buffer == NULL) { @@ -929,7 +929,7 @@ SdtFindPathFromRoot ( ChildHandle = NULL; while (TRUE) { Status = GetChild (HandleIn, &ChildHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -946,7 +946,7 @@ SdtFindPathFromRoot ( // AmlHandle = (EFI_AML_HANDLE *)ChildHandle; Status = AmlFindPath (AmlHandle, AmlPath, &Buffer, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -955,7 +955,7 @@ SdtFindPathFromRoot ( // Great! Find it, open // Status = SdtOpenEx (Buffer, (UINTN)AmlHandle->Buffer + AmlHandle->Size - (UINTN)Buffer, HandleOut); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } // @@ -1029,7 +1029,7 @@ FindPath ( Status = EFI_INVALID_PARAMETER; } - FreePool (AmlPath); + FreePool(AmlPath); return Status; } diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.c index 1d91737cb..a19bb991b 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.c @@ -51,8 +51,8 @@ InitializeAcpiTableDxe ( // Call all constructors per produced protocols // Status = AcpiTableAcpiTableConstructor (PrivateData); - if (EFI_ERROR (Status)) { - gBS->FreePool (PrivateData); + if (EFI_ERROR(Status)) { + gBS->FreePool(PrivateData); return EFI_LOAD_ERROR; } @@ -77,7 +77,7 @@ InitializeAcpiTableDxe ( NULL ); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c index ad7baf820..035051a77 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c @@ -163,14 +163,14 @@ PublishTables ( // if ((Version & EFI_ACPI_TABLE_VERSION_1_0B) != 0) { Status = gBS->InstallConfigurationTable (&gEfiAcpi10TableGuid, AcpiTableInstance->Rsdp1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } } if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) { Status = gBS->InstallConfigurationTable (&gEfiAcpiTableGuid, AcpiTableInstance->Rsdp3); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } } @@ -240,19 +240,19 @@ InstallAcpiTable ( Version, TableKey ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PublishTables ( AcpiTableInstance, Version ); } - FreePool (AcpiTableBufferConst); + FreePool(AcpiTableBufferConst); // // Add a new table successfully, notify registed callback // if (FeaturePcdGet (PcdInstallAcpiSdtProtocol)) { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SdtNotifyAcpiList ( AcpiTableInstance, Version, @@ -301,14 +301,14 @@ UninstallAcpiTable ( Version, TableKey ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PublishTables ( AcpiTableInstance, Version ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } else { return EFI_SUCCESS; @@ -372,7 +372,7 @@ ReallocateAcpiTableBuffer ( &PageAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -535,8 +535,8 @@ AddTableToList ( // // Check return value from memory alloc. // - if (EFI_ERROR (Status)) { - gBS->FreePool (CurrentTableList); + if (EFI_ERROR(Status)) { + gBS->FreePool(CurrentTableList); return EFI_OUT_OF_RESOURCES; } // @@ -576,7 +576,7 @@ AddTableToList ( ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0 && AcpiTableInstance->Fadt3 != NULL) ) { gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages); - gBS->FreePool (CurrentTableList); + gBS->FreePool(CurrentTableList); return EFI_ACCESS_DENIED; } // @@ -730,7 +730,7 @@ AddTableToList ( ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0 && AcpiTableInstance->Facs3 != NULL) ) { gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages); - gBS->FreePool (CurrentTableList); + gBS->FreePool(CurrentTableList); return EFI_ACCESS_DENIED; } // @@ -814,7 +814,7 @@ AddTableToList ( ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0 && AcpiTableInstance->Dsdt3 != NULL) ) { gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages); - gBS->FreePool (CurrentTableList); + gBS->FreePool(CurrentTableList); return EFI_ACCESS_DENIED; } // @@ -940,7 +940,7 @@ AddTableToList ( // if (AcpiTableInstance->NumberOfTableEntries1 >= mEfiAcpiMaxNumTables) { Status = ReallocateAcpiTableBuffer (AcpiTableInstance); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } CurrentRsdtEntry = (UINT32 *) ( @@ -973,7 +973,7 @@ AddTableToList ( // if (AcpiTableInstance->NumberOfTableEntries3 >= mEfiAcpiMaxNumTables) { Status = ReallocateAcpiTableBuffer (AcpiTableInstance); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) { @@ -1451,7 +1451,7 @@ DeleteTable ( // gBS->FreePages (Table->PageAddress, Table->NumberOfPages); RemoveEntryList (&(Table->Link)); - gBS->FreePool (Table); + gBS->FreePool(Table); } // // Done @@ -1497,14 +1497,14 @@ RemoveTableFromList ( &AcpiTableInstance->TableList, &Table ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } // // Remove the table // Status = DeleteTable (AcpiTableInstance, Version, Table); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } // @@ -1702,7 +1702,7 @@ AcpiTableAcpiTableConstructor ( &PageAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -1745,7 +1745,7 @@ AcpiTableAcpiTableConstructor ( &PageAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)AcpiTableInstance->Rsdp1, EFI_SIZE_TO_PAGES (RsdpTableSize)); return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlChild.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlChild.c index 562271807..fd4175190 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlChild.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlChild.c @@ -131,7 +131,7 @@ AmlGetChildFromOptionList ( (VOID **)&Data, &DataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (DataType == EFI_ACPI_DATA_TYPE_NONE) { @@ -202,7 +202,7 @@ AmlGetChildFromObjectChildList ( // Now, we get the last node. // Status = AmlGetOffsetAfterLastOption (AmlParentHandle, &CurrentBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -260,7 +260,7 @@ AmlGetChildFromNonRoot ( // 1. Get Option // Status = AmlGetChildFromOptionList (AmlParentHandle, AmlHandle, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (*Buffer != NULL) { diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c index 8139f3ab4..bde6dba84 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c @@ -319,7 +319,7 @@ AmlConstructNodeListForChild ( // Now, we get the last node. // Status = AmlGetOffsetAfterLastOption (AmlHandle, &CurrentBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -331,7 +331,7 @@ AmlConstructNodeListForChild ( // Find the child node. // Status = SdtOpenEx (CurrentBuffer, (UINTN)Buffer + BufferSize - (UINTN)CurrentBuffer, (EFI_ACPI_HANDLE *)&AmlChildHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No child found, break now. // @@ -346,7 +346,7 @@ AmlConstructNodeListForChild ( AmlRootNodeList, AmlParentNodeList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -453,7 +453,7 @@ AmlDestructNodeList ( // // Done. // - FreePool (AmlParentNodeList); + FreePool(AmlParentNodeList); return ; } @@ -538,7 +538,7 @@ AmlFindPath ( AmlRootNodeList, // Root AmlRootNodeList // Parent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlOption.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlOption.c index d0374c5de..999d18010 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlOption.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlOption.c @@ -64,7 +64,7 @@ AmlParseOptionTerm ( break; case AML_NAME: Status = AmlGetNameStringSize (Buffer, DataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } break; @@ -84,7 +84,7 @@ AmlParseOptionTerm ( *DataType = AmlTypeToAcpiType (AML_NAME); } Status = AmlGetNameStringSize (Buffer, DataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } break; @@ -167,7 +167,7 @@ AmlParseOptionCommon ( // return NameString size // Status = AmlGetNameStringSize (Buffer, DataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } if (*DataSize > MaxBufferSize) { @@ -235,7 +235,7 @@ AmlParseOptionCommon ( Data, DataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -306,7 +306,7 @@ AmlGetObjectSize ( NULL, &DataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return 0; } else { return DataSize; @@ -358,7 +358,7 @@ AmlGetObjectName ( &NameString, &NameSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } ASSERT (DataType == EFI_ACPI_DATA_TYPE_NAME_STRING); @@ -393,7 +393,7 @@ AmlGetOffsetAfterLastOption ( &Data, &DataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } diff --git a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c index d16872e14..5a7e770f7 100644 --- a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c +++ b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c @@ -267,19 +267,19 @@ SetBootLogo2 ( // The Boot Graphics Resource Table only has 32-bit fields for these values. // Status = SafeUintnToUint32 (DestinationX, &Result32); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } Status = SafeUintnToUint32 (DestinationY, &Result32); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } Status = SafeUintnToUint32 (Width, &Result32); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } Status = SafeUintnToUint32 (Height, &Result32); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } @@ -292,7 +292,7 @@ SetBootLogo2 ( Height, &BufferSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } Status = SafeUintnMult ( @@ -300,7 +300,7 @@ SetBootLogo2 ( sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), &BufferSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -313,7 +313,7 @@ SetBootLogo2 ( // Free old logo buffer // if (mLogoBltBuffer != NULL) { - FreePool (mLogoBltBuffer); + FreePool(mLogoBltBuffer); mLogoBltBuffer = NULL; } @@ -427,7 +427,7 @@ BgrtReadyToBootEventNotify ( NULL, (VOID **) &AcpiTableProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -448,7 +448,7 @@ BgrtReadyToBootEventNotify ( AcpiTableProtocol, mBootGraphicsResourceTableKey ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } } @@ -467,7 +467,7 @@ BgrtReadyToBootEventNotify ( // ImageBuffer = (UINT8 *)(UINTN)mBootGraphicsResourceTableTemplate.ImageAddress; if (ImageBuffer != NULL) { - FreePool (ImageBuffer); + FreePool(ImageBuffer); } // @@ -482,14 +482,14 @@ BgrtReadyToBootEventNotify ( &ImageBuffer, &BmpSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } // // Free the logo buffer // - FreePool (mLogoBltBuffer); + FreePool(mLogoBltBuffer); mLogoBltBuffer = NULL; // @@ -528,7 +528,7 @@ BgrtReadyToBootEventNotify ( sizeof (EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE), &mBootGraphicsResourceTableKey ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -583,7 +583,7 @@ BootGraphicsDxeEntryPoint ( &mBootLogo2ProtocolTemplate, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register notify function to install BGRT on ReadyToBoot Event. @@ -596,7 +596,7 @@ BootGraphicsDxeEntryPoint ( &gEfiEventReadyToBootGuid, &mBootGraphicsReadyToBootEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c index 1e3c5b849..65218fa95 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c @@ -36,7 +36,7 @@ SetIdtEntry ( // Setup the default CPU exception handlers // Status = InitializeCpuExceptionHandlers (NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DEBUG_CODE ( // diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c index b2ae9ec3a..c70383a9d 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c @@ -70,9 +70,9 @@ S3BootScriptExecutorEntryFunction ( // // If invalid script table or opcode in S3 boot script table. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { CpuDeadLoop (); return Status; } @@ -230,7 +230,7 @@ RegisterMemoryProfileImage ( FilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)TempBuffer; Status = gBS->LocateProtocol (&gEdkiiMemoryProfileGuid, NULL, (VOID **) &ProfileProtocol); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { EfiInitializeFwVolDevicepathNode (FilePath, FileName); SetDevicePathEndNode (FilePath + 1); @@ -270,7 +270,7 @@ ReadyToLockEventNotify ( EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc; Status = gBS->LocateProtocol (&gEfiDxeSmmReadyToLockProtocolGuid, NULL, &Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -284,7 +284,7 @@ ReadyToLockEventNotify ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Reload BootScriptExecutor image itself to RESERVED mem @@ -296,14 +296,14 @@ ReadyToLockEventNotify ( (VOID **) &Buffer, &BufferSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ImageContext.Handle = Buffer; ImageContext.ImageRead = PeCoffLoaderImageReadFromMemory; // // Get information about the image being loaded // Status = PeCoffLoaderGetImageInfo (&ImageContext); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (ImageContext.SectionAlignment > EFI_PAGE_SIZE) { Pages = EFI_SIZE_TO_PAGES ((UINTN) (ImageContext.ImageSize + ImageContext.SectionAlignment)); } else { @@ -316,13 +316,13 @@ ReadyToLockEventNotify ( Pages, &FfsBuffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Make sure that the buffer can be used to store code. // Status = gDS->GetMemorySpaceDescriptor (FfsBuffer, &MemDesc); - if (!EFI_ERROR (Status) && (MemDesc.Attributes & EFI_MEMORY_XP) != 0) { + if (!EFI_ERROR(Status) && (MemDesc.Attributes & EFI_MEMORY_XP) != 0) { gDS->SetMemorySpaceAttributes ( FfsBuffer, EFI_PAGES_TO_SIZE (Pages), @@ -340,18 +340,18 @@ ReadyToLockEventNotify ( // Load the image to our new buffer // Status = PeCoffLoaderLoadImage (&ImageContext); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Relocate the image in our new buffer // Status = PeCoffLoaderRelocateImage (&ImageContext); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Free the buffer allocated by ReadSection since the image has been relocated in the new buffer // - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); // // Flush the instruction cache so the image data is written before we execute it @@ -366,7 +366,7 @@ ReadyToLockEventNotify ( ); Status = ((EFI_IMAGE_ENTRY_POINT)(UINTN)(ImageContext.EntryPoint)) (NewImageHandle, gST); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Additional step for BootScript integrity @@ -377,10 +377,10 @@ ReadyToLockEventNotify ( (VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SetLockBoxAttributes (&mBootScriptExecutorImageGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); gBS->CloseEvent (Event); } @@ -428,7 +428,7 @@ BootScriptExecutorEntryPoint ( // be reloaded be itself.This is a work-around // Status = gBS->LocateProtocol (&gEfiCallerIdGuid, NULL, &DevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Create ReadyToLock event to reload BootScriptExecutor image // to RESERVED mem and save it to LockBox. @@ -465,7 +465,7 @@ BootScriptExecutorEntryPoint ( Pages, &BootScriptExecutorBuffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); EfiBootScriptExecutorVariable = (BOOT_SCRIPT_EXECUTOR_VARIABLE *)(UINTN)BootScriptExecutorBuffer; EfiBootScriptExecutorVariable->BootScriptExecutorEntrypoint = (UINTN) S3BootScriptExecutorEntryFunction ; @@ -475,7 +475,7 @@ BootScriptExecutorEntryPoint ( &BootScriptExecutorBuffer, sizeof(BootScriptExecutorBuffer) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Additional step for BootScript integrity @@ -486,10 +486,10 @@ BootScriptExecutorEntryPoint ( EfiBootScriptExecutorVariable, sizeof(*EfiBootScriptExecutorVariable) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SetLockBoxAttributes (&gEfiBootScriptExecutorContextGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return EFI_SUCCESS; diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c index 0d448cc60..53698ea04 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c @@ -147,7 +147,7 @@ SetIdtEntry ( // Setup the default CPU exception handlers // Status = InitializeCpuExceptionHandlers (NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DEBUG_CODE ( // diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c index 61a7704b3..db5c9eb0e 100644 --- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c +++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c @@ -202,7 +202,7 @@ FpdtAllocateS3PerformanceTableMemory ( if (!mLockBoxReady) { Status = gBS->LocateProtocol (&gEfiLockBoxProtocolGuid, NULL, &Interface); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // LockBox services has been ready. // @@ -212,7 +212,7 @@ FpdtAllocateS3PerformanceTableMemory ( if (mAcpiS3PerformanceTable == NULL) { Status = gBS->LocateProtocol (&gEfiVariableArchProtocolGuid, NULL, &Interface); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Try to allocate the same runtime buffer as last time boot. // @@ -225,14 +225,14 @@ FpdtAllocateS3PerformanceTableMemory ( &Size, &PerformanceVariable ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->AllocatePages ( AllocateAddress, EfiReservedMemoryType, EFI_SIZE_TO_PAGES (sizeof (S3_PERFORMANCE_TABLE)), &PerformanceVariable.S3PerformanceTablePointer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { mAcpiS3PerformanceTable = (S3_PERFORMANCE_TABLE *) (UINTN) PerformanceVariable.S3PerformanceTablePointer; } } @@ -263,7 +263,7 @@ FpdtAllocateS3PerformanceTableMemory ( &S3PerformanceTablePointer, sizeof (EFI_PHYSICAL_ADDRESS) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -288,7 +288,7 @@ InstallFirmwarePerformanceDataTable ( // Get AcpiTable Protocol. // Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **) &AcpiTableProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -309,14 +309,14 @@ InstallFirmwarePerformanceDataTable ( &Size, &PerformanceVariable ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->AllocatePages ( AllocateAddress, EfiReservedMemoryType, EFI_SIZE_TO_PAGES (BootPerformanceDataSize), &PerformanceVariable.BootPerformanceTablePointer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { mAcpiBootPerformanceTable = (BOOT_PERFORMANCE_TABLE *) (UINTN) PerformanceVariable.BootPerformanceTablePointer; } } @@ -379,7 +379,7 @@ InstallFirmwarePerformanceDataTable ( mFirmwarePerformanceTableTemplate.Header.Length, &mFirmwarePerformanceTableTemplateKey ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (mAcpiBootPerformanceTable != NULL) { FreePages (mAcpiBootPerformanceTable, EFI_SIZE_TO_PAGES (BootPerformanceDataSize)); } @@ -612,13 +612,13 @@ FirmwarePerformanceDxeEntryPoint ( // Get Report Status Code Handler Protocol. // Status = gBS->LocateProtocol (&gEfiRscHandlerProtocolGuid, NULL, (VOID **) &mRscHandlerProtocol); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register report status code listener for OS Loader load and start. // Status = mRscHandlerProtocol->Register (FpdtStatusCodeListenerDxe, TPL_HIGH_LEVEL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register the notify function to update FPDT on ExitBootServices Event. @@ -631,7 +631,7 @@ FirmwarePerformanceDxeEntryPoint ( &gEfiEventExitBootServicesGuid, &mExitBootServicesEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Retrieve GUID HOB data that contains the ResetEnd. diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c index 493d09c78..482497bf8 100644 --- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c +++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c @@ -95,7 +95,7 @@ FpdtStatusCodeListenerPei ( S3PerformanceTablePointer = 0; VarSize = sizeof (EFI_PHYSICAL_ADDRESS); Status = RestoreLockBox (&gFirmwarePerformanceS3PointerGuid, &S3PerformanceTablePointer, &VarSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); AcpiS3PerformanceTable = (S3_PERFORMANCE_TABLE *) (UINTN) S3PerformanceTablePointer; ASSERT (AcpiS3PerformanceTable != NULL); @@ -127,7 +127,7 @@ FpdtStatusCodeListenerPei ( &S3SuspendRecord, &VarSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); AcpiS3SuspendRecord->SuspendStart = S3SuspendRecord.SuspendStart; AcpiS3SuspendRecord->SuspendEnd = S3SuspendRecord.SuspendEnd; @@ -141,7 +141,7 @@ FpdtStatusCodeListenerPei ( NULL, (VOID **) &VariableServices ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Update S3 boot records into the basic boot performance table. @@ -155,7 +155,7 @@ FpdtStatusCodeListenerPei ( &VarSize, &PerformanceVariable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } BootPerformanceTable = (UINT8*) (UINTN) PerformanceVariable.BootPerformanceTablePointer; @@ -215,10 +215,10 @@ FirmwarePerformancePeiEntryPoint ( NULL, (VOID **) &RscHandler ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = RscHandler->Register (FpdtStatusCodeListenerPei); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return EFI_SUCCESS; diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c index d6c6e7693..776f5f133 100644 --- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c +++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c @@ -138,7 +138,7 @@ FpdtStatusCodeListenerSmm ( &S3SuspendRecord, sizeof (EFI_ACPI_5_0_FPDT_S3_SUSPEND_RECORD) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mS3SuspendLockBoxSaved = TRUE; } else { @@ -148,7 +148,7 @@ FpdtStatusCodeListenerSmm ( &S3SuspendRecord, sizeof (EFI_ACPI_5_0_FPDT_S3_SUSPEND_RECORD) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return EFI_SUCCESS; @@ -299,20 +299,20 @@ FirmwarePerformanceSmmEntryPoint ( NULL, (VOID **) &mRscHandlerProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register report status code listener for BootRecords and S3 Suspend Start and End. // Status = mRscHandlerProtocol->Register (FpdtStatusCodeListenerSmm); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register SMI handler. // Handle = NULL; Status = gSmst->SmiHandlerRegister (FpdtSmiHandler, &gEfiFirmwarePerformanceGuid, &Handle); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/AcpiS3ContextSave.c b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/AcpiS3ContextSave.c index e7cd2a12a..9a8cede67 100644 --- a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/AcpiS3ContextSave.c +++ b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/AcpiS3ContextSave.c @@ -60,7 +60,7 @@ AllocateMemoryBelow4G ( Pages, &Address ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Buffer = (VOID *) (UINTN) Address; ZeroMem (Buffer, Size); @@ -239,7 +239,7 @@ AcpiS3ContextSaveOnEndOfDxe ( DEBUG ((EFI_D_INFO, "AcpiS3ContextSave!\n")); Status = gBS->LocateProtocol (&gEfiLockBoxProtocolGuid, NULL, &Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO | EFI_D_WARN, "ACPI S3 context can't be saved without LockBox!\n")); goto Done; } @@ -268,10 +268,10 @@ AcpiS3ContextSaveOnEndOfDxe ( (VOID *)(UINTN)Idtr, (UINTN)sizeof(IA32_DESCRIPTOR) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SetLockBoxAttributes (&mAcpiS3IdtrProfileGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Allocate page table @@ -303,23 +303,23 @@ AcpiS3ContextSaveOnEndOfDxe ( &AcpiS3ContextBuffer, sizeof(AcpiS3ContextBuffer) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SaveLockBox ( &gEfiAcpiS3ContextGuid, (VOID *)(UINTN)AcpiS3Context, (UINTN)sizeof(*AcpiS3Context) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SetLockBoxAttributes (&gEfiAcpiS3ContextGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Done: // // Close the event, deregistering the callback and freeing resources. // Status = gBS->CloseEvent (Event); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } diff --git a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c index e94d15772..768b203ac 100644 --- a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c +++ b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c @@ -809,7 +809,7 @@ BootScriptInsert ( break; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = S3BootScriptMoveLastOpcode (BeforeOrAfter, Position); } return Status; @@ -914,7 +914,7 @@ InitializeS3SaveState ( &gEfiEndOfDxeEventGroupGuid, &EndOfDxeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return gBS->InstallProtocolInterface ( &mHandle, diff --git a/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c b/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c index 9637df4fb..227bd2a1f 100644 --- a/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c +++ b/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c @@ -807,7 +807,7 @@ BootScriptInsert ( break; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = S3BootScriptMoveLastOpcode (BeforeOrAfter, Position); } return Status; diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c index f3d5e5ac0..7f6485988 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -72,7 +72,7 @@ BdsDxeOnConnectConInCallBack ( // no driver dependency is assumed existing. So use a non-dispatch version // Status = EfiBootManagerConnectConsoleVariable (ConIn); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Should not enter this case, if enter, the keyboard will not work. // May need platfrom policy to connect keyboard. @@ -119,13 +119,13 @@ CheckDeferredLoadImageOnReadyToBoot ( &HandleCount, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } for (Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol (Handles[Index], &gEfiDeferredImageLoadProtocolGuid, (VOID **) &DeferredImage); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -141,18 +141,18 @@ CheckDeferredLoadImageOnReadyToBoot ( &ImageSize, &BootOption ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } DevicePathStr = ConvertDevicePathToText (ImageDevicePath, FALSE, FALSE); DEBUG ((DEBUG_LOAD, "[Bds] Image was deferred but not loaded: %s.\n", DevicePathStr)); if (DevicePathStr != NULL) { - FreePool (DevicePathStr); + FreePool(DevicePathStr); } } } if (Handles != NULL) { - FreePool (Handles); + FreePool(Handles); } } @@ -186,7 +186,7 @@ BdsInitialize ( &gEfiBdsArchProtocolGuid, &gBds, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DEBUG_CODE ( EFI_EVENT Event; @@ -201,7 +201,7 @@ BdsInitialize ( &gEfiEventReadyToBootGuid, &Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ); return Status; } @@ -232,7 +232,7 @@ BdsWaitForSingleEvent ( // Create a timer event // Status = gBS->CreateEvent (EVT_TIMER, 0, NULL, NULL, &TimerEvent); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Set the timer event // @@ -248,7 +248,7 @@ BdsWaitForSingleEvent ( WaitList[0] = Event; WaitList[1] = TimerEvent; Status = gBS->WaitForEvent (2, WaitList, &Index); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); gBS->CloseEvent (TimerEvent); // @@ -263,7 +263,7 @@ BdsWaitForSingleEvent ( // No timeout... just wait on the event // Status = gBS->WaitForEvent (1, &Event, &Index); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); ASSERT (Index == 0); } @@ -290,7 +290,7 @@ BdsReadKeys ( Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No more keys. // @@ -326,7 +326,7 @@ BdsWait ( if (HotkeyTriggered != NULL) { Status = BdsWaitForSingleEvent (HotkeyTriggered, EFI_TIMER_PERIOD_SECONDS (1)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } } else { @@ -450,7 +450,7 @@ ProcessLoadOptions ( // Status indicates whether the load option is loaded and executed // LoadOptions[Index].Status is what the load option returns // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Stop processing if any PlatformRecovery#### returns success. // @@ -462,7 +462,7 @@ ProcessLoadOptions ( // // Only set ReconnectAll flag when the load option executes successfully. // - if (!EFI_ERROR (LoadOptions[Index].Status) && + if (!EFI_ERROR(LoadOptions[Index].Status) && (LoadOptions[Index].Attributes & LOAD_OPTION_FORCE_RECONNECT) != 0) { ReconnectAll = TRUE; } @@ -510,11 +510,11 @@ BdsFormalizeConsoleVariable ( // // Deleting variable with current variable implementation shouldn't fail. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (DevicePath != NULL) { - FreePool (DevicePath); + FreePool(DevicePath); } } @@ -570,7 +570,7 @@ BdsFormalizeOSIndicationVariable ( // // Platform needs to make sure setting volatile variable before calling 3rd party code shouldn't fail. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // If OsIndications is invalid, remove it. @@ -707,10 +707,10 @@ BdsEntry ( // Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock); DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n", Status)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < ARRAY_SIZE (mReadOnlyVariables); Index++) { Status = VariableLock->RequestToLock (VariableLock, mReadOnlyVariables[Index], &gEfiGlobalVariableGuid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -753,7 +753,7 @@ BdsEntry ( // // Platform needs to make sure setting volatile variable before calling 3rd party code shouldn't fail. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Cache the "BootNext" NV variable before calling any PlatformBootManagerLib APIs @@ -762,7 +762,7 @@ BdsEntry ( GetEfiGlobalVariable2 (EFI_BOOT_NEXT_VARIABLE_NAME, (VOID **) &BootNext, &DataSize); if (DataSize != sizeof (UINT16)) { if (BootNext != NULL) { - FreePool (BootNext); + FreePool(BootNext); } BootNext = NULL; } @@ -787,7 +787,7 @@ BdsEntry ( NULL, 0 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // System firmware must include a PlatformRecovery#### variable specifying @@ -808,11 +808,11 @@ BdsEntry ( } PlatformDefaultBootOption.OptionNumber = Index; Status = EfiBootManagerLoadOptionToVariable (&PlatformDefaultBootOption); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } EfiBootManagerFreeLoadOptions (LoadOptions, LoadOptionCount); } - FreePool (FilePath); + FreePool(FilePath); // // Report Status Code to indicate connecting drivers will happen @@ -834,7 +834,7 @@ BdsEntry ( &gConnectConInEventGuid, &gConnectConInEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gConnectConInEvent = NULL; } } @@ -916,7 +916,7 @@ BdsEntry ( &DataSize, &OsIndication ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { OsIndication = 0; } @@ -966,7 +966,7 @@ BdsEntry ( // // Changing the content without increasing its size with current variable implementation shouldn't fail. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // @@ -1028,7 +1028,7 @@ BdsEntry ( // UnicodeSPrint (BootNextVariableName, sizeof (BootNextVariableName), L"Boot%04x", *BootNext); Status = EfiBootManagerVariableToLoadOption (BootNextVariableName, &LoadOption); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { EfiBootManagerBoot (&LoadOption); EfiBootManagerFreeLoadOption (&LoadOption); if ((LoadOption.Status == EFI_SUCCESS) && @@ -1129,7 +1129,7 @@ BdsDxeSetVariableAndReportStatusCodeOnError ( DataSize, Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { NameSize = StrSize (VariableName); SetVariableStatus = AllocatePool (sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize); if (SetVariableStatus != NULL) { @@ -1151,7 +1151,7 @@ BdsDxeSetVariableAndReportStatusCodeOnError ( sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize ); - FreePool (SetVariableStatus); + FreePool(SetVariableStatus); } } diff --git a/MdeModulePkg/Universal/BdsDxe/Language.c b/MdeModulePkg/Universal/BdsDxe/Language.c index 03aa055bd..2ab6fce8a 100644 --- a/MdeModulePkg/Universal/BdsDxe/Language.c +++ b/MdeModulePkg/Universal/BdsDxe/Language.c @@ -133,7 +133,7 @@ InitializeLangVariable ( } if (Lang != NULL) { - FreePool (Lang); + FreePool(Lang); } } diff --git a/MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.c b/MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.c index ff45e4f8e..6b7276b23 100644 --- a/MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.c +++ b/MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.c @@ -42,7 +42,7 @@ ConnectAllAndCreateNetworkDeviceList ( EfiBootManagerConnectAll (); Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiManagedNetworkServiceBindingProtocolGuid, NULL, &HandleCount, &Handles); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Handles = NULL; HandleCount = 0; } @@ -50,13 +50,13 @@ ConnectAllAndCreateNetworkDeviceList ( Devices = NULL; while (HandleCount-- != 0) { Status = gBS->HandleProtocol (Handles[HandleCount], &gEfiDevicePathProtocolGuid, (VOID **) &SingleDevice); - if (EFI_ERROR (Status) || (SingleDevice == NULL)) { + if (EFI_ERROR(Status) || (SingleDevice == NULL)) { continue; } TempDevicePath = Devices; Devices = AppendDevicePathInstance (Devices, SingleDevice); if (TempDevicePath != NULL) { - FreePool (TempDevicePath); + FreePool(TempDevicePath); } } @@ -72,7 +72,7 @@ ConnectAllAndCreateNetworkDeviceList ( // Fails to save the network device list to NV storage is not a fatal error. // Only impact is performance. // - FreePool (Devices); + FreePool(Devices); } return (Devices == NULL) ? EFI_DEVICE_ERROR : EFI_SUCCESS; @@ -102,13 +102,13 @@ ConnectNetwork ( while (TempDevicePath != NULL) { SingleDevice = GetNextDevicePathInstance (&TempDevicePath, &Size); Status = EfiBootManagerConnectDevicePath (SingleDevice, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { OneConnected = TRUE; } - FreePool (SingleDevice); + FreePool(SingleDevice); } if (Devices != NULL) { - FreePool (Devices); + FreePool(Devices); } if (OneConnected) { @@ -169,7 +169,7 @@ BootManagerPolicyConnectDevicePath ( Status = EfiBootManagerConnectDevicePath (DevicePath, NULL); } else { Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, &Controller); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->ConnectController (Controller, NULL, DevicePath, FALSE); } } diff --git a/MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c b/MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c index e9b125008..e2947ee31 100644 --- a/MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c +++ b/MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c @@ -130,7 +130,7 @@ IsCapsuleOnDiskMode ( NULL, (VOID **) &PPIVariableServices ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Size = sizeof (BOOLEAN); Status = PPIVariableServices->GetVariable ( @@ -142,7 +142,7 @@ IsCapsuleOnDiskMode ( &CodRelocInfo ); - if (EFI_ERROR (Status) || Size != sizeof(BOOLEAN) || !CodRelocInfo) { + if (EFI_ERROR(Status) || Size != sizeof(BOOLEAN) || !CodRelocInfo) { DEBUG (( DEBUG_ERROR, "Error Get CodRelocationInfo variable %r!\n", Status)); return FALSE; } @@ -305,11 +305,11 @@ InitializeCapsuleOnDiskLoad ( ); Status = PeiServicesInstallPpi (&mCapsuleOnDiskPpiList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); FileNameSize = PcdGetSize (PcdCoDRelocationFileName); Status = PcdSetPtrS (PcdRecoveryFileName, &FileNameSize, (VOID *) PcdGetPtr(PcdCoDRelocationFileName)); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -352,7 +352,7 @@ LoadCapsuleOnDisk ( (VOID **)&DeviceRecoveryPpi ); DEBUG ((DEBUG_INFO, "LoadCapsuleOnDisk - LocateRecoveryPpi (%d) - %r\n", Instance, Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Instance == 0) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MAJOR, @@ -368,7 +368,7 @@ LoadCapsuleOnDisk ( &NumberRecoveryCapsules ); DEBUG ((DEBUG_INFO, "LoadCapsuleOnDisk - GetNumberRecoveryCapsules (%d) - %r\n", NumberRecoveryCapsules, Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -382,7 +382,7 @@ LoadCapsuleOnDisk ( &CapsuleType ); DEBUG ((DEBUG_INFO, "LoadCapsuleOnDisk - GetRecoveryCapsuleInfo (%d - %x) - %r\n", CapsuleInstance, CapsuleSize, Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -404,7 +404,7 @@ LoadCapsuleOnDisk ( CapsuleBuffer ); DEBUG ((DEBUG_INFO, "LoadCapsuleOnDisk - LoadRecoveryCapsule (%d) - %r\n", CapsuleInstance, Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreePages (CapsuleBuffer, EFI_SIZE_TO_PAGES(CapsuleSize)); break; } @@ -417,7 +417,7 @@ LoadCapsuleOnDisk ( break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MAJOR, (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_NO_RECOVERY_CAPSULE) diff --git a/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c b/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c index 468eea5d3..6b6663d01 100644 --- a/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c +++ b/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c @@ -1032,7 +1032,7 @@ CapsuleDataCoalesce ( // Build capsule descriptors list // Status = BuildCapsuleDescriptors (BlockListBuffer, MemoryResource, &BlockList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1046,7 +1046,7 @@ CapsuleDataCoalesce ( // one for a terminator. Do that below. // Status = GetCapsuleInfo (BlockList, &NumDescriptors, &CapsuleSize, &CapsuleNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DEBUG ((DEBUG_INFO, "CapsuleSize - 0x%x\n", CapsuleSize)); diff --git a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c index 51afab7b0..dab132671 100644 --- a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c +++ b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c @@ -465,7 +465,7 @@ ModeSwitch ( Status = Thunk32To64 (LongModeBuffer->PageTableAddress, &Context, &ReturnContext); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *MemoryBase = (VOID *) (UINTN) MemoryBase64; *MemorySize = (UINTN) MemorySize64; } @@ -503,13 +503,13 @@ FindCapsuleCoalesceImage ( while (TRUE) { Status = PeiServicesFfsFindNextVolume (Instance++, &VolumeHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PeiServicesFfsFindFileByName (PcdGetPtr(PcdCapsuleCoalesceFile), VolumeHandle, &FileHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PeiServicesLocatePpi (&gEfiPeiLoadFilePpiGuid, 0, NULL, (VOID **) &LoadFile); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = LoadFile->LoadFile ( LoadFile, @@ -519,7 +519,7 @@ FindCapsuleCoalesceImage ( CoalesceImageEntryPoint, &AuthenticationState ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Unable to find PE32 section in CapsuleX64 image ffs %r!\n", Status)); return Status; } @@ -557,7 +557,7 @@ GetLongModeContext ( NULL, (VOID **) &PPIVariableServices ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Size = sizeof (EFI_CAPSULE_LONG_MODE_BUFFER); Status = PPIVariableServices->GetVariable ( @@ -568,7 +568,7 @@ GetLongModeContext ( &Size, LongModeBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "Error Get LongModeBuffer variable %r!\n", Status)); } return Status; @@ -736,7 +736,7 @@ BuildMemoryResourceDescriptor ( // include extra one NULL terminate memory resource descriptor. // Status = PeiServicesAllocatePool ((1 + 1) * sizeof (MEMORY_RESOURCE_DESCRIPTOR), (VOID **) &MemoryResource); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem (MemoryResource, (1 + 1) * sizeof (MEMORY_RESOURCE_DESCRIPTOR)); MemoryResource[0].PhysicalStart = 0; @@ -754,7 +754,7 @@ BuildMemoryResourceDescriptor ( // include extra one NULL terminate memory resource descriptor. // Status = PeiServicesAllocatePool ((Index + 1) * sizeof (MEMORY_RESOURCE_DESCRIPTOR), (VOID **) &MemoryResource); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ZeroMem (MemoryResource, (Index + 1) * sizeof (MEMORY_RESOURCE_DESCRIPTOR)); // @@ -818,7 +818,7 @@ AreCapsulesStaged ( (VOID **)&PPIVariableServices ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failed to find ReadOnlyVariable2PPI\n")); return FALSE; } @@ -836,7 +836,7 @@ AreCapsulesStaged ( (VOID *)&CapsuleDataPtr64 ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return TRUE; } @@ -898,7 +898,7 @@ GetScatterGatherHeadEntries ( (VOID **)&PPIVariableServices ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Failed to find ReadOnlyVariable2PPI\n")); return Status; } @@ -938,7 +938,7 @@ GetScatterGatherHeadEntries ( (VOID *)&CapsuleDataPtr64 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status != EFI_NOT_FOUND) { DEBUG ((DEBUG_ERROR, "Unexpected error getting Capsule Update variable. Status = %r\n")); } @@ -970,7 +970,7 @@ GetScatterGatherHeadEntries ( return EFI_OUT_OF_RESOURCES; } CopyMem (EnlargedTempList, TempList, TempListLength); - FreePool (TempList); + FreePool(TempList); TempList = EnlargedTempList; TempListLength *= 2; } @@ -1050,7 +1050,7 @@ CapsuleCoalesce ( // capsule update, then return normally. // Status = PeiServicesGetBootMode (&BootMode); - if (EFI_ERROR (Status) || (BootMode != BOOT_ON_FLASH_UPDATE)) { + if (EFI_ERROR(Status) || (BootMode != BOOT_ON_FLASH_UPDATE)) { DEBUG ((DEBUG_ERROR, "Boot mode is not correct for capsule update path.\n")); Status = EFI_NOT_FOUND; goto Done; @@ -1060,7 +1060,7 @@ CapsuleCoalesce ( // Get SG list entries // Status = GetScatterGatherHeadEntries (&ListLength, &VariableArrayAddress); - if (EFI_ERROR (Status) || VariableArrayAddress == NULL) { + if (EFI_ERROR(Status) || VariableArrayAddress == NULL) { DEBUG ((DEBUG_ERROR, "%a failed to get Scatter Gather List Head Entries. Status = %r\n", __FUNCTION__, Status)); goto Done; } @@ -1078,14 +1078,14 @@ CapsuleCoalesce ( // CoalesceImageEntryPoint = 0; Status = GetLongModeContext (&LongModeBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Fail to find the variable for long mode context!\n")); Status = EFI_NOT_FOUND; goto Done; } Status = FindCapsuleCoalesceImage (&CoalesceImageEntryPoint, &CoalesceImageMachineType); - if ((EFI_ERROR (Status)) || (CoalesceImageMachineType != EFI_IMAGE_MACHINE_X64)) { + if ((EFI_ERROR(Status)) || (CoalesceImageMachineType != EFI_IMAGE_MACHINE_X64)) { DEBUG ((DEBUG_ERROR, "Fail to find CapsuleX64 module in FV!\n")); Status = EFI_NOT_FOUND; goto Done; diff --git a/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c b/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c index 4a0567fa7..d3269c64c 100644 --- a/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c +++ b/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c @@ -241,7 +241,7 @@ _ModuleEntryPoint ( // Setup the default CPU exception handlers // Status = InitializeCpuExceptionHandlers (NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Hook page fault handler to handle >4G request. diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c index 77b8f0006..14f2176c9 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c @@ -207,7 +207,7 @@ UpdateCapsule ( sizeof (UINTN), (VOID *) &ScatterGatherList ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Variable has been set successfully, increase variable index. // @@ -391,7 +391,7 @@ CapsuleServiceInitialize ( NULL, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/X64/SaveLongModeContext.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/X64/SaveLongModeContext.c index d80d4ed3a..b034c65b1 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/X64/SaveLongModeContext.c +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/X64/SaveLongModeContext.c @@ -59,7 +59,7 @@ AllocateReservedMemoryBelow4G ( Pages, &Address ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Buffer = (VOID *) (UINTN) Address; ZeroMem (Buffer, Size); @@ -87,9 +87,9 @@ VariableLockCapsuleLongModeBufferVariable ( // Mark EFI_CAPSULE_LONG_MODE_BUFFER_NAME variable to read-only if the Variable Lock protocol exists // Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = VariableLock->RequestToLock (VariableLock, EFI_CAPSULE_LONG_MODE_BUFFER_NAME, &gEfiCapsuleVendorGuid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -173,7 +173,7 @@ PrepareContextForCapsulePei ( sizeof (EFI_CAPSULE_LONG_MODE_BUFFER), &LongModeBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Register callback function upon VariableLockProtocol // to lock EFI_CAPSULE_LONG_MODE_BUFFER_NAME variable to avoid malicious code to update it. diff --git a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c index 46e7688f7..b5014ba36 100644 --- a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c +++ b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c @@ -57,7 +57,7 @@ InitializeConPlatform( &gConPlatformComponentName, &gConPlatformComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = EfiLibInstallDriverBindingComponentName2 ( ImageHandle, @@ -67,7 +67,7 @@ InitializeConPlatform( &gConPlatformComponentName, &gConPlatformComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -162,7 +162,7 @@ ConPlatformDriverBindingSupported ( ControllerHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -176,7 +176,7 @@ ConPlatformDriverBindingSupported ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -232,7 +232,7 @@ ConPlatformTextInDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -246,7 +246,7 @@ ConPlatformTextInDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -258,7 +258,7 @@ ConPlatformTextInDriverBindingStart ( DevicePath, Check ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { IsInConInVariable = TRUE; } @@ -341,7 +341,7 @@ ConPlatformTextOutDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -355,7 +355,7 @@ ConPlatformTextOutDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -367,7 +367,7 @@ ConPlatformTextOutDriverBindingStart ( DevicePath, Check ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { IsInConOutVariable = TRUE; } @@ -377,7 +377,7 @@ ConPlatformTextOutDriverBindingStart ( DevicePath, Check ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { IsInErrOutVariable = TRUE; } @@ -480,7 +480,7 @@ ConPlatformTextInDriverBindingStop ( // // If there is device path on ControllerHandle // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Remove DevicePath from ConInDev if exists. // @@ -551,7 +551,7 @@ ConPlatformTextOutDriverBindingStop ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Remove DevicePath from ConOutDev and ErrOutDev if exists. // @@ -622,7 +622,7 @@ ConPlatformUnInstallProtocol ( EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->UninstallMultipleProtocolInterfaces ( Handle, ProtocolGuid, @@ -689,8 +689,8 @@ ConPlatformGetVariable ( &BufferSize, Buffer ); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); // // To make sure Buffer is NULL if any error occurs. // @@ -785,7 +785,7 @@ MatchUsbClass ( // Check Vendor Id and Product Id. // Status = UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -808,7 +808,7 @@ MatchUsbClass ( // Protocol in Interface Descriptor instead. // Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -875,7 +875,7 @@ MatchUsbWwid ( // Check Vendor Id and Product Id. // Status = UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } if ((DevDesc.IdVendor != UsbWwid->VendorId) || @@ -887,7 +887,7 @@ MatchUsbWwid ( // Check Interface Number. // Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } if (IfDesc.InterfaceNumber != UsbWwid->InterfaceNumber) { @@ -907,7 +907,7 @@ MatchUsbWwid ( TableSize = 0; LangIdTable = NULL; Status = UsbIo->UsbGetSupportedLanguages (UsbIo, &LangIdTable, &TableSize); - if (EFI_ERROR (Status) || (TableSize == 0) || (LangIdTable == NULL)) { + if (EFI_ERROR(Status) || (TableSize == 0) || (LangIdTable == NULL)) { return FALSE; } @@ -931,18 +931,18 @@ MatchUsbWwid ( DevDesc.StrSerialNumber, &SerialNumberStr ); - if (EFI_ERROR (Status) || (SerialNumberStr == NULL)) { + if (EFI_ERROR(Status) || (SerialNumberStr == NULL)) { continue; } Length = StrLen (SerialNumberStr); if ((Length >= CompareLen) && (CompareMem (SerialNumberStr + Length - CompareLen, CompareStr, CompareLen * sizeof (CHAR16)) == 0)) { - FreePool (SerialNumberStr); + FreePool(SerialNumberStr); return TRUE; } - FreePool (SerialNumberStr); + FreePool(SerialNumberStr); } return FALSE; @@ -995,7 +995,7 @@ MatchUsbShortformDevicePath ( ParentDevicePathSize = (UINTN) ShortformNode - (UINTN) ShortformPath; RemainingDevicePath = FullPath; Status = gBS->LocateDevicePath (&gEfiUsbIoProtocolGuid, &RemainingDevicePath, &Handle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } if (ParentDevicePathSize != 0) { @@ -1013,7 +1013,7 @@ MatchUsbShortformDevicePath ( &gEfiUsbIoProtocolGuid, (VOID **) &UsbIo ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return MatchUsbClass (UsbIo, (USB_CLASS_DEVICE_PATH *)ShortformNode) || MatchUsbWwid (UsbIo, (USB_WWID_DEVICE_PATH *)ShortformNode); @@ -1084,7 +1084,7 @@ ConPlatformMatchDevicePaths ( // // If Delete is FALSE, return EFI_SUCCESS if Single is found in Multi. // - FreePool (DevicePathInst); + FreePool(DevicePathInst); return EFI_SUCCESS; } } else { @@ -1098,13 +1098,13 @@ ConPlatformMatchDevicePaths ( DevicePathInst ); if (TempDevicePath1 != NULL) { - FreePool (TempDevicePath1); + FreePool(TempDevicePath1); } TempDevicePath1 = TempDevicePath2; } } - FreePool (DevicePathInst); + FreePool(DevicePathInst); DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size); } @@ -1164,14 +1164,14 @@ ConPlatformUpdateDeviceVariable ( FALSE ); - if ((Operation == Check) || (!EFI_ERROR (Status))) { + if ((Operation == Check) || (!EFI_ERROR(Status))) { // // Branch here includes 2 cases: // 1. Operation is CHECK, simply return Status. // 2. Operation is APPEND, and device path already exists in variable, also return. // if (VariableDevicePath != NULL) { - FreePool (VariableDevicePath); + FreePool(VariableDevicePath); } return Status; @@ -1202,10 +1202,10 @@ ConPlatformUpdateDeviceVariable ( } if (VariableDevicePath != NULL) { - FreePool (VariableDevicePath); + FreePool(VariableDevicePath); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1221,7 +1221,7 @@ ConPlatformUpdateDeviceVariable ( NewVariableDevicePath ); - FreePool (NewVariableDevicePath); + FreePool(NewVariableDevicePath); } return Status; @@ -1252,14 +1252,14 @@ ConPlatformUpdateGopCandidate ( // TempDevicePath = DevicePath; Status = gBS->LocateDevicePath (&gEfiGraphicsOutputProtocolGuid, &TempDevicePath, &GopHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } // // Get the parent PciIo handle in order to find all the children // Status = gBS->LocateDevicePath (&gEfiPciIoProtocolGuid, &DevicePath, &PciHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } TempDevicePath = EfiBootManagerGetGopDevicePath (PciHandle); diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c index 72c01ece5..9653a40b4 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c @@ -276,7 +276,7 @@ ConSplitterTestControllerHandles ( DriverBindingHandle, ProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -379,7 +379,7 @@ ConSplitterConInComponentNameGetControllerName ( ChildHandle, &gEfiConsoleInDeviceGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -479,7 +479,7 @@ ConSplitterSimplePointerComponentNameGetControllerName ( ChildHandle, &gEfiSimplePointerProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -556,7 +556,7 @@ ConSplitterAbsolutePointerComponentNameGetControllerName ( ChildHandle, &gEfiAbsolutePointerProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -656,7 +656,7 @@ ConSplitterConOutComponentNameGetControllerName ( ChildHandle, &gEfiConsoleOutDeviceGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -756,7 +756,7 @@ ConSplitterStdErrComponentNameGetControllerName ( ChildHandle, &gEfiStandardErrorDeviceGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c index 63c814ae1..a9d298777 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c @@ -451,7 +451,7 @@ ConSplitterDriverEntry( &gConSplitterConInComponentName, &gConSplitterConInComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = EfiLibInstallDriverBindingComponentName2 ( ImageHandle, @@ -461,7 +461,7 @@ ConSplitterDriverEntry( &gConSplitterSimplePointerComponentName, &gConSplitterSimplePointerComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = EfiLibInstallDriverBindingComponentName2 ( ImageHandle, @@ -471,7 +471,7 @@ ConSplitterDriverEntry( &gConSplitterAbsolutePointerComponentName, &gConSplitterAbsolutePointerComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = EfiLibInstallDriverBindingComponentName2 ( ImageHandle, @@ -481,7 +481,7 @@ ConSplitterDriverEntry( &gConSplitterConOutComponentName, &gConSplitterConOutComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = EfiLibInstallDriverBindingComponentName2 ( ImageHandle, @@ -491,7 +491,7 @@ ConSplitterDriverEntry( &gConSplitterStdErrComponentName, &gConSplitterStdErrComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Either Graphics Output protocol or UGA Draw protocol must be supported. @@ -508,7 +508,7 @@ ConSplitterDriverEntry( // Create virtual device handle for ConIn Splitter // Status = ConSplitterTextInConstructor (&mConIn); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->InstallMultipleProtocolInterfaces ( &mConIn.VirtualHandle, &gEfiSimpleTextInProtocolGuid, @@ -521,7 +521,7 @@ ConSplitterDriverEntry( &mConIn.AbsolutePointer, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update the EFI System Table with new virtual console // and update the pointer to Simple Text Input protocol. @@ -534,14 +534,14 @@ ConSplitterDriverEntry( // Create virtual device handle for ConOut Splitter // Status = ConSplitterTextOutConstructor (&mConOut); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->InstallMultipleProtocolInterfaces ( &mConOut.VirtualHandle, &gEfiSimpleTextOutProtocolGuid, &mConOut.TextOut, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update the EFI System Table with new virtual console // and Update the pointer to Text Output protocol. @@ -556,14 +556,14 @@ ConSplitterDriverEntry( // Create virtual device handle for StdErr Splitter // Status = ConSplitterTextOutConstructor (&mStdErr); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->InstallMultipleProtocolInterfaces ( &mStdErr.VirtualHandle, &gEfiSimpleTextOutProtocolGuid, &mStdErr.TextOut, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update the EFI System Table with new virtual console // and update the pointer to Text Output protocol. @@ -614,7 +614,7 @@ ConSplitterTextInConstructor ( &ConInPrivate->TextInListCount, (VOID **) &ConInPrivate->TextInList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -628,7 +628,7 @@ ConSplitterTextInConstructor ( ConInPrivate, &ConInPrivate->TextIn.WaitForKey ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Allocate buffer for KeyQueue @@ -639,7 +639,7 @@ ConSplitterTextInConstructor ( &TextInExListCount, (VOID **) &ConInPrivate->KeyQueue ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -651,7 +651,7 @@ ConSplitterTextInConstructor ( &ConInPrivate->TextInExListCount, (VOID **) &ConInPrivate->TextInExList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } // @@ -664,7 +664,7 @@ ConSplitterTextInConstructor ( ConInPrivate, &ConInPrivate->TextInEx.WaitForKeyEx ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); InitializeListHead (&ConInPrivate->NotifyList); @@ -679,7 +679,7 @@ ConSplitterTextInConstructor ( &ConInPrivate->AbsolutePointerListCount, (VOID **) &ConInPrivate->AbsolutePointerList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } // @@ -692,7 +692,7 @@ ConSplitterTextInConstructor ( ConInPrivate, &ConInPrivate->AbsolutePointer.WaitForInput ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ConInPrivate->SimplePointer.Mode = &ConInPrivate->SimplePointerMode; // @@ -703,7 +703,7 @@ ConSplitterTextInConstructor ( &ConInPrivate->PointerListCount, (VOID **) &ConInPrivate->PointerList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } // @@ -716,7 +716,7 @@ ConSplitterTextInConstructor ( ConInPrivate, &ConInPrivate->SimplePointer.WaitForInput ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Create Event to signal ConIn connection request // @@ -778,7 +778,7 @@ ConSplitterTextOutConstructor ( &ConOutPrivate->TextOutListCount, (VOID **) &ConOutPrivate->TextOutList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } // @@ -789,7 +789,7 @@ ConSplitterTextOutConstructor ( &ConOutPrivate->TextOutQueryDataCount, (VOID **) &ConOutPrivate->TextOutQueryData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -896,7 +896,7 @@ ConSplitterSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1088,7 +1088,7 @@ ConSplitterStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1103,7 +1103,7 @@ ConSplitterStart ( ConSplitterVirtualHandle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Err; } @@ -1119,7 +1119,7 @@ ConSplitterStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -1184,7 +1184,7 @@ ConSplitterConInDriverBindingStart ( &gEfiSimpleTextInProtocolGuid, (VOID **) &TextIn ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1192,7 +1192,7 @@ ConSplitterConInDriverBindingStart ( // Add this device into Text In devices list. // Status = ConSplitterTextInAddDevice (&mConIn, TextIn); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1204,7 +1204,7 @@ ConSplitterConInDriverBindingStart ( mConIn.VirtualHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If Simple Text Input Ex protocol exists, // add this device into Text In Ex devices list. @@ -1251,7 +1251,7 @@ ConSplitterSimplePointerDriverBindingStart ( &gEfiSimplePointerProtocolGuid, (VOID **) &SimplePointer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1298,7 +1298,7 @@ ConSplitterAbsolutePointerDriverBindingStart ( (VOID **) &AbsolutePointer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1348,7 +1348,7 @@ ConSplitterConOutDriverBindingStart ( &gEfiSimpleTextOutProtocolGuid, (VOID **) &TextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1366,7 +1366,7 @@ ConSplitterConOutDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { + if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { // // Open UGA DRAW protocol // @@ -1399,7 +1399,7 @@ ConSplitterConOutDriverBindingStart ( // if (GraphicsOutput != NULL) { Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT ( SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)); @@ -1409,7 +1409,7 @@ ConSplitterConOutDriverBindingStart ( mConOut.UgaColorDepth = 32; mConOut.UgaRefreshRate = 60; - FreePool (Info); + FreePool(Info); } else if (UgaDraw != NULL) { Status = UgaDraw->GetMode ( @@ -1461,7 +1461,7 @@ ConSplitterStdErrDriverBindingStart ( &gEfiSimpleTextOutProtocolGuid, (VOID **) &TextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1518,7 +1518,7 @@ ConSplitterStop ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1580,13 +1580,13 @@ ConSplitterConInDriverBindingStop ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If Simple Text Input Ex protocol exists, // remove device from Text Input Ex devices list. // Status = ConSplitterTextInExDeleteDevice (&mConIn, TextInEx); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1602,7 +1602,7 @@ ConSplitterConInDriverBindingStop ( &gEfiSimpleTextInProtocolGuid, (VOID **) &TextIn ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1654,7 +1654,7 @@ ConSplitterSimplePointerDriverBindingStop ( &gEfiSimplePointerProtocolGuid, (VOID **) &SimplePointer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1706,7 +1706,7 @@ ConSplitterAbsolutePointerDriverBindingStop ( &gEfiAbsolutePointerProtocolGuid, (VOID **) &AbsolutePointer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1757,7 +1757,7 @@ ConSplitterConOutDriverBindingStop ( &gEfiSimpleTextOutProtocolGuid, (VOID **) &TextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1808,7 +1808,7 @@ ConSplitterStdErrDriverBindingStop ( &gEfiSimpleTextOutProtocolGuid, (VOID **) &TextOut ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -1888,7 +1888,7 @@ ConSplitterTextInAddDevice ( &Private->TextInListCount, (VOID **) &Private->TextInList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -1976,7 +1976,7 @@ ConSplitterTextInExAddDevice ( &TextInExListCount, (VOID **) &CurrentNotify->NotifyHandleList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -1987,7 +1987,7 @@ ConSplitterTextInExAddDevice ( &TextInExListCount, (VOID **) &Private->KeyQueue ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } @@ -1996,7 +1996,7 @@ ConSplitterTextInExAddDevice ( &Private->TextInExListCount, (VOID **) &Private->TextInExList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -2012,7 +2012,7 @@ ConSplitterTextInExAddDevice ( CurrentNotify->KeyNotificationFn, &CurrentNotify->NotifyHandleList[Private->CurrentNumberOfExConsoles] ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { for (Link = Link->BackLink; Link != &Private->NotifyList; Link = Link->BackLink) { CurrentNotify = TEXT_IN_EX_SPLITTER_NOTIFY_FROM_THIS (Link); TextInEx->UnregisterKeyNotify ( @@ -2106,7 +2106,7 @@ ConSplitterSimplePointerAddDevice ( &Private->PointerListCount, (VOID **) &Private->PointerList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -2183,7 +2183,7 @@ ConSplitterAbsolutePointerAddDevice ( &Private->AbsolutePointerListCount, (VOID **) &Private->AbsolutePointerList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -2319,7 +2319,7 @@ ConSplitterGrowMapTable ( // // Free the old buffer // - FreePool (OldTextOutModeMap); + FreePool(OldTextOutModeMap); } return EFI_SUCCESS; @@ -2360,7 +2360,7 @@ ConSplitterAddOutputMode ( &Private->TextOutQueryDataCount, (VOID **) &Private->TextOutQueryData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -2368,7 +2368,7 @@ ConSplitterAddOutputMode ( // Allocate buffer for the output mode map // Status = ConSplitterGrowMapTable (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } // @@ -2717,8 +2717,8 @@ ConSplitterGetIntersectionBetweenConOutAndStrErr ( mStdErr.TextOut.SetMode (&(mStdErr.TextOut), 0); } - FreePool (ConOutMapTable); - FreePool (StdErrMapTable); + FreePool(ConOutMapTable); + FreePool(StdErrMapTable); return EFI_SUCCESS; } @@ -2795,7 +2795,7 @@ ConSplitterAddGraphicsOutputMode ( if (ModeBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } - FreePool (Private->GraphicsOutputModeBuffer); + FreePool(Private->GraphicsOutputModeBuffer); Private->GraphicsOutputModeBuffer = ModeBuffer; // @@ -2807,13 +2807,13 @@ ConSplitterAddGraphicsOutputMode ( // The Info buffer would be allocated by callee // Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32) Index, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT ( SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)); CopyMem (Mode, Info, SizeOfInfo); Mode++; - FreePool (Info); + FreePool(Info); } } else { // @@ -2834,7 +2834,7 @@ ConSplitterAddGraphicsOutputMode ( // The Info buffer would be allocated by callee // Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32) NumberIndex, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((Info->HorizontalResolution == Mode->HorizontalResolution) && @@ -2844,10 +2844,10 @@ ConSplitterAddGraphicsOutputMode ( // it will be added into matched mode buffer // Match = TRUE; - FreePool (Info); + FreePool(Info); break; } - FreePool (Info); + FreePool(Info); } if (Match) { @@ -2884,7 +2884,7 @@ ConSplitterAddGraphicsOutputMode ( // // Drop the old mode buffer, assign it to a new one // - FreePool (Private->GraphicsOutputModeBuffer); + FreePool(Private->GraphicsOutputModeBuffer); Private->GraphicsOutputModeBuffer = ModeBuffer; // @@ -2982,14 +2982,14 @@ Done: // for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex ++) { Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32) NumberIndex, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((Info->HorizontalResolution == Mode->HorizontalResolution) && (Info->VerticalResolution == Mode->VerticalResolution)) { - FreePool (Info); + FreePool(Info); break; } - FreePool (Info); + FreePool(Info); } Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32) NumberIndex); } @@ -3147,14 +3147,14 @@ ConSplitterTextOutAddDevice ( &Private->TextOutListCount, (VOID **) &Private->TextOutList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } // // Also need to reallocate the TextOutModeMap table // Status = ConSplitterGrowMapTable (Private); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -3202,7 +3202,7 @@ ConSplitterTextOutAddDevice ( // if (GraphicsOutput != NULL) { Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT ( SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)); @@ -3210,7 +3210,7 @@ ConSplitterTextOutAddDevice ( UgaHorizontalResolution = Info->HorizontalResolution; UgaVerticalResolution = Info->VerticalResolution; - FreePool (Info); + FreePool(Info); } else if (UgaDraw != NULL) { Status = UgaDraw->GetMode ( @@ -3220,7 +3220,7 @@ ConSplitterTextOutAddDevice ( &UgaColorDepth, &UgaRefreshRate ); - if (!EFI_ERROR (Status) && EFI_ERROR (DeviceStatus)) { + if (!EFI_ERROR(Status) && EFI_ERROR(DeviceStatus)) { // // if GetMode is successfully and UGA device hasn't been set, set it // @@ -3235,7 +3235,7 @@ ConSplitterTextOutAddDevice ( // // If GetMode/SetMode is failed, set to 800x600 mode // - if(EFI_ERROR (Status)) { + if(EFI_ERROR(Status)) { Status = ConSplitterUgaDrawSetMode ( &Private->UgaDraw, 800, @@ -3247,7 +3247,7 @@ ConSplitterTextOutAddDevice ( } } - if (((!EFI_ERROR (DeviceStatus)) || (!EFI_ERROR (Status))) && + if (((!EFI_ERROR(DeviceStatus)) || (!EFI_ERROR(Status))) && ((Private->CurrentNumberOfGraphicsOutput + Private->CurrentNumberOfUgaDraw) == 1)) { if (!FeaturePcdGet (PcdConOutGopSupport)) { // @@ -3401,7 +3401,7 @@ ConSplitterTextOutDeleteDevice ( Private->TextOutQueryDataCount * sizeof (TEXT_OUT_SPLITTER_QUERY_DATA) ); - FreePool (Private->TextOutModeMap); + FreePool(Private->TextOutModeMap); Private->TextOutModeMap = NULL; TextOutList = Private->TextOutList; @@ -3464,12 +3464,12 @@ ConSplitterTextInReset ( Private->TextInList[Index], ExtendedVerification ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } - if (!EFI_ERROR (ReturnStatus)) { + if (!EFI_ERROR(ReturnStatus)) { ToggleStateSyncReInitialization (Private); // // Empty the key queue. @@ -3541,7 +3541,7 @@ ConSplitterTextInPrivateReadKeyStroke ( // while (TRUE) { Status = ConSplitterTextInExDequeueKey (Private, &KeyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } if ((KeyData.Key.ScanCode != CHAR_NULL) || (KeyData.Key.UnicodeChar != SCAN_NULL)) { @@ -3563,7 +3563,7 @@ ConSplitterTextInPrivateReadKeyStroke ( Private->TextInList[Index], &KeyData.Key ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If it is not partial keystorke, return the key. Otherwise, continue // to read key from THIS physical console input device. @@ -3661,7 +3661,7 @@ ConSplitterTextInWaitForKey ( // for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) { Status = gBS->CheckEvent (Private->TextInList[Index]->WaitForKey); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->SignalEvent (Event); Private->KeyEventSignalState = TRUE; } @@ -3749,12 +3749,12 @@ ConSplitterTextInResetEx ( Private->TextInExList[Index], ExtendedVerification ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } - if (!EFI_ERROR (ReturnStatus)) { + if (!EFI_ERROR(ReturnStatus)) { ToggleStateSyncReInitialization (Private); // // Empty the key queue. @@ -3818,7 +3818,7 @@ ConSplitterTextInReadKeyStrokeEx ( // Return the first saved key. // Status = ConSplitterTextInExDequeueKey (Private, KeyData); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return Status; } ASSERT (Private->CurrentNumberOfKeys == 0); @@ -3836,7 +3836,7 @@ ConSplitterTextInReadKeyStrokeEx ( Private->TextInExList[Index], &CurrentKeyData ); - if (EFI_ERROR (Status) && (Status != EFI_NOT_READY)) { + if (EFI_ERROR(Status) && (Status != EFI_NOT_READY)) { continue; } @@ -3850,7 +3850,7 @@ ConSplitterTextInReadKeyStrokeEx ( KeyState.KeyToggleState |= CurrentKeyData.KeyState.KeyToggleState; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If virtual KeyState has been required to be exposed, or it is not // partial keystorke, queue the key. @@ -3881,7 +3881,7 @@ ConSplitterTextInReadKeyStrokeEx ( // Return the first saved key. // Status = ConSplitterTextInExDequeueKey (Private, KeyData); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return Status; } @@ -3942,7 +3942,7 @@ ConSplitterTextInSetState ( Private->TextInExList[Index], &PhysicalKeyToggleState ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -4028,7 +4028,7 @@ ConSplitterTextInRegisterKeyNotify ( } NewNotify->NotifyHandleList = (EFI_HANDLE *) AllocateZeroPool (sizeof (EFI_HANDLE) * Private->TextInExListCount); if (NewNotify->NotifyHandleList == NULL) { - gBS->FreePool (NewNotify); + gBS->FreePool(NewNotify); return EFI_OUT_OF_RESOURCES; } NewNotify->Signature = TEXT_IN_EX_SPLITTER_NOTIFY_SIGNATURE; @@ -4046,7 +4046,7 @@ ConSplitterTextInRegisterKeyNotify ( KeyNotificationFunction, &NewNotify->NotifyHandleList[Index] ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Un-register the key notify on all physical console input devices // @@ -4056,8 +4056,8 @@ ConSplitterTextInRegisterKeyNotify ( NewNotify->NotifyHandleList[Index] ); } - gBS->FreePool (NewNotify->NotifyHandleList); - gBS->FreePool (NewNotify); + gBS->FreePool(NewNotify->NotifyHandleList); + gBS->FreePool(NewNotify); return Status; } } @@ -4112,8 +4112,8 @@ ConSplitterTextInUnregisterKeyNotify ( } RemoveEntryList (&CurrentNotify->NotifyEntry); - gBS->FreePool (CurrentNotify->NotifyHandleList); - gBS->FreePool (CurrentNotify); + gBS->FreePool(CurrentNotify->NotifyHandleList); + gBS->FreePool(CurrentNotify); return EFI_SUCCESS; } } @@ -4163,7 +4163,7 @@ ConSplitterSimplePointerReset ( Private->PointerList[Index], ExtendedVerification ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -4215,7 +4215,7 @@ ConSplitterSimplePointerPrivateGetState ( Private->PointerList[Index], &CurrentState ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (ReturnStatus == EFI_NOT_READY) { ReturnStatus = EFI_SUCCESS; } @@ -4313,7 +4313,7 @@ ConSplitterSimplePointerWaitForInput ( // for (Index = 0; Index < Private->CurrentNumberOfPointers; Index++) { Status = gBS->CheckEvent (Private->PointerList[Index]->WaitForInput); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->SignalEvent (Event); Private->InputEventSignalState = TRUE; } @@ -4358,7 +4358,7 @@ ConSplitterAbsolutePointerReset ( Private->AbsolutePointerList[Index], ExtendedVerification ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -4435,7 +4435,7 @@ ConSplitterAbsolutePointerGetState ( Private->AbsolutePointerList[Index], &CurrentState ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (ReturnStatus == EFI_NOT_READY) { ReturnStatus = EFI_SUCCESS; } @@ -4528,7 +4528,7 @@ ConSplitterAbsolutePointerWaitForInput ( // for (Index = 0; Index < Private->CurrentNumberOfAbsolutePointers; Index++) { Status = gBS->CheckEvent (Private->AbsolutePointerList[Index]->WaitForInput); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->SignalEvent (Event); Private->AbsoluteInputEventSignalState = TRUE; } @@ -4570,7 +4570,7 @@ ConSplitterTextOutReset ( Private->TextOutList[Index].TextOut, ExtendedVerification ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -4631,7 +4631,7 @@ ConSplitterTextOutOutputString ( Private->TextOutList[Index].TextOut, WString ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -4726,7 +4726,7 @@ ConSplitterTextOutTestString ( Private->TextOutList[Index].TextOut, WString ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -4863,7 +4863,7 @@ ConSplitterTextOutSetMode ( Private->TextOutList[Index].TextOut, TextOutModeMap[Index] ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -4924,7 +4924,7 @@ ConSplitterTextOutSetAttribute ( Private->TextOutList[Index].TextOut, Attribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -4965,7 +4965,7 @@ ConSplitterTextOutClearScreen ( // for (Index = 0, ReturnStatus = EFI_SUCCESS; Index < Private->CurrentNumberOfConsoles; Index++) { Status = Private->TextOutList[Index].TextOut->ClearScreen (Private->TextOutList[Index].TextOut); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -5049,7 +5049,7 @@ ConSplitterTextOutSetCursorPosition ( Column, Row ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -5102,7 +5102,7 @@ ConSplitterTextOutEnableCursor ( Private->TextOutList[Index].TextOut, Visible ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c index ab1d2ddc4..f5a61c81f 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c @@ -142,18 +142,18 @@ ConSplitterGraphicsOutputSetMode ( // for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex ++) { Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32) NumberIndex, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((Info->HorizontalResolution == Mode->HorizontalResolution) && (Info->VerticalResolution == Mode->VerticalResolution)) { - FreePool (Info); + FreePool(Info); break; } - FreePool (Info); + FreePool(Info); } Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32) NumberIndex); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } else if (FeaturePcdGet (PcdUgaConsumeSupport)) { @@ -166,7 +166,7 @@ ConSplitterGraphicsOutputSetMode ( 32, 60 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -290,7 +290,7 @@ ConSplitterGraphicsOutputBlt ( Height, Delta ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } else if (BltOperation == EfiBltVideoToBltBuffer) { // @@ -314,7 +314,7 @@ ConSplitterGraphicsOutputBlt ( Height, Delta ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } else if (BltOperation == EfiBltVideoToBltBuffer) { // @@ -432,18 +432,18 @@ ConSplitterUgaDrawSetMode ( // for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex ++) { Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32) NumberIndex, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution == VerticalResolution)) { - FreePool (Info); + FreePool(Info); break; } - FreePool (Info); + FreePool(Info); } Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32) NumberIndex); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } else if (FeaturePcdGet (PcdUgaConsumeSupport)){ @@ -456,7 +456,7 @@ ConSplitterUgaDrawSetMode ( ColorDepth, RefreshRate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } } @@ -558,7 +558,7 @@ ConSplitterUgaDrawBlt ( Height, Delta ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } else if (BltOperation == EfiUgaVideoToBltBuffer) { // @@ -581,7 +581,7 @@ ConSplitterUgaDrawBlt ( Height, Delta ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReturnStatus = Status; } else if (BltOperation == EfiUgaVideoToBltBuffer) { // diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index c042451a9..83bb5b661 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c @@ -139,7 +139,7 @@ GraphicsConsoleControllerDriverSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { + if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { // // Open Graphics Output Protocol failed, try to open UGA Draw Protocol // @@ -152,7 +152,7 @@ GraphicsConsoleControllerDriverSupported ( EFI_OPEN_PROTOCOL_BY_DRIVER ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -169,7 +169,7 @@ GraphicsConsoleControllerDriverSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( Controller, &gEfiDevicePathProtocolGuid, @@ -426,7 +426,7 @@ GraphicsConsoleControllerDriverStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -452,14 +452,14 @@ GraphicsConsoleControllerDriverStart ( &SizeOfInfo, &Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Info->HorizontalResolution > HorizontalResolution) || ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution > VerticalResolution))) { HorizontalResolution = Info->HorizontalResolution; VerticalResolution = Info->VerticalResolution; ModeNumber = ModeIndex; } - FreePool (Info); + FreePool(Info); } } if ((HorizontalResolution == 0x0) || (VerticalResolution == 0x0)) { @@ -476,7 +476,7 @@ GraphicsConsoleControllerDriverStart ( VerticalResolution, &ModeNumber ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // if not supporting current mode, try 800x600 which is required by UEFI/EFI spec // @@ -489,7 +489,7 @@ GraphicsConsoleControllerDriverStart ( &ModeNumber ); Mode = Private->GraphicsOutput->Mode; - if (EFI_ERROR (Status) && Mode->MaxMode != 0) { + if (EFI_ERROR(Status) && Mode->MaxMode != 0) { // // Set default mode failed or device don't support default mode, then get the current mode information // @@ -505,7 +505,7 @@ GraphicsConsoleControllerDriverStart ( // set the new graphic mode. // Status = Private->GraphicsOutput->SetMode (Private->GraphicsOutput, ModeNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The mode set operation failed // @@ -525,7 +525,7 @@ GraphicsConsoleControllerDriverStart ( ColorDepth, RefreshRate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Try to set 800*600 which is required by UEFI/EFI spec // @@ -536,7 +536,7 @@ GraphicsConsoleControllerDriverStart ( ColorDepth, RefreshRate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = Private->UgaDraw->GetMode ( Private->UgaDraw, &HorizontalResolution, @@ -544,7 +544,7 @@ GraphicsConsoleControllerDriverStart ( &ColorDepth, &RefreshRate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } } @@ -564,7 +564,7 @@ GraphicsConsoleControllerDriverStart ( &Private->ModeData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -611,7 +611,7 @@ GraphicsConsoleControllerDriverStart ( ); Error: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Close the GOP and UGA Draw Protocol // @@ -632,17 +632,17 @@ Error: } if (Private->LineBuffer != NULL) { - FreePool (Private->LineBuffer); + FreePool(Private->LineBuffer); } if (Private->ModeData != NULL) { - FreePool (Private->ModeData); + FreePool(Private->ModeData); } // // Free private data // - FreePool (Private); + FreePool(Private); } return Status; @@ -687,7 +687,7 @@ GraphicsConsoleControllerDriverStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_STARTED; } @@ -699,7 +699,7 @@ GraphicsConsoleControllerDriverStop ( &Private->SimpleTextOutput ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Close the GOP or UGA IO Protocol // @@ -720,17 +720,17 @@ GraphicsConsoleControllerDriverStop ( } if (Private->LineBuffer != NULL) { - FreePool (Private->LineBuffer); + FreePool(Private->LineBuffer); } if (Private->ModeData != NULL) { - FreePool (Private->ModeData); + FreePool(Private->ModeData); } // // Free our instance data // - FreePool (Private); + FreePool(Private); } return Status; @@ -779,7 +779,7 @@ CheckModeSupported ( &SizeOfInfo, &Info ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution == VerticalResolution)) { if ((GraphicsOutput->Mode->Info->HorizontalResolution == HorizontalResolution) && @@ -787,17 +787,17 @@ CheckModeSupported ( // // If video device has been set to this mode, we do not need to SetMode again // - FreePool (Info); + FreePool(Info); break; } else { Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber); - if (!EFI_ERROR (Status)) { - FreePool (Info); + if (!EFI_ERROR(Status)) { + FreePool(Info); break; } } } - FreePool (Info); + FreePool(Info); } } @@ -827,7 +827,7 @@ EfiLocateHiiProtocol ( EFI_STATUS Status; Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &mHiiDatabase); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -866,7 +866,7 @@ GraphicsConsoleConOutReset ( { EFI_STATUS Status; Status = This->SetMode (This, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK)); @@ -1129,7 +1129,7 @@ GraphicsConsoleConOutOutputString ( } Status = DrawUnicodeWeightAtCursorN (This, WString, Count); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Warning = TRUE; } // @@ -1206,12 +1206,12 @@ GraphicsConsoleConOutTestString ( NULL ); if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); Blt = NULL; } Count++; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } } @@ -1350,7 +1350,7 @@ GraphicsConsoleConOutSetMode ( // FlushCursor (This); - FreePool (Private->LineBuffer); + FreePool(Private->LineBuffer); } // @@ -1378,7 +1378,7 @@ GraphicsConsoleConOutSetMode ( // Either no graphics mode is currently set, or it is set to the wrong resolution, so set the new graphics mode // Status = GraphicsOutput->SetMode (GraphicsOutput, ModeData->GopModeNumber); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The mode set operation failed // @@ -1412,7 +1412,7 @@ GraphicsConsoleConOutSetMode ( &ColorDepth, &RefreshRate ); - if (EFI_ERROR (Status) || HorizontalResolution != ModeData->GopWidth || VerticalResolution != ModeData->GopHeight) { + if (EFI_ERROR(Status) || HorizontalResolution != ModeData->GopWidth || VerticalResolution != ModeData->GopHeight) { // // Either no graphics mode is currently set, or it is set to the wrong resolution, so set the new graphics mode // @@ -1423,7 +1423,7 @@ GraphicsConsoleConOutSetMode ( 32, 60 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The mode set operation failed // @@ -1779,7 +1779,7 @@ DrawUnicodeWeightAtCursorN ( String = AllocateCopyPool ((Count + 1) * sizeof (CHAR16), UnicodeWeight); if (String == NULL) { - FreePool (Blt); + FreePool(Blt); return EFI_OUT_OF_RESOURCES; } // @@ -1789,8 +1789,8 @@ DrawUnicodeWeightAtCursorN ( FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO)); if (FontInfo == NULL) { - FreePool (Blt); - FreePool (String); + FreePool(Blt); + FreePool(String); return EFI_OUT_OF_RESOURCES; } // @@ -1828,8 +1828,8 @@ DrawUnicodeWeightAtCursorN ( Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (Blt->Image.Bitmap == NULL) { - FreePool (Blt); - FreePool (String); + FreePool(Blt); + FreePool(String); return EFI_OUT_OF_RESOURCES; } @@ -1851,7 +1851,7 @@ DrawUnicodeWeightAtCursorN ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Line breaks are handled by caller of DrawUnicodeWeightAtCursorN, so the updated parameter RowInfoArraySize by StringToImage will // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure. @@ -1872,20 +1872,20 @@ DrawUnicodeWeightAtCursorN ( ); } - FreePool (RowInfoArray); - FreePool (Blt->Image.Bitmap); + FreePool(RowInfoArray); + FreePool(Blt->Image.Bitmap); } else { Status = EFI_UNSUPPORTED; } if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); } if (String != NULL) { - FreePool (String); + FreePool(String); } if (FontInfo != NULL) { - FreePool (FontInfo); + FreePool(FontInfo); } return Status; } @@ -2040,7 +2040,7 @@ RegisterFontPackage ( NULL, (VOID **) &HiiDatabase ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -2084,7 +2084,7 @@ RegisterFontPackage ( NULL ); ASSERT (mHiiHandle != NULL); - FreePool (Package); + FreePool(Package); } /** @@ -2128,7 +2128,7 @@ InitializeGraphicsConsole ( &gGraphicsConsoleComponentName, &gGraphicsConsoleComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutput.c b/MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutput.c index 99a76aa55..7468834fc 100644 --- a/MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutput.c +++ b/MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutput.c @@ -236,7 +236,7 @@ GraphicsOutputDriverBindingSupported ( if (Status == EFI_ALREADY_STARTED) { Status = EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } gBS->CloseProtocol ( @@ -260,7 +260,7 @@ GraphicsOutputDriverBindingSupported ( if (Status == EFI_ALREADY_STARTED) { Status = EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } gBS->CloseProtocol ( @@ -350,7 +350,7 @@ GraphicsOutputDriverBindingStart ( if (Status == EFI_ALREADY_STARTED) { Status = EFI_SUCCESS; } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->OpenProtocol ( Controller, @@ -363,13 +363,13 @@ GraphicsOutputDriverBindingStart ( if (Status == EFI_ALREADY_STARTED) { Status = EFI_SUCCESS; } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Read the PCI Class Code from the PCI Device // Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0, sizeof (Pci), &Pci); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (!IS_PCI_DISPLAY (&Pci) || ( ((DeviceInfo->VendorId != MAX_UINT16) && (DeviceInfo->VendorId != Pci.Hdr.VendorId)) || ((DeviceInfo->DeviceId != MAX_UINT16) && (DeviceInfo->DeviceId != Pci.Hdr.DeviceId)) || @@ -394,7 +394,7 @@ GraphicsOutputDriverBindingStart ( continue; } Status = PciIo->GetBarAttributes (PciIo, Index, NULL, (VOID**) &Resources); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "[%a]: BAR[%d]: Base = %lx, Length = %lx\n", gEfiCallerBaseName, Index, Resources->AddrRangeMin, Resources->AddrLen)); if ((Resources->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) && @@ -414,7 +414,7 @@ GraphicsOutputDriverBindingStart ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CloseProtocols; } @@ -446,7 +446,7 @@ GraphicsOutputDriverBindingStart ( 0, &Private->PciAttributes ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PciIo->Attributes ( PciIo, EfiPciIoAttributeOperationEnable, @@ -455,7 +455,7 @@ GraphicsOutputDriverBindingStart ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeMemory; } @@ -497,7 +497,7 @@ GraphicsOutputDriverBindingStart ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( Controller, &gEfiPciIoProtocolGuid, @@ -506,7 +506,7 @@ GraphicsOutputDriverBindingStart ( Private->GraphicsOutputHandle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { mDriverStarted = TRUE; } else { gBS->UninstallMultipleProtocolInterfaces ( @@ -519,7 +519,7 @@ GraphicsOutputDriverBindingStart ( } RestorePciAttributes: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Restore original PCI attributes // @@ -532,20 +532,20 @@ RestorePciAttributes: } FreeMemory: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Private != NULL) { if (Private->DevicePath != NULL) { - FreePool (Private->DevicePath); + FreePool(Private->DevicePath); } if (Private->FrameBufferBltLibConfigure != NULL) { - FreePool (Private->FrameBufferBltLibConfigure); + FreePool(Private->FrameBufferBltLibConfigure); } - FreePool (Private); + FreePool(Private); } } CloseProtocols: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Close the PCI I/O Protocol // @@ -605,7 +605,7 @@ GraphicsOutputDriverBindingStop ( This->DriverBindingHandle, Controller ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CloseProtocol ( Controller, @@ -613,7 +613,7 @@ GraphicsOutputDriverBindingStop ( This->DriverBindingHandle, Controller ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -626,7 +626,7 @@ GraphicsOutputDriverBindingStop ( ChildHandleBuffer[0], EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -638,7 +638,7 @@ GraphicsOutputDriverBindingStop ( This->DriverBindingHandle, Private->GraphicsOutputHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Remove the GOP protocol interface from the system // @@ -648,7 +648,7 @@ GraphicsOutputDriverBindingStop ( &gEfiDevicePathProtocolGuid, Private->DevicePath, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Restore original PCI attributes // @@ -658,10 +658,10 @@ GraphicsOutputDriverBindingStop ( Private->PciAttributes, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - FreePool (Private->DevicePath); - FreePool (Private->FrameBufferBltLibConfigure); + FreePool(Private->DevicePath); + FreePool(Private->FrameBufferBltLibConfigure); mDriverStarted = FALSE; } else { Status = gBS->OpenProtocol ( @@ -672,7 +672,7 @@ GraphicsOutputDriverBindingStop ( Private->GraphicsOutputHandle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return Status; } @@ -723,7 +723,7 @@ InitializeGraphicsOutput ( &mGraphicsOutputComponentName, &mGraphicsOutputComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c b/MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c index c06d21bfd..5903bb367 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c @@ -184,7 +184,7 @@ TerminalComponentNameGetControllerName ( gTerminalDriverBinding.DriverBindingHandle, &gEfiSerialIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -200,7 +200,7 @@ TerminalComponentNameGetControllerName ( ChildHandle, &gEfiSerialIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -215,7 +215,7 @@ TerminalComponentNameGetControllerName ( ChildHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index c76b2c510..bdfa176cd 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -212,7 +212,7 @@ TerminalDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -241,7 +241,7 @@ TerminalDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -286,7 +286,7 @@ TerminalFreeNotifyList ( TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE ); RemoveEntryList (ListHead->ForwardLink); - FreePool (NotifyNode); + FreePool(NotifyNode); } return EFI_SUCCESS; @@ -366,14 +366,14 @@ StartTerminalStateMachine ( TerminalDevice, &TerminalDevice->TimerEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->SetTimer ( TerminalDevice->TimerEvent, TimerPeriodic, KEYBOARD_TIMER_INTERVAL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CreateEvent ( EVT_TIMER, @@ -382,7 +382,7 @@ StartTerminalStateMachine ( NULL, &TerminalDevice->TwoSecondTimeOut ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -412,7 +412,7 @@ InitializeControllerNameTable ( mSerialConsoleNames[TerminalType], TRUE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = AddUnicodeString2 ( "en", gTerminalComponentName2.SupportedLanguages, @@ -420,11 +420,11 @@ InitializeControllerNameTable ( mSerialConsoleNames[TerminalType], FALSE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreeUnicodeStringTable (Table); } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *ControllerNameTable = Table; } return Status; @@ -482,7 +482,7 @@ TerminalDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); ASSERT ((Status == EFI_SUCCESS) || (Status == EFI_ALREADY_STARTED)); - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { return Status; } @@ -498,7 +498,7 @@ TerminalDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); ASSERT ((Status == EFI_SUCCESS) || (Status == EFI_ALREADY_STARTED)); - if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) { + if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) { return Status; } @@ -538,7 +538,7 @@ TerminalDriverBindingStart ( &OpenInfoBuffer, &EntryCount ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; for (Index = 0; Index < EntryCount; Index++) { if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) { @@ -550,20 +550,20 @@ TerminalDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { TerminalDevice = TERMINAL_CON_IN_DEV_FROM_THIS (SimpleTextInput); TerminalType = TerminalTypeFromGuid (&((VENDOR_DEVICE_PATH *) RemainingDevicePath)->Guid); ASSERT (TerminalType < ARRAY_SIZE (mTerminalType)); if (TerminalDevice->TerminalType != TerminalType) { Status = InitializeControllerNameTable (TerminalType, &ControllerNameTable); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { StopTerminalStateMachine (TerminalDevice); // // Update the device path // Vendor = TerminalDevice->DevicePath; Status = gBS->LocateDevicePath (&gEfiSerialIoProtocolGuid, &Vendor, &SerialIoHandle); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); CopyGuid (&((VENDOR_DEVICE_PATH *) Vendor)->Guid, mTerminalType[TerminalType]); Status = gBS->ReinstallProtocolInterface ( TerminalDevice->Handle, @@ -571,7 +571,7 @@ TerminalDriverBindingStart ( TerminalDevice->DevicePath, TerminalDevice->DevicePath ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { TerminalDevice->TerminalType = TerminalType; StartTerminalStateMachine (TerminalDevice); FreeUnicodeStringTable (TerminalDevice->ControllerNameTable); @@ -589,7 +589,7 @@ TerminalDriverBindingStart ( break; } } - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); } return Status; } @@ -626,7 +626,7 @@ TerminalDriverBindingStart ( // Build the component name for the child device // Status = InitializeControllerNameTable (TerminalDevice->TerminalType, &TerminalDevice->ControllerNameTable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeResources; } @@ -634,7 +634,7 @@ TerminalDriverBindingStart ( // Build the device path for the child device // Status = SetTerminalDevicePath (TerminalDevice->TerminalType, ParentDevicePath, &TerminalDevice->DevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto FreeResources; } @@ -646,7 +646,7 @@ TerminalDriverBindingStart ( TerminalDevice, &TerminalDevice->SimpleInputEx.WaitForKeyEx ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CreateEvent ( EVT_NOTIFY_WAIT, @@ -655,7 +655,7 @@ TerminalDriverBindingStart ( TerminalDevice, &TerminalDevice->SimpleInput.WaitForKey ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, @@ -663,7 +663,7 @@ TerminalDriverBindingStart ( TerminalDevice, &TerminalDevice->KeyNotifyProcessEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Allocates and initializes the FIFO buffer to be zero, used for accommodating @@ -705,7 +705,7 @@ TerminalDriverBindingStart ( (UINT8) Mode->DataBits, (EFI_STOP_BITS_TYPE) (Mode->StopBits) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // if set attributes operation fails, invalidate // the value of SerialInTimeOut,thus make it @@ -736,10 +736,10 @@ TerminalDriverBindingStart ( // SimpleTextOutput->Mode->CursorVisible = TRUE; Status = SimpleTextOutput->SetAttribute (SimpleTextOutput, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = SimpleTextOutput->Reset (SimpleTextOutput, FALSE); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ReportError; } @@ -747,7 +747,7 @@ TerminalDriverBindingStart ( // Initialize SimpleTextInput instance // Status = SimpleTextInput->Reset (SimpleTextInput, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ReportError; } @@ -759,7 +759,7 @@ TerminalDriverBindingStart ( &gEfiDevicePathProtocolGuid, TerminalDevice->DevicePath, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( Controller, &gEfiSerialIoProtocolGuid, @@ -768,7 +768,7 @@ TerminalDriverBindingStart ( TerminalDevice->Handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); StartTerminalStateMachine (TerminalDevice); return Status; } @@ -794,16 +794,16 @@ FreeResources: } if (TerminalDevice->RawFiFo != NULL) { - FreePool (TerminalDevice->RawFiFo); + FreePool(TerminalDevice->RawFiFo); } if (TerminalDevice->UnicodeFiFo != NULL) { - FreePool (TerminalDevice->UnicodeFiFo); + FreePool(TerminalDevice->UnicodeFiFo); } if (TerminalDevice->EfiKeyFiFo != NULL) { - FreePool (TerminalDevice->EfiKeyFiFo); + FreePool(TerminalDevice->EfiKeyFiFo); } if (TerminalDevice->EfiKeyFiFoForNotify != NULL) { - FreePool (TerminalDevice->EfiKeyFiFoForNotify); + FreePool(TerminalDevice->EfiKeyFiFoForNotify); } if (TerminalDevice->ControllerNameTable != NULL) { @@ -811,14 +811,14 @@ FreeResources: } if (TerminalDevice->DevicePath != NULL) { - FreePool (TerminalDevice->DevicePath); + FreePool(TerminalDevice->DevicePath); } if (TerminalDevice->TerminalConsoleModeData != NULL) { - FreePool (TerminalDevice->TerminalConsoleModeData); + FreePool(TerminalDevice->TerminalConsoleModeData); } - FreePool (TerminalDevice); + FreePool(TerminalDevice); CloseProtocols: @@ -836,7 +836,7 @@ CloseProtocols: This->DriverBindingHandle, Controller ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CloseProtocol ( Controller, @@ -844,7 +844,7 @@ CloseProtocols: This->DriverBindingHandle, Controller ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -896,7 +896,7 @@ TerminalDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Remove Parent Device Path from @@ -935,7 +935,7 @@ TerminalDriverBindingStop ( ChildHandleBuffer[Index], EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { TerminalDevice = TERMINAL_CON_OUT_DEV_FROM_THIS (SimpleTextOutput); @@ -958,7 +958,7 @@ TerminalDriverBindingStop ( TerminalDevice->DevicePath, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( Controller, &gEfiSerialIoProtocolGuid, @@ -975,13 +975,13 @@ TerminalDriverBindingStop ( gBS->CloseEvent (TerminalDevice->SimpleInputEx.WaitForKeyEx); gBS->CloseEvent (TerminalDevice->KeyNotifyProcessEvent); TerminalFreeNotifyList (&TerminalDevice->NotifyList); - FreePool (TerminalDevice->DevicePath); - FreePool (TerminalDevice->TerminalConsoleModeData); - FreePool (TerminalDevice); + FreePool(TerminalDevice->DevicePath); + FreePool(TerminalDevice->TerminalConsoleModeData); + FreePool(TerminalDevice); } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; } } @@ -1025,11 +1025,11 @@ MatchDevicePaths ( // return success // if (CompareMem (Single, DevicePathInst, Size) == 0) { - FreePool (DevicePathInst); + FreePool(DevicePathInst); return TRUE; } - FreePool (DevicePathInst); + FreePool(DevicePathInst); DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size); } @@ -1066,7 +1066,7 @@ TerminalUpdateConsoleDevVariable ( Status = EFI_SUCCESS; Variable = NULL; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -1081,13 +1081,13 @@ TerminalUpdateConsoleDevVariable ( NewVariable = AppendDevicePathInstance (Variable, TempDevicePath); if (NewVariable != NULL) { if (Variable != NULL) { - FreePool (Variable); + FreePool(Variable); } Variable = NewVariable; } } - FreePool (TempDevicePath); + FreePool(TempDevicePath); } } @@ -1102,7 +1102,7 @@ TerminalUpdateConsoleDevVariable ( Variable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { NameSize = StrSize (VariableName); SetVariableStatus = AllocatePool (sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + VariableSize); if (SetVariableStatus != NULL) { @@ -1124,11 +1124,11 @@ TerminalUpdateConsoleDevVariable ( sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + VariableSize ); - FreePool (SetVariableStatus); + FreePool(SetVariableStatus); } } - FreePool (Variable); + FreePool(Variable); return ; } @@ -1179,7 +1179,7 @@ TerminalRemoveConsoleDevVariable ( // Instance = GetNextDevicePathInstance (&Variable, &InstanceSize); if (Instance == NULL) { - FreePool (OriginalVariable); + FreePool(OriginalVariable); return ; } // @@ -1203,7 +1203,7 @@ TerminalRemoveConsoleDevVariable ( FoundOne = TRUE; } - FreePool (TempDevicePath); + FreePool(TempDevicePath); } } // @@ -1213,17 +1213,17 @@ TerminalRemoveConsoleDevVariable ( SavedNewVariable = NewVariable; NewVariable = AppendDevicePathInstance (NewVariable, Instance); if (SavedNewVariable != NULL) { - FreePool (SavedNewVariable); + FreePool(SavedNewVariable); } } // // Get next device path instance from Variable // - FreePool (Instance); + FreePool(Instance); Instance = GetNextDevicePathInstance (&Variable, &InstanceSize); } while (Instance != NULL); - FreePool (OriginalVariable); + FreePool(OriginalVariable); if (FoundOne) { VariableSize = GetDevicePathSize (NewVariable); @@ -1238,11 +1238,11 @@ TerminalRemoveConsoleDevVariable ( // // Shrinking variable with existing variable driver implementation shouldn't fail. // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (NewVariable != NULL) { - FreePool (NewVariable); + FreePool(NewVariable); } return ; @@ -1320,7 +1320,7 @@ InitializeTerminal( &gTerminalComponentName, &gTerminalComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 4ede41677..043a5ac0f 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c @@ -89,7 +89,7 @@ TerminalConInReset ( TerminalDevice->EfiKeyFiFo->Head = TerminalDevice->EfiKeyFiFo->Tail; TerminalDevice->EfiKeyFiFoForNotify->Head = TerminalDevice->EfiKeyFiFoForNotify->Tail; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, (EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_CONTROLLER_ERROR), @@ -130,7 +130,7 @@ TerminalConInReadKeyStroke ( TerminalDevice = TERMINAL_CON_IN_DEV_FROM_THIS (This); Status = ReadKeyStrokeWorker (TerminalDevice, &KeyData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -220,7 +220,7 @@ TerminalConInResetEx ( TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This); Status = TerminalDevice->SimpleInput.Reset (&TerminalDevice->SimpleInput, ExtendedVerification); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -424,7 +424,7 @@ TerminalConInUnregisterKeyNotify ( // RemoveEntryList (&CurrentNotify->NotifyEntry); - gBS->FreePool (CurrentNotify); + gBS->FreePool(CurrentNotify); return EFI_SUCCESS; } } @@ -552,7 +552,7 @@ TerminalConInTimerHandler ( (EFI_STOP_BITS_TYPE) (Mode->StopBits) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { TerminalDevice->SerialInTimeOut = 0; } else { TerminalDevice->SerialInTimeOut = SerialInTimeOut; @@ -564,7 +564,7 @@ TerminalConInTimerHandler ( // successfully reports EFI_SERIAL_INPUT_BUFFER_EMPTY. // Status = SerialIo->GetControl (SerialIo, &Control); - if (EFI_ERROR (Status) || ((Control & EFI_SERIAL_INPUT_BUFFER_EMPTY) == 0)) { + if (EFI_ERROR(Status) || ((Control & EFI_SERIAL_INPUT_BUFFER_EMPTY) == 0)) { // // Fetch all the keys in the serial buffer, // and insert the byte stream into RawFIFO. @@ -573,7 +573,7 @@ TerminalConInTimerHandler ( Status = GetOneKeyFromSerial (TerminalDevice->SerialIo, &Input); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_DEVICE_ERROR) { REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -677,7 +677,7 @@ GetOneKeyFromSerial ( // Status = SerialIo->Read (SerialIo, &Size, Output); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_TIMEOUT) { return EFI_NOT_READY; @@ -1339,7 +1339,7 @@ UnicodeToEfiKey ( TimerStatus = gBS->CheckEvent (TerminalDevice->TwoSecondTimeOut); - if (!EFI_ERROR (TimerStatus)) { + if (!EFI_ERROR(TimerStatus)) { UnicodeToEfiKeyFlushState (TerminalDevice); TerminalDevice->ResetState = RESET_STATE_DEFAULT; } @@ -1351,7 +1351,7 @@ UnicodeToEfiKey ( // Check to see if the 2 seconds timer has expired // TimerStatus = gBS->CheckEvent (TerminalDevice->TwoSecondTimeOut); - if (!EFI_ERROR (TimerStatus)) { + if (!EFI_ERROR(TimerStatus)) { UnicodeToEfiKeyFlushState (TerminalDevice); TerminalDevice->ResetState = RESET_STATE_DEFAULT; } @@ -1814,7 +1814,7 @@ UnicodeToEfiKey ( TimerRelative, (UINT64)20000000 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); continue; } diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c index 7ef655cca..7336a5f53 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c @@ -126,7 +126,7 @@ TerminalConOutReset ( ); Status = TerminalDevice->SerialIo->Reset (TerminalDevice->SerialIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Report error code here // @@ -259,7 +259,7 @@ TerminalConOutOutputString ( &GraphicChar ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto OutputError; } @@ -273,7 +273,7 @@ TerminalConOutOutputString ( &Length, (UINT8 *) &Utf8Char ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto OutputError; } break; @@ -332,7 +332,7 @@ TerminalConOutOutputString ( CrLfStr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto OutputError; } } @@ -498,14 +498,14 @@ TerminalConOutSetMode ( Status = This->OutputString (This, mSetModeString); TerminalDevice->OutputEscChar = FALSE; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } This->Mode->Mode = (INT32) ModeNumber; Status = This->ClearScreen (This); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -671,7 +671,7 @@ TerminalConOutSetAttribute ( Status = This->OutputString (This, mSetAttributeString); TerminalDevice->OutputEscChar = FALSE; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } // @@ -717,7 +717,7 @@ TerminalConOutClearScreen ( Status = This->OutputString (This, mClearScreenString); TerminalDevice->OutputEscChar = FALSE; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -771,7 +771,7 @@ TerminalConOutSetCursorPosition ( &MaxColumn, &MaxRow ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -813,7 +813,7 @@ TerminalConOutSetCursorPosition ( Status = This->OutputString (This, String); TerminalDevice->OutputEscChar = FALSE; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } // diff --git a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c index c3e7db4c4..da18f72ed 100644 --- a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c +++ b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c @@ -70,7 +70,7 @@ GetDebugPortVariable ( } if (IsDevicePathEnd (DevicePath)) { - FreePool (DebugPortVariable); + FreePool(DebugPortVariable); return NULL; } else { CopyMem ( @@ -134,7 +134,7 @@ InitializeDebugPortDriver ( &gDebugPortComponentName, &gDebugPortComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -217,8 +217,8 @@ DebugPortSupported ( Status = EFI_UNSUPPORTED; } - FreePool (DebugPortVariable); - if (EFI_ERROR (Status)) { + FreePool(DebugPortVariable); + if (EFI_ERROR(Status)) { return Status; } } @@ -231,7 +231,7 @@ DebugPortSupported ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -280,7 +280,7 @@ DebugPortStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -298,7 +298,7 @@ DebugPortStart ( mDebugPortDevice.DataBits, mDebugPortDevice.StopBits ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mDebugPortDevice.BaudRate = 0; mDebugPortDevice.Parity = DefaultParity; mDebugPortDevice.DataBits = 0; @@ -313,7 +313,7 @@ DebugPortStart ( mDebugPortDevice.DataBits, mDebugPortDevice.StopBits ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiSerialIoProtocolGuid, @@ -356,7 +356,7 @@ DebugPortStart ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiSerialIoProtocolGuid, @@ -377,7 +377,7 @@ DebugPortStart ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, &gEfiSerialIoProtocolGuid, @@ -435,7 +435,7 @@ DebugPortStop ( ControllerHandle ); - FreePool (mDebugPortDevice.DebugPortDevicePath); + FreePool(mDebugPortDevice.DebugPortDevicePath); return EFI_SUCCESS; } else { @@ -449,7 +449,7 @@ DebugPortStop ( mDebugPortDevice.DebugPortDeviceHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -464,7 +464,7 @@ DebugPortStop ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->OpenProtocol ( ControllerHandle, &gEfiSerialIoProtocolGuid, @@ -555,7 +555,7 @@ DebugPortRead ( } else { Timeout = 0; } - } else if (EFI_ERROR (Status)) { + } else if (EFI_ERROR(Status)) { break; } @@ -602,7 +602,7 @@ DebugPortWrite ( DebugPortDevice = DEBUGPORT_DEVICE_FROM_THIS (This); WriteSize = 8; - for (Position = 0; Position < *BufferSize && !EFI_ERROR (Status); Position += WriteSize) { + for (Position = 0; Position < *BufferSize && !EFI_ERROR(Status); Position += WriteSize) { DebugPortDevice->SerialIoBinding->GetControl ( DebugPortDevice->SerialIoBinding, &SerialControl @@ -652,7 +652,7 @@ DebugPortPoll ( &SerialControl ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((SerialControl & EFI_SERIAL_INPUT_BUFFER_EMPTY) != 0) { Status = EFI_NOT_READY; } else { @@ -692,12 +692,12 @@ ImageUnloadHandler ( // Driver is stopped already. // Status = gBS->HandleProtocol (ImageHandle, &gEfiComponentNameProtocolGuid, &ComponentName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ComponentName = NULL; } Status = gBS->HandleProtocol (ImageHandle, &gEfiComponentName2ProtocolGuid, &ComponentName2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ComponentName2 = NULL; } diff --git a/MdeModulePkg/Universal/DebugSupportDxe/DebugSupport.c b/MdeModulePkg/Universal/DebugSupportDxe/DebugSupport.c index 1a03ba465..844a92e70 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/DebugSupport.c +++ b/MdeModulePkg/Universal/DebugSupportDxe/DebugSupport.c @@ -72,12 +72,12 @@ InitializeDebugSupportDriver ( // // a Debug Support protocol has been installed for this processor // - FreePool (HandlePtr); + FreePool(HandlePtr); Status = EFI_ALREADY_STARTED; goto ErrExit; } } while (NumHandles > 0); - FreePool (HandlePtr); + FreePool(HandlePtr); } // @@ -91,7 +91,7 @@ InitializeDebugSupportDriver ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); if (Status != EFI_SUCCESS) { goto ErrExit; } @@ -102,7 +102,7 @@ InitializeDebugSupportDriver ( // Call hook for processor specific initialization // Status = PlInitializeDebugSupportDriver (); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); if (Status != EFI_SUCCESS) { goto ErrExit; } @@ -117,7 +117,7 @@ InitializeDebugSupportDriver ( EFI_NATIVE_INTERFACE, &mDebugSupportProtocolInterface ); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); if (Status != EFI_SUCCESS) { goto ErrExit; } diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c index afea3a218..5e23c225f 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c +++ b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c @@ -301,11 +301,11 @@ PlUnloadDebugSupportDriver ( // Free space for each Interrupt Stub precedure. // if (IdtEntryTable[ExceptionType].StubEntry != NULL) { - FreePool ((VOID *)(UINTN)IdtEntryTable[ExceptionType].StubEntry); + FreePool((VOID *)(UINTN)IdtEntryTable[ExceptionType].StubEntry); } } - FreePool (IdtEntryTable); + FreePool(IdtEntryTable); return EFI_SUCCESS; } @@ -358,10 +358,10 @@ ErrorCleanup: for (ExceptionType = 0; ExceptionType < NUM_IDT_ENTRIES; ExceptionType++) { if (IdtEntryTable[ExceptionType].StubEntry != NULL) { - FreePool ((VOID *)(UINTN)IdtEntryTable[ExceptionType].StubEntry); + FreePool((VOID *)(UINTN)IdtEntryTable[ExceptionType].StubEntry); } } - FreePool (IdtEntryTable); + FreePool(IdtEntryTable); return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c index fd34f07ee..713964f13 100644 --- a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c +++ b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c @@ -34,7 +34,7 @@ CdExpressPeimEntry ( EFI_STATUS Status; PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData; - if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) { + if (!EFI_ERROR(PeiServicesRegisterForShadow (FileHandle))) { return EFI_SUCCESS; } @@ -80,7 +80,7 @@ CdExpressPeimEntry ( PrivateData->PpiDescriptor.Ppi = &PrivateData->DeviceRecoveryPpi; Status = PeiServicesInstallPpi (&PrivateData->PpiDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } // @@ -189,7 +189,7 @@ UpdateBlocksAndVolumes ( (VOID **) &BlockIoPpi ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Done with all Block Io Ppis // @@ -210,7 +210,7 @@ UpdateBlocksAndVolumes ( &NumberBlockDevices ); } - if (EFI_ERROR (Status) || (NumberBlockDevices == 0)) { + if (EFI_ERROR(Status) || (NumberBlockDevices == 0)) { continue; } // @@ -224,7 +224,7 @@ UpdateBlocksAndVolumes ( IndexBlockDevice, &Media2 ); - if (EFI_ERROR (Status) || + if (EFI_ERROR(Status) || !Media2.MediaPresent || ((Media2.InterfaceType != MSG_ATAPI_DP) && (Media2.InterfaceType != MSG_USB_DP)) || (Media2.BlockSize != PEI_CD_BLOCK_SIZE) @@ -241,7 +241,7 @@ UpdateBlocksAndVolumes ( IndexBlockDevice, &Media ); - if (EFI_ERROR (Status) || + if (EFI_ERROR(Status) || !Media.MediaPresent || ((Media.DeviceType != IdeCDROM) && (Media.DeviceType != UsbMassStorage)) || (Media.BlockSize != PEI_CD_BLOCK_SIZE) @@ -265,7 +265,7 @@ UpdateBlocksAndVolumes ( Status = FindRecoveryCapsules (PrivateData); DEBUG ((EFI_D_INFO, "Status is %d\n", Status)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -343,7 +343,7 @@ FindRecoveryCapsules ( Buffer ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -380,7 +380,7 @@ FindRecoveryCapsules ( RootDirLBA = RoorDirRecord->LocationOfExtent[0]; Status = RetrieveCapsuleFileFromRoot (PrivateData, BlockIoPpi, BlockIo2Ppi, IndexBlockDevice, RootDirLBA); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Just look for the first primary descriptor // @@ -447,7 +447,7 @@ RetrieveCapsuleFileFromRoot ( Buffer ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -583,7 +583,7 @@ GetRecoveryCapsuleInfo ( Status = GetNumberRecoveryCapsules (PeiServices, This, &NumberRecoveryCapsules); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -639,7 +639,7 @@ LoadRecoveryCapsule ( Status = GetNumberRecoveryCapsules (PeiServices, This, &NumberRecoveryCapsules); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c index e19466bd2..f2037a264 100644 --- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c +++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c @@ -83,7 +83,7 @@ DiskIoDriverBindingSupported ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -141,7 +141,7 @@ DiskIoDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit1; } @@ -153,7 +153,7 @@ DiskIoDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gDiskIoPrivateDataTemplate.BlockIo2 = NULL; } @@ -204,7 +204,7 @@ DiskIoDriverBindingStart ( } ErrorExit: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Instance != NULL && Instance->SharedWorkingBuffer != NULL) { FreeAlignedPages ( Instance->SharedWorkingBuffer, @@ -213,7 +213,7 @@ ErrorExit: } if (Instance != NULL) { - FreePool (Instance); + FreePool(Instance); } gBS->CloseProtocol ( @@ -269,7 +269,7 @@ DiskIoDriverBindingStop ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->OpenProtocol ( @@ -280,7 +280,7 @@ DiskIoDriverBindingStop ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DiskIo2 = NULL; } @@ -292,7 +292,7 @@ DiskIoDriverBindingStop ( // ASSERT (Instance->BlockIo2 != NULL); Status = Instance->BlockIo2->Reset (Instance->BlockIo2, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->UninstallMultipleProtocolInterfaces ( @@ -308,7 +308,7 @@ DiskIoDriverBindingStop ( NULL ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { do { EfiAcquireLock (&Instance->TaskQueueLock); @@ -327,7 +327,7 @@ DiskIoDriverBindingStop ( This->DriverBindingHandle, ControllerHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (DiskIo2 != NULL) { Status = gBS->CloseProtocol ( ControllerHandle, @@ -335,10 +335,10 @@ DiskIoDriverBindingStop ( This->DriverBindingHandle, ControllerHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } - FreePool (Instance); + FreePool(Instance); } return Status; @@ -382,7 +382,7 @@ DiskIoDestroySubtask ( gBS->CloseEvent (Subtask->BlockIo2Token.Event); } } - FreePool (Subtask); + FreePool(Subtask); return Link; } @@ -414,7 +414,7 @@ DiskIo2OnReadWriteComplete ( ASSERT (Instance->Signature == DISK_IO_PRIVATE_DATA_SIGNATURE); ASSERT (Task->Signature == DISK_IO2_TASK_SIGNATURE); - if ((Subtask->WorkingBuffer != NULL) && !EFI_ERROR (TransactionStatus) && + if ((Subtask->WorkingBuffer != NULL) && !EFI_ERROR(TransactionStatus) && (Task->Token != NULL) && !Subtask->Write ) { CopyMem (Subtask->Buffer, Subtask->WorkingBuffer + Subtask->Offset, Subtask->Length); @@ -422,7 +422,7 @@ DiskIo2OnReadWriteComplete ( DiskIoDestroySubtask (Instance, Subtask); - if (EFI_ERROR (TransactionStatus) || IsListEmpty (&Task->Subtasks)) { + if (EFI_ERROR(TransactionStatus) || IsListEmpty (&Task->Subtasks)) { if (Task->Token != NULL) { // // Signal error status once the subtask is failed. @@ -486,8 +486,8 @@ DiskIoCreateSubtask ( Subtask, &Subtask->BlockIo2Token.Event ); - if (EFI_ERROR (Status)) { - FreePool (Subtask); + if (EFI_ERROR(Status)) { + FreePool(Subtask); return NULL; } } @@ -771,7 +771,7 @@ DiskIo2RemoveCompletedTask ( if (IsListEmpty (&Task->Subtasks)) { Link = RemoveEntryList (&Task->Link); ASSERT (Task->Token == NULL); - FreePool (Task); + FreePool(Task); } else { Link = GetNextNode (&Instance->TaskQueue, Link); QueueEmpty = FALSE; @@ -856,7 +856,7 @@ DiskIo2ReadWriteDisk ( InitializeListHead (SubtasksPtr); if (!DiskIoCreateSubtaskList (Instance, Write, Offset, BufferSize, Buffer, Blocking, Instance->SharedWorkingBuffer, SubtasksPtr)) { if (Task != NULL) { - FreePool (Task); + FreePool(Task); } return EFI_OUT_OF_RESOURCES; } @@ -915,7 +915,7 @@ DiskIo2ReadWriteDisk ( (Subtask->Length % Media->BlockSize == 0) ? Subtask->Length : Media->BlockSize, (Subtask->WorkingBuffer != NULL) ? Subtask->WorkingBuffer : Subtask->Buffer ); - if (!EFI_ERROR (Status) && (Subtask->WorkingBuffer != NULL)) { + if (!EFI_ERROR(Status) && (Subtask->WorkingBuffer != NULL)) { CopyMem (Subtask->Buffer, Subtask->WorkingBuffer + Subtask->Offset, Subtask->Length); } } else { @@ -930,7 +930,7 @@ DiskIo2ReadWriteDisk ( } } - if (SubtaskBlocking || EFI_ERROR (Status)) { + if (SubtaskBlocking || EFI_ERROR(Status)) { // // Make sure the subtask list only contains non-blocking subtasks. // Remove failed non-blocking subtasks as well because the callback won't be called. @@ -938,7 +938,7 @@ DiskIo2ReadWriteDisk ( DiskIoDestroySubtask (Instance, Subtask); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -949,7 +949,7 @@ DiskIo2ReadWriteDisk ( // Remove all the remaining subtasks when failure. // We shouldn't remove all the tasks because the non-blocking requests have been submitted and cannot be canceled. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { while (!IsNull (SubtasksPtr, NextLink)) { Subtask = CR (NextLink, DISK_IO_SUBTASK, Link, DISK_IO_SUBTASK_SIGNATURE); NextLink = DiskIoDestroySubtask (Instance, Subtask); @@ -965,7 +965,7 @@ DiskIo2ReadWriteDisk ( RemoveEntryList (&Task->Link); EfiReleaseLock (&Instance->TaskQueueLock); - if (!EFI_ERROR (Status) && (Task->Token != NULL)) { + if (!EFI_ERROR(Status) && (Task->Token != NULL)) { // // Task->Token should be set to NULL by the DiskIo2OnReadWriteComplete // It it's not, that means the non-blocking request was downgraded to blocking request. @@ -975,7 +975,7 @@ DiskIo2ReadWriteDisk ( gBS->SignalEvent (Task->Token->Event); } - FreePool (Task); + FreePool(Task); } gBS->RestoreTPL (OldTpl); @@ -1083,7 +1083,7 @@ DiskIo2OnFlushComplete ( Task->Token->TransactionStatus = Task->BlockIo2Token.TransactionStatus; gBS->SignalEvent (Task->Token->Event); - FreePool (Task); + FreePool(Task); } /** @@ -1127,16 +1127,16 @@ DiskIo2FlushDiskEx ( Task, &Task->BlockIo2Token.Event ); - if (EFI_ERROR (Status)) { - FreePool (Task); + if (EFI_ERROR(Status)) { + FreePool(Task); return Status; } Task->Signature = DISK_IO2_FLUSH_TASK_SIGNATURE; Task->Token = Token; Status = Private->BlockIo2->FlushBlocksEx (Private->BlockIo2, &Task->BlockIo2Token); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (Task->BlockIo2Token.Event); - FreePool (Task); + FreePool(Task); } } else { Status = Private->BlockIo2->FlushBlocksEx (Private->BlockIo2, NULL); @@ -1256,7 +1256,7 @@ InitializeDiskIo ( &gDiskIoComponentName, &gDiskIoComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c b/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c index 3d2ff3bc2..a89bc7efb 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c @@ -95,7 +95,7 @@ PartitionInstallElToritoChildHandles ( SIZE_2KB, VolDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Found = Status; break; } @@ -140,7 +140,7 @@ PartitionInstallElToritoChildHandles ( SIZE_2KB, Catalog ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "EltCheckDevice: error reading catalog %r\n", Status)); continue; } @@ -263,13 +263,13 @@ PartitionInstallElToritoChildHandles ( SubBlockSize, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Found = EFI_SUCCESS; } } } - FreePool (VolDescriptor); + FreePool(VolDescriptor); return Found; } diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c index aefb2d6ec..10f263f58 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c @@ -255,7 +255,7 @@ PartitionInstallGptChildHandles ( BlockSize, ProtectiveMbr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GptValidStatus = Status; goto Done; } @@ -339,7 +339,7 @@ PartitionInstallGptChildHandles ( PrimaryHeader->NumberOfPartitionEntries * (PrimaryHeader->SizeOfPartitionEntry), PartEntry ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GptValidStatus = Status; DEBUG ((EFI_D_ERROR, " Partition Entry ReadDisk error\n")); goto Done; @@ -430,19 +430,19 @@ PartitionInstallGptChildHandles ( Done: if (ProtectiveMbr != NULL) { - FreePool (ProtectiveMbr); + FreePool(ProtectiveMbr); } if (PrimaryHeader != NULL) { - FreePool (PrimaryHeader); + FreePool(PrimaryHeader); } if (BackupHeader != NULL) { - FreePool (BackupHeader); + FreePool(BackupHeader); } if (PartEntry != NULL) { - FreePool (PartEntry); + FreePool(PartEntry); } if (PEntryStatus != NULL) { - FreePool (PEntryStatus); + FreePool(PEntryStatus); } return GptValidStatus; @@ -495,8 +495,8 @@ PartitionValidGptTable ( BlockSize, PartHdr ); - if (EFI_ERROR (Status)) { - FreePool (PartHdr); + if (EFI_ERROR(Status)) { + FreePool(PartHdr); return FALSE; } @@ -506,7 +506,7 @@ PartitionValidGptTable ( (PartHdr->SizeOfPartitionEntry < sizeof (EFI_PARTITION_ENTRY)) ) { DEBUG ((EFI_D_INFO, "Invalid efi partition table header\n")); - FreePool (PartHdr); + FreePool(PartHdr); return FALSE; } @@ -514,18 +514,18 @@ PartitionValidGptTable ( // Ensure the NumberOfPartitionEntries * SizeOfPartitionEntry doesn't overflow. // if (PartHdr->NumberOfPartitionEntries > DivU64x32 (MAX_UINTN, PartHdr->SizeOfPartitionEntry)) { - FreePool (PartHdr); + FreePool(PartHdr); return FALSE; } CopyMem (PartHeader, PartHdr, sizeof (EFI_PARTITION_TABLE_HEADER)); if (!PartitionCheckGptEntryArrayCRC (BlockIo, DiskIo, PartHeader)) { - FreePool (PartHdr); + FreePool(PartHdr); return FALSE; } DEBUG ((EFI_D_INFO, " Valid efi partition table header\n")); - FreePool (PartHdr); + FreePool(PartHdr); return TRUE; } @@ -569,21 +569,21 @@ PartitionCheckGptEntryArrayCRC ( PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (Ptr); + if (EFI_ERROR(Status)) { + FreePool(Ptr); return FALSE; } Size = PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry; Status = gBS->CalculateCrc32 (Ptr, Size, &Crc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "CheckPEntryArrayCRC: Crc calculation failed\n")); - FreePool (Ptr); + FreePool(Ptr); return FALSE; } - FreePool (Ptr); + FreePool(Ptr); return (BOOLEAN) (PartHeader->PartitionEntryArrayCRC32 == Crc); } @@ -646,7 +646,7 @@ PartitionRestoreGptTable ( BlockSize, PartHdr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -664,7 +664,7 @@ PartitionRestoreGptTable ( PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry, Ptr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -677,13 +677,13 @@ PartitionRestoreGptTable ( ); Done: - FreePool (PartHdr); + FreePool(PartHdr); if (Ptr != NULL) { - FreePool (Ptr); + FreePool(Ptr); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -861,7 +861,7 @@ PartitionCheckCrcAltSize ( Hdr->CRC32 = 0; Status = gBS->CalculateCrc32 ((UINT8 *) Hdr, Size, &Crc); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "CheckCrc32: Crc calculation failed\n")); return FALSE; } diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c index dac451a14..73a8286ff 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c @@ -163,7 +163,7 @@ PartitionInstallMbrChildHandles ( BlockSize, Mbr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Found = Status; goto Done; } @@ -252,7 +252,7 @@ PartitionInstallMbrChildHandles ( ((Mbr->Partition[Index].OSIndicator == EFI_PARTITION) ? &gEfiPartTypeSystemPartGuid: NULL) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Found = EFI_SUCCESS; } } @@ -273,7 +273,7 @@ PartitionInstallMbrChildHandles ( BlockSize, Mbr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Found = Status; goto Done; } @@ -323,7 +323,7 @@ PartitionInstallMbrChildHandles ( MBR_SIZE, ((Mbr->Partition[0].OSIndicator == EFI_PARTITION) ? &gEfiPartTypeSystemPartGuid: NULL) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Found = EFI_SUCCESS; } @@ -344,7 +344,7 @@ PartitionInstallMbrChildHandles ( } Done: - FreePool (Mbr); + FreePool(Mbr); return Found; } diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c index d1c878ad2..5071b498a 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c @@ -107,7 +107,7 @@ PartitionDriverBindingSupported ( if (Status == EFI_ALREADY_STARTED) { return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -135,7 +135,7 @@ PartitionDriverBindingSupported ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -226,7 +226,7 @@ PartitionDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -238,7 +238,7 @@ PartitionDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BlockIo2 = NULL; } @@ -253,7 +253,7 @@ PartitionDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { goto Exit; } @@ -268,7 +268,7 @@ PartitionDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { gBS->CloseProtocol ( ControllerHandle, &gEfiDevicePathProtocolGuid, @@ -288,7 +288,7 @@ PartitionDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) { + if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { DiskIo2 = NULL; } @@ -315,7 +315,7 @@ PartitionDriverBindingStart ( BlockIo2, ParentDevicePath ); - if (!EFI_ERROR (Status) || Status == EFI_MEDIA_CHANGED || Status == EFI_NO_MEDIA) { + if (!EFI_ERROR(Status) || Status == EFI_MEDIA_CHANGED || Status == EFI_NO_MEDIA) { break; } Routine++; @@ -333,8 +333,8 @@ PartitionDriverBindingStart ( // when this happen. The "media change" case includes either the status is // EFI_MEDIA_CHANGED or it is a "media" to "no media" change. // - if (EFI_ERROR (Status) && - !EFI_ERROR (OpenStatus) && + if (EFI_ERROR(Status) && + !EFI_ERROR(OpenStatus) && Status != EFI_MEDIA_CHANGED && !(MediaPresent && Status == EFI_NO_MEDIA)) { gBS->CloseProtocol ( @@ -539,7 +539,7 @@ PartitionDriverBindingStop ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Private->InStop = FALSE; gBS->OpenProtocol ( ControllerHandle, @@ -550,11 +550,11 @@ PartitionDriverBindingStop ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); } else { - FreePool (Private->DevicePath); - FreePool (Private); + FreePool(Private->DevicePath); + FreePool(Private); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AllChildrenStopped = FALSE; if (Status == EFI_MEDIA_CHANGED) { break; @@ -845,7 +845,7 @@ PartitionOnAccessComplete ( Task->BlockIo2Token->TransactionStatus = Task->DiskIo2Token.TransactionStatus; gBS->SignalEvent (Task->BlockIo2Token->Event); - FreePool (Task); + FreePool(Task); } /** @@ -875,8 +875,8 @@ PartitionCreateAccessTask ( Task, &Task->DiskIo2Token.Event ); - if (EFI_ERROR (Status)) { - FreePool (Task); + if (EFI_ERROR(Status)) { + FreePool(Task); return NULL; } @@ -952,9 +952,9 @@ PartitionReadBlocksEx ( } Status = Private->DiskIo2->ReadDiskEx (Private->DiskIo2, MediaId, Offset, &Task->DiskIo2Token, BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (Task->DiskIo2Token.Event); - FreePool (Task); + FreePool(Task); } } else { Status = Private->DiskIo2->ReadDiskEx (Private->DiskIo2, MediaId, Offset, NULL, BufferSize, Buffer); @@ -1028,9 +1028,9 @@ PartitionWriteBlocksEx ( } Status = Private->DiskIo2->WriteDiskEx (Private->DiskIo2, MediaId, Offset, &Task->DiskIo2Token, BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (Task->DiskIo2Token.Event); - FreePool (Task); + FreePool(Task); } } else { Status = Private->DiskIo2->WriteDiskEx (Private->DiskIo2, MediaId, Offset, NULL, BufferSize, Buffer); @@ -1080,9 +1080,9 @@ PartitionFlushBlocksEx ( } Status = Private->DiskIo2->FlushDiskEx (Private->DiskIo2, &Task->DiskIo2Token); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (Task->DiskIo2Token.Event); - FreePool (Task); + FreePool(Task); } } else { Status = Private->DiskIo2->FlushDiskEx (Private->DiskIo2, NULL); @@ -1212,7 +1212,7 @@ PartitionInstallChildHandle ( Private->DevicePath = AppendDevicePathNode (ParentDevicePath, DevicePathNode); if (Private->DevicePath == NULL) { - FreePool (Private); + FreePool(Private); return EFI_OUT_OF_RESOURCES; } @@ -1261,7 +1261,7 @@ PartitionInstallChildHandle ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Open the Parent Handle for the child // @@ -1274,8 +1274,8 @@ PartitionInstallChildHandle ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); } else { - FreePool (Private->DevicePath); - FreePool (Private); + FreePool(Private->DevicePath); + FreePool(Private); } return Status; @@ -1312,7 +1312,7 @@ InitializePartition ( &gPartitionComponentName, &gPartitionComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; @@ -1344,14 +1344,14 @@ HasChildren ( &OpenInfoBuffer, &EntryCount ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); for (Index = 0; Index < EntryCount; Index++) { if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) { break; } } - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); return (BOOLEAN) (Index < EntryCount); } diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c index 3bf89a187..fdba45b7e 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c @@ -128,7 +128,7 @@ FindAnchorVolumeDescriptorPointer ( sizeof (*AnchorPoint), AnchorPoint ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -152,7 +152,7 @@ FindAnchorVolumeDescriptorPointer ( sizeof (*AnchorPoint), AnchorPoint ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -183,7 +183,7 @@ FindAnchorVolumeDescriptorPointer ( sizeof (*AnchorPoint), AnchorPoint ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -219,7 +219,7 @@ FindAnchorVolumeDescriptorPointer ( Size, AnchorPoints ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Out_Free; } @@ -259,7 +259,7 @@ FindAnchorVolumeDescriptorPointer ( } Out_Free: - FreePool (AnchorPoints); + FreePool(AnchorPoints); return Status; } @@ -307,7 +307,7 @@ FindUdfVolumeIdentifiers ( sizeof (CDROM_VOLUME_DESCRIPTOR), (VOID *)&VolDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -342,7 +342,7 @@ FindUdfVolumeIdentifiers ( sizeof (CDROM_VOLUME_DESCRIPTOR), (VOID *)&VolDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -370,7 +370,7 @@ FindUdfVolumeIdentifiers ( sizeof (CDROM_VOLUME_DESCRIPTOR), (VOID *)&VolDescriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -527,7 +527,7 @@ FindLogicalVolumeLocation ( BlockSize, Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Out_Free; } @@ -591,7 +591,7 @@ FindLogicalVolumeLocation ( // // Check if LVD was found // - if (!EFI_ERROR (Status) && LvdsCount == 1) { + if (!EFI_ERROR(Status) && LvdsCount == 1) { *MainVdsStartBlock = GuardMainVdsStartBlock; // // We do not need to read either LVD or PD descriptors to know the last @@ -607,7 +607,7 @@ Out_Free: // // Free block read buffer // - FreePool (Buffer); + FreePool(Buffer); return Status; } @@ -646,7 +646,7 @@ FindUdfFileSystem ( // Find UDF volume identifiers // Status = FindUdfVolumeIdentifiers (BlockIo, DiskIo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -659,7 +659,7 @@ FindUdfFileSystem ( &AnchorPoint, &LastRecordedBlock ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -742,7 +742,7 @@ PartitionInstallUdfChildHandles ( BlockIo2, DevicePath ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "PartitionDxe: El Torito standard found on handle 0x%p.\n", Handle)); ChildCreated = TRUE; } @@ -751,7 +751,7 @@ PartitionInstallUdfChildHandles ( // Search for an UDF file system on block device // Status = FindUdfFileSystem (BlockIo, DiskIo, &StartingLBA, &EndingLBA); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return (ChildCreated ? EFI_SUCCESS : EFI_NOT_FOUND); } @@ -780,7 +780,7 @@ PartitionInstallUdfChildHandles ( Media->BlockSize, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return (ChildCreated ? EFI_SUCCESS : Status); } diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskBlockIo.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskBlockIo.c index 13f81bae1..79c0ac858 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskBlockIo.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskBlockIo.c @@ -354,7 +354,7 @@ RamDiskBlkIo2ReadBlocksEx ( BufferSize, Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -425,7 +425,7 @@ RamDiskBlkIo2WriteBlocksEx ( BufferSize, Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c index a80ef271d..a38dba2ea 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c @@ -65,7 +65,7 @@ RamDiskAcpiCheck ( NULL, (VOID **)&mAcpiTableProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_INFO, "RamDiskAcpiCheck: Cannot locate the EFI ACPI Table Protocol, " @@ -82,7 +82,7 @@ RamDiskAcpiCheck ( NULL, (VOID **)&mAcpiSdtProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( EFI_D_INFO, "RamDiskAcpiCheck: Cannot locate the EFI ACPI Sdt Protocol, " @@ -132,7 +132,7 @@ RamDiskDxeEntryPoint ( NULL, &DummyInterface ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "Driver already started!\n")); return EFI_ALREADY_STARTED; } @@ -149,7 +149,7 @@ RamDiskDxeEntryPoint ( // Install RAM disk configuration form // Status = InstallRamDiskConfigForm (ConfigPrivate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -165,7 +165,7 @@ RamDiskDxeEntryPoint ( ConfigPrivate, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -180,7 +180,7 @@ RamDiskDxeEntryPoint ( NULL, &Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; @@ -217,7 +217,7 @@ RamDiskDxeUnload ( &gEfiCallerIdGuid, (VOID **) &ConfigPrivate ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskFileExplorer.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskFileExplorer.c index 3a000389f..f8b4cdabf 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskFileExplorer.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskFileExplorer.c @@ -44,7 +44,7 @@ GrowBuffer ( if (*Status == EFI_BUFFER_TOO_SMALL) { if (*Buffer != NULL) { - FreePool (*Buffer); + FreePool(*Buffer); } *Buffer = AllocateZeroPool (BufferSize); @@ -58,8 +58,8 @@ GrowBuffer ( // // If there's an error, free the buffer // - if (!TryAgain && EFI_ERROR (*Status) && (*Buffer != NULL)) { - FreePool (*Buffer); + if (!TryAgain && EFI_ERROR(*Status) && (*Buffer != NULL)) { + FreePool(*Buffer); *Buffer = NULL; } diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c index 96ea74a9a..f4f611f99 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c @@ -78,7 +78,7 @@ InstallRamDiskConfigForm ( ConfigAccess, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -147,7 +147,7 @@ UninstallRamDiskConfigForm ( ConfigPrivateData->DriverHandle = NULL; } - FreePool (ConfigPrivateData); + FreePool(ConfigPrivateData); } @@ -187,11 +187,11 @@ UnregisterAllRamDisks ( // driver is responsible for freeing the allocated memory for the // RAM disk. // - FreePool ((VOID *)(UINTN) PrivateData->StartingAddr); + FreePool((VOID *)(UINTN) PrivateData->StartingAddr); } - FreePool (PrivateData->DevicePath); - FreePool (PrivateData); + FreePool(PrivateData->DevicePath); + FreePool(PrivateData); } } } @@ -422,7 +422,7 @@ HiiCreateRamDisk ( NULL, &DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { do { CreatePopUp ( EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, @@ -642,7 +642,7 @@ RamDiskCallback ( switch (QuestionId) { case MAIN_GOTO_FILE_EXPLORER_ID: Status = ChooseFile (NULL, NULL, NULL, &FileDevPath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -656,7 +656,7 @@ RamDiskCallback ( EFI_FILE_MODE_READ, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -669,7 +669,7 @@ RamDiskCallback ( FileHandle, ConfigPrivate->ConfigStore.MemType ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -720,7 +720,7 @@ RamDiskCallback ( NULL, ConfigPrivate->ConfigStore.MemType ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c index 36d635e4b..a79948224 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c @@ -87,7 +87,7 @@ RamDiskPublishSsdt ( (VOID **) &Table, &TableSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -98,16 +98,16 @@ RamDiskPublishSsdt ( TableSize, &mRamDiskSsdtTableKey ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { mRamDiskSsdtTableKeyValid = TRUE; } - FreePool (Table); + FreePool(Table); return Status; } else { - FreePool (Table); + FreePool(Table); SectionInstance++; } } @@ -177,11 +177,11 @@ RamDiskPublishNfit ( &DescriptorSize, &DescriptorVersion ); - if (EFI_ERROR (Status)) { - FreePool (MemoryMap); + if (EFI_ERROR(Status)) { + FreePool(MemoryMap); } } while (Status == EFI_BUFFER_TOO_SMALL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); MemoryMapEntry = MemoryMap; MemoryMapEnd = (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) MemoryMap + MemoryMapSize); @@ -200,7 +200,7 @@ RamDiskPublishNfit ( } MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize); } - FreePool (MemoryMap); + FreePool(MemoryMap); if (!MemoryFound) { return EFI_NOT_FOUND; @@ -214,14 +214,14 @@ RamDiskPublishNfit ( TableKey = 0; TableHeader = NULL; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = mAcpiSdtProtocol->GetAcpiTable ( TableIndex, (EFI_ACPI_SDT_HEADER **)&TableHeader, &TableVersion, &TableKey ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { TableIndex++; if (((EFI_ACPI_SDT_HEADER *)TableHeader)->Signature == @@ -231,7 +231,7 @@ RamDiskPublishNfit ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // A NFIT is already in the ACPI table. // @@ -260,10 +260,10 @@ RamDiskPublishNfit ( mAcpiTableProtocol, TableKey ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - if (EFI_ERROR (Status)) { - FreePool (Nfit); + if (EFI_ERROR(Status)) { + FreePool(Nfit); return Status; } @@ -291,7 +291,7 @@ RamDiskPublishNfit ( // Description Table (SSDT). // Status = RamDiskPublishSsdt (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -349,11 +349,11 @@ RamDiskPublishNfit ( NfitHeader->Length, &TableKey ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - FreePool (Nfit); + FreePool(Nfit); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -401,14 +401,14 @@ RamDiskUnpublishNfit ( TableKey = 0; TableHeader = NULL; - while (!EFI_ERROR (Status)) { + while (!EFI_ERROR(Status)) { Status = mAcpiSdtProtocol->GetAcpiTable ( TableIndex, (EFI_ACPI_SDT_HEADER **)&TableHeader, &TableVersion, &TableKey ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { TableIndex++; if (((EFI_ACPI_SDT_HEADER *)TableHeader)->Signature == @@ -418,7 +418,7 @@ RamDiskUnpublishNfit ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // No NFIT is found in the ACPI table. // @@ -441,8 +441,8 @@ RamDiskUnpublishNfit ( mAcpiTableProtocol, TableKey ); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -524,10 +524,10 @@ RamDiskUnpublishNfit ( mAcpiTableProtocol, TableKey ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - if (EFI_ERROR (Status)) { - FreePool (NewNfit); + if (EFI_ERROR(Status)) { + FreePool(NewNfit); return Status; } @@ -542,10 +542,10 @@ RamDiskUnpublishNfit ( NewNfitLen, &TableKey ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); - FreePool (NewNfit); - if (EFI_ERROR (Status)) { + FreePool(NewNfit); + if (EFI_ERROR(Status)) { return Status; } @@ -699,7 +699,7 @@ RamDiskRegister ( PrivateData->DevicePath, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto ErrorExit; } @@ -710,7 +710,7 @@ RamDiskRegister ( gBS->ConnectController (PrivateData->Handle, NULL, NULL, TRUE); - FreePool (RamDiskDevNode); + FreePool(RamDiskDevNode); if ((mAcpiTableProtocol != NULL) && (mAcpiSdtProtocol != NULL)) { RamDiskPublishNfit (PrivateData); @@ -720,15 +720,15 @@ RamDiskRegister ( ErrorExit: if (RamDiskDevNode != NULL) { - FreePool (RamDiskDevNode); + FreePool(RamDiskDevNode); } if (PrivateData != NULL) { if (PrivateData->DevicePath) { - FreePool (PrivateData->DevicePath); + FreePool(PrivateData->DevicePath); } - FreePool (PrivateData); + FreePool(PrivateData); } return Status; @@ -836,11 +836,11 @@ RamDiskUnregister ( // driver is responsible for freeing the allocated memory for the // RAM disk. // - FreePool ((VOID *)(UINTN) PrivateData->StartingAddr); + FreePool((VOID *)(UINTN) PrivateData->StartingAddr); } - FreePool (PrivateData->DevicePath); - FreePool (PrivateData); + FreePool(PrivateData->DevicePath); + FreePool(PrivateData); Found = TRUE; break; diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/File.c b/MdeModulePkg/Universal/Disk/UdfDxe/File.c index 4ad7bb93d..b001716a9 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/File.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/File.c @@ -79,7 +79,7 @@ UdfOpenVolume ( PrivFsData->DiskIo, &PrivFsData->Volume ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Read_Udf_Volume; } } @@ -95,7 +95,7 @@ UdfOpenVolume ( &PrivFsData->Volume, &PrivFsData->Root ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Find_Root_Dir; } @@ -219,7 +219,7 @@ UdfOpen ( &_PARENT_FILE(PrivFileData)->FileIdentifierDesc->Icb, &File ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Find_File; } @@ -252,7 +252,7 @@ UdfOpen ( &NewPrivFileData->File, &NewPrivFileData->FileSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG (( DEBUG_ERROR, "%a: GetFileSize() fails with status - %r.\n", @@ -274,7 +274,7 @@ UdfOpen ( return Status; Error_Get_File_Size: - FreePool ((VOID *)NewPrivFileData); + FreePool((VOID *)NewPrivFileData); Error_Alloc_New_Priv_File_Data: CleanupFileInformation (&File); @@ -396,9 +396,9 @@ UdfRead ( ReadDirInfo, &NewFileIdentifierDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_DEVICE_ERROR) { - FreePool (ReadDirInfo->DirectoryData); + FreePool(ReadDirInfo->DirectoryData); ZeroMem ((VOID *)ReadDirInfo, sizeof (UDF_READ_DIRECTORY_INFO)); *BufferSize = 0; @@ -421,7 +421,7 @@ UdfRead ( break; } - FreePool ((VOID *)NewFileIdentifierDesc); + FreePool((VOID *)NewFileIdentifierDesc); } Status = FindFileEntry ( @@ -431,7 +431,7 @@ UdfRead ( &NewFileIdentifierDesc->Icb, &NewFileEntryData ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Find_Fe; } ASSERT (NewFileEntryData != NULL); @@ -445,27 +445,27 @@ UdfRead ( NewFileEntryData, &FoundFile ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Resolve_Symlink; } - FreePool ((VOID *)NewFileEntryData); + FreePool((VOID *)NewFileEntryData); NewFileEntryData = FoundFile.FileEntry; Status = GetFileNameFromFid (NewFileIdentifierDesc, ARRAY_SIZE (FileName), FileName); - if (EFI_ERROR (Status)) { - FreePool ((VOID *)FoundFile.FileIdentifierDesc); + if (EFI_ERROR(Status)) { + FreePool((VOID *)FoundFile.FileIdentifierDesc); goto Error_Get_FileName; } - FreePool ((VOID *)NewFileIdentifierDesc); + FreePool((VOID *)NewFileIdentifierDesc); NewFileIdentifierDesc = FoundFile.FileIdentifierDesc; } else { FoundFile.FileIdentifierDesc = NewFileIdentifierDesc; FoundFile.FileEntry = NewFileEntryData; Status = GetFileNameFromFid (FoundFile.FileIdentifierDesc, ARRAY_SIZE (FileName), FileName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Get_FileName; } } @@ -477,7 +477,7 @@ UdfRead ( &FoundFile, &FileSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Get_File_Size; } @@ -488,7 +488,7 @@ UdfRead ( BufferSize, Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Set_File_Info; } @@ -507,12 +507,12 @@ Error_Get_File_Size: Error_Get_FileName: Error_Resolve_Symlink: if (NewFileEntryData != NULL) { - FreePool (NewFileEntryData); + FreePool(NewFileEntryData); } Error_Find_Fe: if (NewFileIdentifierDesc != NULL) { - FreePool ((VOID *)NewFileIdentifierDesc); + FreePool((VOID *)NewFileIdentifierDesc); } Done: @@ -556,11 +556,11 @@ UdfClose ( CleanupFileInformation (&PrivFileData->File); if (PrivFileData->ReadDirInfo.DirectoryData != NULL) { - FreePool (PrivFileData->ReadDirInfo.DirectoryData); + FreePool(PrivFileData->ReadDirInfo.DirectoryData); } } - FreePool ((VOID *)PrivFileData); + FreePool((VOID *)PrivFileData); Exit: gBS->RestoreTPL (OldTpl); @@ -788,7 +788,7 @@ UdfGetInfo ( ); } else if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid)) { Status = GetVolumeLabel (&PrivFsData->Volume, ARRAY_SIZE (VolumeLabel), VolumeLabel); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -812,7 +812,7 @@ UdfGetInfo ( &VolumeSize, &FreeSpaceSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -827,7 +827,7 @@ UdfGetInfo ( Status = EFI_SUCCESS; } else if (CompareGuid (InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid)) { Status = GetVolumeLabel (&PrivFsData->Volume, ARRAY_SIZE (VolumeLabel), VolumeLabel); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index e9e55cb2b..baff8ff09 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -55,7 +55,7 @@ FindAnchorVolumeDescriptorPointer ( sizeof (UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER), (VOID *)AnchorPoint ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -142,7 +142,7 @@ StartMainVolumeDescriptorSequence ( BlockSize, Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Out_Free; } @@ -188,7 +188,7 @@ Out_Free: // // Free block read buffer // - FreePool (Buffer); + FreePool(Buffer); return Status; } @@ -356,7 +356,7 @@ FindFileSetDescriptor ( LogicalVolDesc = &Volume->LogicalVolDesc; Status = GetLongAdLsn (Volume, &LogicalVolDesc->LogicalVolumeContentsUse, &Lsn); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -375,7 +375,7 @@ FindFileSetDescriptor ( sizeof (Volume->FileSetDesc), &Volume->FileSetDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -421,7 +421,7 @@ ReadVolumeFileStructure ( DiskIo, &AnchorPoint ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -441,7 +441,7 @@ ReadVolumeFileStructure ( &AnchorPoint, Volume ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -881,7 +881,7 @@ GetAedAdsOffset ( ParentIcb, Ad, &Lsn); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -902,7 +902,7 @@ GetAedAdsOffset ( ExtentLength, Data ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -926,7 +926,7 @@ GetAedAdsOffset ( *Length = AllocExtDesc->LengthOfAllocationDescriptors; Exit: - FreePool (Data); + FreePool(Data); return Status; } @@ -978,7 +978,7 @@ GetAedAdsData ( &Offset, Length ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1139,7 +1139,7 @@ ReadFile ( // There are no extents for this FE/EFE. All data is inline. // Status = GetFileEntryData (FileEntryData, Volume->FileEntrySize, &Data, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1186,7 +1186,7 @@ ReadFile ( // for start reading them out. // Status = GetAdsInformation (FileEntryData, Volume->FileEntrySize, &Data, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1228,10 +1228,10 @@ ReadFile ( if (!DoFreeAed) { DoFreeAed = TRUE; } else { - FreePool (DataBak); + FreePool(DataBak); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Get_Aed; } ASSERT (Data != NULL); @@ -1247,7 +1247,7 @@ ReadFile ( ParentIcb, Ad, &Lsn); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1265,7 +1265,7 @@ ReadFile ( &ReadFileInfo->FileData, ReadFileInfo->ReadLength ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Alloc_Buffer_To_Next_Ad; } @@ -1280,7 +1280,7 @@ ReadFile ( (VOID *)((UINT8 *)ReadFileInfo->FileData + ReadFileInfo->ReadLength) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Read_Disk_Blk; } @@ -1332,7 +1332,7 @@ ReadFile ( (VOID *)((UINT8 *)ReadFileInfo->FileData + DataOffset) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Read_Disk_Blk; } @@ -1379,7 +1379,7 @@ ReadFile ( Done: if (DoFreeAed) { - FreePool (Data); + FreePool(Data); } return Status; @@ -1387,11 +1387,11 @@ Done: Error_Read_Disk_Blk: Error_Alloc_Buffer_To_Next_Ad: if (ReadFileInfo->Flags != ReadFileSeekAndRead) { - FreePool (ReadFileInfo->FileData); + FreePool(ReadFileInfo->FileData); } if (DoFreeAed) { - FreePool (Data); + FreePool(Data); } Error_Get_Aed: @@ -1462,7 +1462,7 @@ InternalFindFile ( DuplicateFid (Parent->FileIdentifierDesc, &File->FileIdentifierDesc); if (File->FileIdentifierDesc == NULL) { - FreePool (File->FileEntry); + FreePool(File->FileEntry); return EFI_OUT_OF_RESOURCES; } @@ -1487,7 +1487,7 @@ InternalFindFile ( &ReadDirInfo, &FileIdentifierDesc ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_DEVICE_ERROR) { Status = EFI_NOT_FOUND; } @@ -1516,7 +1516,7 @@ InternalFindFile ( } } else { Status = GetFileNameFromFid (FileIdentifierDesc, ARRAY_SIZE (FoundFileName), FoundFileName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -1529,14 +1529,14 @@ InternalFindFile ( } } - FreePool ((VOID *)FileIdentifierDesc); + FreePool((VOID *)FileIdentifierDesc); } if (ReadDirInfo.DirectoryData != NULL) { // // Free all allocated resources for the directory listing. // - FreePool (ReadDirInfo.DirectoryData); + FreePool(ReadDirInfo.DirectoryData); } if (Found) { @@ -1558,7 +1558,7 @@ InternalFindFile ( &FileIdentifierDesc->Icb, &CompareFileEntry ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Find_Fe; } @@ -1569,8 +1569,8 @@ InternalFindFile ( Volume->FileEntrySize) != 0) { File->FileEntry = CompareFileEntry; } else { - FreePool ((VOID *)FileIdentifierDesc); - FreePool ((VOID *)CompareFileEntry); + FreePool((VOID *)FileIdentifierDesc); + FreePool((VOID *)CompareFileEntry); Status = EFI_NOT_FOUND; } } @@ -1579,7 +1579,7 @@ InternalFindFile ( return Status; Error_Find_Fe: - FreePool ((VOID *)FileIdentifierDesc); + FreePool((VOID *)FileIdentifierDesc); return Status; } @@ -1615,7 +1615,7 @@ ReadUdfVolumeInformation ( DiskIo, Volume ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1623,7 +1623,7 @@ ReadUdfVolumeInformation ( // Find File Set Descriptor // Status = FindFileSetDescriptor (BlockIo, DiskIo, Volume); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1664,7 +1664,7 @@ FindRootDirectory ( &Volume->FileSetDesc.RootDirectoryIcb, &File->FileEntry ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1681,8 +1681,8 @@ FindRootDirectory ( &Volume->FileSetDesc.RootDirectoryIcb, File ); - if (EFI_ERROR (Status)) { - FreePool (File->FileEntry); + if (EFI_ERROR(Status)) { + FreePool(File->FileEntry); } return Status; @@ -1721,7 +1721,7 @@ FindFileEntry ( VOID *ReadBuffer; Status = GetLongAdLsn (Volume, Icb, &Lsn); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1742,7 +1742,7 @@ FindFileEntry ( Volume->FileEntrySize, ReadBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Read_Disk_Blk; } @@ -1763,7 +1763,7 @@ FindFileEntry ( Error_Invalid_Fe: Error_Read_Disk_Blk: - FreePool (ReadBuffer); + FreePool(ReadBuffer); return Status; } @@ -1854,7 +1854,7 @@ FindFile ( // DuplicateFid (Root->FileIdentifierDesc, &File->FileIdentifierDesc); if (File->FileIdentifierDesc == NULL) { - FreePool (File->FileEntry); + FreePool(File->FileEntry); Status = EFI_OUT_OF_RESOURCES; } } @@ -1872,7 +1872,7 @@ FindFile ( File); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1881,7 +1881,7 @@ FindFile ( // FID descriptors. // if (FE_ICB_FILE_TYPE (File->FileEntry) == UdfFileEntrySymlink) { - FreePool ((VOID *)File->FileIdentifierDesc); + FreePool((VOID *)File->FileIdentifierDesc); FileEntry = File->FileEntry; @@ -1892,9 +1892,9 @@ FindFile ( FileEntry, File); - FreePool (FileEntry); + FreePool(FileEntry); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1964,7 +1964,7 @@ ReadDirectoryEntry ( FileEntryData, &ReadFileInfo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2159,7 +2159,7 @@ ResolveSymlink ( FileEntryData, &ReadFileInfo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2207,7 +2207,7 @@ ResolveSymlink ( DuplicateFid (PreviousFile.FileIdentifierDesc, &File->FileIdentifierDesc); if (File->FileIdentifierDesc == NULL) { - FreePool (File->FileEntry); + FreePool(File->FileEntry); Status = EFI_OUT_OF_RESOURCES; goto Error_Find_File; } @@ -2276,7 +2276,7 @@ ResolveSymlink ( NULL, File ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error_Find_File; } @@ -2311,7 +2311,7 @@ ResolveSymlink ( // // Unmap the symlink file. // - FreePool (ReadFileInfo.FileData); + FreePool(ReadFileInfo.FileData); // // Check the content in the resolved file info. @@ -2328,7 +2328,7 @@ Error_Find_File: CleanupFileInformation (&PreviousFile); } - FreePool (ReadFileInfo.FileData); + FreePool(ReadFileInfo.FileData); return Status; } @@ -2345,10 +2345,10 @@ CleanupFileInformation ( ) { if (File->FileEntry != NULL) { - FreePool (File->FileEntry); + FreePool(File->FileEntry); } if (File->FileIdentifierDesc != NULL) { - FreePool ((VOID *)File->FileIdentifierDesc); + FreePool((VOID *)File->FileIdentifierDesc); } ZeroMem ((VOID *)File, sizeof (UDF_FILE_INFO)); @@ -2394,7 +2394,7 @@ GetFileSize ( File->FileEntry, &ReadFileInfo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2723,7 +2723,7 @@ GetVolumeSize ( ExtentAd->ExtentLength, LogicalVolInt ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Out_Free; } @@ -2783,7 +2783,7 @@ Out_Free: // // Free Logical Volume Integrity Descriptor // - FreePool (LogicalVolInt); + FreePool(LogicalVolInt); return Status; } @@ -2838,7 +2838,7 @@ ReadFileData ( File->FileEntry, &ReadFileInfo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2881,7 +2881,7 @@ SupportUdfFileSystem ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.c b/MdeModulePkg/Universal/Disk/UdfDxe/Udf.c index d15f44971..d8311feb8 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/Udf.c @@ -62,7 +62,7 @@ UdfDriverBindingSupported ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -134,7 +134,7 @@ UdfDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Open DiskIo protocol on ControllerHandle @@ -147,13 +147,13 @@ UdfDriverBindingStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Check if ControllerHandle supports an UDF file system // Status = SupportUdfFileSystem (This, ControllerHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -193,7 +193,7 @@ UdfDriverBindingStart ( ); Exit: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Close DiskIo protocol on ControllerHandle // @@ -257,7 +257,7 @@ UdfDriverBindingStop ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PrivFsData = PRIVATE_UDF_SIMPLE_FS_DATA_FROM_THIS (SimpleFs); // @@ -270,10 +270,10 @@ UdfDriverBindingStop ( NULL ); - FreePool ((VOID *)PrivFsData); + FreePool((VOID *)PrivFsData); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Close DiskIo protocol on ControllerHandle // @@ -325,7 +325,7 @@ InitializeUdf ( &gUdfComponentName, &gUdfComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c index b959cb1e9..0ae20ec7f 100644 --- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c +++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c @@ -131,7 +131,7 @@ InitializeUnicodeCollationEng ( &Unicode2Eng, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else { Status = gBS->InstallMultipleProtocolInterfaces ( &mHandle, @@ -139,7 +139,7 @@ InitializeUnicodeCollationEng ( &Unicode2Eng, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } else { if (FeaturePcdGet (PcdUnicodeCollationSupport)) { @@ -149,7 +149,7 @@ InitializeUnicodeCollationEng ( &UnicodeEng, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else { // // This module must support to produce at least one of Unicode Collation Protocol diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c index 3b034a1c8..6788b0d9e 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c @@ -278,57 +278,57 @@ FreeDisplayStrings ( VOID ) { - FreePool (mUnknownString); - FreePool (gEmptyString); - FreePool (gSaveFailed); - FreePool (gNoSubmitIfFailed); - FreePool (gReconnectFail); - FreePool (gReconnectRequired); - FreePool (gChangesOpt); - FreePool (gReconnectConfirmChanges); - FreePool (gSaveProcess); - FreePool (gSaveNoSubmitProcess); - FreePool (gDiscardChange); - FreePool (gJumpToFormSet); - FreePool (gCheckError); - FreePool (gPromptForData); - FreePool (gPromptForPassword); - FreePool (gPromptForNewPassword); - FreePool (gConfirmPassword); - FreePool (gConfirmError); - FreePool (gPassowordInvalid); - FreePool (gPressEnter); - FreePool (gMiniString); - FreePool (gOptionMismatch); - FreePool (gFormSuppress); - FreePool (gProtocolNotFound); - FreePool (gBrowserError); - FreePool (gNoSubmitIf); - FreePool (gFormNotFound); - FreePool (gConfirmDefaultMsg); - FreePool (gConfirmSubmitMsg); - FreePool (gConfirmDiscardMsg); - FreePool (gConfirmResetMsg); - FreePool (gConfirmExitMsg); - FreePool (gConfirmDefaultMsg2nd); - FreePool (gConfirmSubmitMsg2nd); - FreePool (gConfirmResetMsg2nd); - FreePool (gConfirmExitMsg2nd); - FreePool (gConfirmOpt); - FreePool (gConfirmOptYes); - FreePool (gConfirmOptNo); - FreePool (gConfirmOptOk); - FreePool (gConfirmOptCancel); - FreePool (gYesOption); - FreePool (gNoOption); - FreePool (gOkOption); - FreePool (gCancelOption); - FreePool (gErrorPopup); - FreePool (gWarningPopup); - FreePool (gInfoPopup); - FreePool (gConfirmMsgConnect); - FreePool (gConfirmMsgEnd); - FreePool (gPasswordUnsupported); + FreePool(mUnknownString); + FreePool(gEmptyString); + FreePool(gSaveFailed); + FreePool(gNoSubmitIfFailed); + FreePool(gReconnectFail); + FreePool(gReconnectRequired); + FreePool(gChangesOpt); + FreePool(gReconnectConfirmChanges); + FreePool(gSaveProcess); + FreePool(gSaveNoSubmitProcess); + FreePool(gDiscardChange); + FreePool(gJumpToFormSet); + FreePool(gCheckError); + FreePool(gPromptForData); + FreePool(gPromptForPassword); + FreePool(gPromptForNewPassword); + FreePool(gConfirmPassword); + FreePool(gConfirmError); + FreePool(gPassowordInvalid); + FreePool(gPressEnter); + FreePool(gMiniString); + FreePool(gOptionMismatch); + FreePool(gFormSuppress); + FreePool(gProtocolNotFound); + FreePool(gBrowserError); + FreePool(gNoSubmitIf); + FreePool(gFormNotFound); + FreePool(gConfirmDefaultMsg); + FreePool(gConfirmSubmitMsg); + FreePool(gConfirmDiscardMsg); + FreePool(gConfirmResetMsg); + FreePool(gConfirmExitMsg); + FreePool(gConfirmDefaultMsg2nd); + FreePool(gConfirmSubmitMsg2nd); + FreePool(gConfirmResetMsg2nd); + FreePool(gConfirmExitMsg2nd); + FreePool(gConfirmOpt); + FreePool(gConfirmOptYes); + FreePool(gConfirmOptNo); + FreePool(gConfirmOptOk); + FreePool(gConfirmOptCancel); + FreePool(gYesOption); + FreePool(gNoOption); + FreePool(gOkOption); + FreePool(gCancelOption); + FreePool(gErrorPopup); + FreePool(gWarningPopup); + FreePool(gInfoPopup); + FreePool(gConfirmMsgConnect); + FreePool(gConfirmMsgEnd); + FreePool(gPasswordUnsupported); } /** @@ -398,7 +398,7 @@ GetWidth ( if (TestOp->TextTwo != 0) { String = GetToken (TestOp->TextTwo, gFormData->HiiHandle); Size = StrLen (String); - FreePool (String); + FreePool(String); } } @@ -728,7 +728,7 @@ UiAddMenuOption ( if (StrLen (&MenuOption->Description[ArrayEntry]) != 0) { NumberOfLines++; } - FreePool (OutputString); + FreePool(OutputString); } } else { // @@ -911,7 +911,7 @@ UpdateSkipInfoForMenu ( Row++; } - FreePool (OutputString); + FreePool(OutputString); } if ((Row > MenuOption->Skip) && @@ -940,7 +940,7 @@ UpdateOptionSkipLines ( if (OptionString != NULL) { UpdateSkipInfoForMenu (MenuOption, OptionString); - FreePool (OptionString); + FreePool(OptionString); } if ((MenuOption->ThisTag->OpCode->OpCode == EFI_IFR_TEXT_OP) && (((EFI_IFR_TEXT*)MenuOption->ThisTag->OpCode)->TextTwo != 0)) { @@ -949,7 +949,7 @@ UpdateOptionSkipLines ( if (OptionString != NULL) { UpdateSkipInfoForMenu (MenuOption, OptionString); - FreePool (OptionString); + FreePool(OptionString); } } } @@ -982,11 +982,11 @@ PrintableMenu ( } Status = ProcessOptions (MenuOption, FALSE, &OptionString, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } if (OptionString != NULL && OptionString[0] != '\0') { - FreePool (OptionString); + FreePool(OptionString); return TRUE; } @@ -994,7 +994,7 @@ PrintableMenu ( OptionString = GetToken (((EFI_IFR_TEXT*)MenuOption->ThisTag->OpCode)->TextTwo, gFormData->HiiHandle); ASSERT (OptionString != NULL); if (OptionString[0] != '\0'){ - FreePool (OptionString); + FreePool(OptionString); return TRUE; } } @@ -1448,7 +1448,7 @@ UiWaitForEvent ( } Status = gBS->WaitForEvent (EventNum, WaitList, &Index); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); switch (Index) { case 0: @@ -2026,7 +2026,7 @@ UpdateHighlightMenuInfo ( // if question id == 0, save the opcode buffer.. // if (gHighligthMenuInfo.HLTOpCode != NULL) { - FreePool (gHighligthMenuInfo.HLTOpCode); + FreePool(gHighligthMenuInfo.HLTOpCode); } gHighligthMenuInfo.HLTOpCode = AllocateCopyPool (Statement->OpCode->Length, Statement->OpCode); ASSERT (gHighligthMenuInfo.HLTOpCode != NULL); @@ -2043,7 +2043,7 @@ UpdateHighlightMenuInfo ( // if question id == 0, save the opcode buffer.. // if (gHighligthMenuInfo.TOSOpCode != NULL) { - FreePool (gHighligthMenuInfo.TOSOpCode); + FreePool(gHighligthMenuInfo.TOSOpCode); } gHighligthMenuInfo.TOSOpCode = AllocateCopyPool (Statement->OpCode->Length, Statement->OpCode); ASSERT (gHighligthMenuInfo.TOSOpCode != NULL); @@ -2056,14 +2056,14 @@ UpdateHighlightMenuInfo ( gHighligthMenuInfo.HLTSequence = 0; gHighligthMenuInfo.HLTQuestionId = 0; if (gHighligthMenuInfo.HLTOpCode != NULL) { - FreePool (gHighligthMenuInfo.HLTOpCode); + FreePool(gHighligthMenuInfo.HLTOpCode); } gHighligthMenuInfo.HLTOpCode = NULL; gHighligthMenuInfo.HLTIndex = 0; gHighligthMenuInfo.TOSQuestionId = 0; if (gHighligthMenuInfo.TOSOpCode != NULL) { - FreePool (gHighligthMenuInfo.TOSOpCode); + FreePool(gHighligthMenuInfo.TOSOpCode); } gHighligthMenuInfo.TOSOpCode = NULL; gHighligthMenuInfo.TOSIndex = 0; @@ -2179,7 +2179,7 @@ HasOptionString ( if (TestOp->TextTwo != 0) { String = GetToken (TestOp->TextTwo, gFormData->HiiHandle); Size = StrLen (String); - FreePool (String); + FreePool(String); } } @@ -2339,7 +2339,7 @@ FxConfirmPopup ( RetVal = FALSE; } - FreePool (CfmStr); + FreePool(CfmStr); return RetVal; } @@ -2408,7 +2408,7 @@ DisplayOneMenu ( // 1. Paint the option string. // Status = ProcessOptions (MenuOption, FALSE, &OptionString, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2471,7 +2471,7 @@ DisplayOneMenu ( } } - FreePool (OutputString); + FreePool(OutputString); if (Temp2 != 0) { Temp2--; } @@ -2479,7 +2479,7 @@ DisplayOneMenu ( Highlight = FALSE; - FreePool (OptionString); + FreePool(OptionString); } // @@ -2524,7 +2524,7 @@ DisplayOneMenu ( } } - FreePool (OutputString); + FreePool(OutputString); if (Temp != 0) { Temp--; } @@ -2565,13 +2565,13 @@ DisplayOneMenu ( } } - FreePool (OutputString); + FreePool(OutputString); if (Temp3 != 0) { Temp3--; } } - FreePool (StringPtr); + FreePool(StringPtr); } // @@ -2808,7 +2808,7 @@ UiDisplayMenu ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (gMisMatch) { return EFI_SUCCESS; } else { @@ -2978,8 +2978,8 @@ UiDisplayMenu ( StringPtr = AllocateZeroPool ((StrLen (StringRightPtr) + StrLen (StringErrorPtr)+ 1 ) * sizeof (CHAR16)); StrCpyS (StringPtr, StrLen (StringRightPtr) + StrLen (StringErrorPtr) + 1, StringRightPtr); StrCatS (StringPtr, StrLen (StringRightPtr) + StrLen (StringErrorPtr) + 1, StringErrorPtr); - FreePool (StringRightPtr); - FreePool (StringErrorPtr); + FreePool(StringRightPtr); + FreePool(StringErrorPtr); } else { StringPtr = GetToken (HelpInfo, gFormData->HiiHandle); } @@ -2992,28 +2992,28 @@ UiDisplayMenu ( // 1.Calculate how many line the help string need to print. // if (HelpString != NULL) { - FreePool (HelpString); + FreePool(HelpString); HelpString = NULL; } HelpLine = ProcessHelpString (StringPtr, &HelpString, &EachLineWidth, RowCount); - FreePool (StringPtr); + FreePool(StringPtr); if (HelpLine > RowCount) { MultiHelpPage = TRUE; StringPtr = GetToken (STRING_TOKEN(ADJUST_HELP_PAGE_UP), gHiiHandle); if (HelpHeaderString != NULL) { - FreePool (HelpHeaderString); + FreePool(HelpHeaderString); HelpHeaderString = NULL; } HelpHeaderLine = ProcessHelpString (StringPtr, &HelpHeaderString, &HeaderLineWidth, 0); - FreePool (StringPtr); + FreePool(StringPtr); StringPtr = GetToken (STRING_TOKEN(ADJUST_HELP_PAGE_DOWN), gHiiHandle); if (HelpBottomString != NULL) { - FreePool (HelpBottomString); + FreePool(HelpBottomString); HelpBottomString = NULL; } HelpBottomLine = ProcessHelpString (StringPtr, &HelpBottomString, &BottomLineWidth, 0); - FreePool (StringPtr); + FreePool(StringPtr); // // Calculate the help page count. // @@ -3155,7 +3155,7 @@ UiDisplayMenu ( // while (TRUE) { Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { EventType = UIEventKey; break; } @@ -3227,9 +3227,9 @@ UiDisplayMenu ( Status = ProcessOptions (MenuOption, TRUE, &OptionString, TRUE); if (OptionString != NULL) { - FreePool (OptionString); + FreePool(OptionString); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Repaint to clear possible error prompt pop-up // @@ -3356,10 +3356,10 @@ UiDisplayMenu ( Status = ProcessOptions (MenuOption, TRUE, &OptionString, TRUE); if (OptionString != NULL) { - FreePool (OptionString); + FreePool(OptionString); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Repaint = TRUE; NewLine = TRUE; RefreshKeyHelp (gFormData, Statement, FALSE); @@ -3783,13 +3783,13 @@ UiDisplayMenu ( case CfExit: gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)); if (HelpString != NULL) { - FreePool (HelpString); + FreePool(HelpString); } if (HelpHeaderString != NULL) { - FreePool (HelpHeaderString); + FreePool(HelpHeaderString); } if (HelpBottomString != NULL) { - FreePool (HelpBottomString); + FreePool(HelpBottomString); } return EFI_SUCCESS; @@ -3823,7 +3823,7 @@ FreeMenuOptionData( FreePool(Option->Description); } RemoveEntryList (&Option->Link); - FreePool (Option); + FreePool(Option); } } @@ -3966,14 +3966,14 @@ BrowserStatusProcess ( } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); } else { Status = gBS->CreateEvent (EVT_NOTIFY_WAIT, TPL_CALLBACK, EmptyEventProcess, NULL, &TimeOutEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); EventContext.SyncEvent = TimeOutEvent; EventContext.TimeOut = &TimeOut; EventContext.ErrorInfo = ErrorInfo; Status = gBS->CreateEvent (EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, RefreshTimeOutProcess, &EventContext, &RefreshIntervalEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Show the dialog first to avoid long time not reaction. @@ -3981,11 +3981,11 @@ BrowserStatusProcess ( gBS->SignalEvent (RefreshIntervalEvent); Status = gBS->SetTimer (RefreshIntervalEvent, TimerPeriodic, ONE_SECOND); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); while (TRUE) { Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); - if (!EFI_ERROR (Status) && Key.UnicodeChar == CHAR_CARRIAGE_RETURN) { + if (!EFI_ERROR(Status) && Key.UnicodeChar == CHAR_CARRIAGE_RETURN) { break; } @@ -3997,7 +3997,7 @@ BrowserStatusProcess ( WaitList[1] = gST->ConIn->WaitForKey; Status = gBS->WaitForEvent (2, WaitList, &Index); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (Index == 0) { // @@ -4014,7 +4014,7 @@ BrowserStatusProcess ( } if (StringToken != 0) { - FreePool (ErrorInfo); + FreePool(ErrorInfo); } } @@ -4058,7 +4058,7 @@ FormDisplay ( } Status = DisplayPageFrame (FormData, &gStatementDimensions); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -4185,7 +4185,7 @@ InitializeDisplayEngine ( EFI_NATIVE_INTERFACE, &mPrivateData.FromDisplayProt ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install HII Popup Protocol. @@ -4196,7 +4196,7 @@ InitializeDisplayEngine ( EFI_NATIVE_INTERFACE, &mPrivateData.HiiPopup ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); InitializeDisplayStrings(); @@ -4207,7 +4207,7 @@ InitializeDisplayEngine ( // Use BrowserEx2 protocol to register HotKey. // Status = gBS->LocateProtocol (&gEdkiiFormBrowserEx2ProtocolGuid, NULL, (VOID **) &FormBrowserEx2); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Register the default HotKey F9 and F10 again. // @@ -4216,13 +4216,13 @@ InitializeDisplayEngine ( NewString = HiiGetString (gHiiHandle, STRING_TOKEN (FUNCTION_TEN_STRING), NULL); ASSERT (NewString != NULL); FormBrowserEx2->RegisterHotKey (&HotKey, BROWSER_ACTION_SUBMIT, 0, NewString); - FreePool (NewString); + FreePool(NewString); HotKey.ScanCode = SCAN_F9; NewString = HiiGetString (gHiiHandle, STRING_TOKEN (FUNCTION_NINE_STRING), NULL); ASSERT (NewString != NULL); FormBrowserEx2->RegisterHotKey (&HotKey, BROWSER_ACTION_DEFAULT, EFI_HII_DEFAULT_CLASS_STANDARD, NewString); - FreePool (NewString); + FreePool(NewString); } return EFI_SUCCESS; @@ -4248,11 +4248,11 @@ UnloadDisplayEngine ( FreeDisplayStrings (); if (gHighligthMenuInfo.HLTOpCode != NULL) { - FreePool (gHighligthMenuInfo.HLTOpCode); + FreePool(gHighligthMenuInfo.HLTOpCode); } if (gHighligthMenuInfo.TOSOpCode != NULL) { - FreePool (gHighligthMenuInfo.TOSOpCode); + FreePool(gHighligthMenuInfo.TOSOpCode); } return EFI_SUCCESS; diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c index 722c56aa2..d5655e6ba 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c @@ -161,7 +161,7 @@ ReadString ( do { Status = WaitForKeyStroke (&Key); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_BLACK, EFI_LIGHTGRAY)); switch (Key.UnicodeChar) { @@ -180,8 +180,8 @@ ReadString ( break; case SCAN_ESC: - FreePool (TempString); - FreePool (BufferedString); + FreePool(TempString); + FreePool(BufferedString); gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)); gST->ConOut->EnableCursor (gST->ConOut, CursorVisible); return EFI_DEVICE_ERROR; @@ -202,8 +202,8 @@ ReadString ( case CHAR_CARRIAGE_RETURN: if (GetStringWidth (StringPtr) >= ((Minimum + 1) * sizeof (CHAR16))) { - FreePool (TempString); - FreePool (BufferedString); + FreePool(TempString); + FreePool(BufferedString); gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)); gST->ConOut->EnableCursor (gST->ConOut, CursorVisible); return EFI_SUCCESS; @@ -216,8 +216,8 @@ ReadString ( CreateDialog (&Key, &NullCharacter, gMiniString, gPressEnter, &NullCharacter, NULL); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); - FreePool (TempString); - FreePool (BufferedString); + FreePool(TempString); + FreePool(BufferedString); gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)); gST->ConOut->EnableCursor (gST->ConOut, CursorVisible); return EFI_DEVICE_ERROR; @@ -1158,7 +1158,7 @@ AdjustOptionOrder ( InsertHeadList (&Question->OptionListHead, &OneOfOption->Link); } - FreePool (HiiValueArray); + FreePool(HiiValueArray); return EFI_SUCCESS; } @@ -1339,7 +1339,7 @@ GetSelectionInputPopUp ( if (StrLen (StringPtr) > PopUpWidth) { PopUpWidth = StrLen (StringPtr); } - FreePool (StringPtr); + FreePool(StringPtr); HiiValue.Type = OneOfOption->OptionOpCode->Type; SetValuesByType (&HiiValue.Value, &OneOfOption->OptionOpCode->Value, HiiValue.Type); if (!OrderedList && (CompareHiiValue (&Question->CurrentValue, &HiiValue, &Result, NULL) == EFI_SUCCESS) && (Result == 0)) { @@ -1438,7 +1438,7 @@ GetSelectionInputPopUp ( TempStringPtr = AllocateZeroPool (sizeof (CHAR16) * (PopUpWidth - 1)); ASSERT ( TempStringPtr != NULL ); CopyMem (TempStringPtr, StringPtr, (sizeof (CHAR16) * (PopUpWidth - 5))); - FreePool (StringPtr); + FreePool(StringPtr); StringPtr = TempStringPtr; StrCatS (StringPtr, PopUpWidth - 1, L"..."); } @@ -1458,7 +1458,7 @@ GetSelectionInputPopUp ( } Index2++; - FreePool (StringPtr); + FreePool(StringPtr); } Character = BOXDRAW_UP_RIGHT; @@ -1635,7 +1635,7 @@ TheKey: } } if (CompareMem (ReturnValue, ValueArray, Question->CurrentValue.BufferLen) == 0) { - FreePool (ReturnValue); + FreePool(ReturnValue); return EFI_DEVICE_ERROR; } else { gUserInput->InputValue.Buffer = ReturnValue; diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/Popup.c b/MdeModulePkg/Universal/DisplayEngineDxe/Popup.c index a597a5d8a..9150b154d 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/Popup.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/Popup.c @@ -32,7 +32,7 @@ FreeSelectableOptions( Link = GetFirstNode (OptionList); SelectableOption = SELECTABLE_OPTION_FROM_LINK (Link); RemoveEntryList (&SelectableOption->Link); - FreePool (SelectableOption); + FreePool(SelectableOption); } } @@ -243,7 +243,7 @@ GetUserSelection ( } Status = WaitForKeyStroke (&KeyValue); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); HighlightOption = SELECTABLE_OPTION_FROM_LINK (HighlightPos); switch (KeyValue.UnicodeChar) { @@ -452,7 +452,7 @@ CalculatePopupPosition ( if (gMaxRowWidth < OutputStrWidth) { gMaxRowWidth = OutputStrWidth; } - FreePool (OutputString); + FreePool(OutputString); } // @@ -588,19 +588,19 @@ DrawMessageBox ( GetStringOffsetWithWidth (OutputString, gMaxRowWidth, &Length); TempString = AllocateZeroPool ((Length + 1) * sizeof (CHAR16)); if (TempString == NULL) { - FreePool (OutputString); + FreePool(OutputString); return EFI_OUT_OF_RESOURCES; } StrnCpyS (TempString, Length + 1, OutputString, Length - 3); StrCatS (TempString, Length + 1, L"..."); PrintStringAt ((ColDimension - gMaxRowWidth) / 2 + StartCol, Index, TempString); - FreePool (TempString); + FreePool(TempString); } else { PrintStringAt ((ColDimension - OutputStrWidth) / 2 + StartCol, Index, OutputString); } Index ++; DrawMesStrRowNum ++; - FreePool (OutputString); + FreePool(OutputString); } // @@ -695,7 +695,7 @@ CreatePopup ( CalculatePopupPosition (PopupType, &gPopupDimensions); Status = DrawMessageBox (PopupStyle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -703,7 +703,7 @@ CreatePopup ( // Add user selectable options to option list: gUserSelectableOptions // Status = AddUserSelectableOptions (PopupType); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -717,7 +717,7 @@ Done: ConOut->SetCursorPosition (ConOut, SavedConsoleMode.CursorColumn, SavedConsoleMode.CursorRow); ConOut->SetAttribute (ConOut, SavedConsoleMode.Attribute); FreeSelectableOptions (&gUserSelectableOptions); - FreePool (gMessageString); + FreePool(gMessageString); return Status; } diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c index 7d9486112..5147eafd4 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c @@ -250,14 +250,14 @@ CompareHiiValue ( Str2 = GetToken (Value2->Value.string, HiiHandle); if (Str2 == NULL) { - FreePool (Str1); + FreePool(Str1); return EFI_NOT_FOUND; } *Result = StrCmp (Str1, Str2); - FreePool (Str1); - FreePool (Str2); + FreePool(Str1); + FreePool(Str2); return EFI_SUCCESS; } @@ -813,17 +813,17 @@ PasswordProcess ( CreateDialog (&Key, gEmptyString, gPasswordUnsupported, gPressEnter, gEmptyString, NULL); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); } - FreePool (StringPtr); + FreePool(StringPtr); return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Old password exist, ask user for the old password // Status = ReadString (MenuOption, gPromptForPassword, StringPtr); - if (EFI_ERROR (Status)) { - FreePool (StringPtr); + if (EFI_ERROR(Status)) { + FreePool(StringPtr); return Status; } @@ -831,7 +831,7 @@ PasswordProcess ( // Check user input old password // Status = Question->PasswordCheck (gFormData, Question, StringPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_READY) { // // Typed in old password incorrect @@ -841,7 +841,7 @@ PasswordProcess ( Status = EFI_SUCCESS; } - FreePool (StringPtr); + FreePool(StringPtr); return Status; } } @@ -851,12 +851,12 @@ PasswordProcess ( // ZeroMem (StringPtr, (Maximum + 1) * sizeof (CHAR16)); Status = ReadString (MenuOption, gPromptForNewPassword, StringPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Reset state machine for password // Question->PasswordCheck (gFormData, Question, NULL); - FreePool (StringPtr); + FreePool(StringPtr); return Status; } @@ -866,13 +866,13 @@ PasswordProcess ( TempString = AllocateZeroPool ((Maximum + 1) * sizeof (CHAR16)); ASSERT (TempString); Status = ReadString (MenuOption, gConfirmPassword, TempString); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Reset state machine for password // Question->PasswordCheck (gFormData, Question, NULL); - FreePool (StringPtr); - FreePool (TempString); + FreePool(StringPtr); + FreePool(TempString); return Status; } @@ -903,8 +903,8 @@ PasswordProcess ( } ZeroMem (TempString, (Maximum + 1) * sizeof (CHAR16)); ZeroMem (StringPtr, (Maximum + 1) * sizeof (CHAR16)); - FreePool (TempString); - FreePool (StringPtr); + FreePool(TempString); + FreePool(StringPtr); return Status; } @@ -1044,7 +1044,7 @@ ProcessOptions ( } SetArrayData (ValueArray, ValueType, Index2, 0); - FreePool (*OptionString); + FreePool(*OptionString); *OptionString = NULL; return EFI_NOT_FOUND; } @@ -1058,7 +1058,7 @@ ProcessOptions ( NewStrCat (OptionString[0], MaxLen, Character); Character[0] = CHAR_CARRIAGE_RETURN; NewStrCat (OptionString[0], MaxLen, Character); - FreePool (StringPtr); + FreePool(StringPtr); } // @@ -1093,7 +1093,7 @@ ProcessOptions ( NewStrCat (OptionString[0], MaxLen, Character); Character[0] = CHAR_CARRIAGE_RETURN; NewStrCat (OptionString[0], MaxLen, Character); - FreePool (StringPtr); + FreePool(StringPtr); continue; } @@ -1124,7 +1124,7 @@ ProcessOptions ( } if (ValueInvalid) { - FreePool (*OptionString); + FreePool(*OptionString); *OptionString = NULL; return EFI_NOT_FOUND; } @@ -1191,7 +1191,7 @@ ProcessOptions ( } gUserInput->SelectedStatement = Question; gMisMatch = TRUE; - FreePool (*OptionString); + FreePool(*OptionString); *OptionString = NULL; return EFI_NOT_FOUND; } @@ -1205,7 +1205,7 @@ ProcessOptions ( Character[0] = RIGHT_ONEOF_DELIMITER; NewStrCat (OptionString[0], MaxLen, Character); - FreePool (StringPtr); + FreePool(StringPtr); } break; @@ -1354,8 +1354,8 @@ ProcessOptions ( CopyMem(StringPtr, Question->CurrentValue.Buffer, Question->CurrentValue.BufferLen); Status = ReadString (MenuOption, gPromptForData, StringPtr); - if (EFI_ERROR (Status)) { - FreePool (StringPtr); + if (EFI_ERROR(Status)) { + FreePool(StringPtr); return Status; } @@ -1363,7 +1363,7 @@ ProcessOptions ( gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen; gUserInput->InputValue.Type = Question->CurrentValue.Type; gUserInput->InputValue.Value.string = HiiSetString(gFormData->HiiHandle, gUserInput->InputValue.Value.string, StringPtr, NULL); - FreePool (StringPtr); + FreePool(StringPtr); return EFI_SUCCESS; } else { *OptionString = AllocateZeroPool (BufferSize); @@ -1442,7 +1442,7 @@ ProcessHelpString ( } TotalRowNum ++; - FreePool (OutputString); + FreePool(OutputString); } *EachLineWidth = MaxStringLen; @@ -1457,7 +1457,7 @@ ProcessHelpString ( while((StringLen = GetLineByWidth (StringPtr, LineWidth, &GlyphWidth, &Index, &OutputString)) != 0) { CopyMem (*FormattedString + CheckedNum * MaxStringLen, OutputString, StringLen * sizeof (CHAR16)); CheckedNum ++; - FreePool (OutputString); + FreePool(OutputString); } return TotalRowNum; diff --git a/MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.c b/MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.c index 92c738a3f..1c39adc30 100644 --- a/MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.c +++ b/MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.c @@ -151,7 +151,7 @@ InitializeDriverHealthManager ( NULL, (VOID **) &mDriverHealthManagerDatabase ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Handle = NULL; Status = gBS->InstallMultipleProtocolInterfaces ( @@ -162,7 +162,7 @@ InitializeDriverHealthManager ( &mDriverHealthManagerConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // @@ -220,7 +220,7 @@ DriverHealthManagerSelectBestLanguage ( NULL ); if (LanguageVariable != NULL) { - FreePool (LanguageVariable); + FreePool(LanguageVariable); } return BestLanguage; @@ -267,7 +267,7 @@ DriverHealthManagerGetComponentNameWorker ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -321,7 +321,7 @@ DriverHealthManagerGetDriverNameWorker ( &ComponentName, &BestLanguage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -333,7 +333,7 @@ DriverHealthManagerGetDriverNameWorker ( BestLanguage, DriverName ); - FreePool (BestLanguage); + FreePool(BestLanguage); return Status; } @@ -363,7 +363,7 @@ DriverHealthManagerGetDriverName ( // Get driver name from UEFI 2.0 Component Name 2 protocol interface. // Status = DriverHealthManagerGetDriverNameWorker (&gEfiComponentName2ProtocolGuid, DriverBindingHandle, &DriverName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If it fails to get the driver name from Component Name protocol interface, we should fall back on // EFI 1.1 Component Name protocol interface. @@ -371,7 +371,7 @@ DriverHealthManagerGetDriverName ( Status = DriverHealthManagerGetDriverNameWorker (&gEfiComponentNameProtocolGuid, DriverBindingHandle, &DriverName); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return AllocateCopyPool (StrSize (DriverName), DriverName); } else { return ConvertDevicePathToText (DevicePathFromHandle (DriverBindingHandle), FALSE, TRUE); @@ -426,7 +426,7 @@ DriverHealthManagerGetControllerNameWorker ( &ComponentName, &BestLanguage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -440,7 +440,7 @@ DriverHealthManagerGetControllerNameWorker ( BestLanguage, ControllerName ); - FreePool (BestLanguage); + FreePool(BestLanguage); return Status; } @@ -484,7 +484,7 @@ DriverHealthManagerGetControllerName ( ChildHandle, &ControllerName ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If it fails to get the controller name from Component Name protocol interface, we should fall back on // EFI 1.1 Component Name protocol interface. @@ -498,7 +498,7 @@ DriverHealthManagerGetControllerName ( ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return AllocateCopyPool (StrSize (ControllerName), ControllerName); } else { return ConvertDevicePathToText (DevicePathFromHandle (ChildHandle != NULL ? ChildHandle : ControllerHandle), FALSE, TRUE); @@ -566,7 +566,7 @@ DriverHealthManagerGetFormsetId ( Status = mDriverHealthManagerDatabase->ExportPackageLists (mDriverHealthManagerDatabase, Handle, &BufferSize, HiiPackageList); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT (HiiPackageList != NULL); @@ -596,7 +596,7 @@ DriverHealthManagerGetFormsetId ( for (Index = 0; Index < NumberOfClassGuid; Index++) { if (CompareGuid (&gEfiHiiDriverHealthFormsetGuid, &ClassGuid[Index])) { CopyMem (FormsetGuid, &((EFI_IFR_FORM_SET *) OpCodeData)->Guid, sizeof (EFI_GUID)); - FreePool (HiiPackageList); + FreePool(HiiPackageList); return EFI_SUCCESS; } } @@ -608,7 +608,7 @@ DriverHealthManagerGetFormsetId ( // // Form package not found in this Package List // - FreePool (HiiPackageList); + FreePool(HiiPackageList); return EFI_NOT_FOUND; } @@ -662,7 +662,7 @@ DriverHealthManagerProcessSingleControllerHealth ( case EfiDriverHealthStatusReconnectRequired: Status = gBS->DisconnectController (ControllerHandle, NULL, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Disconnect failed. Need to promote reconnect to a reboot. // @@ -754,9 +754,9 @@ DriverHealthManagerUpdateForm ( ); ASSERT (ControllerName != NULL); UnicodeSPrint (String, sizeof (String), L"%s %s", DriverName, ControllerName); - FreePool (ControllerName); + FreePool(ControllerName); } - FreePool (DriverName); + FreePool(DriverName); Prompt = HiiSetString (mDriverHealthManagerHiiHandle, 0, String, NULL); @@ -782,7 +782,7 @@ DriverHealthManagerUpdateForm ( break; } StringCount = UnicodeSPrint (String, sizeof (String), L"%s\n", TmpString); - FreePool (TmpString); + FreePool(TmpString); // // Add the message of the Module itself provided as the help. @@ -795,7 +795,7 @@ DriverHealthManagerUpdateForm ( NULL ); StringCount += UnicodeSPrint (String + StringCount, sizeof (String) - sizeof (String[0]) * StringCount, L"\n%s", TmpString); - FreePool (TmpString); + FreePool(TmpString); } } Help = HiiSetString (mDriverHealthManagerHiiHandle, 0, String, NULL); @@ -807,13 +807,13 @@ DriverHealthManagerUpdateForm ( mDriverHealthManagerHealthInfo[Index].HiiHandle, &DriverHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); TmpString = ConvertDevicePathToText (DevicePathFromHandle (DriverHandle), FALSE, TRUE); DevicePath = HiiSetString (mDriverHealthManagerHiiHandle, 0, TmpString, NULL); - FreePool (TmpString); + FreePool(TmpString); Status = DriverHealthManagerGetFormsetId (mDriverHealthManagerHealthInfo[Index].HiiHandle, &FormsetGuid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); HiiCreateGotoExOpCode ( StartOpCodeHandle, @@ -861,7 +861,7 @@ DriverHealthManagerUpdateForm ( StartOpCodeHandle, EndOpCodeHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); HiiFreeOpCodeHandle (StartOpCodeHandle); HiiFreeOpCodeHandle (EndOpCodeHandle); @@ -901,12 +901,12 @@ DriverHealthManagerCleanDynamicString ( mDriverHealthManagerHiiHandle, HiiPackageList ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Form package not found in this Package List // - FreePool (HiiPackageList); + FreePool(HiiPackageList); } /** diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index 7cfd5c178..338607bb3 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -154,7 +154,7 @@ InternalStartMonitor( ); for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { Status = gBS->HandleProtocol (Handles[HandleIndex], &gEfiSimpleTextInputExProtocolGuid, (VOID **) &SimpleEx); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); KeyData.KeyState.KeyToggleState = 0; KeyData.Key.ScanCode = 0; @@ -166,7 +166,7 @@ InternalStartMonitor( &KeyData, NotificationFunction, &NotifyHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -176,7 +176,7 @@ InternalStartMonitor( &KeyData, NotificationFunction, &NotifyHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } @@ -213,7 +213,7 @@ InternalStopMonitor( ); for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { Status = gBS->HandleProtocol (Handles[HandleIndex], &gEfiSimpleTextInputExProtocolGuid, (VOID **) &SimpleEx); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); KeyData.KeyState.KeyToggleState = 0; KeyData.Key.ScanCode = 0; @@ -225,7 +225,7 @@ InternalStopMonitor( &KeyData, NotificationFunction, &NotifyHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = SimpleEx->UnregisterKeyNotify (SimpleEx, NotifyHandle); } @@ -235,7 +235,7 @@ InternalStopMonitor( &KeyData, NotificationFunction, &NotifyHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = SimpleEx->UnregisterKeyNotify (SimpleEx, NotifyHandle); } } @@ -356,7 +356,7 @@ GetValueOfNumber ( Exit: if (Str != NULL) { - FreePool (Str); + FreePool(Str); } return Status; @@ -399,7 +399,7 @@ CreateAltCfgString ( if (Result != NULL) { StrCpyS (StringPtr, NewLen / sizeof (CHAR16), Result); StringPtr += StrLen (Result); - FreePool (Result); + FreePool(Result); } UnicodeSPrint ( @@ -484,7 +484,7 @@ AppendAltCfgString ( // Get Offset // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } Offset = 0; @@ -493,7 +493,7 @@ AppendAltCfgString ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); StringPtr += Length; if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) { @@ -505,7 +505,7 @@ AppendAltCfgString ( // Get Width // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } Width = 0; @@ -514,7 +514,7 @@ AppendAltCfgString ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); StringPtr += Length; if (StrnCmp (StringPtr, L"&VALUE=", StrLen (L"&VALUE=")) != 0) { @@ -526,7 +526,7 @@ AppendAltCfgString ( // Get Value // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } StringPtr += Length; @@ -625,7 +625,7 @@ ExtractConfig ( &BufferSize, &PrivateData->Configuration ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -644,7 +644,7 @@ ExtractConfig ( ASSERT (ConfigRequest != NULL); AllocatedRequest = TRUE; UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); ConfigRequestHdr = NULL; } else { // @@ -701,7 +701,7 @@ ExtractConfig ( // Update Name/Value storage Names // Status = LoadNameValueNames (PrivateData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -799,7 +799,7 @@ ExtractConfig ( Results, Progress ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ConfigRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, VariableName, PrivateData->DriverHandle[0]); AppendAltCfgString(Results, ConfigRequestHdr); } @@ -809,11 +809,11 @@ ExtractConfig ( // Free the allocated config request string. // if (AllocatedRequest) { - FreePool (ConfigRequest); + FreePool(ConfigRequest); } if (ConfigRequestHdr != NULL) { - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); } // // Set Progress string to the original request string. @@ -907,7 +907,7 @@ RouteConfig ( &BufferSize, &PrivateData->Configuration ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -919,7 +919,7 @@ RouteConfig ( // Update Name/Value storage Names // Status = LoadNameValueNames (PrivateData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1041,7 +1041,7 @@ RouteConfig ( &BufferSize, Progress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1172,7 +1172,7 @@ DriverCallback ( if (QuestionId == 0x1247) { Status = InternalStartMonitor (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } break; @@ -1199,7 +1199,7 @@ DriverCallback ( if (QuestionId == 0x1247) { Status = InternalStopMonitor (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } break; @@ -1287,7 +1287,7 @@ DriverCallback ( NULL ); } - FreePool (EfiData); + FreePool(EfiData); } break; } @@ -1434,7 +1434,7 @@ DriverCallback ( NULL ); } - FreePool (Configuration); + FreePool(Configuration); HiiCreateOneOfOpCode ( StartOpCodeHandle, // Container for dynamic created opcodes @@ -1580,7 +1580,7 @@ DriverCallback ( &ProgressErr, &Results ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { do { CreatePopUp ( EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, @@ -1622,7 +1622,7 @@ DriverCallback ( &Progress, &ProgressErr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { do { CreatePopUp ( EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, @@ -1649,7 +1649,7 @@ DriverCallback ( STRING_TOKEN (STR_POPUP_STRING), &UserSelection ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (UserSelection == EfiHiiPopupSelectionYes) { *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; } @@ -1762,7 +1762,7 @@ DriverSampleInit ( // Locate Hii Database protocol // Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &HiiDatabase); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } mPrivateData->HiiDatabase = HiiDatabase; @@ -1771,7 +1771,7 @@ DriverSampleInit ( // Locate HiiString protocol // Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &HiiString); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } mPrivateData->HiiString = HiiString; @@ -1780,7 +1780,7 @@ DriverSampleInit ( // Locate Formbrowser2 protocol // Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &FormBrowser2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } mPrivateData->FormBrowser2 = FormBrowser2; @@ -1789,7 +1789,7 @@ DriverSampleInit ( // Locate ConfigRouting protocol // Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &HiiConfigRouting); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } mPrivateData->HiiConfigRouting = HiiConfigRouting; @@ -1798,7 +1798,7 @@ DriverSampleInit ( // Locate keyword handler protocol // Status = gBS->LocateProtocol (&gEfiConfigKeywordHandlerProtocolGuid, NULL, (VOID **) &HiiKeywordHandler); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } mPrivateData->HiiKeywordHandler = HiiKeywordHandler; @@ -1807,7 +1807,7 @@ DriverSampleInit ( // Locate HiiPopup protocol // Status = gBS->LocateProtocol (&gEfiHiiPopupProtocolGuid, NULL, (VOID **) &PopupHandler); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } mPrivateData->HiiPopup = PopupHandler; @@ -1820,7 +1820,7 @@ DriverSampleInit ( &mPrivateData->ConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mPrivateData->DriverHandle[0] = DriverHandle[0]; @@ -1851,7 +1851,7 @@ DriverSampleInit ( &mPrivateData->ConfigAccess, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mPrivateData->DriverHandle[1] = DriverHandle[1]; @@ -1878,7 +1878,7 @@ DriverSampleInit ( return EFI_OUT_OF_RESOURCES; } if (NewString != NULL) { - FreePool (NewString); + FreePool(NewString); } // @@ -1918,7 +1918,7 @@ DriverSampleInit ( BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION); Status = gRT->GetVariable (VariableName, &gDriverSampleFormSetGuid, NULL, &BufferSize, Configuration); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Store zero data Buffer Storage to EFI variable // @@ -1929,7 +1929,7 @@ DriverSampleInit ( sizeof (DRIVER_SAMPLE_CONFIGURATION), Configuration ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DriverSampleUnload (ImageHandle); return Status; } @@ -1964,7 +1964,7 @@ DriverSampleInit ( return EFI_INVALID_PARAMETER; } } - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); // // Initialize efi varstore configuration data @@ -1977,7 +1977,7 @@ DriverSampleInit ( BufferSize = sizeof (MY_EFI_VARSTORE_DATA); Status = gRT->GetVariable (MyEfiVar, &gDriverSampleFormSetGuid, NULL, &BufferSize, VarStoreConfig); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Store zero data to EFI variable Storage. // @@ -1988,7 +1988,7 @@ DriverSampleInit ( sizeof (MY_EFI_VARSTORE_DATA), VarStoreConfig ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DriverSampleUnload (ImageHandle); return Status; } @@ -2011,7 +2011,7 @@ DriverSampleInit ( return EFI_INVALID_PARAMETER; } } - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); // // Initialize Bits efi varstore configuration data @@ -2024,7 +2024,7 @@ DriverSampleInit ( BufferSize = sizeof (MY_EFI_BITS_VARSTORE_DATA); Status = gRT->GetVariable (MyEfiBitVar, &gDriverSampleFormSetGuid, NULL, &BufferSize, BitsVarStoreConfig); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Store zero data to EFI variable Storage. // @@ -2035,7 +2035,7 @@ DriverSampleInit ( sizeof (MY_EFI_BITS_VARSTORE_DATA), BitsVarStoreConfig ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DriverSampleUnload (ImageHandle); return Status; } @@ -2058,7 +2058,7 @@ DriverSampleInit ( return EFI_INVALID_PARAMETER; } } - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); // // Initialize Union efi varstore configuration data @@ -2071,7 +2071,7 @@ DriverSampleInit ( BufferSize = sizeof (MY_EFI_UNION_DATA); Status = gRT->GetVariable (MyEfiUnionVar, &gDriverSampleFormSetGuid, NULL, &BufferSize, UnionConfig); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Store zero data to EFI variable Storage. // @@ -2082,7 +2082,7 @@ DriverSampleInit ( sizeof (MY_EFI_UNION_DATA), UnionConfig ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DriverSampleUnload (ImageHandle); return Status; } @@ -2105,7 +2105,7 @@ DriverSampleInit ( return EFI_INVALID_PARAMETER; } } - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, @@ -2115,13 +2115,13 @@ DriverSampleInit ( &gEfiIfrRefreshIdOpGuid, &mEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Example of how to use BrowserEx protocol to register HotKey. // Status = gBS->LocateProtocol (&gEdkiiFormBrowserExProtocolGuid, NULL, (VOID **) &FormBrowserEx); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // First unregister the default hot key F9 and F10. // @@ -2227,10 +2227,10 @@ DriverSampleUnload ( for (Index = 0; Index < NAME_VALUE_NAME_NUMBER; Index++) { if (mPrivateData->NameValueName[Index] != NULL) { - FreePool (mPrivateData->NameValueName[Index]); + FreePool(mPrivateData->NameValueName[Index]); } } - FreePool (mPrivateData); + FreePool(mPrivateData); mPrivateData = NULL; gBS->CloseEvent (mEvent); diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c index 611b2de5d..c392b8646 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c @@ -278,7 +278,7 @@ EdbClearSymbol ( // Free source buffer // for (Index = 0; Object->SourceBuffer[Index] != NULL; Index++) { - gBS->FreePool (Object->SourceBuffer[Index]); + gBS->FreePool(Object->SourceBuffer[Index]); Object->SourceBuffer[Index] = NULL; } } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c index e0c797be2..b82c43c09 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c @@ -325,7 +325,7 @@ DebuggerBreakpointSet ( // Get breakpoint address // Status = Symboltoi (CommandArg, &Address); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND) { Address = Xtoi(CommandArg); } else { diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c index e5cf857a2..532d57c02 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c @@ -46,7 +46,7 @@ DebuggerGo ( // set BreakAddress, and set feature flag. // Status = Symboltoi (CommandStr, &Address); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND) { Address = Xtoi(CommandStr); } else { diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c index 42bd8093f..30b013d2b 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c @@ -225,7 +225,7 @@ EdbGetMemoryAddressCount ( return EFI_INVALID_PARAMETER; } Status = Symboltoi (CommandStr, &MemAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND) { MemAddress = Xtoi(CommandStr); } else { @@ -286,7 +286,7 @@ EdbGetMemoryAddressValue ( return EFI_INVALID_PARAMETER; } Status = Symboltoi (CommandStr, &MemAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND) { MemAddress = Xtoi(CommandStr); } else { diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdScope.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdScope.c index 8240ab624..524819c2e 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdScope.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdScope.c @@ -40,7 +40,7 @@ DebuggerScope ( // Load new scope // Status = Symboltoi (CommandArg, &Address); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND) { Address = Xtoi(CommandArg); } else { diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c index 8e305e424..e9f3740c2 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c @@ -445,10 +445,10 @@ DebuggerLoadSymbol ( Status = EdbLoadSymbol (DebuggerPrivate, FileName, BufferSize, Buffer); if (EFI_ERROR(Status)) { EDBPrint (L"LoadSymbol error!\n"); - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); return EFI_DEBUG_CONTINUE; } - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); // // Patch Symbol for RVA @@ -500,9 +500,9 @@ DebuggerLoadSymbol ( // Load Code // Status = EdbLoadCode (DebuggerPrivate, FileName, CodFileName, BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EDBPrint (L"LoadCode error!\n"); - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index); continue; } @@ -511,9 +511,9 @@ DebuggerLoadSymbol ( // Record the buffer // Status = EdbAddCodeBuffer (DebuggerPrivate, FileName, CodFileName, BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EDBPrint (L"AddCodeBuffer error!\n"); - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index); continue; } @@ -594,7 +594,7 @@ DebuggerUnloadSymbol ( // Unload Code // Status = EdbUnloadCode (DebuggerPrivate, FileName, CodFileName, &BufferPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EDBPrint (L"UnloadCode error!\n"); CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index); continue; @@ -604,7 +604,7 @@ DebuggerUnloadSymbol ( // Delete the code buffer // Status = EdbDeleteCodeBuffer (DebuggerPrivate, FileName, CodFileName, BufferPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EDBPrint (L"DeleteCodeBuffer error!\n"); CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index); continue; @@ -738,9 +738,9 @@ DebuggerLoadCode ( // Load Code // Status = EdbLoadCode (DebuggerPrivate, MapFileName, FileName, BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EDBPrint (L"LoadCode error!\n"); - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); return EFI_DEBUG_CONTINUE; } @@ -748,9 +748,9 @@ DebuggerLoadCode ( // Record the buffer // Status = EdbAddCodeBuffer (DebuggerPrivate, MapFileName, FileName, BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EDBPrint (L"AddCodeBuffer error!\n"); - gBS->FreePool (Buffer); + gBS->FreePool(Buffer); return EFI_DEBUG_CONTINUE; } @@ -806,7 +806,7 @@ DebuggerUnloadCode ( // Unload Code // Status = EdbUnloadCode (DebuggerPrivate, MapFileName, FileName, &BufferPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EDBPrint (L"UnloadCode error!\n"); return EFI_DEBUG_CONTINUE; } @@ -815,7 +815,7 @@ DebuggerUnloadCode ( // Delete Code buffer // Status = EdbDeleteCodeBuffer (DebuggerPrivate, MapFileName, FileName, BufferPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EDBPrint (L"DeleteCodeBuffer error!\n"); } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c index 83257a2c2..cadcd4e1d 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c @@ -396,7 +396,7 @@ EbcDebuggerHookInit ( NULL, &mDebuggerPrivate.BreakEvent ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->SetTimer ( mDebuggerPrivate.BreakEvent, TimerPeriodic, @@ -437,24 +437,24 @@ EbcDebuggerHookUnload ( // // Clean up Entry // - gBS->FreePool (Object[Index].Entry); + gBS->FreePool(Object[Index].Entry); Object[Index].Entry = NULL; Object[Index].EntryCount = 0; // // Clean up source buffer // for (SubIndex = 0; Object[Index].SourceBuffer[SubIndex] != NULL; SubIndex++) { - gBS->FreePool (Object[Index].SourceBuffer[SubIndex]); + gBS->FreePool(Object[Index].SourceBuffer[SubIndex]); Object[Index].SourceBuffer[SubIndex] = NULL; } - gBS->FreePool (Object[Index].SourceBuffer); + gBS->FreePool(Object[Index].SourceBuffer); Object[Index].SourceBuffer = NULL; } // // Clean up Object // - gBS->FreePool (Object); + gBS->FreePool(Object); mDebuggerPrivate.DebuggerSymbolContext.Object = NULL; mDebuggerPrivate.DebuggerSymbolContext.ObjectCount = 0; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c index ee2f8fc2f..d25fa9dcb 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c @@ -41,7 +41,7 @@ ReadFileFromVol ( // Open the root directory // Status = Vol->OpenVolume (Vol, &RootDir); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -55,7 +55,7 @@ ReadFileFromVol ( EFI_FILE_MODE_READ, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { RootDir->Close (RootDir); return Status; } @@ -79,9 +79,9 @@ ReadFileFromVol ( &FileInfoSize, FileInfo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Handle->Close (Handle); - gBS->FreePool (FileInfo); + gBS->FreePool(FileInfo); return Status; } @@ -92,11 +92,11 @@ ReadFileFromVol ( TempBuffer = AllocateZeroPool (TempBufferSize); if (TempBuffer == NULL) { Handle->Close (Handle); - gBS->FreePool (FileInfo); + gBS->FreePool(FileInfo); return Status; } - gBS->FreePool (FileInfo); + gBS->FreePool(FileInfo); // // Read the file data to the buffer @@ -106,9 +106,9 @@ ReadFileFromVol ( &TempBufferSize, TempBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Handle->Close (Handle); - gBS->FreePool (TempBuffer); + gBS->FreePool(TempBuffer); return Status; } @@ -190,7 +190,7 @@ ReadFileToBuffer ( &NoHandles, &HandleBuffer ); - if (EFI_ERROR (Status) && (NoHandles == 0)) { + if (EFI_ERROR(Status) && (NoHandles == 0)) { return EFI_NOT_FOUND; } @@ -211,7 +211,7 @@ ReadFileToBuffer ( } Status = ReadFileFromVol (Vol, FileName, &TempBufferSize, &TempBuffer); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Read file OK, check duplication // @@ -219,8 +219,8 @@ ReadFileToBuffer ( // // Find the duplicated file // - gBS->FreePool (TempBuffer); - gBS->FreePool (*Buffer); + gBS->FreePool(TempBuffer); + gBS->FreePool(*Buffer); EDBPrint (L"Duplicated FileName found!\n"); return EFI_NO_MAPPING; } else { @@ -293,7 +293,7 @@ GetFileNameUnderDir ( // Open the root directory // Status = Vol->OpenVolume (Vol, &RootDir); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -307,7 +307,7 @@ GetFileNameUnderDir ( EFI_FILE_MODE_READ, EFI_FILE_DIRECTORY ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { RootDir->Close (RootDir); return NULL; } @@ -317,7 +317,7 @@ GetFileNameUnderDir ( // Set Dir Position // Status = Handle->SetPosition (Handle, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Handle->Close (Handle); return NULL; } @@ -349,7 +349,7 @@ GetFileNameUnderDir ( &FileInfoSize, FileInfo ); - if (EFI_ERROR (Status) || (FileInfoSize == 0)) { + if (EFI_ERROR(Status) || (FileInfoSize == 0)) { break; } @@ -377,7 +377,7 @@ GetFileNameUnderDir ( // // Free resources // - gBS->FreePool (FileInfo); + gBS->FreePool(FileInfo); Handle->Close (Handle); return TempName; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c index dd881a021..2a40748c6 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c @@ -62,7 +62,7 @@ WaitForSingleEvent ( // Create a timer event // Status = gBS->CreateEvent (EVT_TIMER, 0, NULL, NULL, &TimerEvent); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Set the timer event // @@ -83,7 +83,7 @@ WaitForSingleEvent ( // // If the timer expired, change the return to timed out // - if (!EFI_ERROR (Status) && Index == 1) { + if (!EFI_ERROR(Status) && Index == 1) { Status = EFI_TIMEOUT; } } @@ -92,7 +92,7 @@ WaitForSingleEvent ( // No timeout... just wait on the event // Status = gBS->WaitForEvent (1, &Event, &Index); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); ASSERT (Index == 0); } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c index 85cc275c1..067fe4f01 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c @@ -199,21 +199,21 @@ EdbLoadSymbolEntryByIec ( // Check each field // while (FieldBuffer != NULL) { - if (AsciiStrCmp (FieldBuffer, "") == 0) { + if (AsciiStrCmp(FieldBuffer, "") == 0) { FieldBuffer = AsciiStrGetNextTokenField (" "); continue; } // // check "Address" // - if (AsciiStrCmp (FieldBuffer, "Address") == 0) { + if (AsciiStrCmp(FieldBuffer, "Address") == 0) { MapParseState = EdbEbcMapParseStateSymbolStart; break; } // // check "Static" // - if (AsciiStrCmp (FieldBuffer, "Static") == 0) { + if (AsciiStrCmp(FieldBuffer, "Static") == 0) { MapParseState = EdbEbcMapParseStateStaticFunctionSymbol; break; } @@ -224,7 +224,7 @@ EdbLoadSymbolEntryByIec ( // break; } - if (AsciiStrCmp (FieldBuffer, "entry") == 0) { + if (AsciiStrCmp(FieldBuffer, "entry") == 0) { // // Skip entry point // @@ -301,7 +301,7 @@ EdbLoadSymbolEntryByIec ( // // Get the Type. This is optional, only for "f". // - if (AsciiStrCmp (FieldBuffer, "f") == 0) { + if (AsciiStrCmp(FieldBuffer, "f") == 0) { SymbolParseState = EdbEbcSymbolParseStateReadyForObject; switch (MapParseState) { case EdbEbcMapParseStateFunctionSymbol: @@ -654,7 +654,7 @@ EdbUnloadSymbol ( // Free OldSourceBuffer // for (Index = 0; OldSourceBuffer[Index] != NULL; Index++) { - gBS->FreePool (OldSourceBuffer[Index]); + gBS->FreePool(OldSourceBuffer[Index]); OldSourceBuffer[Index] = NULL; } @@ -720,7 +720,7 @@ EdbLoadSymbol ( // DEBUG ((DEBUG_ERROR, "Symbol File: %s\n", FileName)); Status = EdbLoadSymbolEntry (Object, BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1002,7 +1002,7 @@ EdbPatchSymbolRVA ( &gEfiDebugImageInfoTableGuid, (VOID **) &mDebuggerPrivate.DebugImageInfoTableHeader ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EDBPrint (L"DebugImageInfoTable not found!\n"); return Status; } @@ -1199,7 +1199,7 @@ EdbLoadCodBySymbolByIec ( // // check mark_begin, begin to check line after this match // - if (AsciiStrCmp (LineBuffer, "; mark_begin;") == 0) { + if (AsciiStrCmp(LineBuffer, "; mark_begin;") == 0) { CodParseState = EdbEbcCodParseStateSymbolInitialized; } LineBuffer = AsciiStrGetNextTokenLine ("\n\r"); @@ -1210,7 +1210,7 @@ EdbLoadCodBySymbolByIec ( // // check mark_end, not check line after this match // - if (AsciiStrCmp (LineBuffer, "; mark_end;") == 0) { + if (AsciiStrCmp(LineBuffer, "; mark_end;") == 0) { CodParseState = EdbEbcCodParseStateUninitialized; LineBuffer = AsciiStrGetNextTokenLine ("\n\r"); PatchForAsciiStrTokenBefore (LineBuffer, '\n'); @@ -1252,7 +1252,7 @@ EdbLoadCodBySymbolByIec ( // // check mark_end, if this match, means the function is found successfully. // - if (AsciiStrCmp (LineBuffer, "; mark_end;") == 0) { + if (AsciiStrCmp(LineBuffer, "; mark_end;") == 0) { CodParseState = EdbEbcCodParseStateSymbolEnd; // // prepare CodeBufferSize, FuncOffset, and FuncStart to return @@ -1646,7 +1646,7 @@ EdbDeleteCodeBuffer ( // free the buffer if match // if (Object->SourceBuffer[Index] == SourceBuffer) { - gBS->FreePool (SourceBuffer); + gBS->FreePool(SourceBuffer); break; } } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c index 1c4a4f515..9609342b9 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c @@ -1446,7 +1446,7 @@ EbcExecute ( NULL, (VOID **) &EbcSimpleDebugger ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EbcSimpleDebugger = NULL; } DEBUG_CODE_END (); @@ -1885,7 +1885,7 @@ ExecuteBREAK ( // Now create a new thunk // Status = EbcCreateThunks (VmPtr->ImageHandle, EbcEntryPoint, &Thunk, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcInt.c b/MdeModulePkg/Universal/EbcDxe/EbcInt.c index eced1d5c7..c460c7c8d 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcInt.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcInt.c @@ -412,7 +412,7 @@ EbcRegisterImage ( ImageContext.ImageRead = PeCoffLoaderImageReadFromMemory; Status = PeCoffLoaderGetImageInfo (&ImageContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -537,7 +537,7 @@ InitializeEbcDriver ( } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); HandleBuffer = NULL; } // @@ -550,8 +550,8 @@ InitializeEbcDriver ( &gEdkiiPeCoffImageEmulatorProtocolGuid, &mPeCoffEmuProtocol, NULL ); - if (EFI_ERROR (Status)) { - FreePool (EbcProtocol); + if (EFI_ERROR(Status)) { + FreePool(EbcProtocol); return Status; } } @@ -588,8 +588,8 @@ InitializeEbcDriver ( // // This is recoverable, so free the memory and continue. // - if (EFI_ERROR (Status)) { - FreePool (EbcDebugProtocol); + if (EFI_ERROR(Status)) { + FreePool(EbcDebugProtocol); goto ErrorExit; } // @@ -640,11 +640,11 @@ ErrorExit: } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); HandleBuffer = NULL; } - FreePool (EbcProtocol); + FreePool(EbcProtocol); return Status; } @@ -1185,8 +1185,8 @@ EbcUnloadImage ( ThunkList = ImageList->ThunkList; while (ThunkList != NULL) { NextThunkList = ThunkList->Next; - FreePool (ThunkList->ThunkBuffer); - FreePool (ThunkList); + FreePool(ThunkList->ThunkBuffer); + FreePool(ThunkList); ThunkList = NextThunkList; } // @@ -1203,7 +1203,7 @@ EbcUnloadImage ( // // Now free up the image list element // - FreePool (ImageList); + FreePool(ImageList); EbcDebuggerHookEbcUnloadImage (ImageHandle); @@ -1240,7 +1240,7 @@ EbcAddImageThunk ( // if (mEbcICacheFlush != NULL) { Status = mEbcICacheFlush ((EFI_PHYSICAL_ADDRESS) (UINTN) ThunkBuffer, ThunkSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1495,8 +1495,8 @@ InitEbcVmTestProtocol ( // Handle = NULL; Status = gBS->InstallProtocolInterface (&Handle, &gEfiEbcVmTestProtocolGuid, EFI_NATIVE_INTERFACE, EbcVmTestProtocol); - if (EFI_ERROR (Status)) { - FreePool (EbcVmTestProtocol); + if (EFI_ERROR(Status)) { + FreePool(EbcVmTestProtocol); } return Status; } @@ -1535,7 +1535,7 @@ EbcAllocatePoolForThunk ( EFI_STATUS Status; Status = gBS->AllocatePool (EfiBootServicesCode, AllocationSize, &Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return Buffer; diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.c b/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.c index a386a9770..bf787b5ea 100644 --- a/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.c +++ b/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.c @@ -48,7 +48,7 @@ EsrtDxeGetEsrtEntry( } Status = EfiAcquireLockOrFail (&mPrivate.NonFmpLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -65,7 +65,7 @@ EsrtDxeGetEsrtEntry( if (EFI_ERROR(Status)) { Status = EfiAcquireLockOrFail (&mPrivate.FmpLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -107,7 +107,7 @@ EsrtDxeUpdateEsrtEntry( } Status = EfiAcquireLockOrFail (&mPrivate.FmpLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -121,7 +121,7 @@ EsrtDxeUpdateEsrtEntry( Status = EfiAcquireLockOrFail (&mPrivate.NonFmpLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -154,7 +154,7 @@ EsrtDxeUnRegisterEsrtEntry( } Status = EfiAcquireLockOrFail (&mPrivate.NonFmpLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -189,7 +189,7 @@ EsrtDxeRegisterEsrtEntry( } Status = EfiAcquireLockOrFail (&mPrivate.NonFmpLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -413,7 +413,7 @@ EsrtDxeSyncFmp( UPDATE_REPOSITORY: Status = EfiAcquireLockOrFail (&mPrivate.FmpLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -483,7 +483,7 @@ EsrtDxeLockEsrtRepository( // Mark ACPI_GLOBAL_VARIABLE variable to read-only if the Variable Lock protocol exists // Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = VariableLock->RequestToLock (VariableLock, EFI_ESRT_FMP_VARIABLE_NAME, &gEfiCallerIdGuid); DEBUG((EFI_D_INFO, "EsrtDxe Lock EsrtFmp Variable Status 0x%x", Status)); @@ -523,7 +523,7 @@ EsrtReadyToBootEventNotify ( NonFmpRepositorySize = 0; Status = EfiAcquireLockOrFail (&mPrivate.NonFmpLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -642,7 +642,7 @@ EsrtDxeEntryPoint ( &mEsrtManagementProtocolTemplate, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register notify function to install Esrt Table on ReadyToBoot Event. @@ -655,7 +655,7 @@ EsrtDxeEntryPoint ( &gEfiEventReadyToBootGuid, &mPrivate.Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c index 4670349f8..3b7ebebf9 100644 --- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c +++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c @@ -73,7 +73,7 @@ InstallEfiSystemResourceTableInUefiConfigurationTable ( // Install the pointer into config table // Status = gBS->InstallConfigurationTable (&gEfiSystemResourceTableGuid, Table); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Can't install ESRT table. Status: %r. \n", Status)); } else { DEBUG ((DEBUG_INFO, "EsrtFmpDxe: Installed ESRT table. \n")); @@ -339,11 +339,11 @@ FmpGetFirmwareImageDescriptor ( &PackageVersionName // PackageVersionName ); if (PackageVersionName != NULL) { - FreePool (PackageVersionName); + FreePool(PackageVersionName); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failure in GetImageInfo. Status = %r\n", Status)); - FreePool (FmpImageInfoBuf); + FreePool(FmpImageInfoBuf); return NULL; } @@ -405,7 +405,7 @@ CreateFmpBasedEsrt ( ); if (FmpImageInfoBuf != NULL) { NumberOfDescriptors += FmpImageInfoCount; - FreePool (FmpImageInfoBuf); + FreePool(FmpImageInfoBuf); } } @@ -417,15 +417,15 @@ CreateFmpBasedEsrt ( ); if (Table == NULL) { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to allocate memory for ESRT.\n")); - FreePool (Buffer); + FreePool(Buffer); return NULL; } HardwareInstances = AllocateZeroPool (NumberOfDescriptors * sizeof (GUID_HARDWAREINSTANCE_PAIR)); if (HardwareInstances == NULL) { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to allocate memory for HW Instance Table.\n")); - FreePool (Table); - FreePool (Buffer); + FreePool(Table); + FreePool(Buffer); return NULL; } @@ -469,12 +469,12 @@ CreateFmpBasedEsrt ( FmpImageInfoBuf = (EFI_FIRMWARE_IMAGE_DESCRIPTOR *)(((UINT8 *)FmpImageInfoBuf) + DescriptorSize); } - FreePool (OrgFmpImageInfoBuf); + FreePool(OrgFmpImageInfoBuf); OrgFmpImageInfoBuf = NULL; } - FreePool (Buffer); - FreePool (HardwareInstances); + FreePool(Buffer); + FreePool(HardwareInstances); return Table; } @@ -506,8 +506,8 @@ EsrtReadyToBootEventNotify ( DEBUG_CODE_END (); Status = InstallEfiSystemResourceTableInUefiConfigurationTable (Table); - if (EFI_ERROR (Status)) { - FreePool (Table); + if (EFI_ERROR(Status)) { + FreePool(Table); } } else { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Can't install ESRT table because it is NULL. \n")); @@ -549,8 +549,8 @@ EsrtFmpEntryPoint ( &EsrtReadyToBootEvent ); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to register for ready to boot\n")); } diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c index 484763225..b979263e0 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c @@ -82,7 +82,7 @@ FtwAllocate ( FtwDevice = FTW_CONTEXT_FROM_THIS (This); Status = WorkSpaceRefresh (FtwDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } // @@ -110,7 +110,7 @@ FtwAllocate ( Offset = (UINT8 *) FtwHeader - (UINT8 *) FtwDevice->FtwWorkSpace; if (Offset + FTW_WRITE_TOTAL_SIZE (NumberOfWrites, PrivateDataSize) > FtwDevice->FtwWorkSpaceSize) { Status = FtwReclaimWorkSpace (FtwDevice, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -135,7 +135,7 @@ FtwAllocate ( sizeof (EFI_FAULT_TOLERANT_WRITE_HEADER), (UINT8 *) FtwHeader ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } // @@ -148,7 +148,7 @@ FtwAllocate ( FtwDevice->FtwWorkSpaceBase + Offset, WRITES_ALLOCATED ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -217,7 +217,7 @@ FtwWriteRecord ( FtwDevice->FtwWorkSpaceBaseInSpare + Offset, SPARE_COMPLETED ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -235,7 +235,7 @@ FtwWriteRecord ( Status = FlushSpareBlockToTargetBlock (FtwDevice, Fvb, Record->Lba, BlockSize, NumberOfWriteBlocks); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } // @@ -249,7 +249,7 @@ FtwWriteRecord ( FtwDevice->FtwWorkSpaceBase + Offset, DEST_COMPLETED ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -269,7 +269,7 @@ FtwWriteRecord ( WRITES_COMPLETED ); Header->Complete = FTW_VALID_STATE; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } } @@ -336,7 +336,7 @@ FtwWrite ( FtwDevice = FTW_CONTEXT_FROM_THIS (This); Status = WorkSpaceRefresh (FtwDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -350,7 +350,7 @@ FtwWrite ( // No additional private data, the private data size is zero. Number of record can be set to 1. // Status = FtwAllocate (This, &gEfiCallerIdGuid, 0, 1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } else { @@ -390,12 +390,12 @@ FtwWrite ( // Get the FVB protocol by handle // Status = FtwGetFvbByHandle (FvBlockHandle, &Fvb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } Status = Fvb->GetPhysicalAddress (Fvb, &FvbPhysicalAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ftw: Write(), Get FVB physical address - %r\n", Status)); return EFI_ABORTED; } @@ -404,7 +404,7 @@ FtwWrite ( // Now, one FVB has one type of BlockSize. // Status = Fvb->GetBlockSize (Fvb, 0, &BlockSize, &NumberOfBlocks); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ftw: Write(), Get block size - %r\n", Status)); return EFI_ABORTED; } @@ -452,7 +452,7 @@ FtwWrite ( MyLength, (UINT8 *) Record ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } // @@ -473,8 +473,8 @@ FtwWrite ( for (Index = 0; Index < NumberOfWriteBlocks; Index += 1) { MyLength = BlockSize; Status = Fvb->Read (Fvb, Lba + Index, 0, &MyLength, Ptr); - if (EFI_ERROR (Status)) { - FreePool (MyBuffer); + if (EFI_ERROR(Status)) { + FreePool(MyBuffer); return EFI_ABORTED; } @@ -493,7 +493,7 @@ FtwWrite ( SpareBufferSize = FtwDevice->SpareAreaLength; SpareBuffer = AllocatePool (SpareBufferSize); if (SpareBuffer == NULL) { - FreePool (MyBuffer); + FreePool(MyBuffer); return EFI_OUT_OF_RESOURCES; } @@ -507,9 +507,9 @@ FtwWrite ( &MyLength, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (MyBuffer); - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(MyBuffer); + FreePool(SpareBuffer); return EFI_ABORTED; } @@ -520,9 +520,9 @@ FtwWrite ( // Do not assume Spare Block and Target Block have same block size // Status = FtwEraseSpareBlock (FtwDevice); - if (EFI_ERROR (Status)) { - FreePool (MyBuffer); - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(MyBuffer); + FreePool(SpareBuffer); return EFI_ABORTED; } Ptr = MyBuffer; @@ -539,9 +539,9 @@ FtwWrite ( &MyLength, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (MyBuffer); - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(MyBuffer); + FreePool(SpareBuffer); return EFI_ABORTED; } @@ -551,7 +551,7 @@ FtwWrite ( // // Free MyBuffer // - FreePool (MyBuffer); + FreePool(MyBuffer); // // Set the SpareComplete in the FTW record, @@ -564,8 +564,8 @@ FtwWrite ( FtwDevice->FtwWorkSpaceBase + MyOffset, SPARE_COMPLETED ); - if (EFI_ERROR (Status)) { - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(SpareBuffer); return EFI_ABORTED; } @@ -576,16 +576,16 @@ FtwWrite ( // guaranteed to be completed with fault tolerant manner. // Status = FtwWriteRecord (This, Fvb, BlockSize); - if (EFI_ERROR (Status)) { - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(SpareBuffer); return EFI_ABORTED; } // // Restore spare backup buffer into spare block , if no failure happened during FtwWrite. // Status = FtwEraseSpareBlock (FtwDevice); - if (EFI_ERROR (Status)) { - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(SpareBuffer); return EFI_ABORTED; } Ptr = SpareBuffer; @@ -598,8 +598,8 @@ FtwWrite ( &MyLength, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(SpareBuffer); return EFI_ABORTED; } @@ -608,7 +608,7 @@ FtwWrite ( // // All success. // - FreePool (SpareBuffer); + FreePool(SpareBuffer); DEBUG ( (EFI_D_INFO, @@ -653,7 +653,7 @@ FtwRestart ( FtwDevice = FTW_CONTEXT_FROM_THIS (This); Status = WorkSpaceRefresh (FtwDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -665,7 +665,7 @@ FtwRestart ( // Recover the targt block with the spare block. // Status = FtwGetFvbByHandle (FvBlockHandle, &Fvb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -673,7 +673,7 @@ FtwRestart ( // Now, one FVB has one type of BlockSize // Status = Fvb->GetBlockSize (Fvb, 0, &BlockSize, &NumberOfBlocks); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ftw: Restart(), Get block size - %r\n", Status)); return EFI_ABORTED; } @@ -701,7 +701,7 @@ FtwRestart ( // guaranteed to be completed with fault tolerant manner. // Status = FtwWriteRecord (This, Fvb, BlockSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -710,7 +710,7 @@ FtwRestart ( // This is restart, no need to keep spareblock content. // Status = FtwEraseSpareBlock (FtwDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -741,7 +741,7 @@ FtwAbort ( FtwDevice = FTW_CONTEXT_FROM_THIS (This); Status = WorkSpaceRefresh (FtwDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -763,7 +763,7 @@ FtwAbort ( FtwDevice->FtwWorkSpaceBase + Offset, WRITES_COMPLETED ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -821,7 +821,7 @@ FtwGetLastWrite ( FtwDevice = FTW_CONTEXT_FROM_THIS (This); Status = WorkSpaceRefresh (FtwDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -853,7 +853,7 @@ FtwGetLastWrite ( // if (Record->SpareComplete != FTW_VALID_STATE) { Status = GetPreviousRecordOfWrites (Header, &Record); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FtwAbort (This); *Complete = TRUE; return EFI_NOT_FOUND; diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c index ae8f11790..6a5db614b 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c @@ -170,7 +170,7 @@ FvbNotificationEvent ( NULL, (VOID **) &FtwProtocol ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return ; } @@ -192,10 +192,10 @@ FvbNotificationEvent ( EFI_NATIVE_INTERFACE, &FtwDevice->FtwInstance ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CloseEvent (Event); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return; } @@ -271,7 +271,7 @@ FtwCalculateCrc32 ( UINT32 ReturnValue; Status = gBS->CalculateCrc32 (Buffer, Length, &ReturnValue); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return ReturnValue; } diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c index e8e935a85..e0d63af26 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c @@ -178,7 +178,7 @@ GetFvbCountAndBuffer ( *NumberHandles = BufferSize / sizeof(EFI_HANDLE); if (EFI_ERROR(Status)) { *NumberHandles = 0; - FreePool (*Buffer); + FreePool(*Buffer); *Buffer = NULL; } @@ -218,7 +218,7 @@ GetFvbByAddressAndAttribute ( // Locate all handles of SMM Fvb protocol. // Status = GetFvbCountAndBuffer (&HandleCount, &HandleBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -227,14 +227,14 @@ GetFvbByAddressAndAttribute ( // for (Index = 0; Index < HandleCount; Index++) { Status = FtwGetFvbByHandle (HandleBuffer[Index], &Fvb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } // // Compare the address. // Status = Fvb->GetPhysicalAddress (Fvb, &FvbBaseAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } if (Address != FvbBaseAddress) { @@ -245,7 +245,7 @@ GetFvbByAddressAndAttribute ( // Compare the attribute. // Status = Fvb->GetAttributes (Fvb, &FvbAttributes); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } if (Attributes != FvbAttributes) { @@ -256,11 +256,11 @@ GetFvbByAddressAndAttribute ( // Found the proper FVB handle. // *SmmFvbHandle = HandleBuffer[Index]; - FreePool (HandleBuffer); + FreePool(HandleBuffer); return EFI_SUCCESS; } - FreePool (HandleBuffer); + FreePool(HandleBuffer); return EFI_ABORTED; } @@ -410,7 +410,7 @@ SmmFaultTolerantWriteHandler ( SmmFtwWriteHeader->FvbAttributes, &SmmFvbHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The SpeculationBarrier() call here is to ensure the previous // range/content checks for the CommBuffer have been completed before @@ -440,7 +440,7 @@ SmmFaultTolerantWriteHandler ( SmmFtwRestartHeader->FvbAttributes, &SmmFvbHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = FtwRestart (&mFtwDevice->FtwInstance, SmmFvbHandle); } break; @@ -528,7 +528,7 @@ FvbNotificationEvent ( NULL, (VOID **) &FtwProtocol ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -549,13 +549,13 @@ FvbNotificationEvent ( EFI_NATIVE_INTERFACE, &mFtwDevice->FtwInstance ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); /// /// Register SMM FTW SMI handler /// Status = gMmst->MmiHandlerRegister (SmmFaultTolerantWriteHandler, &gEfiSmmFaultTolerantWriteProtocolGuid, &SmmFtwHandle); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Notify the Ftw wrapper driver SMM Ftw is ready @@ -618,7 +618,7 @@ MmFaultTolerantWriteInitialize ( MmEndOfDxeCallback, &MmEndOfDxeRegistration ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register FvbNotificationEvent () notify function. @@ -628,7 +628,7 @@ MmFaultTolerantWriteInitialize ( FvbNotificationEvent, &mFvbRegistration ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); FvbNotificationEvent (NULL, NULL, NULL); diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c index 6e3eb3b58..628ca22f7 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c @@ -84,7 +84,7 @@ SendCommunicateBuffer ( CommSize = DataSize + SMM_COMMUNICATE_HEADER_SIZE + SMM_FTW_COMMUNICATE_HEADER_SIZE; Status = mSmmCommunication->Communicate (mSmmCommunication, SmmCommunicateHeader, &CommSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); SmmFtwFunctionHeader = (SMM_FTW_COMMUNICATE_FUNCTION_HEADER *) SmmCommunicateHeader->Data; return SmmFtwFunctionHeader->ReturnStatus; @@ -113,12 +113,12 @@ ConvertFvbHandle ( EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb; Status = gBS->HandleProtocol (FvbHandle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **) &Fvb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = Fvb->GetPhysicalAddress (Fvb, FvbBaseAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -166,7 +166,7 @@ FtwGetMaxBlockSize ( // Get data from SMM // *BlockSize = SmmFtwBlockSizeHeader->BlockSize; - FreePool (SmmCommunicateHeader); + FreePool(SmmCommunicateHeader); return Status; } @@ -224,7 +224,7 @@ FtwAllocate ( mPrivateDataSize = PrivateDataSize; } - FreePool (SmmCommunicateHeader); + FreePool(SmmCommunicateHeader); return Status; } @@ -290,8 +290,8 @@ FtwWrite ( // and its attribute. Send these information to SMM handler, the SMM handler will find the proper FVB to write data. // Status = ConvertFvbHandle (FvBlockHandle, &SmmFtwWriteHeader->FvbBaseAddress, &SmmFtwWriteHeader->FvbAttributes); - if (EFI_ERROR (Status)) { - FreePool (SmmCommunicateHeader); + if (EFI_ERROR(Status)) { + FreePool(SmmCommunicateHeader); return EFI_ABORTED; } @@ -310,7 +310,7 @@ FtwWrite ( // Send data to SMM. // Status = SendCommunicateBuffer (SmmCommunicateHeader, PayloadSize); - FreePool (SmmCommunicateHeader); + FreePool(SmmCommunicateHeader); return Status; } @@ -350,8 +350,8 @@ FtwRestart ( // and its attribute. Send these information to SMM handler, the SMM handler will find the proper FVB to write data. // Status = ConvertFvbHandle (FvBlockHandle, &SmmFtwRestartHeader->FvbBaseAddress, &SmmFtwRestartHeader->FvbAttributes); - if (EFI_ERROR (Status)) { - FreePool (SmmCommunicateHeader); + if (EFI_ERROR(Status)) { + FreePool(SmmCommunicateHeader); return EFI_ABORTED; } @@ -359,7 +359,7 @@ FtwRestart ( // Send data to SMM. // Status = SendCommunicateBuffer (SmmCommunicateHeader, PayloadSize); - FreePool (SmmCommunicateHeader); + FreePool(SmmCommunicateHeader); return Status; } @@ -393,7 +393,7 @@ FtwAbort ( // Status = SendCommunicateBuffer (SmmCommunicateHeader, 0); - FreePool (SmmCommunicateHeader); + FreePool(SmmCommunicateHeader); return Status; } @@ -470,7 +470,7 @@ FtwGetLastWrite ( *Complete = SmmFtwGetLastWriteHeader->Complete; } - FreePool (SmmCommunicateHeader); + FreePool(SmmCommunicateHeader); return Status; } @@ -497,12 +497,12 @@ SmmFtwReady ( // if Fault Tolerant Write protocol had been installed. // Status = gBS->LocateProtocol (&gEfiFaultTolerantWriteProtocolGuid, NULL, (VOID **)&FtwProtocol); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return; } Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install protocol interface @@ -513,10 +513,10 @@ SmmFtwReady ( EFI_NATIVE_INTERFACE, &mFaultTolerantWriteDriver ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CloseEvent (Event); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c index 10e56e9a3..3b3c5ac73 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c @@ -60,7 +60,7 @@ FtwCalculateCrc32 ( UINT32 ReturnValue; Status = gBS->CalculateCrc32 (Buffer, Length, &ReturnValue); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return ReturnValue; } @@ -83,7 +83,7 @@ FtwNotifySmmReady ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c index ed73f887a..730f8e2a1 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c @@ -166,7 +166,7 @@ GetFvbByAddress ( // Locate all handles of Fvb protocol // Status = GetFvbCountAndBuffer (&HandleCount, &HandleBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } // @@ -174,14 +174,14 @@ GetFvbByAddress ( // for (Index = 0; Index < HandleCount; Index += 1) { Status = FtwGetFvbByHandle (HandleBuffer[Index], &Fvb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } // // Compare the address and select the right one // Status = Fvb->GetPhysicalAddress (Fvb, &FvbBaseAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -189,7 +189,7 @@ GetFvbByAddress ( // Now, one FVB has one type of BlockSize // Status = Fvb->GetBlockSize (Fvb, 0, &BlockSize, &NumberOfBlocks); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -200,7 +200,7 @@ GetFvbByAddress ( } } - FreePool (HandleBuffer); + FreePool(HandleBuffer); return FvbHandle; } @@ -235,7 +235,7 @@ IsBootBlock ( } Status = FtwGetSarProtocol ((VOID **) &SarProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } // @@ -248,12 +248,12 @@ IsBootBlock ( &BackupBlockBase, &BackupBlockSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } Status = SarProtocol->GetSwapState (SarProtocol, &IsSwapped); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } // @@ -324,7 +324,7 @@ FlushSpareBlockToBootBlock ( // Locate swap address range protocol // Status = FtwGetSarProtocol ((VOID **) &SarProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -339,9 +339,9 @@ FlushSpareBlockToBootBlock ( // Get TopSwap bit state // Status = SarProtocol->GetSwapState (SarProtocol, &TopSwap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ftw: Get Top Swapped status - %r\n", Status)); - FreePool (Buffer); + FreePool(Buffer); return EFI_ABORTED; } @@ -350,7 +350,7 @@ FlushSpareBlockToBootBlock ( // Get FVB of current boot block // if (GetFvbByAddress (FtwDevice->SpareAreaAddress + FtwDevice->SpareAreaLength, &BootFvb) == NULL) { - FreePool (Buffer); + FreePool(Buffer); return EFI_ABORTED; } // @@ -367,8 +367,8 @@ FlushSpareBlockToBootBlock ( &Count, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); return Status; } @@ -388,8 +388,8 @@ FlushSpareBlockToBootBlock ( &Count, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); return Status; } @@ -399,8 +399,8 @@ FlushSpareBlockToBootBlock ( // Set TopSwap bit // Status = SarProtocol->SetSwapState (SarProtocol, TRUE); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); return Status; } } @@ -409,8 +409,8 @@ FlushSpareBlockToBootBlock ( // Because TopSwap is set, this actually erase the top block (boot block)! // Status = FtwEraseSpareBlock (FtwDevice); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); return EFI_ABORTED; } // @@ -426,16 +426,16 @@ FlushSpareBlockToBootBlock ( &Count, Ptr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ftw: FVB Write boot block - %r\n", Status)); - FreePool (Buffer); + FreePool(Buffer); return Status; } Ptr += Count; } - FreePool (Buffer); + FreePool(Buffer); // // Clear TopSwap bit @@ -503,8 +503,8 @@ FlushSpareBlockToTargetBlock ( &Count, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); return Status; } @@ -514,8 +514,8 @@ FlushSpareBlockToTargetBlock ( // Erase the target block // Status = FtwEraseBlock (FtwDevice, FvBlock, Lba, NumberOfBlocks); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); return EFI_ABORTED; } // @@ -525,16 +525,16 @@ FlushSpareBlockToTargetBlock ( for (Index = 0; Index < NumberOfBlocks; Index += 1) { Count = BlockSize; Status = FvBlock->Write (FvBlock, Lba + Index, 0, &Count, Ptr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ftw: FVB Write block - %r\n", Status)); - FreePool (Buffer); + FreePool(Buffer); return Status; } Ptr += Count; } - FreePool (Buffer); + FreePool(Buffer); return Status; } @@ -606,8 +606,8 @@ FlushSpareBlockToWorkingBlock ( &Count, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); return Status; } @@ -638,8 +638,8 @@ FlushSpareBlockToWorkingBlock ( FtwDevice->FtwWorkSpaceBase + sizeof (EFI_GUID) + sizeof (UINT32), WORKING_BLOCK_INVALID ); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); return EFI_ABORTED; } @@ -649,8 +649,8 @@ FlushSpareBlockToWorkingBlock ( // Erase the working block // Status = FtwEraseBlock (FtwDevice, FtwDevice->FtwFvBlock, FtwDevice->FtwWorkBlockLba, FtwDevice->NumberOfWorkBlock); - if (EFI_ERROR (Status)) { - FreePool (Buffer); + if (EFI_ERROR(Status)) { + FreePool(Buffer); return EFI_ABORTED; } // @@ -666,9 +666,9 @@ FlushSpareBlockToWorkingBlock ( &Count, Ptr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ftw: FVB Write block - %r\n", Status)); - FreePool (Buffer); + FreePool(Buffer); return Status; } @@ -677,7 +677,7 @@ FlushSpareBlockToWorkingBlock ( // // Since the memory buffer will not be used, free memory Buffer. // - FreePool (Buffer); + FreePool(Buffer); // // Update the VALID of the working block @@ -692,7 +692,7 @@ FlushSpareBlockToWorkingBlock ( FtwDevice->FtwWorkSpaceBase + sizeof (EFI_GUID) + sizeof (UINT32), WORKING_BLOCK_VALID ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -747,7 +747,7 @@ FtwUpdateFvState ( // Length = sizeof (UINT8); Status = FvBlock->Read (FvBlock, Lba, Offset, &Length, &State); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -985,7 +985,7 @@ InitFtwDevice ( FtwDevice->SpareAreaLength = (UINTN) PcdGet32 (PcdFlashNvStorageFtwSpareSize); if ((FtwDevice->WorkSpaceLength == 0) || (FtwDevice->SpareAreaLength == 0)) { DEBUG ((EFI_D_ERROR, "Ftw: Workspace or Spare block does not exist!\n")); - FreePool (FtwDevice); + FreePool(FtwDevice); return EFI_INVALID_PARAMETER; } @@ -1042,7 +1042,7 @@ FindFvbForFtw ( // Get all FVB handle. // Status = GetFvbCountAndBuffer (&HandleCount, &HandleBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -1052,7 +1052,7 @@ FindFvbForFtw ( Fvb = NULL; for (Index = 0; Index < HandleCount; Index += 1) { Status = FtwGetFvbByHandle (HandleBuffer[Index], &Fvb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; break; } @@ -1061,14 +1061,14 @@ FindFvbForFtw ( // Ensure this FVB protocol support Write operation. // Status = Fvb->GetAttributes (Fvb, &Attributes); - if (EFI_ERROR (Status) || ((Attributes & EFI_FVB2_WRITE_STATUS) == 0)) { + if (EFI_ERROR(Status) || ((Attributes & EFI_FVB2_WRITE_STATUS) == 0)) { continue; } // // Compare the address and select the right one // Status = Fvb->GetPhysicalAddress (Fvb, &FvbBaseAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -1076,7 +1076,7 @@ FindFvbForFtw ( // Now, one FVB has one type of BlockSize. // Status = Fvb->GetBlockSize (Fvb, 0, &BlockSize, &NumberOfBlocks); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -1104,13 +1104,13 @@ FindFvbForFtw ( if (((FtwDevice->WorkSpaceAddress & (FtwDevice->WorkBlockSize - 1)) != 0) || ((FtwDevice->WorkSpaceLength & (FtwDevice->WorkBlockSize - 1)) != 0)) { DEBUG ((EFI_D_ERROR, "Ftw: Work space address or length is not block size aligned when work space size is larger than one block size\n")); - FreePool (HandleBuffer); + FreePool(HandleBuffer); ASSERT (FALSE); return EFI_ABORTED; } } else if ((FtwDevice->FtwWorkSpaceBase + FtwDevice->FtwWorkSpaceSize) > FtwDevice->WorkBlockSize) { DEBUG ((EFI_D_ERROR, "Ftw: The work space range should not span blocks when work space size is less than one block size\n")); - FreePool (HandleBuffer); + FreePool(HandleBuffer); ASSERT (FALSE); return EFI_ABORTED; } @@ -1139,7 +1139,7 @@ FindFvbForFtw ( // if ((FtwDevice->FtwSpareLba + FtwDevice->NumberOfSpareBlock) > NumberOfBlocks) { DEBUG ((EFI_D_ERROR, "Ftw: Spare area is out of FV range\n")); - FreePool (HandleBuffer); + FreePool(HandleBuffer); ASSERT (FALSE); return EFI_ABORTED; } @@ -1149,7 +1149,7 @@ FindFvbForFtw ( if (((FtwDevice->SpareAreaAddress & (FtwDevice->SpareBlockSize - 1)) != 0) || ((FtwDevice->SpareAreaLength & (FtwDevice->SpareBlockSize - 1)) != 0)) { DEBUG ((EFI_D_ERROR, "Ftw: Spare area address or length is not block size aligned\n")); - FreePool (HandleBuffer); + FreePool(HandleBuffer); // // Report Status Code EFI_SW_EC_ABORTED. // @@ -1162,7 +1162,7 @@ FindFvbForFtw ( } } } - FreePool (HandleBuffer); + FreePool(HandleBuffer); if ((FtwDevice->FtwBackupFvb == NULL) || (FtwDevice->FtwFvBlock == NULL) || (FtwDevice->FtwWorkSpaceLba == (EFI_LBA) (-1)) || (FtwDevice->FtwSpareLba == (EFI_LBA) (-1))) { @@ -1200,7 +1200,7 @@ InitFtwProtocol ( // Find the right SMM Fvb protocol instance for FTW. // Status = FindFvbForFtw (FtwDevice); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -1251,7 +1251,7 @@ InitFtwProtocol ( // Refresh the working space data from working block // Status = WorkSpaceRefresh (FtwDevice); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // If the working block workspace is not valid, try the spare block // @@ -1267,7 +1267,7 @@ InitFtwProtocol ( FtwDevice->FtwWorkSpaceSize, FtwDevice->FtwWorkSpace ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // If spare block is valid, then replace working block content. @@ -1281,7 +1281,7 @@ InitFtwProtocol ( // Refresh work space. // Status = WorkSpaceRefresh (FtwDevice); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else { DEBUG ((EFI_D_INFO, "Ftw: Both working and spare blocks are invalid, init workspace\n")); @@ -1298,7 +1298,7 @@ InitFtwProtocol ( // Initialize the work space // Status = FtwReclaimWorkSpace (FtwDevice, FALSE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } // @@ -1335,7 +1335,7 @@ InitFtwProtocol ( if (!IsErasedFlashBuffer (FtwDevice->FtwWorkSpace + Offset, FtwDevice->FtwWorkSpaceSize - Offset)) { Status = FtwReclaimWorkSpace (FtwDevice, TRUE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // @@ -1347,7 +1347,7 @@ InitFtwProtocol ( if (FtwDevice->FtwLastWriteRecord->BootBlockUpdate == FTW_VALID_STATE) { Status = FlushSpareBlockToBootBlock (FtwDevice); DEBUG ((EFI_D_ERROR, "Ftw: Restart boot block update - %r\n", Status)); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); FtwAbort (&FtwDevice->FtwInstance); } else { // @@ -1358,7 +1358,7 @@ InitFtwProtocol ( if (FvbHandle != NULL) { Status = FtwRestart (&FtwDevice->FtwInstance, FvbHandle); DEBUG ((EFI_D_ERROR, "Ftw: Restart last write - %r\n", Status)); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } FtwAbort (&FtwDevice->FtwInstance); } diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c index 04cb38afd..06c922e8b 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c @@ -164,7 +164,7 @@ ReadWorkSpaceData ( &MyLength, Ptr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } Offset = 0; @@ -227,7 +227,7 @@ WriteWorkSpaceData ( &MyLength, Ptr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } Offset = 0; @@ -275,7 +275,7 @@ WorkSpaceRefresh ( FtwDevice->FtwWorkSpaceSize, FtwDevice->FtwWorkSpace ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } // @@ -294,12 +294,12 @@ WorkSpaceRefresh ( // pointed by FtwDevice->FtwLastWriteHeader or record pointed by FtwDevice->FtwLastWriteRecord may contain invalid data), // it needs to reclaim work space. // - if (EFI_ERROR (Status) || RemainingSpaceSize < sizeof (EFI_FAULT_TOLERANT_WRITE_HEADER) + sizeof (EFI_FAULT_TOLERANT_WRITE_RECORD)) { + if (EFI_ERROR(Status) || RemainingSpaceSize < sizeof (EFI_FAULT_TOLERANT_WRITE_HEADER) + sizeof (EFI_FAULT_TOLERANT_WRITE_RECORD)) { // // reclaim work space in working block. // Status = FtwReclaimWorkSpace (FtwDevice, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "Ftw: Reclaim workspace - %r\n", Status)); return EFI_ABORTED; } @@ -314,7 +314,7 @@ WorkSpaceRefresh ( FtwDevice->FtwWorkSpaceSize, FtwDevice->FtwWorkSpace ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -323,7 +323,7 @@ WorkSpaceRefresh ( FtwDevice->FtwWorkSpaceSize, &FtwDevice->FtwLastWriteHeader ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } } @@ -334,7 +334,7 @@ WorkSpaceRefresh ( FtwDevice->FtwLastWriteHeader, &FtwDevice->FtwLastWriteRecord ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } @@ -393,8 +393,8 @@ FtwReclaimWorkSpace ( &Length, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (TempBuffer); + if (EFI_ERROR(Status)) { + FreePool(TempBuffer); return EFI_ABORTED; } @@ -430,7 +430,7 @@ FtwReclaimWorkSpace ( &FtwDevice->FtwLastWriteHeader ); Header = FtwDevice->FtwLastWriteHeader; - if (!EFI_ERROR (Status) && (Header != NULL) && (Header->Complete != FTW_VALID_STATE) && (Header->HeaderAllocated == FTW_VALID_STATE)) { + if (!EFI_ERROR(Status) && (Header != NULL) && (Header->Complete != FTW_VALID_STATE) && (Header->HeaderAllocated == FTW_VALID_STATE)) { CopyMem ( Ptr + sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER), FtwDevice->FtwLastWriteHeader, @@ -472,7 +472,7 @@ FtwReclaimWorkSpace ( SpareBufferSize = FtwDevice->SpareAreaLength; SpareBuffer = AllocatePool (SpareBufferSize); if (SpareBuffer == NULL) { - FreePool (TempBuffer); + FreePool(TempBuffer); return EFI_OUT_OF_RESOURCES; } @@ -486,9 +486,9 @@ FtwReclaimWorkSpace ( &Length, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (TempBuffer); - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(TempBuffer); + FreePool(SpareBuffer); return EFI_ABORTED; } @@ -498,9 +498,9 @@ FtwReclaimWorkSpace ( // Write the memory buffer to spare block // Status = FtwEraseSpareBlock (FtwDevice); - if (EFI_ERROR (Status)) { - FreePool (TempBuffer); - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(TempBuffer); + FreePool(SpareBuffer); return EFI_ABORTED; } Ptr = TempBuffer; @@ -517,9 +517,9 @@ FtwReclaimWorkSpace ( &Length, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (TempBuffer); - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(TempBuffer); + FreePool(SpareBuffer); return EFI_ABORTED; } @@ -529,7 +529,7 @@ FtwReclaimWorkSpace ( // // Free TempBuffer // - FreePool (TempBuffer); + FreePool(TempBuffer); // // Set the WorkingBlockValid in spare block @@ -541,8 +541,8 @@ FtwReclaimWorkSpace ( FtwDevice->FtwWorkSpaceBaseInSpare + sizeof (EFI_GUID) + sizeof (UINT32), WORKING_BLOCK_VALID ); - if (EFI_ERROR (Status)) { - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(SpareBuffer); return EFI_ABORTED; } // @@ -558,8 +558,8 @@ FtwReclaimWorkSpace ( FtwDevice->FtwWorkSpaceBase + sizeof (EFI_GUID) + sizeof (UINT32), WORKING_BLOCK_INVALID ); - if (EFI_ERROR (Status)) { - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(SpareBuffer); return EFI_ABORTED; } @@ -569,16 +569,16 @@ FtwReclaimWorkSpace ( // Write the spare block to working block // Status = FlushSpareBlockToWorkingBlock (FtwDevice); - if (EFI_ERROR (Status)) { - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(SpareBuffer); return Status; } // // Restore spare backup buffer into spare block , if no failure happened during FtwWrite. // Status = FtwEraseSpareBlock (FtwDevice); - if (EFI_ERROR (Status)) { - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(SpareBuffer); return EFI_ABORTED; } Ptr = SpareBuffer; @@ -591,15 +591,15 @@ FtwReclaimWorkSpace ( &Length, Ptr ); - if (EFI_ERROR (Status)) { - FreePool (SpareBuffer); + if (EFI_ERROR(Status)) { + FreePool(SpareBuffer); return EFI_ABORTED; } Ptr += Length; } - FreePool (SpareBuffer); + FreePool(SpareBuffer); DEBUG ((EFI_D_INFO, "Ftw: reclaim work space successfully\n")); diff --git a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c index 439d5b01e..89a7a8f30 100644 --- a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c +++ b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c @@ -241,14 +241,14 @@ PeimFaultTolerantWriteInitialize ( WorkSpaceLength, &FtwLastWriteHeader ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = FtwGetLastWriteRecord ( FtwLastWriteHeader, &FtwLastWriteRecord ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (FtwLastWriteRecord != NULL); if ((FtwLastWriteRecord->SpareComplete == FTW_VALID_STATE) && (FtwLastWriteRecord->DestinationComplete != FTW_VALID_STATE)) { // diff --git a/MdeModulePkg/Universal/FileExplorerDxe/FileExplorerDxe.c b/MdeModulePkg/Universal/FileExplorerDxe/FileExplorerDxe.c index 19ab71b1e..10574bd4f 100644 --- a/MdeModulePkg/Universal/FileExplorerDxe/FileExplorerDxe.c +++ b/MdeModulePkg/Universal/FileExplorerDxe/FileExplorerDxe.c @@ -46,7 +46,7 @@ FileExplorerEntryPoint ( &gEfiFileExplorerProtocolGuid, &mFileExplorerProtocol, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c b/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c index ac57a6c06..1b65c483f 100644 --- a/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c +++ b/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c @@ -153,7 +153,7 @@ FvFsGetFileSize ( if (Status == EFI_WARN_BUFFER_TOO_SMALL) { return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Didn't find a raw section, just return the whole file's size. // @@ -240,7 +240,7 @@ FvFsReadFile ( BufferSize, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Didn't find a raw section, just return the whole file. // @@ -572,7 +572,7 @@ FvSimpleFileSystemOpen ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { NewFile = AllocateZeroPool (sizeof (FV_FILESYSTEM_FILE)); if (NewFile == NULL) { return EFI_OUT_OF_RESOURCES; @@ -615,7 +615,7 @@ FvSimpleFileSystemClose ( if (File != Instance->Root) { RemoveEntryList (&File->Link); - FreePool (File); + FreePool(File); } return EFI_SUCCESS; } @@ -664,7 +664,7 @@ FvSimpleFileSystemRead ( // Directory read: populate Buffer with an EFI_FILE_INFO // Status = FvFsGetFileInfo (File->DirReadNext, BufferSize, Buffer); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Successfully read a directory entry, now update the pointer to the // next file, which will be read on the next call to this function @@ -697,8 +697,8 @@ FvSimpleFileSystemRead ( } Status = FvFsReadFile (File->Instance->FvProtocol, File->FvFileInfo, &FileSize, &FileBuffer); - if (EFI_ERROR (Status)) { - FreePool (FileBuffer); + if (EFI_ERROR(Status)) { + FreePool(FileBuffer); return EFI_DEVICE_ERROR; } @@ -709,7 +709,7 @@ FvSimpleFileSystemRead ( CopyMem (Buffer, (UINT8*)FileBuffer + File->Position, *BufferSize); File->Position += *BufferSize; - FreePool (FileBuffer); + FreePool(FileBuffer); return EFI_SUCCESS; } @@ -877,7 +877,7 @@ FvSimpleFileSystemDelete ( EFI_STATUS Status; Status = FvSimpleFileSystemClose (This); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_WARN_DELETE_FAILURE; } @@ -944,7 +944,7 @@ FvSimpleFileSystemGetInfo ( Instance->VolumeLabel, StrLen (Instance->VolumeLabel) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); FsInfoOut->Size = Size; return Status; } else if (CompareGuid (InformationType, &gEfiFileInfoGuid)) { @@ -969,7 +969,7 @@ FvSimpleFileSystemGetInfo ( Instance->VolumeLabel, StrLen (Instance->VolumeLabel) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } else { return EFI_UNSUPPORTED; diff --git a/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemEntryPoint.c b/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemEntryPoint.c index f5d6275d1..9427f737c 100644 --- a/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemEntryPoint.c +++ b/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemEntryPoint.c @@ -139,7 +139,7 @@ FvSimpleFileSystemOpenVolume ( &Attributes, &Size ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ASSERT (Status == EFI_NOT_FOUND); break; } @@ -158,7 +158,7 @@ FvSimpleFileSystemOpenVolume ( &Size, &Authentication ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Name = UiSection; } else { Name = AllocateZeroPool (GUID_STRING_SIZE); @@ -193,22 +193,22 @@ FvSimpleFileSystemOpenVolume ( // DestMax = NameLen / sizeof (CHAR16); Status = StrnCpyS (&FvFileInfo->FileInfo.FileName[0], DestMax, Name, StrLen (Name)); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (FV_FILETYPE_IS_EXECUTABLE (FileType)) { Status = StrnCatS (&FvFileInfo->FileInfo.FileName[0], DestMax, L".efi", StrLen (L".efi")); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } FvFileInfo->FileInfo.Size = sizeof (EFI_FILE_INFO) + NameLen - sizeof (CHAR16); Status = FvFsGetFileSize (FvProtocol, FvFileInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); FvFileInfo->FileInfo.PhysicalSize = FvFileInfo->FileInfo.FileSize; FvFileInfo->FileInfo.Attribute = EFI_FILE_READ_ONLY; InsertHeadList (&Instance->FileInfoHead, &FvFileInfo->Link); - FreePool (Name); + FreePool(Name); } while (TRUE); @@ -266,7 +266,7 @@ InitializeUnicodeCollationSupportWorker ( &NumHandles, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -286,7 +286,7 @@ InitializeUnicodeCollationSupportWorker ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -302,7 +302,7 @@ InitializeUnicodeCollationSupportWorker ( NULL ); if (BestLanguage != NULL) { - FreePool (BestLanguage); + FreePool(BestLanguage); mUnicodeCollation = Uci; ReturnStatus = EFI_SUCCESS; break; @@ -310,10 +310,10 @@ InitializeUnicodeCollationSupportWorker ( } if (Language != NULL) { - FreePool (Language); + FreePool(Language); } - FreePool (Handles); + FreePool(Handles); return ReturnStatus; } @@ -354,7 +354,7 @@ InitializeUnicodeCollationSupport ( // If the attempt to use Unicode Collation 2 Protocol fails, then we fall back // on the ISO 639-2 Unicode Collation Protocol. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = InitializeUnicodeCollationSupportWorker ( AgentHandle, &gEfiUnicodeCollationProtocolGuid, @@ -427,7 +427,7 @@ FvSimpleFileSystemDriverStart ( UINTN NumChars; Status = InitializeUnicodeCollationSupport (DriverBinding->DriverBindingHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -442,7 +442,7 @@ FvSimpleFileSystemDriverStart ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -465,7 +465,7 @@ FvSimpleFileSystemDriverStart ( EFI_NATIVE_INTERFACE, &Instance->SimpleFs ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Decide on a filesystem volume label, which will include the FV's guid. @@ -480,7 +480,7 @@ FvSimpleFileSystemDriverStart ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Iterate over device path until we find a firmware volume node // @@ -566,7 +566,7 @@ FvSimpleFileSystemDriverStop ( ControllerHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -588,14 +588,14 @@ FvSimpleFileSystemDriverStop ( gImageHandle, ControllerHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->UninstallProtocolInterface ( ControllerHandle, &gEfiSimpleFileSystemProtocolGuid, &Instance->SimpleFs ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Free file structures @@ -612,7 +612,7 @@ FvSimpleFileSystemDriverStop ( FvFileInfo = FVFS_FILE_INFO_FROM_LINK (DelEntry); RemoveEntryList (DelEntry); - FreePool (FvFileInfo); + FreePool(FvFileInfo); } } @@ -621,18 +621,18 @@ FvSimpleFileSystemDriverStop ( // Root->Name is statically allocated, no need to free. // if (Instance->Root->FvFileInfo != NULL) { - FreePool (Instance->Root->FvFileInfo); + FreePool(Instance->Root->FvFileInfo); } - FreePool (Instance->Root); + FreePool(Instance->Root); } // // Free Instance // if (Instance->VolumeLabel != NULL) { - FreePool (Instance->VolumeLabel); + FreePool(Instance->VolumeLabel); } - FreePool (Instance); + FreePool(Instance); return EFI_SUCCESS; } @@ -667,7 +667,7 @@ FvSimpleFileSystemEntryPoint ( &gFvSimpleFileSystemComponentName, &gFvSimpleFileSystemComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c index 5ee866fb9..4953307c8 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c @@ -137,7 +137,7 @@ ExtractDevicePath ( // // Invalid device path // - FreePool (DevicePathBuffer); + FreePool(DevicePathBuffer); return EFI_INVALID_PARAMETER; } DevicePath = NextDevicePathNode (DevicePath); @@ -866,7 +866,7 @@ GetStringIdFromString ( // terminator. // Status = GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (String != NULL); @@ -886,7 +886,7 @@ GetStringIdFromString ( // terminator. // Status = GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (String != NULL); @@ -905,7 +905,7 @@ GetStringIdFromString ( CopyMem (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16)); for (Index = 0; Index < StringCount; Index++) { Status = GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (String != NULL); @@ -930,7 +930,7 @@ GetStringIdFromString ( ); for (Index = 0; Index < StringCount; Index++) { Status = GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (String != NULL); @@ -990,7 +990,7 @@ GetStringIdFromString ( } if (String != NULL) { - FreePool (String); + FreePool(String); String = NULL; } @@ -1001,10 +1001,10 @@ GetStringIdFromString ( Done: if (AsciiKeywordValue != NULL) { - FreePool (AsciiKeywordValue); + FreePool(AsciiKeywordValue); } if (String != NULL) { - FreePool (String); + FreePool(String); } return Status; } @@ -1284,7 +1284,7 @@ GetNextStringId ( } if (String != NULL) { - FreePool (String); + FreePool(String); String = NULL; } @@ -1341,7 +1341,7 @@ GetStringIdFromRecord ( if (AsciiStrnCmp(Name, StringPackage->StringPkgHdr->Language, AsciiStrLen (Name)) == 0) { Status = GetStringIdFromString (StringPackage, KeywordValue, StringId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return KEYWORD_HANDLER_KEYWORD_NOT_FOUND; } else { if (*NameSpace == NULL) { @@ -1966,8 +1966,8 @@ GetNameFromId ( NULL ); - if (EFI_ERROR (Status)) { - FreePool (Name); + if (EFI_ERROR(Status)) { + FreePool(Name); Name = NULL; goto Done; } @@ -1977,10 +1977,10 @@ Done: FreePool(SupportedLanguages); } if (BestLanguage != NULL) { - FreePool (BestLanguage); + FreePool(BestLanguage); } if (PlatformLanguage != NULL) { - FreePool (PlatformLanguage); + FreePool(PlatformLanguage); } return Name; @@ -2064,8 +2064,8 @@ ExtractConfigRequest ( MaxLen = StrLen (ConfigHdr) + 1 + StrLen(RequestElement) + 1; *ConfigRequest = AllocatePool (MaxLen * sizeof (CHAR16)); if (*ConfigRequest == NULL) { - FreePool (ConfigHdr); - FreePool (RequestElement); + FreePool(ConfigHdr); + FreePool(RequestElement); return EFI_OUT_OF_RESOURCES; } StringPtr = *ConfigRequest; @@ -2076,8 +2076,8 @@ ExtractConfigRequest ( StrCatS (StringPtr, MaxLen, RequestElement); - FreePool (ConfigHdr); - FreePool (RequestElement); + FreePool(ConfigHdr); + FreePool(RequestElement); return EFI_SUCCESS; } @@ -2168,8 +2168,8 @@ ExtractConfigResp ( MaxLen = StrLen (ConfigHdr) + 1 + StrLen(RequestElement) + 1 + StrLen (L"VALUE=") + StrLen(ValueElement) + 1; *ConfigResp = AllocatePool (MaxLen * sizeof (CHAR16)); if (*ConfigResp == NULL) { - FreePool (ConfigHdr); - FreePool (RequestElement); + FreePool(ConfigHdr); + FreePool(RequestElement); return EFI_OUT_OF_RESOURCES; } StringPtr = *ConfigResp; @@ -2187,8 +2187,8 @@ ExtractConfigResp ( StrCatS (StringPtr, MaxLen, ValueElement); - FreePool (ConfigHdr); - FreePool (RequestElement); + FreePool(ConfigHdr); + FreePool(RequestElement); return EFI_SUCCESS; } @@ -2230,7 +2230,7 @@ ExtractValueFromDriver ( &Progress, &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2252,7 +2252,7 @@ ExtractValueFromDriver ( if (StringEnd != NULL) { *StringEnd = L'&'; } - FreePool (Result); + FreePool(Result); return EFI_SUCCESS; } @@ -2460,7 +2460,7 @@ GenerateKeywordResp ( *KeywordResp = AllocatePool (RespStrLen * sizeof (CHAR16)); if (*KeywordResp == NULL) { if (UnicodeNameSpace != NULL) { - FreePool (UnicodeNameSpace); + FreePool(UnicodeNameSpace); } return EFI_OUT_OF_RESOURCES; @@ -2499,10 +2499,10 @@ GenerateKeywordResp ( } if (UnicodeNameSpace != NULL) { - FreePool (UnicodeNameSpace); + FreePool(UnicodeNameSpace); } if (PathHdr != NULL) { - FreePool (PathHdr); + FreePool(PathHdr); } return EFI_SUCCESS; @@ -2652,7 +2652,7 @@ EnumerateAllKeywords ( // 3.3 Construct the ConfigRequest string. // Status = ExtractConfigRequest (DataBaseRecord, NextStringId, &OpCode, &ConfigRequest); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If can't generate ConfigRequest for this question, skip it and start the next. // @@ -2663,7 +2663,7 @@ EnumerateAllKeywords ( // 3.4 Extract Value for the input keyword. // Status = ExtractValueFromDriver(ConfigRequest, &ValueElement); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status != EFI_OUT_OF_RESOURCES) { // // If can't generate ConfigRequest for this question, skip it and start the next. @@ -2697,7 +2697,7 @@ EnumerateAllKeywords ( // 6. Merge to the MultiKeywordResp string. // Status = MergeToMultiKeywordResp(&MultiKeywordResp, &KeywordResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Error: @@ -2705,21 +2705,21 @@ Error: // Clean the temp buffer to later use again. // if (ConfigRequest != NULL) { - FreePool (ConfigRequest); + FreePool(ConfigRequest); ConfigRequest = NULL; } if (ValueElement != NULL) { - FreePool (ValueElement); + FreePool(ValueElement); ValueElement = NULL; } if (KeywordResp != NULL) { - FreePool (KeywordResp); + FreePool(KeywordResp); KeywordResp = NULL; } } if (LocalNameSpace != NULL) { - FreePool (LocalNameSpace); + FreePool(LocalNameSpace); LocalNameSpace = NULL; } } @@ -2743,13 +2743,13 @@ Error: Done: if (LocalNameSpace != NULL) { - FreePool (LocalNameSpace); + FreePool(LocalNameSpace); } if (ConfigRequest != NULL) { - FreePool (ConfigRequest); + FreePool(ConfigRequest); } if (ValueElement != NULL) { - FreePool (ValueElement); + FreePool(ValueElement); } return Status; @@ -2869,7 +2869,7 @@ EfiConfigKeywordHandlerSetData ( // 1. Get NameSpace from NameSpaceId keyword. // Status = ExtractNameSpace (StringPtr, &NameSpace, &NextStringPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING; goto Done; } @@ -2889,7 +2889,7 @@ EfiConfigKeywordHandlerSetData ( // 2. Get possible Device Path info from KeywordString. // Status = ExtractDevicePath (StringPtr, (UINT8 **)&DevicePath, &NextStringPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING; goto Done; } @@ -2900,7 +2900,7 @@ EfiConfigKeywordHandlerSetData ( // KeywordStartPos = StringPtr; Status = ExtractKeyword(StringPtr, &KeywordData, &NextStringPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Can't find Keyword base on the input device path info. // @@ -2914,7 +2914,7 @@ EfiConfigKeywordHandlerSetData ( // 4. Extract Value from the KeywordRequest string. // Status = ExtractValue (StringPtr, &ValueElement, &NextStringPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Can't find Value base on the input device path info. // @@ -2938,7 +2938,7 @@ EfiConfigKeywordHandlerSetData ( // 6. Get EFI_STRING_ID for the input keyword. // Status = GetStringIdFromDatabase (&DevicePath, &NameSpace, KeywordData, &RetVal, &KeywordStringId, &DataBaseRecord); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *ProgressErr = RetVal; goto Done; } @@ -2947,7 +2947,7 @@ EfiConfigKeywordHandlerSetData ( // 7. Construct the ConfigRequest string. // Status = ExtractConfigResp (DataBaseRecord, KeywordStringId, ValueElement, &OpCode, &ConfigResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2973,23 +2973,23 @@ EfiConfigKeywordHandlerSetData ( // 9. Merge to the MultiKeywordResp string. // Status = MergeToMultiKeywordResp(&MultiConfigResp, &ConfigResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // // 10. Clean the temp buffer point. // - FreePool (NameSpace); - FreePool (DevicePath); - FreePool (KeywordData); - FreePool (ValueElement); + FreePool(NameSpace); + FreePool(DevicePath); + FreePool(KeywordData); + FreePool(ValueElement); NameSpace = NULL; DevicePath = NULL; KeywordData = NULL; ValueElement = NULL; if (ConfigResp != NULL) { - FreePool (ConfigResp); + FreePool(ConfigResp); ConfigResp = NULL; } KeywordStartPos = NULL; @@ -3003,7 +3003,7 @@ EfiConfigKeywordHandlerSetData ( (EFI_STRING) MultiConfigResp, &InternalProgress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto Done; } @@ -3018,24 +3018,24 @@ Done: } ASSERT (TempString != NULL); - FreePool (TempString); + FreePool(TempString); if (NameSpace != NULL) { - FreePool (NameSpace); + FreePool(NameSpace); } if (DevicePath != NULL) { - FreePool (DevicePath); + FreePool(DevicePath); } if (KeywordData != NULL) { - FreePool (KeywordData); + FreePool(KeywordData); } if (ValueElement != NULL) { - FreePool (ValueElement); + FreePool(ValueElement); } if (ConfigResp != NULL) { - FreePool (ConfigResp); + FreePool(ConfigResp); } if (MultiConfigResp != NULL && MultiConfigResp != ConfigResp) { - FreePool (MultiConfigResp); + FreePool(MultiConfigResp); } return Status; @@ -3166,10 +3166,10 @@ EfiConfigKeywordHandlerGetData ( // Status = ExtractNameSpace (TempString, &NameSpace, NULL); if (TempString != NULL) { - FreePool (TempString); + FreePool(TempString); TempString = NULL; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING; return Status; } @@ -3196,7 +3196,7 @@ EfiConfigKeywordHandlerGetData ( // 2. Get possible Device Path info from KeywordString. // Status = ExtractDevicePath (StringPtr, (UINT8 **)&DevicePath, &NextStringPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING; goto Done; } @@ -3209,7 +3209,7 @@ EfiConfigKeywordHandlerGetData ( // 3.1 Extract keyword from the KeywordRequest string. // Status = ExtractKeyword(StringPtr, &KeywordData, &NextStringPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Can't find Keyword base on the input device path info. // @@ -3222,7 +3222,7 @@ EfiConfigKeywordHandlerGetData ( // 3.2 Get EFI_STRING_ID for the input keyword. // Status = GetStringIdFromDatabase (&DevicePath, &NameSpace, KeywordData, &RetVal, &KeywordStringId, &DataBaseRecord); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *ProgressErr = RetVal; goto Done; } @@ -3231,7 +3231,7 @@ EfiConfigKeywordHandlerGetData ( // 3.3 Construct the ConfigRequest string. // Status = ExtractConfigRequest (DataBaseRecord, KeywordStringId, &OpCode, &ConfigRequest); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3239,7 +3239,7 @@ EfiConfigKeywordHandlerGetData ( // 3.4 Extract Value for the input keyword. // Status = ExtractValueFromDriver(ConfigRequest, &ValueElement); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status != EFI_OUT_OF_RESOURCES) { Status = EFI_DEVICE_ERROR; } @@ -3271,7 +3271,7 @@ EfiConfigKeywordHandlerGetData ( // 6. Merge to the MultiKeywordResp string. // Status = MergeToMultiKeywordResp(&MultiKeywordResp, &KeywordResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3283,16 +3283,16 @@ EfiConfigKeywordHandlerGetData ( // // 8. Clean the temp buffer. // - FreePool (DevicePath); - FreePool (KeywordData); - FreePool (ValueElement); - FreePool (ConfigRequest); + FreePool(DevicePath); + FreePool(KeywordData); + FreePool(ValueElement); + FreePool(ConfigRequest); DevicePath = NULL; KeywordData = NULL; ValueElement = NULL; ConfigRequest = NULL; if (KeywordResp != NULL) { - FreePool (KeywordResp); + FreePool(KeywordResp); KeywordResp = NULL; } } @@ -3301,7 +3301,7 @@ EfiConfigKeywordHandlerGetData ( // Enumerate all keyword in the system. // Status = EnumerateAllKeywords(NameSpace, &MultiKeywordResp, ProgressErr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } *Results = MultiKeywordResp; @@ -3313,16 +3313,16 @@ Done: *Progress = KeywordString + (StringPtr - TempString); if (TempString != NULL) { - FreePool (TempString); + FreePool(TempString); } if (NameSpace != NULL) { - FreePool (NameSpace); + FreePool(NameSpace); } if (DevicePath != NULL) { - FreePool (DevicePath); + FreePool(DevicePath); } if (KeywordData != NULL) { - FreePool (KeywordData); + FreePool(KeywordData); } return Status; diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 71ea25bc1..d7164f7ca 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -145,7 +145,7 @@ GetDevicePath ( // // Invalid device path // - FreePool (DevicePathBuffer); + FreePool(DevicePathBuffer); return EFI_NOT_FOUND; } DevicePath = NextDevicePathNode (DevicePath); @@ -518,7 +518,7 @@ GetValueOfNumber ( Exit: if (Str != NULL) { - FreePool (Str); + FreePool(Str); } return Status; @@ -558,17 +558,17 @@ FindSameBlockElement( while (BlockPtr != NULL) { BlockPtr += StrLen (BlockName); Status = GetValueOfNumber (BlockPtr, &TempBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT (TempBuffer != NULL); if ((BufferLen == Length) && (0 == CompareMem (Buffer, TempBuffer, Length))) { *Found = TRUE; - FreePool (TempBuffer); + FreePool(TempBuffer); TempBuffer = NULL; return EFI_SUCCESS; } else { - FreePool (TempBuffer); + FreePool(TempBuffer); TempBuffer = NULL; BlockPtr = StrStr (BlockPtr + 1, BlockName); } @@ -634,7 +634,7 @@ CompareBlockElementDefault ( BlockPtrStart = BlockPtr; BlockPtr += StrLen (L"&OFFSET="); Status = GetValueOfNumber (BlockPtr, &TempBuffer, &OffsetLength); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto Exit; } @@ -643,10 +643,10 @@ CompareBlockElementDefault ( // Status = FindSameBlockElement (StringPtr, L"&OFFSET=", TempBuffer, &FoundOffset, OffsetLength); if (TempBuffer != NULL) { - FreePool (TempBuffer); + FreePool(TempBuffer); TempBuffer = NULL; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_OUT_OF_RESOURCES; goto Exit; } @@ -711,7 +711,7 @@ CompareBlockElementDefault ( Exit: if (AppendString != NULL) { - FreePool (AppendString); + FreePool(AppendString); } return Status; @@ -843,7 +843,7 @@ CompareNameElementDefault ( Exit: if (AppendString != NULL) { - FreePool (AppendString); + FreePool(AppendString); } return Status; } @@ -979,7 +979,7 @@ CompareAndMergeDefaultString ( StrCatS (AltCfgRespBackup, ReallocateSize / sizeof (CHAR16), StringPtrNext); } - FreePool (*AltCfgResp); + FreePool(*AltCfgResp); *AltCfgResp = AltCfgRespBackup; Status = EFI_SUCCESS; @@ -1101,7 +1101,7 @@ MergeDefaultString ( (VOID *) (*AltCfgResp) ); if (*AltCfgResp == NULL) { - FreePool (AltConfigHdr); + FreePool(AltConfigHdr); return EFI_OUT_OF_RESOURCES; } StrCatS (*AltCfgResp, TotalSize / sizeof (CHAR16), StringPtrDefault); @@ -1116,7 +1116,7 @@ MergeDefaultString ( (VOID *) (*AltCfgResp) ); if (*AltCfgResp == NULL) { - FreePool (AltConfigHdr); + FreePool(AltConfigHdr); return EFI_OUT_OF_RESOURCES; } StrCatS (*AltCfgResp, TotalSize / sizeof (CHAR16), StringPtrDefault); @@ -1138,7 +1138,7 @@ MergeDefaultString ( StringPtrDefault = StrStr (StringPtrDefault + 1, AltConfigHdr); } - FreePool (AltConfigHdr); + FreePool(AltConfigHdr); return EFI_SUCCESS; } @@ -1232,7 +1232,7 @@ InsertBlockData ( // The same block array has been added. // if (BlockSingleData != BlockArray) { - FreePool (BlockSingleData); + FreePool(BlockSingleData); *BlockData = BlockArray; } return; @@ -1316,11 +1316,11 @@ GetSupportedLanguages ( // Retrieve the supported languages string // Status = mPrivate.HiiString.GetLanguages (&mPrivate.HiiString, HiiHandle, SupportedLanguages, &LanguageSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free the buffer and return NULL if the supported languages can not be retrieved. // - FreePool (SupportedLanguages); + FreePool(SupportedLanguages); return NULL; } @@ -1442,11 +1442,11 @@ InternalGetString ( &StringSize, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free the buffer and return NULL if the supported languages can not be retrieved. // - FreePool (String); + FreePool(String); String = NULL; } @@ -1455,13 +1455,13 @@ Error: // Free allocated buffers // if (SupportedLanguages != NULL) { - FreePool (SupportedLanguages); + FreePool(SupportedLanguages); } if (PlatformLanguage != NULL) { - FreePool (PlatformLanguage); + FreePool(PlatformLanguage); } if (BestLanguage != NULL) { - FreePool (BestLanguage); + FreePool(BestLanguage); } // @@ -1513,10 +1513,10 @@ BlockArrayCheck ( ASSERT (Name != NULL); if (StrnCmp (BlockData->Name, Name, StrLen (Name)) == 0) { - FreePool (Name); + FreePool(Name); return TRUE; } - FreePool (Name); + FreePool(Name); } else { if ((VarOffset >= BlockData->Offset) && ((VarOffset + VarWidth) <= (BlockData->Offset + BlockData->Width))) { return TRUE; @@ -1564,7 +1564,7 @@ GetFormPackageData ( HiiFormPackage, &ResultSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1588,8 +1588,8 @@ GetFormPackageData ( *HiiFormPackage, &ResultSize ); - if (EFI_ERROR (Status)) { - FreePool (*HiiFormPackage); + if (EFI_ERROR(Status)) { + FreePool(*HiiFormPackage); } *PackageSize = Size; @@ -1639,7 +1639,7 @@ GetVarStoreType ( *IsEfiVarstore = FALSE; Status = GetFormPackageData(DataBaseRecord, &HiiFormPackage, &PackageSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1689,9 +1689,9 @@ GetVarStoreType ( LengthString = LengthString + StrLen (NameStr) + 1; TempStr = AllocateZeroPool (LengthString * sizeof (CHAR16)); if (TempStr == NULL) { - FreePool (GuidStr); - FreePool (NameStr); - FreePool (VarStoreName); + FreePool(GuidStr); + FreePool(NameStr); + FreePool(VarStoreName); Status = EFI_OUT_OF_RESOURCES; goto Done; } @@ -1700,10 +1700,10 @@ GetVarStoreType ( if (ConfigHdr == NULL || StrnCmp (ConfigHdr, TempStr, StrLen (TempStr)) == 0) { *EfiVarStore = (EFI_IFR_VARSTORE_EFI *) AllocateZeroPool (IfrOpHdr->Length); if (*EfiVarStore == NULL) { - FreePool (VarStoreName); - FreePool (GuidStr); - FreePool (NameStr); - FreePool (TempStr); + FreePool(VarStoreName); + FreePool(GuidStr); + FreePool(NameStr); + FreePool(TempStr); Status = EFI_OUT_OF_RESOURCES; goto Done; } @@ -1714,10 +1714,10 @@ GetVarStoreType ( // // Free allocated temp string. // - FreePool (VarStoreName); - FreePool (GuidStr); - FreePool (NameStr); - FreePool (TempStr); + FreePool(VarStoreName); + FreePool(GuidStr); + FreePool(NameStr); + FreePool(TempStr); // // Already found the varstore, break; @@ -1729,7 +1729,7 @@ GetVarStoreType ( } Done: if (HiiFormPackage != NULL) { - FreePool (HiiFormPackage); + FreePool(HiiFormPackage); } return Status; @@ -1820,15 +1820,15 @@ IsThisVarstore ( Done: if (GuidStr != NULL) { - FreePool (GuidStr); + FreePool(GuidStr); } if (NameStr != NULL) { - FreePool (NameStr); + FreePool(NameStr); } if (TempStr != NULL) { - FreePool (TempStr); + FreePool(TempStr); } return RetVal; @@ -1869,7 +1869,7 @@ IsThisPackageList ( FindVarstore = FALSE; Status = GetFormPackageData(DataBaseRecord, &HiiFormPackage, &PackageSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -1910,7 +1910,7 @@ IsThisPackageList ( FindVarstore = TRUE; goto Done; } else { - FreePool (VarStoreName); + FreePool(VarStoreName); VarStoreName = NULL; } break; @@ -1928,7 +1928,7 @@ IsThisPackageList ( FindVarstore = TRUE; goto Done; } else { - FreePool (VarStoreName); + FreePool(VarStoreName); VarStoreName = NULL; } break; @@ -1955,11 +1955,11 @@ IsThisPackageList ( } Done: if (HiiFormPackage != NULL) { - FreePool (HiiFormPackage); + FreePool(HiiFormPackage); } if (VarStoreName != NULL) { - FreePool (VarStoreName); + FreePool(VarStoreName); } return FindVarstore; @@ -2217,7 +2217,7 @@ ParseIfrData ( VarStorageData->Type = EFI_HII_VARSTORE_BUFFER; VarStoreId = IfrVarStore->VarStoreId; } else { - FreePool (VarStoreName); + FreePool(VarStoreName); VarStoreName = NULL; } break; @@ -2259,7 +2259,7 @@ ParseIfrData ( VarStorageData->Type = EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER; VarStoreId = IfrEfiVarStore->VarStoreId; } else { - FreePool (VarStoreName); + FreePool(VarStoreName); VarStoreName = NULL; } break; @@ -2334,7 +2334,7 @@ ParseIfrData ( } Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND){ // //The opcode is not required,exit and parse other opcode. @@ -2380,7 +2380,7 @@ ParseIfrData ( } Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, QuestionReferBitField); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND){ // //The opcode is not required,exit and parse other opcode. @@ -2476,7 +2476,7 @@ ParseIfrData ( } Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND){ // //The opcode is not required,exit and parse other opcode. @@ -2524,7 +2524,7 @@ ParseIfrData ( VarWidth = 1; } Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, QuestionReferBitField); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND){ // //The opcode is not required,exit and parse other opcode. @@ -2668,7 +2668,7 @@ ParseIfrData ( VarWidth = (UINT16) sizeof (EFI_HII_DATE); Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND){ // //The opcode is not required,exit and parse other opcode. @@ -2710,7 +2710,7 @@ ParseIfrData ( VarWidth = (UINT16) sizeof (EFI_HII_TIME); Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND){ // //The opcode is not required,exit and parse other opcode. @@ -2752,7 +2752,7 @@ ParseIfrData ( VarWidth = (UINT16) (IfrString->MaxSize * sizeof (UINT16)); Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND){ // //The opcode is not required,exit and parse other opcode. @@ -2794,7 +2794,7 @@ ParseIfrData ( VarWidth = (UINT16) (IfrPassword->MaxSize * sizeof (UINT16)); Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Status == EFI_NOT_FOUND){ // //The opcode is not required,exit and parse other opcode. @@ -2841,9 +2841,9 @@ ParseIfrData ( // Status = EFI_INVALID_PARAMETER; if (BlockData->Name != NULL) { - FreePool (BlockData->Name); + FreePool(BlockData->Name); } - FreePool (BlockData); + FreePool(BlockData); goto Done; } @@ -2859,9 +2859,9 @@ ParseIfrData ( // This question is not in the requested string. Skip it. // if (BlockData->Name != NULL) { - FreePool (BlockData->Name); + FreePool(BlockData->Name); } - FreePool (BlockData); + FreePool(BlockData); BlockData = NULL; break; } @@ -2871,9 +2871,9 @@ ParseIfrData ( if ((BlockData->Name == NULL) && ((BlockData->Offset + BlockData->Width) > VarStorageData->Size)) { Status = EFI_INVALID_PARAMETER; if (BlockData->Name != NULL) { - FreePool (BlockData->Name); + FreePool(BlockData->Name); } - FreePool (BlockData); + FreePool(BlockData); goto Done; } // @@ -3087,7 +3087,7 @@ Done: LinkDefault = LinkDefault->ForwardLink; if (DefaultDataPtr->Cleaned == TRUE) { RemoveEntryList (&DefaultDataPtr->Entry); - FreePool (DefaultDataPtr); + FreePool(DefaultDataPtr); } } } @@ -3152,7 +3152,7 @@ GetBlockElement ( // Get Offset // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Offset = 0; @@ -3161,7 +3161,7 @@ GetBlockElement ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINT16)) ? ((Length + 1) / 2) : sizeof (UINT16) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); StringPtr += Length; if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) { @@ -3173,7 +3173,7 @@ GetBlockElement ( // Get Width // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Width = 0; @@ -3182,7 +3182,7 @@ GetBlockElement ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINT16)) ? ((Length + 1) / 2) : sizeof (UINT16) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); StringPtr += Length; if (*StringPtr != 0 && *StringPtr != L'&') { @@ -3210,10 +3210,10 @@ GetBlockElement ( // Get Value // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } - FreePool (TmpBuffer); + FreePool(TmpBuffer); StringPtr += Length; if (*StringPtr != 0 && *StringPtr != L'&') { goto Done; @@ -3239,7 +3239,7 @@ GetBlockElement ( BlockData->Width = (UINT16) (NextBlockData->Offset + NextBlockData->Width - BlockData->Offset); } RemoveEntryList (Link->ForwardLink); - FreePool (NextBlockData); + FreePool(NextBlockData); continue; } Link = Link->ForwardLink; @@ -3255,10 +3255,10 @@ Done: while (!IsListEmpty (&RequestBlockArray->Entry)) { BlockData = BASE_CR (RequestBlockArray->Entry.ForwardLink, IFR_BLOCK_DATA, Entry); RemoveEntryList (&BlockData->Entry); - FreePool (BlockData); + FreePool(BlockData); } - FreePool (RequestBlockArray); + FreePool(RequestBlockArray); } return NULL; @@ -3361,12 +3361,12 @@ Done: BlockData = BASE_CR (RequestBlockArray->Entry.ForwardLink, IFR_BLOCK_DATA, Entry); RemoveEntryList (&BlockData->Entry); if (BlockData->Name != NULL) { - FreePool (BlockData->Name); + FreePool(BlockData->Name); } - FreePool (BlockData); + FreePool(BlockData); } - FreePool (RequestBlockArray); + FreePool(RequestBlockArray); } return NULL; @@ -3495,7 +3495,7 @@ GenerateConfigRequest ( HiiToLower (FullConfigRequest); if (*ConfigRequest != NULL) { - FreePool (*ConfigRequest); + FreePool(*ConfigRequest); } *ConfigRequest = FullConfigRequest; @@ -3570,15 +3570,15 @@ GenerateHdr ( Done: if (GuidStr != NULL) { - FreePool (GuidStr); + FreePool(GuidStr); } if (NameStr != NULL) { - FreePool (NameStr); + FreePool(NameStr); } if (PathStr != NULL) { - FreePool (PathStr); + FreePool(PathStr); } return Status; @@ -4068,7 +4068,7 @@ GetFullStringFromHiiFormPackages ( Progress = *Request; Status = GetFormPackageData (DataBaseRecord, &HiiFormPackage, &PackageSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -4165,7 +4165,7 @@ GetFullStringFromHiiFormPackages ( RequestBlockArray, VarStorageData, DefaultIdArray); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -4181,7 +4181,7 @@ GetFullStringFromHiiFormPackages ( // 3. Construct Request Element (Block Name) for 2.1 and 2.2 case. // Status = GenerateHdr (VarStorageData, DevicePath, &ConfigHdr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -4197,7 +4197,7 @@ GetFullStringFromHiiFormPackages ( // Then construct them all to : ConfigHdr AltConfigHdr ConfigBody AltConfigHdr ConfigBody // Status = GenerateAltConfigResp (DataBaseRecord->Handle,ConfigHdr, VarStorageData, DefaultIdArray, &DefaultAltCfgResp); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -4206,7 +4206,7 @@ GetFullStringFromHiiFormPackages ( // if (*AltCfgResp != NULL && DefaultAltCfgResp != NULL) { Status = MergeDefaultString (AltCfgResp, DefaultAltCfgResp); - FreePool (DefaultAltCfgResp); + FreePool(DefaultAltCfgResp); } else if (*AltCfgResp == NULL) { *AltCfgResp = DefaultAltCfgResp; } @@ -4220,12 +4220,12 @@ Done: BlockData = BASE_CR (RequestBlockArray->Entry.ForwardLink, IFR_BLOCK_DATA, Entry); RemoveEntryList (&BlockData->Entry); if (BlockData->Name != NULL) { - FreePool (BlockData->Name); + FreePool(BlockData->Name); } - FreePool (BlockData); + FreePool(BlockData); } - FreePool (RequestBlockArray); + FreePool(RequestBlockArray); } if (VarStorageData != NULL) { @@ -4236,7 +4236,7 @@ Done: BlockData = BASE_CR (VarStorageData->BlockEntry.ForwardLink, IFR_BLOCK_DATA, Entry); RemoveEntryList (&BlockData->Entry); if (BlockData->Name != NULL) { - FreePool (BlockData->Name); + FreePool(BlockData->Name); } // // Free default value link array @@ -4244,15 +4244,15 @@ Done: while (!IsListEmpty (&BlockData->DefaultValueEntry)) { DefaultValueData = BASE_CR (BlockData->DefaultValueEntry.ForwardLink, IFR_DEFAULT_DATA, Entry); RemoveEntryList (&DefaultValueData->Entry); - FreePool (DefaultValueData); + FreePool(DefaultValueData); } - FreePool (BlockData); + FreePool(BlockData); } if (VarStorageData ->Name != NULL) { - FreePool (VarStorageData ->Name); + FreePool(VarStorageData ->Name); VarStorageData ->Name = NULL; } - FreePool (VarStorageData); + FreePool(VarStorageData); } if (DefaultIdArray != NULL) { @@ -4262,29 +4262,29 @@ Done: while (!IsListEmpty (&DefaultIdArray->Entry)) { DefaultId = BASE_CR (DefaultIdArray->Entry.ForwardLink, IFR_DEFAULT_DATA, Entry); RemoveEntryList (&DefaultId->Entry); - FreePool (DefaultId); + FreePool(DefaultId); } - FreePool (DefaultIdArray); + FreePool(DefaultIdArray); } // // Free the allocated string // if (ConfigHdr != NULL) { - FreePool (ConfigHdr); + FreePool(ConfigHdr); } // // Free Package data // if (HiiFormPackage != NULL) { - FreePool (HiiFormPackage); + FreePool(HiiFormPackage); } if (PointerProgress != NULL) { if (*Request == NULL) { *PointerProgress = NULL; - } else if (EFI_ERROR (Status)) { + } else if (EFI_ERROR(Status)) { *PointerProgress = *Request; } else { *PointerProgress = *Request + StrLen (*Request); @@ -4358,22 +4358,22 @@ GetConfigRespFromEfiVarStore ( VarStore = AllocateZeroPool (BufferSize); ASSERT (VarStore != NULL); Status = gRT->GetVariable (VarStoreName, &EfiVarStoreInfo->Guid, NULL, &BufferSize, VarStore); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = HiiBlockToConfig(This, Request, VarStore, BufferSize, RequestResp, AccessProgress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Done: if (VarStoreName != NULL) { - FreePool (VarStoreName); + FreePool(VarStoreName); } if (VarStore != NULL) { - FreePool (VarStore); + FreePool(VarStore); } return Status; @@ -4437,28 +4437,28 @@ RouteConfigRespForEfiVarStore ( VarStore = AllocateZeroPool (BufferSize); ASSERT (VarStore != NULL); Status = gRT->GetVariable (VarStoreName, &EfiVarStoreInfo->Guid, NULL, &BufferSize, VarStore); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = HiiConfigToBlock(This, RequestResp, VarStore, &BlockSize, Result); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = gRT->SetVariable (VarStoreName, &EfiVarStoreInfo->Guid, EfiVarStoreInfo->Attributes, BufferSize, VarStore); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *Result = RequestResp; goto Done; } Done: if (VarStoreName != NULL) { - FreePool (VarStoreName); + FreePool(VarStoreName); } if (VarStore != NULL) { - FreePool (VarStore); + FreePool(VarStore); } return Status; @@ -4755,7 +4755,7 @@ HiiConfigRoutingExtractConfig ( // Get the UEFI device path // Status = GetDevicePath (ConfigRequest, (UINT8 **) &DevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -4791,7 +4791,7 @@ HiiConfigRoutingExtractConfig ( &TempDevicePath, &DriverHandle ); - if (EFI_ERROR (Status) || (DriverHandle == NULL)) { + if (EFI_ERROR(Status) || (DriverHandle == NULL)) { // // Routing data does not match any known driver. // Set Progress to the 'G' in "GUID" of the routing header. @@ -4822,7 +4822,7 @@ HiiConfigRoutingExtractConfig ( // IfrDataParsedFlag = TRUE; Status = GetFullStringFromHiiFormPackages (Database, DevicePath, &ConfigRequest, &DefaultResults, &AccessProgress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // AccessProgress indicates the parsing progress on . // Map it to the progress on then return it. @@ -4844,7 +4844,7 @@ HiiConfigRoutingExtractConfig ( // Check whether this ConfigRequest is search from Efi varstore type storage. // Status = GetVarStoreType(Database, ConfigRequest, &IsEfiVarStore, &EfiVarStoreInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -4853,8 +4853,8 @@ HiiConfigRoutingExtractConfig ( // Call the GetVariable function to extract settings. // Status = GetConfigRespFromEfiVarStore(This, EfiVarStoreInfo, ConfigRequest, &AccessResults, &AccessProgress); - FreePool (EfiVarStoreInfo); - if (EFI_ERROR (Status)) { + FreePool(EfiVarStoreInfo); + if (EFI_ERROR(Status)) { // // AccessProgress indicates the parsing progress on . // Map it to the progress on then return it. @@ -4871,7 +4871,7 @@ HiiConfigRoutingExtractConfig ( &gEfiHiiConfigAccessProtocolGuid, (VOID **) &ConfigAccess ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The driver has EfiVarStore, may not install ConfigAccess protocol. // So ignore the error status in this case. @@ -4906,7 +4906,7 @@ HiiConfigRoutingExtractConfig ( Status = EFI_SUCCESS; } if (AccessResultsBackup != NULL) { - FreePool (AccessResultsBackup); + FreePool(AccessResultsBackup); AccessResultsBackup = NULL; } } @@ -4919,7 +4919,7 @@ HiiConfigRoutingExtractConfig ( &gEfiHiiConfigAccessProtocolGuid, (VOID **) &ConfigAccess ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -4930,7 +4930,7 @@ HiiConfigRoutingExtractConfig ( &AccessResults ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // AccessProgress indicates the parsing progress on . // Map it to the progress on then return it. @@ -4950,33 +4950,33 @@ HiiConfigRoutingExtractConfig ( // if (!IfrDataParsedFlag && HiiHandle != NULL) { Status = GetFullStringFromHiiFormPackages (Database, DevicePath, &ConfigRequest, &DefaultResults, NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } - FreePool (DevicePath); + FreePool(DevicePath); DevicePath = NULL; if (DefaultResults != NULL) { Status = MergeDefaultString (&AccessResults, DefaultResults); - ASSERT_EFI_ERROR (Status); - FreePool (DefaultResults); + ASSERT_EFI_ERROR(Status); + FreePool(DefaultResults); DefaultResults = NULL; } NextConfigString: if (!FirstElement) { Status = AppendToMultiString (Results, L"&"); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Status = AppendToMultiString (Results, AccessResults); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); FirstElement = FALSE; - FreePool (AccessResults); + FreePool(AccessResults); AccessResults = NULL; - FreePool (ConfigRequest); + FreePool(ConfigRequest); ConfigRequest = NULL; // @@ -4992,25 +4992,25 @@ NextConfigString: } Done: - if (EFI_ERROR (Status)) { - FreePool (*Results); + if (EFI_ERROR(Status)) { + FreePool(*Results); *Results = NULL; } if (ConfigRequest != NULL) { - FreePool (ConfigRequest); + FreePool(ConfigRequest); } if (AccessResults != NULL) { - FreePool (AccessResults); + FreePool(AccessResults); } if (DefaultResults != NULL) { - FreePool (DefaultResults); + FreePool(DefaultResults); } if (DevicePath != NULL) { - FreePool (DevicePath); + FreePool(DevicePath); } return Status; @@ -5089,7 +5089,7 @@ HiiConfigRoutingExportConfig ( &NumberConfigAccessHandles, &ConfigAccessHandles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -5101,7 +5101,7 @@ HiiConfigRoutingExportConfig ( &gEfiHiiConfigAccessProtocolGuid, (VOID **) &ConfigAccess ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -5141,7 +5141,7 @@ HiiConfigRoutingExportConfig ( &Progress, &AccessResults ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Update AccessResults by getting default setting from IFR when HiiPackage is registered to HiiHandle // @@ -5151,21 +5151,21 @@ HiiConfigRoutingExportConfig ( // // Get the full request string to get the Current setting again. // - if (!EFI_ERROR (Status) && ConfigRequest != NULL) { + if (!EFI_ERROR(Status) && ConfigRequest != NULL) { Status = ConfigAccess->ExtractConfig ( ConfigAccess, ConfigRequest, &Progress, &AccessResults ); - FreePool (ConfigRequest); + FreePool(ConfigRequest); } else { Status = EFI_NOT_FOUND; } } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update AccessResults by getting default setting from IFR when HiiPackage is registered to HiiHandle // @@ -5176,7 +5176,7 @@ HiiConfigRoutingExportConfig ( } if (GetElementsFromRequest (AccessResults)) { Status = GetFullStringFromHiiFormPackages (Database, DevicePath, &AccessResults, &DefaultResults, NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (StringPtr != NULL) { *StringPtr = L'&'; @@ -5187,8 +5187,8 @@ HiiConfigRoutingExportConfig ( // if (DefaultResults != NULL) { Status = MergeDefaultString (&AccessResults, DefaultResults); - ASSERT_EFI_ERROR (Status); - FreePool (DefaultResults); + ASSERT_EFI_ERROR(Status); + FreePool(DefaultResults); DefaultResults = NULL; } @@ -5198,19 +5198,19 @@ HiiConfigRoutingExportConfig ( // if (!FirstElement) { Status = AppendToMultiString (Results, L"&"); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Status = AppendToMultiString (Results, AccessResults); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); FirstElement = FALSE; - FreePool (AccessResults); + FreePool(AccessResults); AccessResults = NULL; } } - FreePool (ConfigAccessHandles); + FreePool(ConfigAccessHandles); return EFI_SUCCESS; } @@ -5320,8 +5320,8 @@ HiiConfigRoutingRouteConfig ( // Get the UEFI device path // Status = GetDevicePath (ConfigResp, (UINT8 **) &DevicePath); - if (EFI_ERROR (Status)) { - FreePool (ConfigResp); + if (EFI_ERROR(Status)) { + FreePool(ConfigResp); return Status; } @@ -5355,25 +5355,25 @@ HiiConfigRoutingRouteConfig ( &TempDevicePath, &DriverHandle ); - if (EFI_ERROR (Status) || (DriverHandle == NULL)) { + if (EFI_ERROR(Status) || (DriverHandle == NULL)) { // // Routing data does not match any known driver. // Set Progress to the 'G' in "GUID" of the routing header. // - FreePool (DevicePath); + FreePool(DevicePath); *Progress = StringPtr; - FreePool (ConfigResp); + FreePool(ConfigResp); return EFI_NOT_FOUND; } } - FreePool (DevicePath); + FreePool(DevicePath); // // Check whether this ConfigRequest is search from Efi varstore type storage. // Status = GetVarStoreType(Database, ConfigResp, &IsEfiVarstore, &EfiVarStoreInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -5382,7 +5382,7 @@ HiiConfigRoutingRouteConfig ( // Call the SetVariable function to route settings. // Status = RouteConfigRespForEfiVarStore(This, EfiVarStoreInfo, ConfigResp, &AccessProgress); - FreePool (EfiVarStoreInfo); + FreePool(EfiVarStoreInfo); } else { // // Call corresponding ConfigAccess protocol to route settings @@ -5392,9 +5392,9 @@ HiiConfigRoutingRouteConfig ( &gEfiHiiConfigAccessProtocolGuid, (VOID **) &ConfigAccess ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *Progress = StringPtr; - FreePool (ConfigResp); + FreePool(ConfigResp); return EFI_NOT_FOUND; } @@ -5404,7 +5404,7 @@ HiiConfigRoutingRouteConfig ( &AccessProgress ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ASSERT (AccessProgress != NULL); // // AccessProgress indicates the parsing progress on . @@ -5412,11 +5412,11 @@ HiiConfigRoutingRouteConfig ( // *Progress = StrStr (StringPtr, AccessProgress); - FreePool (ConfigResp); + FreePool(ConfigResp); return Status; } - FreePool (ConfigResp); + FreePool(ConfigResp); ConfigResp = NULL; // @@ -5584,7 +5584,7 @@ HiiBlockToConfig ( // Get Offset // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *Progress = TmpPtr - 1; goto Exit; } @@ -5594,7 +5594,7 @@ HiiBlockToConfig ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); StringPtr += Length; if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) { @@ -5608,7 +5608,7 @@ HiiBlockToConfig ( // Get Width // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *Progress = TmpPtr - 1; goto Exit; } @@ -5618,7 +5618,7 @@ HiiBlockToConfig ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); StringPtr += Length; if (*StringPtr != 0 && *StringPtr != L'&') { @@ -5666,7 +5666,7 @@ HiiBlockToConfig ( TemString += StrnLenS (TemString, Length - ((UINTN)TemString - (UINTN)ValueStr) / sizeof (CHAR16)); } - FreePool (Value); + FreePool(Value); Value = NULL; // @@ -5688,8 +5688,8 @@ HiiBlockToConfig ( AppendToMultiString (Config, ConfigElement); - FreePool (ConfigElement); - FreePool (ValueStr); + FreePool(ConfigElement); + FreePool(ValueStr); ConfigElement = NULL; ValueStr = NULL; @@ -5716,17 +5716,17 @@ HiiBlockToConfig ( Exit: if (*Config != NULL) { - FreePool (*Config); + FreePool(*Config); *Config = NULL; } if (ValueStr != NULL) { - FreePool (ValueStr); + FreePool(ValueStr); } if (Value != NULL) { - FreePool (Value); + FreePool(Value); } if (ConfigElement != NULL) { - FreePool (ConfigElement); + FreePool(ConfigElement); } return Status; @@ -5860,7 +5860,7 @@ HiiConfigToBlock ( // Get Offset // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *Progress = TmpPtr; goto Exit; } @@ -5870,7 +5870,7 @@ HiiConfigToBlock ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); StringPtr += Length; if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) { @@ -5884,7 +5884,7 @@ HiiConfigToBlock ( // Get Width // Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *Progress = TmpPtr; goto Exit; } @@ -5894,7 +5894,7 @@ HiiConfigToBlock ( TmpBuffer, (((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN) ); - FreePool (TmpBuffer); + FreePool(TmpBuffer); StringPtr += Length; if (StrnCmp (StringPtr, L"&VALUE=", StrLen (L"&VALUE=")) != 0) { @@ -5908,7 +5908,7 @@ HiiConfigToBlock ( // Get Value // Status = GetValueOfNumber (StringPtr, &Value, &Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *Progress = TmpPtr; goto Exit; } @@ -5930,7 +5930,7 @@ HiiConfigToBlock ( MaxBlockSize = Offset + Width; } - FreePool (Value); + FreePool(Value); Value = NULL; // @@ -5970,7 +5970,7 @@ HiiConfigToBlock ( Exit: if (Value != NULL) { - FreePool (Value); + FreePool(Value); } return Status; } @@ -6192,7 +6192,7 @@ HiiGetAltCfg ( Exit: *AltCfgResp = NULL; - if (!EFI_ERROR (Status) && (Result != NULL)) { + if (!EFI_ERROR(Status) && (Result != NULL)) { // // Copy the and // @@ -6208,19 +6208,19 @@ Exit: } if (GuidStr != NULL) { - FreePool (GuidStr); + FreePool(GuidStr); } if (NameStr != NULL) { - FreePool (NameStr); + FreePool(NameStr); } if (PathStr != NULL) { - FreePool (PathStr); + FreePool(PathStr); } if (AltIdStr != NULL) { - FreePool (AltIdStr); + FreePool(AltIdStr); } if (Result != NULL) { - FreePool (Result); + FreePool(Result); } return Status; diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c index d3791ca68..8a360a804 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c @@ -61,7 +61,7 @@ GenerateHiiDatabaseRecord ( DatabaseRecord->PackageList = AllocateZeroPool (sizeof (HII_DATABASE_PACKAGE_LIST_INSTANCE)); if (DatabaseRecord->PackageList == NULL) { - FreePool (DatabaseRecord); + FreePool(DatabaseRecord); return EFI_OUT_OF_RESOURCES; } @@ -81,8 +81,8 @@ GenerateHiiDatabaseRecord ( // HiiHandle = (HII_HANDLE *) AllocateZeroPool (sizeof (HII_HANDLE)); if (HiiHandle == NULL) { - FreePool (DatabaseRecord->PackageList); - FreePool (DatabaseRecord); + FreePool(DatabaseRecord->PackageList); + FreePool(DatabaseRecord); return EFI_OUT_OF_RESOURCES; } HiiHandle->Signature = HII_HANDLE_SIGNATURE; @@ -344,7 +344,7 @@ InvokeRegisteredFunction ( } if (Buffer != NULL) { - FreePool (Buffer); + FreePool(Buffer); } return EFI_SUCCESS; @@ -394,7 +394,7 @@ InsertGuidPackage ( } GuidPackage->GuidPkg = (UINT8 *) AllocateZeroPool (PackageHeader.Length); if (GuidPackage->GuidPkg == NULL) { - FreePool (GuidPackage); + FreePool(GuidPackage); return EFI_OUT_OF_RESOURCES; } @@ -468,7 +468,7 @@ ExportGuidPackages ( EFI_HII_PACKAGE_TYPE_GUID, Handle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); CopyMem (Buffer, GuidPackage->GuidPkg, PackageHeader.Length); Buffer = (UINT8 *) Buffer + PackageHeader.Length; } @@ -521,15 +521,15 @@ RemoveGuidPackages ( EFI_HII_PACKAGE_TYPE_GUID, Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } RemoveEntryList (&Package->GuidEntry); CopyMem (&PackageHeader, Package->GuidPkg, sizeof (EFI_HII_PACKAGE_HEADER)); PackageList->PackageListHdr.PackageLength -= PackageHeader.Length; - FreePool (Package->GuidPkg); - FreePool (Package); + FreePool(Package->GuidPkg); + FreePool(Package); } return EFI_SUCCESS; @@ -716,7 +716,7 @@ FindQuestionDefaultSetting ( // Cache the found result in VarStorageList // if (!IsFound) { - FreePool (VariableStorage); + FreePool(VariableStorage); VariableStorage = NULL; } Entry = AllocatePool (sizeof (VARSTORAGE_DEFAULT_DATA)); @@ -725,7 +725,7 @@ FindQuestionDefaultSetting ( Entry->VariableStorage = VariableStorage; InsertTailList (&gVarStorageList, &Entry->Entry); } else if (VariableStorage != NULL) { - FreePool (VariableStorage); + FreePool(VariableStorage); VariableStorage = NULL; } } @@ -864,10 +864,10 @@ UpdateDefaultSettingInFormPackage ( CopyMem (EfiVarStoreList [EfiVarStoreNumber], IfrEfiVarStore, IfrEfiVarStore->Header.Length); AsciiStrToUnicodeStrS ((CHAR8 *)IfrEfiVarStore->Name, (CHAR16 *) &(EfiVarStoreList [EfiVarStoreNumber]->Name[0]), AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name) * sizeof (CHAR16)); Status = FindQuestionDefaultSetting (EFI_HII_DEFAULT_CLASS_STANDARD, EfiVarStoreList[EfiVarStoreNumber], &VarStoreQuestionHeader, NULL, IfrEfiVarStore->Size, FALSE); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { EfiVarStoreNumber ++; } else { - FreePool (EfiVarStoreList [EfiVarStoreNumber]); + FreePool(EfiVarStoreList [EfiVarStoreNumber]); EfiVarStoreList [EfiVarStoreNumber] = NULL; } break; @@ -904,7 +904,7 @@ UpdateDefaultSettingInFormPackage ( for (Index = 0; Index < DefaultIdNumber; Index ++) { if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD) { Status = FindQuestionDefaultSetting (DefaultIdList[Index], EfiVarStoreList[EfiVarStoreIndex], IfrQuestionHdr, &IfrValue, sizeof (BOOLEAN), QuestionReferBitField); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (IfrValue.b) { IfrCheckBox->Flags = IfrCheckBox->Flags | EFI_IFR_CHECKBOX_DEFAULT; } else { @@ -913,7 +913,7 @@ UpdateDefaultSettingInFormPackage ( } } else if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_MANUFACTURING) { Status = FindQuestionDefaultSetting (DefaultIdList[Index], EfiVarStoreList[EfiVarStoreIndex], IfrQuestionHdr, &IfrValue, sizeof (BOOLEAN), QuestionReferBitField); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (IfrValue.b) { IfrCheckBox->Flags = IfrCheckBox->Flags | EFI_IFR_CHECKBOX_DEFAULT_MFG; } else { @@ -953,12 +953,12 @@ UpdateDefaultSettingInFormPackage ( for (Index = 0; Index < DefaultIdNumber; Index ++) { if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD) { Status = FindQuestionDefaultSetting (EFI_HII_DEFAULT_CLASS_STANDARD, EfiVarStoreList[EfiVarStoreIndex], IfrQuestionHdr, &IfrValue, Width, QuestionReferBitField); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { StandardDefaultIsSet = TRUE; } } else if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_MANUFACTURING) { Status = FindQuestionDefaultSetting (EFI_HII_DEFAULT_CLASS_MANUFACTURING, EfiVarStoreList[EfiVarStoreIndex], IfrQuestionHdr, &IfrManufactValue, Width, QuestionReferBitField); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ManufactDefaultIsSet = TRUE; } } @@ -1052,7 +1052,7 @@ UpdateDefaultSettingInFormPackage ( Done: if (EfiVarStoreList != NULL) { for (Index = 0; Index < EfiVarStoreNumber; Index ++) { - FreePool (EfiVarStoreList [Index]); + FreePool(EfiVarStoreList [Index]); } } return; @@ -1105,7 +1105,7 @@ InsertFormPackage ( FormPackage->IfrData = (UINT8 *) AllocateZeroPool (PackageHeader.Length - sizeof (EFI_HII_PACKAGE_HEADER)); if (FormPackage->IfrData == NULL) { - FreePool (FormPackage); + FreePool(FormPackage); return EFI_OUT_OF_RESOURCES; } @@ -1200,7 +1200,7 @@ ExportFormPackages ( EFI_HII_PACKAGE_FORMS, Handle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Copy the Form package content. // @@ -1263,14 +1263,14 @@ RemoveFormPackages ( EFI_HII_PACKAGE_FORMS, Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } RemoveEntryList (&Package->IfrEntry); PackageList->PackageListHdr.PackageLength -= Package->FormPkgHdr.Length; - FreePool (Package->IfrData); - FreePool (Package); + FreePool(Package->IfrData); + FreePool(Package); // // If Hii runtime support feature is enabled, // will export Hii info for runtime use after ReadyToBoot event triggered. @@ -1348,11 +1348,11 @@ InsertStringPackage ( for (Link = PackageList->StringPkgHdr.ForwardLink; Link != &PackageList->StringPkgHdr; Link = Link->ForwardLink) { StringPackage = CR (Link, HII_STRING_PACKAGE_INSTANCE, StringEntry, HII_STRING_PACKAGE_SIGNATURE); if (HiiCompareLanguage (Language, StringPackage->StringPkgHdr->Language)) { - FreePool (Language); + FreePool(Language); return EFI_UNSUPPORTED; } } - FreePool (Language); + FreePool(Language); // // Create a String package node @@ -1397,7 +1397,7 @@ InsertStringPackage ( // Collect all font block info // Status = FindStringBlock (Private, StringPackage, (EFI_STRING_ID) (-1), NULL, NULL, NULL, &StringPackage->MaxStringId, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1417,12 +1417,12 @@ Error: if (StringPackage != NULL) { if (StringPackage->StringBlock != NULL) { - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); } if (StringPackage->StringPkgHdr != NULL) { - FreePool (StringPackage->StringPkgHdr); + FreePool(StringPackage->StringPkgHdr); } - FreePool (StringPackage); + FreePool(StringPackage); } return Status; @@ -1495,7 +1495,7 @@ AdjustStringPackage ( // Append a EFI_HII_SIBT_END block to the end. // *BlockPtr = EFI_HII_SIBT_END; - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); StringPackage->StringBlock = StringBlock; StringPackage->StringPkgHdr->Header.Length += Skip2BlockSize; PackageList->PackageListHdr.PackageLength += Skip2BlockSize; @@ -1564,7 +1564,7 @@ ExportStringPackages ( EFI_HII_PACKAGE_STRINGS, Handle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Copy String package header // @@ -1630,14 +1630,14 @@ RemoveStringPackages ( EFI_HII_PACKAGE_STRINGS, Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } RemoveEntryList (&Package->StringEntry); PackageList->PackageListHdr.PackageLength -= Package->StringPkgHdr->Header.Length; - FreePool (Package->StringBlock); - FreePool (Package->StringPkgHdr); + FreePool(Package->StringBlock); + FreePool(Package->StringPkgHdr); // // Delete font information // @@ -1649,10 +1649,10 @@ RemoveStringPackages ( HII_FONT_INFO_SIGNATURE ); RemoveEntryList (&FontInfo->Entry); - FreePool (FontInfo); + FreePool(FontInfo); } - FreePool (Package); + FreePool(Package); } return EFI_SUCCESS; @@ -1758,7 +1758,7 @@ InsertFontPackage ( // Collect all default character cell information and backup in GlyphInfoList. // Status = FindGlyphBlock (FontPackage, (CHAR16) (-1), NULL, NULL, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -1792,19 +1792,19 @@ InsertFontPackage ( Error: if (FontPkgHdr != NULL) { - FreePool (FontPkgHdr); + FreePool(FontPkgHdr); } if (FontInfo != NULL) { - FreePool (FontInfo); + FreePool(FontInfo); } if (FontPackage != NULL) { if (FontPackage->GlyphBlock != NULL) { - FreePool (FontPackage->GlyphBlock); + FreePool(FontPackage->GlyphBlock); } - FreePool (FontPackage); + FreePool(FontPackage); } if (GlobalFont != NULL) { - FreePool (GlobalFont); + FreePool(GlobalFont); } return Status; @@ -1871,7 +1871,7 @@ ExportFontPackages ( EFI_HII_PACKAGE_FONTS, Handle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Copy Font package header // @@ -1939,7 +1939,7 @@ RemoveFontPackages ( EFI_HII_PACKAGE_FONTS, Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1947,9 +1947,9 @@ RemoveFontPackages ( PackageList->PackageListHdr.PackageLength -= Package->FontPkgHdr->Header.Length; if (Package->GlyphBlock != NULL) { - FreePool (Package->GlyphBlock); + FreePool(Package->GlyphBlock); } - FreePool (Package->FontPkgHdr); + FreePool(Package->FontPkgHdr); // // Delete default character cell information // @@ -1961,7 +1961,7 @@ RemoveFontPackages ( HII_GLYPH_INFO_SIGNATURE ); RemoveEntryList (&GlyphInfo->Entry); - FreePool (GlyphInfo); + FreePool(GlyphInfo); } // @@ -1971,13 +1971,13 @@ RemoveFontPackages ( GlobalFont = CR (Link, HII_GLOBAL_FONT_INFO, Entry, HII_GLOBAL_FONT_INFO_SIGNATURE); if (GlobalFont->FontPackage == Package) { RemoveEntryList (&GlobalFont->Entry); - FreePool (GlobalFont->FontInfo); - FreePool (GlobalFont); + FreePool(GlobalFont->FontInfo); + FreePool(GlobalFont); break; } } - FreePool (Package); + FreePool(Package); } return EFI_SUCCESS; @@ -2065,7 +2065,7 @@ InsertImagePackage ( ImagePackage->PaletteBlock = (UINT8 *) AllocateZeroPool (PaletteSize); if (ImagePackage->PaletteBlock == NULL) { - FreePool (ImagePackage); + FreePool(ImagePackage); return EFI_OUT_OF_RESOURCES; } CopyMem ( @@ -2085,8 +2085,8 @@ InsertImagePackage ( sizeof (EFI_HII_IMAGE_PACKAGE_HDR) - PaletteSize; ImagePackage->ImageBlock = AllocateZeroPool (ImageSize); if (ImagePackage->ImageBlock == NULL) { - FreePool (ImagePackage->PaletteBlock); - FreePool (ImagePackage); + FreePool(ImagePackage->PaletteBlock); + FreePool(ImagePackage); return EFI_OUT_OF_RESOURCES; } CopyMem ( @@ -2169,7 +2169,7 @@ ExportImagePackages ( EFI_HII_PACKAGE_IMAGES, Handle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (Package->ImagePkgHdr.Header.Length == sizeof (EFI_HII_IMAGE_PACKAGE_HDR) + Package->ImageBlockSize + Package->PaletteInfoSize); // @@ -2240,17 +2240,17 @@ RemoveImagePackages ( EFI_HII_PACKAGE_IMAGES, Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } PackageList->PackageListHdr.PackageLength -= Package->ImagePkgHdr.Header.Length; - FreePool (Package->ImageBlock); + FreePool(Package->ImageBlock); if (Package->PaletteBlock != NULL) { - FreePool (Package->PaletteBlock); + FreePool(Package->PaletteBlock); } - FreePool (Package); + FreePool(Package); PackageList->ImagePkg = NULL; @@ -2330,9 +2330,9 @@ Error: if (SimpleFontPackage != NULL) { if (SimpleFontPackage->SimpleFontPkgHdr != NULL) { - FreePool (SimpleFontPackage->SimpleFontPkgHdr); + FreePool(SimpleFontPackage->SimpleFontPkgHdr); } - FreePool (SimpleFontPackage); + FreePool(SimpleFontPackage); } return Status; } @@ -2396,7 +2396,7 @@ ExportSimpleFontPackages ( EFI_HII_PACKAGE_SIMPLE_FONTS, Handle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Copy SimpleFont package @@ -2452,14 +2452,14 @@ RemoveSimpleFontPackages ( EFI_HII_PACKAGE_SIMPLE_FONTS, Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } RemoveEntryList (&Package->SimpleFontEntry); PackageList->PackageListHdr.PackageLength -= Package->SimpleFontPkgHdr->Header.Length; - FreePool (Package->SimpleFontPkgHdr); - FreePool (Package); + FreePool(Package->SimpleFontPkgHdr); + FreePool(Package); } return EFI_SUCCESS; @@ -2584,7 +2584,7 @@ ExportDevicePathPackage ( EFI_HII_PACKAGE_DEVICE_PATH, Handle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Copy Device path package @@ -2637,14 +2637,14 @@ RemoveDevicePathPackage ( EFI_HII_PACKAGE_DEVICE_PATH, Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } CopyMem (&Header, Package, sizeof (EFI_HII_PACKAGE_HEADER)); PackageList->PackageListHdr.PackageLength -= Header.Length; - FreePool (Package); + FreePool(Package); PackageList->DevicePathPkg = NULL; @@ -2695,7 +2695,7 @@ AddDevicePathPackage ( NotifyType, DatabaseRecord->PackageList ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2776,9 +2776,9 @@ Error: if (KeyboardLayoutPackage != NULL) { if (KeyboardLayoutPackage->KeyboardPkg != NULL) { - FreePool (KeyboardLayoutPackage->KeyboardPkg); + FreePool(KeyboardLayoutPackage->KeyboardPkg); } - FreePool (KeyboardLayoutPackage); + FreePool(KeyboardLayoutPackage); } return Status; @@ -2846,7 +2846,7 @@ ExportKeyboardLayoutPackages ( EFI_HII_PACKAGE_KEYBOARD_LAYOUT, Handle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Copy Keyboard Layout package @@ -2904,15 +2904,15 @@ RemoveKeyboardLayoutPackages ( EFI_HII_PACKAGE_KEYBOARD_LAYOUT, Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } RemoveEntryList (&Package->KeyboardEntry); CopyMem (&PackageHeader, Package->KeyboardPkg, sizeof (EFI_HII_PACKAGE_HEADER)); PackageList->PackageListHdr.PackageLength -= PackageHeader.Length; - FreePool (Package->KeyboardPkg); - FreePool (Package); + FreePool(Package->KeyboardPkg); + FreePool(Package); } return EFI_SUCCESS; @@ -2999,7 +2999,7 @@ AddPackages ( DatabaseRecord->PackageList, &GuidPackage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = InvokeRegisteredFunction ( @@ -3017,7 +3017,7 @@ AddPackages ( DatabaseRecord->PackageList, &FormPackage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = InvokeRegisteredFunction ( @@ -3045,7 +3045,7 @@ AddPackages ( DatabaseRecord->PackageList, &KeyboardLayoutPackage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = InvokeRegisteredFunction ( @@ -3064,7 +3064,7 @@ AddPackages ( DatabaseRecord->PackageList, &StringPackage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT (StringPackage != NULL); @@ -3085,7 +3085,7 @@ AddPackages ( DatabaseRecord->PackageList, &FontPackage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = InvokeRegisteredFunction ( @@ -3103,7 +3103,7 @@ AddPackages ( DatabaseRecord->PackageList, &ImagePackage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = InvokeRegisteredFunction ( @@ -3121,7 +3121,7 @@ AddPackages ( DatabaseRecord->PackageList, &SimpleFontPackage ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = InvokeRegisteredFunction ( @@ -3144,7 +3144,7 @@ AddPackages ( break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -3157,7 +3157,7 @@ AddPackages ( // // Adjust String Package to make sure all string packages have the same max string ID. // - if (!EFI_ERROR (Status) && StringPkgIsAdd) { + if (!EFI_ERROR(Status) && StringPkgIsAdd) { Status = AdjustStringPackage (DatabaseRecord->PackageList); } @@ -3226,7 +3226,7 @@ ExportPackageList ( (VOID *) ((UINT8 *) Buffer + ResultSize), &ResultSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = ExportFormPackages ( @@ -3238,7 +3238,7 @@ ExportPackageList ( (VOID *) ((UINT8 *) Buffer + ResultSize), &ResultSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = ExportKeyboardLayoutPackages ( @@ -3250,7 +3250,7 @@ ExportPackageList ( (VOID *) ((UINT8 *) Buffer + ResultSize), &ResultSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = ExportStringPackages ( @@ -3262,7 +3262,7 @@ ExportPackageList ( (VOID *) ((UINT8 *) Buffer + ResultSize), &ResultSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = ExportFontPackages ( @@ -3274,7 +3274,7 @@ ExportPackageList ( (VOID *) ((UINT8 *) Buffer + ResultSize), &ResultSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = ExportImagePackages ( @@ -3286,7 +3286,7 @@ ExportPackageList ( (VOID *) ((UINT8 *) Buffer + ResultSize), &ResultSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = ExportSimpleFontPackages ( @@ -3298,7 +3298,7 @@ ExportPackageList ( (VOID *) ((UINT8 *) Buffer + ResultSize), &ResultSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = ExportDevicePathPackage ( @@ -3310,7 +3310,7 @@ ExportPackageList ( (VOID *) ((UINT8 *) Buffer + ResultSize), &ResultSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -3360,7 +3360,7 @@ HiiGetConfigRespInfo( // Status = HiiConfigRoutingExportConfig(&Private->ConfigRouting,&ConfigAltResp); - if (!EFI_ERROR (Status)){ + if (!EFI_ERROR(Status)){ ConfigSize = StrSize(ConfigAltResp); if (ConfigSize > gConfigRespSize){ // @@ -3437,7 +3437,7 @@ HiiGetDatabaseInfo( ZeroMem(gRTDatabaseInfoBuffer,gDatabaseInfoSize); } Status = HiiExportPackageLists(This, NULL, &DatabaseInfoSize, gRTDatabaseInfoBuffer); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); gBS->InstallConfigurationTable (&gEfiHiiDatabaseProtocolGuid, gRTDatabaseInfoBuffer); return EFI_SUCCESS; @@ -3508,7 +3508,7 @@ HiiNewPackageList ( // Build a PackageList node // Status = GenerateHiiDatabaseRecord (Private, &DatabaseRecord); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } @@ -3518,7 +3518,7 @@ HiiNewPackageList ( // according to incoming package list. // Status = AddPackages (Private, EFI_HII_DATABASE_NOTIFY_NEW_PACK, PackageList, DatabaseRecord); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } @@ -3533,9 +3533,9 @@ HiiNewPackageList ( &gEfiDevicePathProtocolGuid, (VOID **) &DevicePath ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = AddDevicePathPackage (Private, EFI_HII_DATABASE_NOTIFY_NEW_PACK, DevicePath, DatabaseRecord); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } *Handle = DatabaseRecord->Handle; @@ -3625,42 +3625,42 @@ HiiRemovePackageList ( // then remove them. // Status = RemoveGuidPackages (Private, Handle, PackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } Status = RemoveFormPackages (Private, Handle, PackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } Status = RemoveKeyboardLayoutPackages (Private, Handle, PackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } Status = RemoveStringPackages (Private, Handle, PackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } Status = RemoveFontPackages (Private, Handle, PackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } Status = RemoveImagePackages (Private, Handle, PackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } Status = RemoveSimpleFontPackages (Private, Handle, PackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } Status = RemoveDevicePathPackage (Private, Handle, PackageList); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } @@ -3676,9 +3676,9 @@ HiiRemovePackageList ( ASSERT (Private->HiiHandleCount >= 0); HiiHandle->Signature = 0; - FreePool (HiiHandle); - FreePool (Node->PackageList); - FreePool (Node); + FreePool(HiiHandle); + FreePool(Node->PackageList); + FreePool(Node); // // Check whether need to get the Database info. @@ -3803,7 +3803,7 @@ HiiUpdatePackageList ( break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } @@ -4082,7 +4082,7 @@ HiiExportPackageLists ( *BufferSize, (EFI_HII_PACKAGE_LIST_HEADER *)((UINT8 *) Buffer + UsedSize) ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } else if (Handle != NULL && Node->Handle == Handle) { Status = ExportPackageList ( Private, @@ -4092,7 +4092,7 @@ HiiExportPackageLists ( *BufferSize, Buffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (*BufferSize < UsedSize) { *BufferSize = UsedSize; return EFI_BUFFER_TOO_SMALL; @@ -4191,7 +4191,7 @@ HiiRegisterPackageNotify ( NULL, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Fill in the information to the notification node @@ -4251,7 +4251,7 @@ HiiUnregisterPackageNotify ( NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -4270,8 +4270,8 @@ HiiUnregisterPackageNotify ( NULL, NULL ); - ASSERT_EFI_ERROR (Status); - FreePool (Notify); + ASSERT_EFI_ERROR(Status); + FreePool(Notify); return EFI_SUCCESS; } @@ -4549,7 +4549,7 @@ HiiSetKeyboardLayout ( KeyboardLayout = (EFI_HII_KEYBOARD_LAYOUT *) AllocateZeroPool (KeyboardLayoutLength); ASSERT (KeyboardLayout != NULL); Status = HiiGetKeyboardLayout (This, KeyGuid, &KeyboardLayoutLength, KeyboardLayout); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Backup current keyboard layout. @@ -4565,7 +4565,7 @@ HiiSetKeyboardLayout ( // current keyboard layout is changed. // Status = gBS->SignalEvent (gHiiKeyboardLayoutChanged); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c index ca63df168..ae4a81c94 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c @@ -690,7 +690,7 @@ FindGlyphBlock ( &FontPackage->GlyphInfoList, (EFI_HII_GLYPH_INFO *) ((UINT8 *) FontPackage->FontPkgHdr + 3 * sizeof (UINT32)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } CopyMem ( @@ -717,7 +717,7 @@ FindGlyphBlock ( &FontPackage->GlyphInfoList, (EFI_HII_GLYPH_INFO *) (BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK)) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } CopyMem ( @@ -830,7 +830,7 @@ FindGlyphBlock ( case EFI_HII_GIBT_GLYPH_DEFAULT: Status = GetCell (CharCurrent, &FontPackage->GlyphInfoList, &DefaultCell); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (CharValue == (CHAR16) (-1)) { @@ -860,7 +860,7 @@ FindGlyphBlock ( case EFI_HII_GIBT_GLYPHS_DEFAULT: CopyMem (&Length16, BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK), sizeof (UINT16)); Status = GetCell (CharCurrent, &FontPackage->GlyphInfoList, &DefaultCell); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (CharValue == (CHAR16) (-1)) { @@ -1054,7 +1054,7 @@ IsSystemFontInfo ( DefaultLen = 0; Status = GetSystemFont (Private, &SystemDefault, &DefaultLen); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT ((SystemDefault != NULL) && (DefaultLen != 0)); // @@ -1115,7 +1115,7 @@ IsSystemFontInfo ( Exit: if (SystemInfo == NULL) { if (SystemDefault != NULL) { - FreePool (SystemDefault); + FreePool(SystemDefault); } } return Flag; @@ -1667,7 +1667,7 @@ HiiStringToImage ( Image->Height = 600; Image->Image.Bitmap = AllocateZeroPool (Image->Width * Image->Height *sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (Image->Image.Bitmap == NULL) { - FreePool (Image); + FreePool(Image); return EFI_OUT_OF_RESOURCES; } @@ -1812,13 +1812,13 @@ HiiStringToImage ( &Cell[Index], &Attributes[Index] ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_INVALID_PARAMETER; } } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -2109,12 +2109,12 @@ HiiStringToImage ( RowInfo[RowIndex].LineHeight, 0 ); - if (EFI_ERROR (Status)) { - FreePool (BltBuffer); + if (EFI_ERROR(Status)) { + FreePool(BltBuffer); goto Exit; } - FreePool (BltBuffer); + FreePool(BltBuffer); } } else { // @@ -2209,32 +2209,32 @@ Exit: for (Index = 0; Index < StrLength; Index++) { if (GlyphBuf[Index] != NULL) { - FreePool (GlyphBuf[Index]); + FreePool(GlyphBuf[Index]); } } if (StringIn != NULL) { - FreePool (StringIn); + FreePool(StringIn); } if (StringIn2 != NULL) { - FreePool (StringIn2); + FreePool(StringIn2); } if (StringInfoOut != NULL) { - FreePool (StringInfoOut); + FreePool(StringInfoOut); } if (RowInfo != NULL) { - FreePool (RowInfo); + FreePool(RowInfo); } if (SystemDefault != NULL) { - FreePool (SystemDefault); + FreePool(SystemDefault); } if (GlyphBuf != NULL) { - FreePool (GlyphBuf); + FreePool(GlyphBuf); } if (Cell != NULL) { - FreePool (Cell); + FreePool(Cell); } if (Attributes != NULL) { - FreePool (Attributes); + FreePool(Attributes); } return Status; @@ -2383,7 +2383,7 @@ HiiStringIdToImage ( SupportedLanguages, &SupportedLanguagesSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -2421,7 +2421,7 @@ HiiStringIdToImage ( &StringFontInfo ); if (Status == EFI_BUFFER_TOO_SMALL) { - FreePool (String); + FreePool(String); String = (EFI_STRING) AllocateZeroPool (StringSize); if (String == NULL) { Status = EFI_OUT_OF_RESOURCES; @@ -2438,7 +2438,7 @@ HiiStringIdToImage ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -2490,22 +2490,22 @@ HiiStringIdToImage ( Exit: if (SupportedLanguages != NULL) { - FreePool (SupportedLanguages); + FreePool(SupportedLanguages); } if (CurrentLanguage != NULL) { - FreePool (CurrentLanguage); + FreePool(CurrentLanguage); } if (BestLanguage != NULL) { - FreePool (BestLanguage); + FreePool(BestLanguage); } if (String != NULL) { - FreePool (String); + FreePool(String); } if (StringFontInfo != NULL) { - FreePool (StringFontInfo); + FreePool(StringFontInfo); } if (NewStringInfo != NULL) { - FreePool (NewStringInfo); + FreePool(NewStringInfo); } return Status; @@ -2595,7 +2595,7 @@ HiiGetGlyph ( *(String + 1) = 0; Status = HiiGetFontInfo (This, &FontHandle, StringInfo, &StringInfoOut, String); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } ASSERT (StringInfoOut != NULL); @@ -2609,7 +2609,7 @@ HiiGetGlyph ( } Status = GetGlyphBuffer (Private, Char, FontInfo, &GlyphBuffer, &Cell, &Attributes); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -2624,7 +2624,7 @@ HiiGetGlyph ( if (Image->Width * Image->Height > 0) { Image->Image.Bitmap = AllocateZeroPool (Image->Width * Image->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (Image->Image.Bitmap == NULL) { - FreePool (Image); + FreePool(Image); Status = EFI_OUT_OF_RESOURCES; goto Exit; } @@ -2667,7 +2667,7 @@ Exit: // if (Char != REPLACE_UNKNOWN_GLYPH) { Status = HiiGetGlyph (This, REPLACE_UNKNOWN_GLYPH, StringInfo, Blt, Baseline); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = EFI_WARN_UNKNOWN_GLYPH; } } else { @@ -2676,16 +2676,16 @@ Exit: } if (SystemDefault != NULL) { - FreePool (SystemDefault); + FreePool(SystemDefault); } if (StringInfoOut != NULL) { - FreePool (StringInfoOut); + FreePool(StringInfoOut); } if (String != NULL) { - FreePool (String); + FreePool(String); } if (GlyphBuffer != NULL) { - FreePool (GlyphBuffer); + FreePool(GlyphBuffer); } return Status; @@ -2826,7 +2826,7 @@ HiiGetFontInfo ( } else { Status = SaveFontName (((EFI_FONT_DISPLAY_INFO *) StringInfoIn)->FontInfo.FontName, &FontInfo); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Exit; } @@ -2855,7 +2855,7 @@ HiiGetFontInfo ( StringIn = String; while (*StringIn != 0) { Status = FindGlyphBlock (GlobalFont->FontPackage, *StringIn, NULL, NULL, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { LocalFontHandle = NULL; goto Exit; } @@ -2892,10 +2892,10 @@ Exit: } if (SystemDefault != NULL) { - FreePool (SystemDefault); + FreePool(SystemDefault); } if (FontInfo != NULL) { - FreePool (FontInfo); + FreePool(FontInfo); } return Status; } diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseEntry.c b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseEntry.c index bbf437bbb..52f29b84e 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseEntry.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseEntry.c @@ -200,7 +200,7 @@ InitializeHiiDatabase ( &gEfiHiiKeyBoardLayoutGuid, &gHiiKeyboardLayoutChanged ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -220,7 +220,7 @@ InitializeHiiDatabase ( NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -241,7 +241,7 @@ InitializeHiiDatabase ( NULL, &ReadyToBootEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c index a108fc615..91e8d6770 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c @@ -276,7 +276,7 @@ Output1bitPixel ( ZeroMem (PaletteValue, sizeof (PaletteValue)); CopyRgbToGopPixel (&PaletteValue[0], &Palette->PaletteValue[0], 1); CopyRgbToGopPixel (&PaletteValue[1], &Palette->PaletteValue[1], 1); - FreePool (Palette); + FreePool(Palette); // // Convert the pixel from one bit to corresponding color. @@ -365,7 +365,7 @@ Output4bitPixel ( ZeroMem (PaletteValue, sizeof (PaletteValue)); CopyRgbToGopPixel (PaletteValue, Palette->PaletteValue, MIN (PaletteNum, ARRAY_SIZE (PaletteValue))); - FreePool (Palette); + FreePool(Palette); // // Convert the pixel from 4 bit to corresponding color. @@ -442,7 +442,7 @@ Output8bitPixel ( PaletteNum = (UINT16)(Palette->PaletteSize / sizeof (EFI_HII_RGB_PIXEL)); ZeroMem (PaletteValue, sizeof (PaletteValue)); CopyRgbToGopPixel (PaletteValue, Palette->PaletteValue, MIN (PaletteNum, ARRAY_SIZE (PaletteValue))); - FreePool (Palette); + FreePool(Palette); // // Convert the pixel from 8 bits to corresponding color. @@ -701,7 +701,7 @@ HiiNewImage ( ImagePackage->ImageBlock, ImagePackage->ImageBlockSize - sizeof (EFI_HII_IIBT_END_BLOCK) ); - FreePool (ImagePackage->ImageBlock); + FreePool(ImagePackage->ImageBlock); ImagePackage->ImageBlock = ImageBlocks; // @@ -760,7 +760,7 @@ HiiNewImage ( ImagePackage->ImageBlockSize = NewBlockSize + sizeof (EFI_HII_IIBT_END_BLOCK); ImagePackage->ImageBlock = AllocateZeroPool (NewBlockSize + sizeof (EFI_HII_IIBT_END_BLOCK)); if (ImagePackage->ImageBlock == NULL) { - FreePool (ImagePackage); + FreePool(ImagePackage); EfiReleaseLock (&mHiiDatabaseLock); return EFI_OUT_OF_RESOURCES; } @@ -905,11 +905,11 @@ IGetImage ( // Spec requires to use the first capable image decoder instance. // The first image decoder instance may fail to decode the image. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Image->Bitmap = ImageOut->Image.Bitmap; Image->Height = ImageOut->Height; Image->Width = ImageOut->Width; - FreePool (ImageOut); + FreePool(ImageOut); } return Status; @@ -1204,7 +1204,7 @@ HiiSetImage ( CopyMem ((UINT8 *) NewImageBlock + NewBlockSize, (UINT8 *) CurrentImageBlock + OldBlockSize, Part2Size); - FreePool (ImagePackage->ImageBlock); + FreePool(ImagePackage->ImageBlock); ImagePackage->ImageBlock = ImageBlocks; ImagePackage->ImageBlockSize += NewBlockSize - OldBlockSize; ImagePackage->ImagePkgHdr.Header.Length += NewBlockSize - OldBlockSize; @@ -1415,7 +1415,7 @@ HiiDrawImage ( } - FreePool (BltBuffer); + FreePool(BltBuffer); return Status; } else { @@ -1448,7 +1448,7 @@ HiiDrawImage ( ImageOut = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT)); if (ImageOut == NULL) { - FreePool (BltBuffer); + FreePool(BltBuffer); return EFI_OUT_OF_RESOURCES; } ImageOut->Width = Width; @@ -1460,16 +1460,16 @@ HiiDrawImage ( // color. Not sure if it need to be updated or not. // Status = GetSystemFont (Private, &FontInfo, NULL); - if (EFI_ERROR (Status)) { - FreePool (BltBuffer); - FreePool (ImageOut); + if (EFI_ERROR(Status)) { + FreePool(BltBuffer); + FreePool(ImageOut); return Status; } ASSERT (FontInfo != NULL); for (Index = 0; Index < (UINTN)Width * Height; Index++) { BltBuffer[Index] = FontInfo->BackgroundColor; } - FreePool (FontInfo); + FreePool(FontInfo); // // Draw the incoming image to the new created image. @@ -1547,7 +1547,7 @@ HiiDrawImageId ( // Get the specified Image. // Status = HiiGetImage (This, PackageList, ImageId, &Image); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1556,7 +1556,7 @@ HiiDrawImageId ( // Status = HiiDrawImage (This, Flags, &Image, Blt, BltX, BltY); if (Image.Bitmap != NULL) { - FreePool (Image.Bitmap); + FreePool(Image.Bitmap); } return Status; } diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ImageEx.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ImageEx.c index 07e8b3b56..39c013acf 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ImageEx.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ImageEx.c @@ -223,7 +223,7 @@ HiiDrawImageIdEx ( // Get the specified Image. // Status = HiiGetImageEx (This, PackageList, ImageId, &Image); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -232,7 +232,7 @@ HiiDrawImageIdEx ( // Status = HiiDrawImageEx (This, Flags, &Image, Blt, BltX, BltY); if (Image.Bitmap != NULL) { - FreePool (Image.Bitmap); + FreePool(Image.Bitmap); } return Status; } @@ -274,17 +274,17 @@ LocateHiiImageDecoder ( } Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiHiiImageDecoderProtocolGuid, NULL, &HandleNum, &Handles); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } for (Index = 0; Index < HandleNum; Index++) { Status = gBS->HandleProtocol (Handles[Index], &gEfiHiiImageDecoderProtocolGuid, (VOID **) &Decoder); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } Status = Decoder->GetImageDecoderName (Decoder, &DecoderNames, &NumberOfDecoderName); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } for (DecoderNameIndex = 0; DecoderNameIndex < NumberOfDecoderName; DecoderNameIndex++) { @@ -386,11 +386,11 @@ HiiGetImageInfo ( // Spec requires to use the first capable image decoder instance. // The first image decoder instance may fail to decode the image. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Image->Height = ImageInfo->ImageHeight; Image->Width = ImageInfo->ImageWidth; Image->Image.Bitmap = NULL; - FreePool (ImageInfo); + FreePool(ImageInfo); } return Status; diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c index 505e063d4..cf9532edc 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c @@ -521,7 +521,7 @@ FindStringBlock ( // StringPackage->FontId++; - FreePool (FontInfo); + FreePool(FontInfo); } BlockSize += Ext2.Length; @@ -639,7 +639,7 @@ GetStringWorker ( NULL, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -670,7 +670,7 @@ GetStringWorker ( default: return EFI_NOT_FOUND; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -839,7 +839,7 @@ InsertLackStringBlock ( } else { *BlockType = EFI_HII_SIBT_STRING_UCS2; } - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); StringPackage->StringBlock = StringBlock; StringPackage->StringPkgHdr->Header.Length += NewBlockSize - OldBlockSize; @@ -911,7 +911,7 @@ SetStringWorker ( NULL, &StartStringId ); - if (EFI_ERROR (Status) && (BlockType == EFI_HII_SIBT_SKIP1 || BlockType == EFI_HII_SIBT_SKIP2)) { + if (EFI_ERROR(Status) && (BlockType == EFI_HII_SIBT_SKIP1 || BlockType == EFI_HII_SIBT_SKIP2)) { Status = InsertLackStringBlock(StringPackage, StartStringId, StringId, @@ -919,7 +919,7 @@ SetStringWorker ( &StringBlockAddr, (BOOLEAN)(StringFontInfo != NULL) ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } if (StringFontInfo != NULL) { @@ -1006,7 +1006,7 @@ SetStringWorker ( TmpSize ); - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); StringPackage->StringBlock = Block; StringPackage->StringPkgHdr->Header.Length += (UINT32) (BlockSize - OldBlockSize); break; @@ -1039,7 +1039,7 @@ SetStringWorker ( OldBlockSize - (StringTextPtr - StringPackage->StringBlock) - StringSize ); - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); StringPackage->StringBlock = Block; StringPackage->StringPkgHdr->Header.Length += (UINT32) (BlockSize - OldBlockSize); break; @@ -1090,7 +1090,7 @@ SetStringWorker ( CopyMem (BlockPtr, StringPackage->StringBlock, OldBlockSize); - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); StringPackage->StringBlock = Block; StringPackage->StringPkgHdr->Header.Length += Ext2.Length; @@ -1231,7 +1231,7 @@ HiiNewString ( &NextStringId, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -1275,7 +1275,7 @@ HiiNewString ( // Append a EFI_HII_SIBT_END block to the end. // *BlockPtr = EFI_HII_SIBT_END; - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); StringPackage->StringBlock = StringBlock; StringPackage->StringPkgHdr->Header.Length += Ucs2BlockSize; PackageListNode->PackageListHdr.PackageLength += Ucs2BlockSize; @@ -1322,7 +1322,7 @@ HiiNewString ( HeaderSize = (UINT32) (AsciiStrSize ((CHAR8 *) Language) - 1 + sizeof (EFI_HII_STRING_PACKAGE_HDR)); StringPackage->StringPkgHdr = AllocateZeroPool (HeaderSize); if (StringPackage->StringPkgHdr == NULL) { - FreePool (StringPackage); + FreePool(StringPackage); Status = EFI_OUT_OF_RESOURCES; goto Done; } @@ -1343,8 +1343,8 @@ HiiNewString ( BlockSize = Ucs2BlockSize + sizeof (EFI_HII_SIBT_END_BLOCK); StringPackage->StringBlock = (UINT8 *) AllocateZeroPool (BlockSize); if (StringPackage->StringBlock == NULL) { - FreePool (StringPackage->StringPkgHdr); - FreePool (StringPackage); + FreePool(StringPackage->StringPkgHdr); + FreePool(StringPackage); Status = EFI_OUT_OF_RESOURCES; goto Done; } @@ -1406,7 +1406,7 @@ HiiNewString ( // Append a EFI_HII_SIBT_END block to the end. // *BlockPtr = EFI_HII_SIBT_END; - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); StringPackage->StringBlock = StringBlock; StringPackage->StringPkgHdr->Header.Length += Ucs2BlockSize; PackageListNode->PackageListHdr.PackageLength += Ucs2BlockSize; @@ -1448,7 +1448,7 @@ HiiNewString ( // Append a EFI_HII_SIBT_END block to the end. // *BlockPtr = EFI_HII_SIBT_END; - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); StringPackage->StringBlock = StringBlock; StringPackage->StringPkgHdr->Header.Length += Ucs2FontBlockSize; PackageListNode->PackageListHdr.PackageLength += Ucs2FontBlockSize; @@ -1509,7 +1509,7 @@ HiiNewString ( // Append a EFI_HII_SIBT_END block to the end. // *BlockPtr = EFI_HII_SIBT_END; - FreePool (StringPackage->StringBlock); + FreePool(StringPackage->StringBlock); StringPackage->StringBlock = StringBlock; StringPackage->StringPkgHdr->Header.Length += FontBlockSize + Ucs2FontBlockSize; PackageListNode->PackageListHdr.PackageLength += FontBlockSize + Ucs2FontBlockSize; @@ -1523,7 +1523,7 @@ HiiNewString ( } Done: - if (!EFI_ERROR (Status) && NewStringPackageCreated) { + if (!EFI_ERROR(Status) && NewStringPackageCreated) { // // Trigger any registered notification function for new string package // @@ -1536,7 +1536,7 @@ Done: ); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update MaxString Id to new StringId // @@ -1552,9 +1552,9 @@ Done: // Free the allocated new string Package when new string can't be added. // RemoveEntryList (&StringPackage->StringEntry); - FreePool (StringPackage->StringBlock); - FreePool (StringPackage->StringPkgHdr); - FreePool (StringPackage); + FreePool(StringPackage->StringBlock); + FreePool(StringPackage->StringPkgHdr); + FreePool(StringPackage); } // // The contents of HiiDataBase may updated,need to check. @@ -1564,7 +1564,7 @@ Done: // Only after ReadyToBoot to do the export. // if (gExportAfterReadyToBoot) { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { HiiGetDatabaseInfo(&Private->HiiDatabase); } } @@ -1675,7 +1675,7 @@ HiiGetString ( ) { StringPackage = CR (Link, HII_STRING_PACKAGE_INSTANCE, StringEntry, HII_STRING_PACKAGE_SIGNATURE); Status = GetStringWorker (Private, StringPackage, StringId, NULL, NULL, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_INVALID_LANGUAGE; } } @@ -1763,7 +1763,7 @@ HiiSetString ( (EFI_STRING) String, (EFI_FONT_INFO *) StringFontInfo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiReleaseLock (&mHiiDatabaseLock); return Status; } @@ -2059,14 +2059,14 @@ HiiCompareLanguage ( // // Return FALSE if any characters are different. // - FreePool (Lan1); - FreePool (Lan2); + FreePool(Lan1); + FreePool(Lan2); return FALSE; } } - FreePool (Lan1); - FreePool (Lan2); + FreePool(Lan1); + FreePool(Lan2); // // Only return TRUE if Language2[Index] is a Null-terminator which means diff --git a/MdeModulePkg/Universal/HiiResourcesSampleDxe/HiiResourcesSample.c b/MdeModulePkg/Universal/HiiResourcesSampleDxe/HiiResourcesSample.c index 01cbf37fb..7adcd98dd 100644 --- a/MdeModulePkg/Universal/HiiResourcesSampleDxe/HiiResourcesSample.c +++ b/MdeModulePkg/Universal/HiiResourcesSampleDxe/HiiResourcesSample.c @@ -82,7 +82,7 @@ HiiResourcesSampleInit ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -95,7 +95,7 @@ HiiResourcesSampleInit ( EFI_NATIVE_INTERFACE, &mHiiVendorDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -108,7 +108,7 @@ HiiResourcesSampleInit ( mDriverHandle, &mHiiHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Universal/LegacyRegion2Dxe/LegacyRegion2.c b/MdeModulePkg/Universal/LegacyRegion2Dxe/LegacyRegion2.c index c1278157a..72a71bb66 100644 --- a/MdeModulePkg/Universal/LegacyRegion2Dxe/LegacyRegion2.c +++ b/MdeModulePkg/Universal/LegacyRegion2Dxe/LegacyRegion2.c @@ -245,7 +245,7 @@ LegacyRegion2Install ( &gEfiLegacyRegion2ProtocolGuid, &mLegacyRegion2, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c index 4af2da05e..4ebf1df7e 100644 --- a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c +++ b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c @@ -112,7 +112,7 @@ LoadFileOnFv2LoadFile ( &Pe32BufferSize, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -220,7 +220,7 @@ CreateFileDevicePath ( SetDevicePathEndNode (NextDevicePathNode (&FilePath->Header)); DevicePath = AppendDevicePath (DevicePath, FileDevicePath); - FreePool (FileDevicePath); + FreePool(FileDevicePath); } return DevicePath; @@ -255,7 +255,7 @@ InstallFileLoadProtocol ( DEBUG ((DEBUG_INFO, "LoadFileOnFv2:Find a FV!\n")); Status = gBS->HandleProtocol (Handle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->HandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb); Fvb->GetPhysicalAddress (Fvb, &Address); DEBUG ((DEBUG_INFO, "LoadFileOnFv2:Fvb->Address=%x \n", Address)); @@ -269,7 +269,7 @@ InstallFileLoadProtocol ( Key = 0; while (TRUE) { Status = Fv->GetNextFile (Fv, &Key, &FileType, &NameGuid, &Attributes, &Size); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -283,7 +283,7 @@ InstallFileLoadProtocol ( &UiNameSize, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } if (!IsInPrivateList (&NameGuid)) { @@ -300,12 +300,12 @@ InstallFileLoadProtocol ( &gEfiLoadFileProtocolGuid, &Private->LoadFile, NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { InsertTailList (&mPrivateDataList, &Private->Link); } else { DEBUG ((DEBUG_ERROR, "Application with the same name %s has been installed.!\n", UiName)); - FreePool (Private->DevicePath); - FreePool (Private); + FreePool(Private->DevicePath); + FreePool(Private); } } } @@ -350,7 +350,7 @@ FvNotificationEvent ( Handle ); if (EFI_BUFFER_TOO_SMALL == Status) { - FreePool (Handle); + FreePool(Handle); Handle = AllocateZeroPool (BufferSize); if (Handle == NULL) { return; @@ -362,10 +362,10 @@ FvNotificationEvent ( &BufferSize, Handle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } - } else if (EFI_ERROR (Status)) { + } else if (EFI_ERROR(Status)) { return; } @@ -378,7 +378,7 @@ FvNotificationEvent ( InstallFileLoadProtocol (*CurHandle); } if (Handle != NULL) { - FreePool (Handle); + FreePool(Handle); } } diff --git a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c index f11c3a17e..7314198e8 100644 --- a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c +++ b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c @@ -406,7 +406,7 @@ SmmLockBoxEntryPoint ( &gEfiSmmLockBoxCommunicationGuid, &DispatchHandle ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register SMM Ready To Lock Protocol notification @@ -416,7 +416,7 @@ SmmLockBoxEntryPoint ( SmmReadyToLockEventNotify, &Registration ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install NULL to DXE data base as notify @@ -428,7 +428,7 @@ SmmLockBoxEntryPoint ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/LightMemoryTest.c b/MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/LightMemoryTest.c index ce9e5e659..18746ca8f 100644 --- a/MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/LightMemoryTest.c +++ b/MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/LightMemoryTest.c @@ -127,7 +127,7 @@ DestroyLinkList ( while (Link != &Private->NonTestedMemRanList) { RemoveEntryList (Link); NontestedRange = NONTESTED_MEMORY_RANGE_FROM_LINK (Link); - gBS->FreePool (NontestedRange); + gBS->FreePool(NontestedRange); Link = Private->NonTestedMemRanList.BackLink;; } } @@ -154,7 +154,7 @@ ConvertToTestedMemory ( BaseAddress, Length ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gDS->AddMemorySpace ( ((Capabilities & EFI_MEMORY_MORE_RELIABLE) == EFI_MEMORY_MORE_RELIABLE) ? EfiGcdMemoryTypeMoreReliable : EfiGcdMemoryTypeSystemMemory, @@ -232,7 +232,7 @@ DirectRangeTest ( // Verify the memory range // Status = VerifyMemory (Private, StartAddress, Length); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // @@ -489,7 +489,7 @@ InitializeMemoryTest ( NULL, (VOID **) &Cpu ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Private->Cpu = Cpu; } // @@ -611,7 +611,7 @@ GenPerformMemoryTest ( WriteMemory (Private, mCurrentAddress, BlockBoundary); Status = VerifyMemory (Private, mCurrentAddress, BlockBoundary); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If perform here, means there is mis-compare error, and no agent can // handle it, so we return to BDS EFI_DEVICE_ERROR. @@ -680,7 +680,7 @@ GenMemoryTestFinished ( // Perform Data and Address line test // Status = PerformAddressDataLineTest (Private); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Add the non tested memory range to system memory map through GCD service @@ -739,7 +739,7 @@ GenCompatibleRangeTest ( CurrentBase, &Descriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -757,7 +757,7 @@ GenCompatibleRangeTest ( CurrentLength, Descriptor.Capabilities ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } diff --git a/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c b/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c index 9c016106b..2503cce4f 100644 --- a/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c +++ b/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c @@ -47,7 +47,7 @@ GenericMemoryTestEntryPoint ( EFI_NATIVE_INTERFACE, &mGenericMemoryTest ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -74,7 +74,7 @@ ConvertToTestedMemory ( BaseAddress, Length ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gDS->AddMemorySpace ( ((Capabilities & EFI_MEMORY_MORE_RELIABLE) == EFI_MEMORY_MORE_RELIABLE) ? EfiGcdMemoryTypeMoreReliable : EfiGcdMemoryTypeSystemMemory, @@ -131,7 +131,7 @@ InitializeMemoryTest ( MemorySpaceMap[Index].Length, MemorySpaceMap[Index].Capabilities ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mTestedSystemMemory += MemorySpaceMap[Index].Length; mTotalSystemMemory += MemorySpaceMap[Index].Length; } else if ((MemorySpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeSystemMemory) || @@ -140,7 +140,7 @@ InitializeMemoryTest ( } } - FreePool (MemorySpaceMap); + FreePool(MemorySpaceMap); *RequireSoftECCInit = FALSE; return EFI_SUCCESS; @@ -253,7 +253,7 @@ GenCompatibleRangeTest ( CurrentBase, &Descriptor ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -270,7 +270,7 @@ GenCompatibleRangeTest ( CurrentLength, Descriptor.Capabilities ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } diff --git a/MdeModulePkg/Universal/Metronome/Metronome.c b/MdeModulePkg/Universal/Metronome/Metronome.c index fdee1e39a..c81600cbd 100644 --- a/MdeModulePkg/Universal/Metronome/Metronome.c +++ b/MdeModulePkg/Universal/Metronome/Metronome.c @@ -113,7 +113,7 @@ InstallMetronome ( &gEfiMetronomeArchProtocolGuid, &mMetronome, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounter.c b/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounter.c index f74b0b8a1..c97498dc5 100644 --- a/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounter.c +++ b/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounter.c @@ -220,7 +220,7 @@ MonotonicCounterDriverInitialize ( NULL, &mEfiMtcEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Read the last high part @@ -233,7 +233,7 @@ MonotonicCounterDriverInitialize ( &BufferSize, &HighCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { HighCount = 0; } // @@ -263,7 +263,7 @@ MonotonicCounterDriverInitialize ( NULL, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c index cdb9b4fac..153256f1e 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c @@ -144,7 +144,7 @@ PcdDxeInit ( &gEfiPcdProtocolGuid, &mEfiPcdInstance, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install GET_PCD_INFO_PROTOCOL to handle dynamic type PCD @@ -156,7 +156,7 @@ PcdDxeInit ( &gEfiGetPcdInfoProtocolGuid, &mEfiGetPcdInfoInstance, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register callback function upon VariableLockProtocol @@ -310,7 +310,7 @@ DxePcdSetSku ( if (SkuId == SkuIdTable[Index + 1]) { DEBUG ((DEBUG_INFO, "PcdDxe - SkuId is found in SkuId table.\n")); Status = UpdatePcdDatabase (SkuId, TRUE); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { mPcdDatabase.DxeDb->SystemSkuId = (SKU_ID) SkuId; DEBUG ((DEBUG_INFO, "PcdDxe - Set current SKU Id to 0x%lx.\n", (SKU_ID) SkuId)); return; @@ -1320,7 +1320,7 @@ DxePcdGetNextTokenSpace ( ); CopyMem (TmpTokenSpaceBuffer, PeiTokenSpaceTable, sizeof (EFI_GUID*) * PeiTokenSpaceTableSize); TmpTokenSpaceBufferCount = PeiTokenSpaceTableSize; - FreePool (PeiTokenSpaceTable); + FreePool(PeiTokenSpaceTable); } if (!DxeExMapTableEmpty) { @@ -1347,7 +1347,7 @@ DxePcdGetNextTokenSpace ( } TmpTokenSpaceBufferCount = Idx3; - FreePool (DxeTokenSpaceTable); + FreePool(DxeTokenSpaceTable); } } diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index ea7edc3cb..402442ac3 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -479,7 +479,7 @@ GetWorker ( // CopyMem (VaraiableDefaultBuffer, Data + VariableHead->Offset, GetSize); } - FreePool (Data); + FreePool(Data); } RetPtr = (VOID *) VaraiableDefaultBuffer; break; @@ -611,7 +611,7 @@ DxeUnRegisterCallBackWorker ( // the Link List and return EFI_SUCCESS. // RemoveEntryList (ListNode); - FreePool (FnTableEntry); + FreePool(FnTableEntry); return EFI_SUCCESS; } @@ -743,7 +743,7 @@ LocateExPcdBinary ( (VOID **) &mDxePcdDbBinary, &mDxePcdDbSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Check the first bytes (Header Signature Guid) and build version. @@ -890,7 +890,7 @@ BuildPcdDxeDataBase ( // if (mPcdDatabase.PeiDb->SystemSkuId != 0) { Status = UpdatePcdDatabase (mPcdDatabase.PeiDb->SystemSkuId, FALSE); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } mPcdDatabase.DxeDb->SystemSkuId = mPcdDatabase.PeiDb->SystemSkuId; } else { @@ -1489,7 +1489,7 @@ SetHiiVariable ( Buffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); CopyMem ((UINT8 *)Buffer + Offset, Data, DataSize); @@ -1505,7 +1505,7 @@ SetHiiVariable ( Buffer ); - FreePool (Buffer); + FreePool(Buffer); return Status; } else if (Status == EFI_NOT_FOUND) { // @@ -1537,7 +1537,7 @@ SetHiiVariable ( Buffer ); - FreePool (Buffer); + FreePool(Buffer); return Status; } @@ -1868,7 +1868,7 @@ VariableLockDynamicHiiPcd ( Guid = GuidTable + VariableHead->GuidTableIndex; Name = (UINT16*) (StringTable + VariableHead->StringIndex); Status = VariableLock->RequestToLock (VariableLock, Name, Guid); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } } @@ -1893,7 +1893,7 @@ VariableLockCallBack ( EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock; Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { VariableLockDynamicHiiPcd (TRUE, VariableLock); VariableLockDynamicHiiPcd (FALSE, VariableLock); } diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.c b/MdeModulePkg/Universal/PCD/Pei/Pcd.c index 9c6346924..93edc3b41 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Pcd.c +++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.c @@ -219,7 +219,7 @@ PcdSetNvStoreDefaultIdCallBack ( PcdToken(PcdSetNvStoreDefaultId), PcdSetNvStoreDefaultIdCallBack ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -250,7 +250,7 @@ EndOfPeiSignalPpiNotifyCallback ( PEI_PCD_DATABASE *PeiPcdDb; Status = PeiServicesGetBootMode(&BootMode); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Don't need to report it on S3 boot. @@ -280,14 +280,14 @@ EndOfPeiSignalPpiNotifyCallback ( // // Error should not happen // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Find PcdDb file from the beginning in this firmware volume. // FileHandle = NULL; Status = PeiServicesFfsFindFileByName (&gEfiCallerIdGuid, VolumeHandle, &FileHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Find PcdPeim FileHandle in this volume // @@ -303,7 +303,7 @@ EndOfPeiSignalPpiNotifyCallback ( // Find PEI PcdDb and Build second PcdDB GuidHob // Status = PeiServicesFfsFindSectionData (EFI_SECTION_RAW, FileHandle, &PcdDb); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Length = PeiPcdDb->LengthForAllSkus; Database = BuildGuidHob (&gPcdDataBaseHobGuid, Length); CopyMem (Database, PcdDb, Length); @@ -345,23 +345,23 @@ PcdPeimInit ( // Install PCD_PPI and EFI_PEI_PCD_PPI. // Status = PeiServicesInstallPpi (&mPpiList[0]); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install GET_PCD_INFO_PPI and EFI_GET_PCD_INFO_PPI. // Status = PeiServicesInstallPpi (&mPpiList2[0]); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PeiServicesNotifyPpi (&mEndOfPeiSignalPpiNotifyList[0]); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = PeiRegisterCallBackOnSet ( &gEfiMdeModulePkgTokenSpaceGuid, PcdToken(PcdSetNvStoreDefaultId), PcdSetNvStoreDefaultIdCallBack ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -515,14 +515,14 @@ PeiPcdSetSku ( // // Error should not happen // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Find PcdDb file from the beginning in this firmware volume. // FileHandle = NULL; Status = PeiServicesFfsFindFileByName (&gEfiCallerIdGuid, VolumeHandle, &FileHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Find PcdPeim FileHandle in this volume // @@ -538,7 +538,7 @@ PeiPcdSetSku ( // Find the delta data between the different Skus // Status = PeiServicesFfsFindSectionData (EFI_SECTION_RAW, FileHandle, &PcdDb); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Length = PeiPcdDb->LengthForAllSkus; Index = (PeiPcdDb->Length + 7) & (~7); SkuDelta = NULL; diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c b/MdeModulePkg/Universal/PCD/Pei/Service.c index 5b037353a..267b97e39 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Service.c +++ b/MdeModulePkg/Universal/PCD/Pei/Service.c @@ -397,7 +397,7 @@ LocateExPcdBinary ( ASSERT (FileHandle != NULL); Status = PeiServicesFfsFindSectionData (EFI_SECTION_RAW, FileHandle, &PcdDb); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Check the first bytes (Header Signature Guid) and build version. @@ -478,7 +478,7 @@ GetHiiVariable ( EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariablePpi; Status = PeiServicesLocatePpi (&gEfiPeiReadOnlyVariable2PpiGuid, 0, NULL, (VOID **) &VariablePpi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Size = 0; Status = VariablePpi->GetVariable ( @@ -492,7 +492,7 @@ GetHiiVariable ( if (Status == EFI_BUFFER_TOO_SMALL) { Status = PeiServicesAllocatePool (Size, &Buffer); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = VariablePpi->GetVariable ( VariablePpi, @@ -502,7 +502,7 @@ GetHiiVariable ( &Size, Buffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); *VariableSize = Size; *VariableData = Buffer; diff --git a/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c b/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c index 41fa92911..8dd557401 100644 --- a/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c +++ b/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c @@ -305,7 +305,7 @@ PeimInitializePciCfg ( (**(EFI_PEI_SERVICES **)PeiServices).PciCfg = &gPciCfg2Ppi; Status = PeiServicesInstallPpi (&gPciCfg2PpiList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c index 045c57415..91c73a86e 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c @@ -157,7 +157,7 @@ GetComponentNameWorker ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -179,11 +179,11 @@ GetComponentNameWorker ( BestLanguage, &DriverName ); - FreePool (BestLanguage); + FreePool(BestLanguage); } if (Language != NULL) { - FreePool (Language); + FreePool(Language); } return DriverName; @@ -275,7 +275,7 @@ GetImageName ( // // Locate Image EFI UI section to get the image name. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Fv2->ReadSection ( Fv2, &FvFilePath->FvFileName, @@ -285,15 +285,15 @@ GetImageName ( &BufferSize, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { - FreePool (AlignedDevPathNode); + if (!EFI_ERROR(Status)) { + FreePool(AlignedDevPathNode); break; } Buffer = NULL; } } - FreePool (AlignedDevPathNode); + FreePool(AlignedDevPathNode); // // Next device path node @@ -395,7 +395,7 @@ UpdateDeviceSelectPage ( if (HiiSetString (Private->RegisteredHandle, NewStringToken, NewString, NULL) == 0) { ASSERT (FALSE); } - FreePool (NewString); + FreePool(NewString); NewStringToken = STRING_TOKEN (STR_FIRST_REFRESH_HELP); NewString = HiiGetString (Private->RegisteredHandle, STRING_TOKEN (STR_REFRESH_HELP), NULL); @@ -403,7 +403,7 @@ UpdateDeviceSelectPage ( if (HiiSetString (Private->RegisteredHandle, NewStringToken, NewString, NULL) == 0) { ASSERT (FALSE); } - FreePool (NewString); + FreePool(NewString); // // created needed controller device item in first page @@ -416,7 +416,7 @@ UpdateDeviceSelectPage ( &DevicePathHandleCount, &mDevicePathHandleBuffer ); - if (EFI_ERROR (Status) || (DevicePathHandleCount == 0)) { + if (EFI_ERROR(Status) || (DevicePathHandleCount == 0)) { return EFI_SUCCESS; } @@ -444,7 +444,7 @@ UpdateDeviceSelectPage ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } // @@ -455,7 +455,7 @@ UpdateDeviceSelectPage ( &gEfiBusSpecificDriverOverrideProtocolGuid, (VOID **) &BusSpecificDriverOverride ); - if (EFI_ERROR (Status) || BusSpecificDriverOverride == NULL) { + if (EFI_ERROR(Status) || BusSpecificDriverOverride == NULL) { continue; } } @@ -469,7 +469,7 @@ UpdateDeviceSelectPage ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Save the device path protocol interface // @@ -487,7 +487,7 @@ UpdateDeviceSelectPage ( NewStrSize = Len + StrSize (L"--"); NewString = AllocateZeroPool (NewStrSize); ASSERT (NewString != NULL); - if (EFI_ERROR (CheckMapping (ControllerDevicePath,NULL, &mMappingDataBase, NULL, NULL))) { + if (EFI_ERROR(CheckMapping (ControllerDevicePath,NULL, &mMappingDataBase, NULL, NULL))) { StrCatS (NewString, NewStrSize/sizeof(CHAR16), L"--"); } else { StrCatS (NewString, NewStrSize/sizeof(CHAR16), L"**"); @@ -496,7 +496,7 @@ UpdateDeviceSelectPage ( NewStringToken = HiiSetString (Private->RegisteredHandle, mControllerToken[Index], NewString, NULL); ASSERT (NewStringToken != 0); - FreePool (NewString); + FreePool(NewString); // // Save the device path string toke for next access use // @@ -566,7 +566,7 @@ GetDriverBindingHandleFromImageHandle ( &DriverBindingHandleCount, &DriverBindingHandleBuffer ); - if (EFI_ERROR (Status) || (DriverBindingHandleCount == 0)) { + if (EFI_ERROR(Status) || (DriverBindingHandleCount == 0)) { return NULL; } @@ -583,7 +583,7 @@ GetDriverBindingHandleFromImageHandle ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -593,7 +593,7 @@ GetDriverBindingHandleFromImageHandle ( } } - FreePool (DriverBindingHandleBuffer); + FreePool(DriverBindingHandleBuffer); return DriverBindingHandle; } @@ -700,7 +700,7 @@ UpdateBindingDriverSelectPage ( &DriverImageHandleCount, &mDriverImageHandleBuffer ); - if (EFI_ERROR (Status) || (DriverImageHandleCount == 0)) { + if (EFI_ERROR(Status) || (DriverImageHandleCount == 0)) { return EFI_NOT_FOUND; } @@ -733,7 +733,7 @@ UpdateBindingDriverSelectPage ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mDriSelection[Index] = FALSE; continue; } @@ -766,13 +766,13 @@ UpdateBindingDriverSelectPage ( // only care the driver which is in a Pci device option rom, // and the driver's LoadedImage->DeviceHandle must point to a pci device which has efi option rom // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol( LoadedImage->DeviceHandle, &gEfiBusSpecificDriverOverrideProtocolGuid, (VOID **) &BusSpecificDriverOverride ); - if (EFI_ERROR (Status) || BusSpecificDriverOverride == NULL) { + if (EFI_ERROR(Status) || BusSpecificDriverOverride == NULL) { mDriSelection[Index] = FALSE; continue; } @@ -814,7 +814,7 @@ UpdateBindingDriverSelectPage ( NewStrSize = StrSize (DriverName); NewString = AllocateZeroPool (NewStrSize); ASSERT (NewString != NULL); - if (EFI_ERROR (CheckMapping (mControllerDevicePathProtocol[mSelectedCtrIndex], LoadedImageDevicePath, &mMappingDataBase, NULL, NULL))) { + if (EFI_ERROR(CheckMapping (mControllerDevicePathProtocol[mSelectedCtrIndex], LoadedImageDevicePath, &mMappingDataBase, NULL, NULL))) { mDriSelection[Index] = FALSE; } else { mDriSelection[Index] = TRUE; @@ -824,9 +824,9 @@ UpdateBindingDriverSelectPage ( NewStringToken = HiiSetString (Private->RegisteredHandle, mDriverImageToken[Index], NewString, NULL); ASSERT (NewStringToken != 0); mDriverImageToken[Index] = NewStringToken; - FreePool (NewString); + FreePool(NewString); if (FreeDriverName) { - FreePool (DriverName); + FreePool(DriverName); } // @@ -841,8 +841,8 @@ UpdateBindingDriverSelectPage ( NewStringHelpToken = HiiSetString (Private->RegisteredHandle, DriverImageFilePathToken[Index], NewString, NULL); ASSERT (NewStringHelpToken != 0); DriverImageFilePathToken[Index] = NewStringHelpToken; - FreePool (NewString); - FreePool (DriverName); + FreePool(NewString); + FreePool(DriverName); CheckFlags = 0; if (mDriSelection[Index]) { @@ -877,11 +877,11 @@ UpdateBindingDriverSelectPage ( HiiFreeOpCodeHandle (EndOpCodeHandle); if (DriverImageProtocol != NULL) { - FreePool (DriverImageProtocol); + FreePool(DriverImageProtocol); } if (DriverImageFilePathToken != NULL) { - FreePool (DriverImageFilePathToken); + FreePool(DriverImageFilePathToken); } return EFI_SUCCESS; @@ -1213,7 +1213,7 @@ PlatOverMngrExtractConfig ( AllocatedRequest = TRUE; BufferSize = sizeof (PLAT_OVER_MNGR_DATA); UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); - FreePool (ConfigRequestHdr); + FreePool(ConfigRequestHdr); } // @@ -1232,7 +1232,7 @@ PlatOverMngrExtractConfig ( // Free the allocated config request string. // if (AllocatedRequest) { - FreePool (ConfigRequest); + FreePool(ConfigRequest); ConfigRequest = NULL; } // @@ -1424,7 +1424,7 @@ PlatOverMngrCallback ( case KEY_VALUE_ORDER_SAVE_AND_EXIT: Status = CommitChanges (Private, KeyValue, FakeNvData); *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Single Override Info too large, Saving Error!", NULL); return EFI_DEVICE_ERROR; } @@ -1493,7 +1493,7 @@ GetDriver ( mEnvironmentVariableRead = TRUE; Status = InitOverridesMapping (&mMappingDataBase); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ DEBUG ((DEBUG_INFO, "The status to Get Platform Driver Override Variable is %r\n", Status)); InitializeListHead (&mMappingDataBase); return EFI_NOT_FOUND; @@ -1600,7 +1600,7 @@ PlatDriOverrideDxeInit ( NULL, (VOID **) &FormBrowser2 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1617,7 +1617,7 @@ PlatDriOverrideDxeInit ( // // If there was no error, assume there is an installation and return error // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_ALREADY_STARTED; } @@ -1643,7 +1643,7 @@ PlatDriOverrideDxeInit ( NULL, (VOID **) &mCallbackInfo->HiiConfigRouting ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Finish; } @@ -1661,7 +1661,7 @@ PlatDriOverrideDxeInit ( &mCallbackInfo->PlatformDriverOverride, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Finish; } @@ -1726,18 +1726,18 @@ PlatDriOverrideDxeUnload ( HiiRemovePackages (mCallbackInfo->RegisteredHandle); } - FreePool (mCallbackInfo); + FreePool(mCallbackInfo); if (mControllerToken != NULL) { - FreePool (mControllerToken); + FreePool(mControllerToken); } if (mControllerDevicePathProtocol != NULL) { - FreePool (mControllerDevicePathProtocol); + FreePool(mControllerDevicePathProtocol); } if (mDriverImageToken != NULL) { - FreePool (mDriverImageToken); + FreePool(mDriverImageToken); } return EFI_SUCCESS; diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c index 2d3736b46..85dea492a 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c @@ -93,9 +93,9 @@ PopDevPathStack ( if (DevicePath != NULL) { *DevicePath = DuplicateDevicePath (DevicePathStackItem->DevicePath); } - FreePool (DevicePathStackItem->DevicePath); + FreePool(DevicePathStackItem->DevicePath); RemoveEntryList (&DevicePathStackItem->Link); - FreePool (DevicePathStackItem); + FreePool(DevicePathStackItem); return EFI_SUCCESS; } return EFI_NOT_FOUND; @@ -253,13 +253,13 @@ UpdateFvFileDevicePath ( &TempDevicePath, &FoundFvHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol ( FoundFvHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **) &Fv ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Set FV ReadFile Buffer as NULL, only need to check whether input Fv file exist there // @@ -272,7 +272,7 @@ UpdateFvFileDevicePath ( &Attributes, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_ALREADY_STARTED; } } @@ -289,13 +289,13 @@ UpdateFvFileDevicePath ( &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol ( LoadedImage->DeviceHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **) &Fv ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Fv->ReadFile ( Fv, FileGuid, @@ -305,7 +305,7 @@ UpdateFvFileDevicePath ( &Attributes, &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { FindFvFile = TRUE; FoundFvHandle = LoadedImage->DeviceHandle; } @@ -338,7 +338,7 @@ UpdateFvFileDevicePath ( &Attributes, &AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Skip if input Fv file not in the FV // @@ -410,7 +410,7 @@ GetVariableAndSize ( // Read variable into the allocated buffer. // Status = gRT->GetVariable (Name, VendorGuid, NULL, &BufferSize, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { BufferSize = 0; } } @@ -493,7 +493,7 @@ ConnectDevicePath ( RemainingDevicePath = Instance; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Handle == PreviousHandle) { // // If no forward progress is made try invoking the Dispatcher. @@ -505,7 +505,7 @@ ConnectDevicePath ( Status = gDS->Dispatch (); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PreviousHandle = Handle; // // Connect all drivers that apply to Handle and RemainingDevicePath, @@ -528,12 +528,12 @@ ConnectDevicePath ( // // Loop until RemainingDevicePath is an empty device path // - } while (!EFI_ERROR (Status) && !IsDevicePathEnd (RemainingDevicePath)); + } while (!EFI_ERROR(Status) && !IsDevicePathEnd (RemainingDevicePath)); } while (DevicePath != NULL); if (CopyOfDevicePath != NULL) { - FreePool (CopyOfDevicePath); + FreePool(CopyOfDevicePath); } // // All handle with DevicePath exists in the handle database @@ -572,7 +572,7 @@ FreeMappingDatabase ( // Free PLATFORM_OVERRIDE_ITEM.ControllerDevicePath[] // if (OverrideItem->ControllerDevicePath != NULL){ - FreePool (OverrideItem->ControllerDevicePath); + FreePool(OverrideItem->ControllerDevicePath); } ImageInfoListIndex = GetFirstNode (&OverrideItem->DriverInfoList); @@ -589,14 +589,14 @@ FreeMappingDatabase ( // ImageInfoListIndex = GetNextNode (&OverrideItem->DriverInfoList, ImageInfoListIndex); RemoveEntryList (&DriverImageInfo->Link); - FreePool (DriverImageInfo); + FreePool(DriverImageInfo); } // // Free PLATFORM_OVERRIDE_ITEM itself // OverrideItemListIndex = GetNextNode (MappingDataBase, OverrideItemListIndex); RemoveEntryList (&OverrideItem->Link); - FreePool (OverrideItem); + FreePool(OverrideItem); } InitializeListHead (MappingDataBase); @@ -787,7 +787,7 @@ InitOverridesMapping ( } } - FreePool (VariableBuffer); + FreePool(VariableBuffer); if (Corrupted) { FreeMappingDatabase (MappingDataBase); return EFI_VOLUME_CORRUPTED; @@ -894,7 +894,7 @@ DeleteOverridesVariables ( // Check NotEnd to get all PlatDriOverX variable(s) // while ((VariableBuffer != NULL) && ((*(UINT32*)VariableBuffer) != 0)) { - FreePool (VariableBuffer); + FreePool(VariableBuffer); UnicodeSPrint (OverrideVariableName, sizeof (OverrideVariableName), L"PlatDriOver%d", VariableNum); VariableBuffer = GetVariableAndSize (OverrideVariableName, &gEfiCallerIdGuid, &BufferSize); VariableNum++; @@ -910,7 +910,7 @@ DeleteOverridesVariables ( 0, NULL ); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); for (Index = 1; Index < VariableNum; Index++) { UnicodeSPrint (OverrideVariableName, sizeof (OverrideVariableName), L"PlatDriOver%d", Index); Status = gRT->SetVariable ( @@ -920,7 +920,7 @@ DeleteOverridesVariables ( 0, NULL ); - ASSERT (!EFI_ERROR (Status)); + ASSERT (!EFI_ERROR(Status)); } return EFI_SUCCESS; } @@ -1083,9 +1083,9 @@ SaveOverridesMapping ( VariableNeededSize, VariableBuffer ); - FreePool (VariableBuffer); + FreePool(VariableBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (NumIndex > 0) { // // Delete all PlatDriOver variables when full mapping can't be set. @@ -1139,7 +1139,7 @@ GetBindingProtocolFromImageHandle ( &DriverBindingHandleCount, &DriverBindingHandleBuffer ); - if (EFI_ERROR (Status) || (DriverBindingHandleCount == 0)) { + if (EFI_ERROR(Status) || (DriverBindingHandleCount == 0)) { return NULL; } @@ -1153,13 +1153,13 @@ GetBindingProtocolFromImageHandle ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } if (DriverBindingInterface->ImageHandle == ImageHandle) { *BindingHandle = DriverBindingHandleBuffer[Index]; - FreePool (DriverBindingHandleBuffer); + FreePool(DriverBindingHandleBuffer); return DriverBindingInterface; } } @@ -1167,7 +1167,7 @@ GetBindingProtocolFromImageHandle ( // // If no Driver Binding Protocol instance is found // - FreePool (DriverBindingHandleBuffer); + FreePool(DriverBindingHandleBuffer); *BindingHandle = NULL; return NULL; } @@ -1261,7 +1261,7 @@ GetDriverFromMapping ( &gEfiDevicePathProtocolGuid, (VOID **) &ControllerDevicePath ); - if (EFI_ERROR (Status) || ControllerDevicePath == NULL) { + if (EFI_ERROR(Status) || ControllerDevicePath == NULL) { return EFI_INVALID_PARAMETER; } @@ -1334,8 +1334,8 @@ GetDriverFromMapping ( // use this function could promise the FV file device path is right. // Status = UpdateFvFileDevicePath (&TempDriverImagePath, NULL, CallerImageHandle); - if (!EFI_ERROR (Status)) { - FreePool (DriverImageInfo->DriverImagePath); + if (!EFI_ERROR(Status)) { + FreePool(DriverImageInfo->DriverImagePath); DriverImageInfo->DriverImagePath = TempDriverImagePath; } // @@ -1350,7 +1350,7 @@ GetDriverFromMapping ( &ImageHandleCount, &ImageHandleBuffer ); - if (EFI_ERROR (Status) || (ImageHandleCount == 0)) { + if (EFI_ERROR(Status) || (ImageHandleCount == 0)) { return EFI_NOT_FOUND; } @@ -1364,7 +1364,7 @@ GetDriverFromMapping ( &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &LoadedImageDevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Maybe not all EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL existed. // @@ -1422,13 +1422,13 @@ GetDriverFromMapping ( &gEfiBusSpecificDriverOverrideProtocolGuid, (VOID **) &BusSpecificDriverOverride ); - if (!EFI_ERROR (Status) && (BusSpecificDriverOverride != NULL)) { + if (!EFI_ERROR(Status) && (BusSpecificDriverOverride != NULL)) { ImageHandle = NULL; Status = BusSpecificDriverOverride->GetDriver ( BusSpecificDriverOverride, &ImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Find its related driver binding protocol // Driver binding handle may be different with its driver's Image handle @@ -1464,12 +1464,12 @@ GetDriverFromMapping ( 0, &ImageHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Try to start the driver // Status = gBS->StartImage (ImageHandle, NULL, NULL); - if (EFI_ERROR (Status)){ + if (EFI_ERROR(Status)){ DriverImageInfo->UnStartable = TRUE; DriverImageInfo->ImageHandle = NULL; } else { @@ -1491,7 +1491,7 @@ GetDriverFromMapping ( } } } - FreePool (ImageHandleBuffer); + FreePool(ImageHandleBuffer); } } ImageInfoListIndex = GetNextNode (&OverrideItem->DriverInfoList, ImageInfoListIndex); @@ -1839,7 +1839,7 @@ DeleteDriverImage ( NULL, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -1917,7 +1917,7 @@ DeleteDriverImage ( if (OverrideItem->DriverInfoNum == 0) { FreePool(OverrideItem->ControllerDevicePath); RemoveEntryList (&OverrideItem->Link); - FreePool (OverrideItem); + FreePool(OverrideItem); } if (!Found) { diff --git a/MdeModulePkg/Universal/PrintDxe/Print.c b/MdeModulePkg/Universal/PrintDxe/Print.c index c417a2c81..c4abcbef9 100644 --- a/MdeModulePkg/Universal/PrintDxe/Print.c +++ b/MdeModulePkg/Universal/PrintDxe/Print.c @@ -157,7 +157,7 @@ PrintEntryPoint ( &gEfiPrint2SProtocolGuid, &mPrint2SProtocol, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c index b6a58c6a5..46293b52e 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c @@ -22,5 +22,5 @@ int EFIAPI sprintf_s(char *str, size_t sizeOfBuffer, char const *fmt, ...) int OnigStrCmp (char* Str1, char* Str2) { - return (int)AsciiStrCmp (Str1, Str2); + return (int)AsciiStrCmp(Str1, Str2); } diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.h b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.h index fb53cbf98..1f89ba969 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.h +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.h @@ -31,7 +31,7 @@ typedef UINTN size_t; \ EvalOnce = (p); \ if (EvalOnce != NULL) { \ - FreePool (EvalOnce); \ + FreePool(EvalOnce); \ } \ } while (FALSE) diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c index d1324c135..afe575b76 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c @@ -177,13 +177,13 @@ OnigurumaMatch ( } } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { for (Index = 0; Index < *CapturesCount; ++Index) { if ((*Captures)[Index].CapturePtr != NULL) { - FreePool ((CHAR16*)(*Captures)[Index].CapturePtr); + FreePool((CHAR16*)(*Captures)[Index].CapturePtr); } } - FreePool (*Captures); + FreePool(*Captures); } } } diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.c index cb3eab1b4..5c2f6083a 100644 --- a/MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.c +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.c @@ -290,7 +290,7 @@ GenericStatusCodePeiEntry ( // Install Report Status Code Handler PPI // Status = PeiServicesInstallPpi (mRscHandlerPpiList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install Status Code PPI. PI spec specifies that there can be only one instance @@ -304,12 +304,12 @@ GenericStatusCodePeiEntry ( &OldDescriptor, (VOID **) &OldStatusCodePpi ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PeiServicesReInstallPpi (OldDescriptor, mStatusCodePpiList); } else { Status = PeiServicesInstallPpi (mStatusCodePpiList); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c index 6ca7e180e..a120bfd86 100644 --- a/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c @@ -150,7 +150,7 @@ Register ( CallbackEntry, &CallbackEntry->Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } InsertTailList (&mCallbackListHead, &CallbackEntry->Node); @@ -192,11 +192,11 @@ Unregister ( // If the function is found in list, delete it and return. // if (CallbackEntry->Tpl != TPL_HIGH_LEVEL) { - FreePool ((VOID *) (UINTN) CallbackEntry->StatusCodeDataBuffer); + FreePool((VOID *) (UINTN) CallbackEntry->StatusCodeDataBuffer); gBS->CloseEvent (CallbackEntry->Event); } RemoveEntryList (&CallbackEntry->Node); - FreePool (CallbackEntry); + FreePool(CallbackEntry); return EFI_SUCCESS; } } @@ -310,7 +310,7 @@ ReportDispatcher ( } Status = gBS->SignalEvent (CallbackEntry->Event); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // @@ -344,14 +344,14 @@ VirtualAddressChangeCallBack ( for (Link = GetFirstNode (&mCallbackListHead); !IsNull (&mCallbackListHead, Link); Link = GetNextNode (&mCallbackListHead, Link)) { CallbackEntry = CR (Link, RSC_HANDLER_CALLBACK_ENTRY, Node, RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); Status = EfiConvertFunctionPointer (0, (VOID **) &CallbackEntry->RscHandlerCallback); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Status = EfiConvertList ( 0, &mCallbackListHead ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -384,7 +384,7 @@ GenericStatusCodeRuntimeDxeEntry ( &mStatusCodeProtocol, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, @@ -394,7 +394,7 @@ GenericStatusCodeRuntimeDxeEntry ( &gEfiEventVirtualAddressChangeGuid, &mVirtualAddressChangeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c index c3ab5cd05..8be015b6d 100644 --- a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c @@ -109,7 +109,7 @@ Unregister ( // If the function is found in list, delete it and return. // RemoveEntryList (&CallbackEntry->Node); - FreePool (CallbackEntry); + FreePool(CallbackEntry); return EFI_SUCCESS; } } @@ -216,7 +216,7 @@ GenericStatusCodeSmmEntry ( EFI_NATIVE_INTERFACE, &mSmmRscHandlerProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install SmmStatusCode Protocol @@ -227,7 +227,7 @@ GenericStatusCodeSmmEntry ( EFI_NATIVE_INTERFACE, &mSmmStatusCodeProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c index 77aedcba6..7d29467bf 100644 --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c @@ -116,7 +116,7 @@ UnregisterResetNotify ( Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link); if (Entry->ResetNotify == ResetFunction) { RemoveEntryList (&Entry->Link); - FreePool (Entry); + FreePool(Entry); return EFI_SUCCESS; } } @@ -195,7 +195,7 @@ InitializeResetSystem ( &gEdkiiPlatformSpecificResetHandlerProtocolGuid, &mPlatformSpecificResetHandler.ResetNotification, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/SectionExtractionDxe/SectionExtractionDxe.c b/MdeModulePkg/Universal/SectionExtractionDxe/SectionExtractionDxe.c index 8cf464155..1a8426f8a 100644 --- a/MdeModulePkg/Universal/SectionExtractionDxe/SectionExtractionDxe.c +++ b/MdeModulePkg/Universal/SectionExtractionDxe/SectionExtractionDxe.c @@ -235,7 +235,7 @@ CustomGuidedSectionExtract ( &SectionAttribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "GetInfo from guided section Failed - %r\n", Status)); return Status; } @@ -256,7 +256,7 @@ CustomGuidedSectionExtract ( // AllocatedOutputBuffer = AllocatePool (OutputBufferSize); if (AllocatedOutputBuffer == NULL) { - FreePool (ScratchBuffer); + FreePool(ScratchBuffer); return EFI_OUT_OF_RESOURCES; } *OutputBuffer = AllocatedOutputBuffer; @@ -271,15 +271,15 @@ CustomGuidedSectionExtract ( ScratchBuffer, AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Decode failed // if (AllocatedOutputBuffer != NULL) { - FreePool (AllocatedOutputBuffer); + FreePool(AllocatedOutputBuffer); } if (ScratchBuffer != NULL) { - FreePool (ScratchBuffer); + FreePool(ScratchBuffer); } DEBUG ((DEBUG_ERROR, "Extract guided section Failed - %r\n", Status)); return Status; @@ -303,7 +303,7 @@ CustomGuidedSectionExtract ( // Free unused scratch buffer. // if (ScratchBuffer != NULL) { - FreePool (ScratchBuffer); + FreePool(ScratchBuffer); } return EFI_SUCCESS; @@ -347,7 +347,7 @@ SectionExtractionDxeEntry ( &ExtractHandlerGuidTable [ExtractHandlerNumber], &mCustomGuidedSectionExtractionProtocol, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return EFI_SUCCESS; diff --git a/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c b/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c index 8b0c3fdcc..c0d26c705 100644 --- a/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c +++ b/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c @@ -169,7 +169,7 @@ CustomGuidedSectionExtract ( &SectionAttribute ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "GetInfo from guided section Failed - %r\n", Status)); return Status; } @@ -201,7 +201,7 @@ CustomGuidedSectionExtract ( ScratchBuffer, AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Decode failed // @@ -255,7 +255,7 @@ SectionExtractionPeiEntry ( GuidPpi->Ppi = (VOID *) &mCustomGuidedSectionExtractionPpi; GuidPpi->Guid = &ExtractHandlerGuidTable[ExtractHandlerNumber]; Status = PeiServicesInstallPpi (GuidPpi++); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } diff --git a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c index 45e5a537d..3ef35b7a9 100644 --- a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c +++ b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c @@ -71,7 +71,7 @@ FileFromFv ( &TempDevicePath, &DeviceHandle ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->OpenProtocol ( DeviceHandle, &gEfiFirmwareVolume2ProtocolGuid, @@ -80,7 +80,7 @@ FileFromFv ( NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return TRUE; } } @@ -283,7 +283,7 @@ DxeSmmReadyToLock ( VOID *Interface; Status = gBS->LocateProtocol (&gEfiDxeSmmReadyToLockProtocolGuid, NULL, &Interface); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -349,7 +349,7 @@ Defer3rdPartyImageLoad ( DevicePathStr )); if (DevicePathStr != NULL) { - FreePool (DevicePathStr); + FreePool(DevicePathStr); } ); @@ -395,7 +395,7 @@ Defer3rdPartyImageLoadInitialize ( &mDeferredImageLoad, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, @@ -405,7 +405,7 @@ Defer3rdPartyImageLoadInitialize ( &gEfiEndOfDxeEventGroupGuid, &Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); EfiCreateProtocolNotifyEvent ( &gEfiDxeSmmReadyToLockProtocolGuid, diff --git a/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c b/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c index 3ed952756..331e9ae8c 100644 --- a/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c +++ b/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c @@ -139,7 +139,7 @@ Security2StubAuthenticate ( if (FileBuffer != NULL) { Status = Defer3rdPartyImageLoad (File, BootPolicy); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -202,7 +202,7 @@ SecurityStubInitialize ( &mSecurityStub, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Defer3rdPartyImageLoadInitialize (); diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Universal/SerialDxe/SerialIo.c index fb816a161..913c9185a 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c @@ -218,7 +218,7 @@ SerialReset ( EFI_STATUS Status; Status = SerialPortInitialize (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -307,7 +307,7 @@ SerialSetAttributes ( OriginalDataBits = DataBits; OriginalStopBits = StopBits; Status = SerialPortSetAttributes (&BaudRate, &ReceiveFifoDepth, &Timeout, &Parity, &DataBits, &StopBits); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // If it is just to set Timeout value and unsupported is returned, // do not return error. @@ -542,7 +542,7 @@ SerialDxeInitialize ( // Issue a reset to initialize the Serial Port // Status = mSerialIoTemplate.Reset (&mSerialIoTemplate); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -555,7 +555,7 @@ SerialDxeInitialize ( &gEfiDevicePathProtocolGuid, &mSerialDevicePath, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c index 7f4929c2f..b999892e3 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c @@ -94,7 +94,7 @@ GrowStack ( // // Free The Old Stack // - FreePool (*Stack); + FreePool(*Stack); } // @@ -138,7 +138,7 @@ PushStack ( // Grow the stack // Status = GrowStack (Stack, StackPtr, StackEnd); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -326,7 +326,7 @@ GrowConditionalStack ( // // Free The Old Stack // - FreePool (*Stack); + FreePool(*Stack); } // @@ -369,7 +369,7 @@ PushConditionalStack ( // Grow the stack // Status = GrowConditionalStack (Stack, StackPtr, StackEnd, sizeof (FORM_EXPRESSION *)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1136,7 +1136,7 @@ IfrToString ( UINTN BufferSize; Status = PopExpression (&Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1204,9 +1204,9 @@ IfrToString ( } UnicodeSPrint (Buffer, sizeof (Buffer), PrintFormat, TmpBuf); String = Buffer; - FreePool (TmpBuf); + FreePool(TmpBuf); if (Value.Type == EFI_IFR_TYPE_BUFFER) { - FreePool (Value.Buffer); + FreePool(Value.Buffer); } break; @@ -1243,7 +1243,7 @@ IfrToUint ( CHAR16 *StringPtr; Status = PopExpression (&Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1272,18 +1272,18 @@ IfrToUint ( // Result->Value.u64 = StrDecimalToUint64 (String); } - FreePool (String); + FreePool(String); } else if (IsTypeInBuffer(&Value)) { if (GetLengthForValue (&Value) > 8) { if (Value.Type == EFI_IFR_TYPE_BUFFER) { - FreePool (Value.Buffer); + FreePool(Value.Buffer); } Result->Type = EFI_IFR_TYPE_UNDEFINED; return EFI_SUCCESS; } Result->Value.u64 = *(UINT64*) GetBufferForValue (&Value); if (Value.Type == EFI_IFR_TYPE_BUFFER) { - FreePool (Value.Buffer); + FreePool(Value.Buffer); } } else { CopyMem (Result, &Value, sizeof (EFI_HII_VALUE)); @@ -1332,12 +1332,12 @@ IfrCatenate ( ZeroMem (Value, sizeof (Value)); Status = PopExpression (&Value[0]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = PopExpression (&Value[1]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1385,19 +1385,19 @@ IfrCatenate ( } Done: if (Value[0].Buffer != NULL) { - FreePool (Value[0].Buffer); + FreePool(Value[0].Buffer); } if (Value[1].Buffer != NULL) { - FreePool (Value[1].Buffer); + FreePool(Value[1].Buffer); } if (String[0] != NULL) { - FreePool (String[0]); + FreePool(String[0]); } if (String[1] != NULL) { - FreePool (String[1]); + FreePool(String[1]); } if (StringPtr != NULL) { - FreePool (StringPtr); + FreePool(StringPtr); } return Status; @@ -1435,12 +1435,12 @@ IfrMatch ( ZeroMem (Value, sizeof (Value)); Status = PopExpression (&Value[0]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = PopExpression (&Value[1]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1463,10 +1463,10 @@ IfrMatch ( Done: if (String[0] != NULL) { - FreePool (String[0]); + FreePool(String[0]); } if (String[1] != NULL) { - FreePool (String[1]); + FreePool(String[1]); } return Status; @@ -1514,12 +1514,12 @@ IfrMatch2 ( ZeroMem (Value, sizeof (Value)); Status = PopExpression (&Value[0]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = PopExpression (&Value[1]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1560,7 +1560,7 @@ IfrMatch2 ( } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Result->Type = EFI_IFR_TYPE_UNDEFINED; Status = EFI_SUCCESS; goto Done; @@ -1573,7 +1573,7 @@ IfrMatch2 ( &gEfiRegularExpressionProtocolGuid, (VOID**)&RegularExpressionProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1596,7 +1596,7 @@ IfrMatch2 ( &RegExSyntaxTypeListSize, RegExSyntaxTypeList ); - } else if (EFI_ERROR (Status)) { + } else if (EFI_ERROR(Status)) { goto Done; } @@ -1620,7 +1620,7 @@ IfrMatch2 ( } if (RegExSyntaxTypeList != NULL) { - FreePool (RegExSyntaxTypeList); + FreePool(RegExSyntaxTypeList); } } @@ -1633,16 +1633,16 @@ IfrMatch2 ( Done: if (String[0] != NULL) { - FreePool (String[0]); + FreePool(String[0]); } if (String[1] != NULL) { - FreePool (String[1]); + FreePool(String[1]); } if (RegExSyntaxTypeList != NULL) { - FreePool (RegExSyntaxTypeList); + FreePool(RegExSyntaxTypeList); } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } return Status; } @@ -1679,17 +1679,17 @@ IfrFind ( } Status = PopExpression (&Value[0]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PopExpression (&Value[1]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PopExpression (&Value[2]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1736,10 +1736,10 @@ IfrFind ( Done: if (String[0] != NULL) { - FreePool (String[0]); + FreePool(String[0]); } if (String[1] != NULL) { - FreePool (String[1]); + FreePool(String[1]); } return Status; @@ -1774,17 +1774,17 @@ IfrMid ( ZeroMem (Value, sizeof (Value)); Status = PopExpression (&Value[0]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PopExpression (&Value[1]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PopExpression (&Value[2]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1822,7 +1822,7 @@ IfrMid ( Result->Type = EFI_IFR_TYPE_STRING; Result->Value.string = NewString (SubString, FormSet->HiiHandle); - FreePool (String); + FreePool(String); } else { BufferLen = GetLengthForValue (&Value[2]); Buffer = GetBufferForValue (&Value[2]); @@ -1839,7 +1839,7 @@ IfrMid ( } if (Value[2].Type == EFI_IFR_TYPE_BUFFER) { - FreePool (Value[2].Buffer); + FreePool(Value[2].Buffer); } } @@ -1875,17 +1875,17 @@ IfrToken ( ZeroMem (Value, sizeof (Value)); Status = PopExpression (&Value[0]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PopExpression (&Value[1]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PopExpression (&Value[2]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1950,10 +1950,10 @@ IfrToken ( Done: if (String[0] != NULL) { - FreePool (String[0]); + FreePool(String[0]); } if (String[1] != NULL) { - FreePool (String[1]); + FreePool(String[1]); } return Status; @@ -1990,17 +1990,17 @@ IfrSpan ( ZeroMem (Value, sizeof (Value)); Status = PopExpression (&Value[0]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PopExpression (&Value[1]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = PopExpression (&Value[2]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2069,10 +2069,10 @@ IfrSpan ( Done: if (String[0] != NULL) { - FreePool (String[0]); + FreePool(String[0]); } if (String[1] != NULL) { - FreePool (String[1]); + FreePool(String[1]); } return Status; @@ -2230,14 +2230,14 @@ CompareHiiValue ( Str2 = GetToken (Value2->Value.string, HiiHandle); if (Str2 == NULL) { - FreePool (Str1); + FreePool(Str1); return EFI_NOT_FOUND; } *Result = StrCmp (Str1, Str2); - FreePool (Str1); - FreePool (Str2); + FreePool(Str1); + FreePool(Str2); return EFI_SUCCESS; } @@ -2311,7 +2311,7 @@ CheckUserPrivilege ( NULL, (VOID **) &mUserManager ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { /// /// If the system does not support user management, then it is assumed that /// all users have admin privilege and evaluation of each EFI_IFR_SECURITY @@ -2322,7 +2322,7 @@ CheckUserPrivilege ( } Status = mUserManager->Current (mUserManager, &UserProfileHandle); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); /// /// Enumerate all user information of the current user profile @@ -2331,7 +2331,7 @@ CheckUserPrivilege ( for (UserInfoHandle = NULL;;) { Status = mUserManager->GetNextInfo (mUserManager, UserProfileHandle, &UserInfoHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -2347,10 +2347,10 @@ CheckUserPrivilege ( } Status = mUserManager->GetInfo (mUserManager, UserProfileHandle, UserInfoHandle, UserInfo, &UserInfoSize); - if (EFI_ERROR (Status) || + if (EFI_ERROR(Status) || UserInfo->InfoType != EFI_USER_INFO_ACCESS_POLICY_RECORD || UserInfo->InfoSize <= sizeof (EFI_USER_INFO)) { - FreePool (UserInfo); + FreePool(UserInfo); continue; } @@ -2369,7 +2369,7 @@ CheckUserPrivilege ( AccessControlDataSize = AccessControl->Size - sizeof (EFI_USER_INFO_ACCESS_CONTROL); while (AccessControlDataSize >= sizeof (EFI_GUID)) { if (CompareGuid (Guid, UserPermissionsGuid)) { - FreePool (UserInfo); + FreePool(UserInfo); return TRUE; } UserPermissionsGuid++; @@ -2380,7 +2380,7 @@ CheckUserPrivilege ( AccessControl = (EFI_USER_INFO_ACCESS_CONTROL *)((UINT8 *)AccessControl + AccessControl->Size); } - FreePool (UserInfo); + FreePool(UserInfo); } return FALSE; } @@ -2444,7 +2444,7 @@ GetQuestionValueFromForm ( FormSet = AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET)); ASSERT (FormSet != NULL); Status = InitializeFormSet(HiiHandle, FormSetGuid, FormSet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GetTheVal = FALSE; goto Done; } @@ -2479,7 +2479,7 @@ GetQuestionValueFromForm ( // Get the question value. // Status = GetQuestionValue(FormSet, Form, Question, GetSetValueWithEditBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { GetTheVal = FALSE; goto Done; } @@ -2590,7 +2590,7 @@ EvaluateExpression ( break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Value->Value.b = (BOOLEAN) ((Result == 0) ? TRUE : FALSE); @@ -2615,7 +2615,7 @@ EvaluateExpression ( Status = EFI_SUCCESS; break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Value->Value.b = (BOOLEAN) ((Result == 0) ? TRUE : FALSE); @@ -2639,7 +2639,7 @@ EvaluateExpression ( case EFI_IFR_DUP_OP: Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2683,7 +2683,7 @@ EvaluateExpression ( // Get value from string except for STRING value. // Status = GetValueByName (OpCode->VarStorage, OpCode->ValueName, &StrPtr, GetSetValueWithEditBuffer); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (StrPtr != NULL); TempLength = StrLen (StrPtr); if (OpCode->ValueWidth >= ((TempLength + 1) / 2)) { @@ -2716,7 +2716,7 @@ EvaluateExpression ( &TempLength, &Value->Value ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Value->Type = EFI_IFR_TYPE_UNDEFINED; Value->Value.u8 = 0; } @@ -2740,7 +2740,7 @@ EvaluateExpression ( goto Done; } Status = gRT->GetTime (&EfiTime, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (OpCode->ValueType == EFI_IFR_TYPE_DATE) { switch (OpCode->VarStoreInfo.VarOffset) { case 0x00: @@ -2795,7 +2795,7 @@ EvaluateExpression ( // Pop an expression from the expression stack // Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2817,12 +2817,12 @@ EvaluateExpression ( Value = &QuestionVal; } if (DevicePath != NULL) { - FreePool (DevicePath); + FreePool(DevicePath); } } if (StrPtr != NULL) { - FreePool (StrPtr); + FreePool(StrPtr); } } else if (IsZeroGuid (&OpCode->Guid)) { if (!GetQuestionValueFromForm(NULL, FormSet->HiiHandle, &OpCode->Guid, Value->Value.u16, &QuestionVal)){ @@ -2858,7 +2858,7 @@ EvaluateExpression ( // Evaluate this rule expression // Status = EvaluateExpression (FormSet, Form, RuleExpression); - if (EFI_ERROR (Status) || RuleExpression->Result.Type == EFI_IFR_TYPE_UNDEFINED) { + if (EFI_ERROR(Status) || RuleExpression->Result.Type == EFI_IFR_TYPE_UNDEFINED) { Value->Type = EFI_IFR_TYPE_UNDEFINED; break; } @@ -2893,7 +2893,7 @@ EvaluateExpression ( // case EFI_IFR_LENGTH_OP: Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } if (Value->Type != EFI_IFR_TYPE_STRING && !IsTypeInBuffer (Value)) { @@ -2910,17 +2910,17 @@ EvaluateExpression ( Value->Type = EFI_IFR_TYPE_NUM_SIZE_64; Value->Value.u64 = StrLen (StrPtr); - FreePool (StrPtr); + FreePool(StrPtr); } else { Value->Type = EFI_IFR_TYPE_NUM_SIZE_64; Value->Value.u64 = GetLengthForValue(Value); - FreePool (Value->Buffer); + FreePool(Value->Buffer); } break; case EFI_IFR_NOT_OP: Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } if (Value->Type != EFI_IFR_TYPE_BOOLEAN) { @@ -2935,7 +2935,7 @@ EvaluateExpression ( // Pop an expression from the expression stack // Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2961,7 +2961,7 @@ EvaluateExpression ( // Pop an expression from the expression stack // Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2983,7 +2983,7 @@ EvaluateExpression ( } else { Index = (UINT16) Value->Value.u64; Value->Value.string = Index; - FreePool (StrPtr); + FreePool(StrPtr); } break; @@ -2992,7 +2992,7 @@ EvaluateExpression ( // Pop an expression from the expression stack // Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3029,7 +3029,7 @@ EvaluateExpression ( } else { Value->Type = EFI_IFR_TYPE_UNDEFINED; } - FreePool (StrPtr); + FreePool(StrPtr); } else if (Value->Type == EFI_IFR_TYPE_BUFFER) { // // When converting from a buffer, if the buffer is all zeroes, @@ -3047,7 +3047,7 @@ EvaluateExpression ( Value->Value.b = TRUE; } Value->Type = EFI_IFR_TYPE_BOOLEAN; - FreePool (Value->Buffer); + FreePool(Value->Buffer); } break; @@ -3062,12 +3062,12 @@ EvaluateExpression ( case EFI_IFR_TO_LOWER_OP: case EFI_IFR_TO_UPPER_OP: Status = InitializeUnicodeCollationProtocol (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3088,7 +3088,7 @@ EvaluateExpression ( mUnicodeCollation->StrUpr (mUnicodeCollation, StrPtr); } Value->Value.string = NewString (StrPtr, FormSet->HiiHandle); - FreePool (StrPtr); + FreePool(StrPtr); break; case EFI_IFR_BITWISE_NOT_OP: @@ -3096,7 +3096,7 @@ EvaluateExpression ( // Pop an expression from the expression stack // Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } if (Value->Type > EFI_IFR_TYPE_DATE) { @@ -3113,7 +3113,7 @@ EvaluateExpression ( // Pop an expression from the expression stack // Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Data1.Type = EFI_IFR_TYPE_BOOLEAN; @@ -3148,8 +3148,8 @@ EvaluateExpression ( StrPtr += StrnLenS (StrPtr, OpCode->ValueWidth * 2 + 1 - ((UINTN)StrPtr - (UINTN)NameValue) / sizeof (CHAR16)); } Status = SetValueByName (OpCode->VarStorage, OpCode->ValueName, NameValue, GetSetValueWithEditBuffer, NULL); - FreePool (NameValue); - if (!EFI_ERROR (Status)) { + FreePool(NameValue); + if (!EFI_ERROR(Status)) { Data1.Value.b = TRUE; } } @@ -3162,7 +3162,7 @@ EvaluateExpression ( OpCode->ValueWidth, &Value->Value ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Data1.Value.b = TRUE; } break; @@ -3185,7 +3185,7 @@ EvaluateExpression ( goto Done; } Status = gRT->GetTime (&EfiTime, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (OpCode->ValueType == EFI_IFR_TYPE_DATE) { switch (OpCode->VarStoreInfo.VarOffset) { case 0x00: @@ -3224,7 +3224,7 @@ EvaluateExpression ( } } Status = gRT->SetTime (&EfiTime); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Data1.Value.b = TRUE; } } @@ -3248,7 +3248,7 @@ EvaluateExpression ( // Pop an expression from the expression stack // Status = PopExpression (&Data2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3256,7 +3256,7 @@ EvaluateExpression ( // Pop another expression from the expression stack // Status = PopExpression (&Data1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3322,7 +3322,7 @@ EvaluateExpression ( // Two Boolean operator // Status = PopExpression (&Data2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3330,7 +3330,7 @@ EvaluateExpression ( // Pop another expression from the expression stack // Status = PopExpression (&Data1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3361,7 +3361,7 @@ EvaluateExpression ( // Compare two integer, string, boolean or date/time // Status = PopExpression (&Data2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3369,7 +3369,7 @@ EvaluateExpression ( // Pop another expression from the expression stack // Status = PopExpression (&Data1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3389,10 +3389,10 @@ EvaluateExpression ( Status = CompareHiiValue (&Data1, &Data2, &Result, FormSet->HiiHandle); if (Data1.Type == EFI_IFR_TYPE_BUFFER) { - FreePool (Data1.Buffer); + FreePool(Data1.Buffer); } if (Data2.Type == EFI_IFR_TYPE_BUFFER) { - FreePool (Data2.Buffer); + FreePool(Data2.Buffer); } if (Status == EFI_UNSUPPORTED) { @@ -3401,7 +3401,7 @@ EvaluateExpression ( break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3437,7 +3437,7 @@ EvaluateExpression ( case EFI_IFR_MATCH_OP: Status = InitializeUnicodeCollationProtocol (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3460,7 +3460,7 @@ EvaluateExpression ( // Pop third expression from the expression stack // Status = PopExpression (&Data3); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3468,7 +3468,7 @@ EvaluateExpression ( // Pop second expression from the expression stack // Status = PopExpression (&Data2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3476,7 +3476,7 @@ EvaluateExpression ( // Pop first expression from the expression stack // Status = PopExpression (&Data1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } if (Data1.Type != EFI_IFR_TYPE_BOOLEAN) { @@ -3512,7 +3512,7 @@ EvaluateExpression ( // Pop the check value // Status = PopExpression (&Data1); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -3532,7 +3532,7 @@ EvaluateExpression ( // Evaluate the first expression in this pair. // Status = EvaluateExpression (FormSet, Form, SubExpression); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -3549,7 +3549,7 @@ EvaluateExpression ( } SubExpression = FORM_EXPRESSION_FROM_LINK (SubExpressionLink); Status = EvaluateExpression (FormSet, Form, SubExpression); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } Value = &SubExpression->Result; @@ -3581,12 +3581,12 @@ EvaluateExpression ( default: break; } - if (EFI_ERROR (Status) || Value->Type == EFI_IFR_TYPE_UNDEFINED) { + if (EFI_ERROR(Status) || Value->Type == EFI_IFR_TYPE_UNDEFINED) { goto Done; } Status = PushExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -3596,7 +3596,7 @@ EvaluateExpression ( // Value = &Data1; Status = PopExpression (Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -3609,7 +3609,7 @@ EvaluateExpression ( Done: RestoreExpressionEvaluationStackOffset (StackOffset); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CopyMem (&Expression->Result, Value, sizeof (EFI_HII_VALUE)); } @@ -3694,7 +3694,7 @@ EvaluateExpressionList ( if (Evaluate) { while (ExpList->Count > Index) { Status = EvaluateExpression (FormSet, Form, ExpList->Expression[Index++]); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ExpressFalse; } } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c index 891b95cf9..c8bed3b02 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -627,7 +627,7 @@ InitializeRequestElement ( ASSERT (NewStr != NULL); if (FormsetStorage->ConfigRequest != NULL) { CopyMem (NewStr, FormsetStorage->ConfigRequest, StringSize); - FreePool (FormsetStorage->ConfigRequest); + FreePool(FormsetStorage->ConfigRequest); } FormsetStorage->ConfigRequest = NewStr; FormsetStorage->SpareStrLen = CONFIG_REQUEST_STRING_INCREMENTAL; @@ -679,7 +679,7 @@ InitializeRequestElement ( ASSERT (NewStr != NULL); if (ConfigInfo->ConfigRequest != NULL) { CopyMem (NewStr, ConfigInfo->ConfigRequest, StringSize); - FreePool (ConfigInfo->ConfigRequest); + FreePool(ConfigInfo->ConfigRequest); } ConfigInfo->ConfigRequest = NewStr; ConfigInfo->SpareStrLen = CONFIG_REQUEST_STRING_INCREMENTAL; @@ -714,11 +714,11 @@ DestroyExpression ( RemoveEntryList (&OpCode->Link); if (OpCode->ValueList != NULL) { - FreePool (OpCode->ValueList); + FreePool(OpCode->ValueList); } if (OpCode->ValueName != NULL) { - FreePool (OpCode->ValueName); + FreePool(OpCode->ValueName); } if (OpCode->MapExpressionList.ForwardLink != NULL) { @@ -734,7 +734,7 @@ DestroyExpression ( // // Free this Expression // - FreePool (Expression); + FreePool(Expression); } /** @@ -753,10 +753,10 @@ DestroyStorage ( } if (Storage->ConfigRequest != NULL) { - FreePool (Storage->ConfigRequest); + FreePool(Storage->ConfigRequest); } - FreePool (Storage); + FreePool(Storage); } @@ -787,9 +787,9 @@ DestroyStatement ( RemoveEntryList (&Default->Link); if (Default->Value.Buffer != NULL) { - FreePool (Default->Value.Buffer); + FreePool(Default->Value.Buffer); } - FreePool (Default); + FreePool(Default); } // @@ -799,11 +799,11 @@ DestroyStatement ( Link = GetFirstNode (&Statement->OptionListHead); Option = QUESTION_OPTION_FROM_LINK (Link); if (Option->SuppressExpression != NULL) { - FreePool (Option->SuppressExpression); + FreePool(Option->SuppressExpression); } RemoveEntryList (&Option->Link); - FreePool (Option); + FreePool(Option); } // @@ -840,17 +840,17 @@ DestroyStatement ( } if (Statement->Expression != NULL) { - FreePool (Statement->Expression); + FreePool(Statement->Expression); } if (Statement->VariableName != NULL) { - FreePool (Statement->VariableName); + FreePool(Statement->VariableName); } if (Statement->BlockName != NULL) { - FreePool (Statement->BlockName); + FreePool(Statement->BlockName); } if (Statement->BufferValue != NULL) { - FreePool (Statement->BufferValue); + FreePool(Statement->BufferValue); } if (Statement->Operand == EFI_IFR_STRING_OP || Statement->Operand == EFI_IFR_PASSWORD_OP) { DeleteString(Statement->HiiValue.Value.string, FormSet->HiiHandle); @@ -906,12 +906,12 @@ DestroyForm ( ConfigInfo = FORM_BROWSER_CONFIG_REQUEST_FROM_LINK (Link); RemoveEntryList (&ConfigInfo->Link); - FreePool (ConfigInfo->ConfigRequest); - FreePool (ConfigInfo); + FreePool(ConfigInfo->ConfigRequest); + FreePool(ConfigInfo); } if (Form->SuppressExpression != NULL) { - FreePool (Form->SuppressExpression); + FreePool(Form->SuppressExpression); } UiFreeMenuList (&Form->FormViewListHead); @@ -919,7 +919,7 @@ DestroyForm ( // // Free this Form // - FreePool (Form); + FreePool(Form); } @@ -944,14 +944,14 @@ DestroyFormSet ( // // Uninitialized FormSet // - FreePool (FormSet); + FreePool(FormSet); return; } // // Free IFR binary buffer // - FreePool (FormSet->IfrBinaryData); + FreePool(FormSet->IfrBinaryData); // // Free FormSet Storage @@ -975,7 +975,7 @@ DestroyFormSet ( DefaultStore = FORMSET_DEFAULTSTORE_FROM_LINK (Link); RemoveEntryList (&DefaultStore->Link); - FreePool (DefaultStore); + FreePool(DefaultStore); } } @@ -1004,13 +1004,13 @@ DestroyFormSet ( } if (FormSet->StatementBuffer != NULL) { - FreePool (FormSet->StatementBuffer); + FreePool(FormSet->StatementBuffer); } if (FormSet->ExpressionBuffer != NULL) { - FreePool (FormSet->ExpressionBuffer); + FreePool(FormSet->ExpressionBuffer); } - FreePool (FormSet); + FreePool(FormSet); } @@ -1300,7 +1300,7 @@ ParseOpCodes ( DepthOfDisable++; } else if (Operand == EFI_IFR_END_OP) { Status = PopScope (&ScopeOpCode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1571,7 +1571,7 @@ ParseOpCodes ( // This is DisableIf expression for Form, it should be a constant expression // Status = EvaluateExpression (FormSet, CurrentForm, CurrentExpression); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2552,7 +2552,7 @@ ParseOpCodes ( case EFI_IFR_END_OP: QuestionReferBitField = FALSE; Status = PopScope (&ScopeOpCode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ResetScopeStack (); return Status; } @@ -2640,7 +2640,7 @@ ParseOpCodes ( // Get current expression. // Status = PopCurrentExpression ((VOID **) &CurrentExpression); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (MapScopeDepth > 0); MapScopeDepth --; break; @@ -2653,7 +2653,7 @@ ParseOpCodes ( // ASSERT (CurrentExpression != NULL); Status = EvaluateExpression (FormSet, CurrentForm, CurrentExpression); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index bafee4c61..17450e731 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -40,7 +40,7 @@ CheckConfigAccess( &gEfiHiiConfigAccessProtocolGuid, (VOID **) &FormSet->ConfigAccess ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Configuration Driver don't attach ConfigAccess protocol to its HII package // list, then there will be no configuration action required. @@ -88,7 +88,7 @@ EvaluateFormExpressions ( } Status = EvaluateExpression (FormSet, Form, Expression); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -144,7 +144,7 @@ FreeRefreshEvent ( gBS->CloseEvent (EventNode->RefreshEvent); - FreePool (EventNode); + FreePool(EventNode); } } @@ -244,7 +244,7 @@ CreateRefreshEventForStatement ( Statement, &Statement->RefreshGuid, &RefreshEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); EventNode = AllocateZeroPool (sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); ASSERT (EventNode != NULL); @@ -277,7 +277,7 @@ CreateRefreshEventForForm ( Form, &Form->RefreshGuid, &RefreshEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); EventNode = AllocateZeroPool (sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); ASSERT (EventNode != NULL); @@ -625,9 +625,9 @@ AddStatementToDisplayForm ( // if (MinRefreshInterval != 0) { Status = gBS->CreateEvent (EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, RefreshIntervalProcess, NULL, &RefreshIntervalEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->SetTimer (RefreshIntervalEvent, TimerPeriodic, MinRefreshInterval * ONE_SECOND); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); EventNode = AllocateZeroPool (sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); ASSERT (EventNode != NULL); @@ -732,7 +732,7 @@ InitializeDisplayFormData ( NULL, &mValueChangedEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -754,9 +754,9 @@ FreeHotkeyList ( RemoveEntryList (&HotKey->Link); - FreePool (HotKey->KeyData); - FreePool (HotKey->HelpString); - FreePool (HotKey); + FreePool(HotKey->KeyData); + FreePool(HotKey->HelpString); + FreePool(HotKey); } } @@ -818,7 +818,7 @@ FreeStatementData ( OptionLink = GetFirstNode (&Statement->OptionListHead); Option = DISPLAY_QUESTION_OPTION_FROM_LINK (OptionLink); RemoveEntryList (&Option->Link); - FreePool (Option); + FreePool(Option); } // @@ -829,7 +829,7 @@ FreeStatementData ( } RemoveEntryList (&Statement->DisplayLink); - FreePool (Statement); + FreePool(Statement); } } @@ -1085,7 +1085,7 @@ GetFormsetGuidFromHiiHandle ( Status = mHiiDatabase->ExportPackageLists (mHiiDatabase, HiiHandle, &BufferSize, HiiPackageList); } - if (EFI_ERROR (Status) || HiiPackageList == NULL) { + if (EFI_ERROR(Status) || HiiPackageList == NULL) { return FALSE; } @@ -1124,7 +1124,7 @@ GetFormsetGuidFromHiiHandle ( } } - FreePool (HiiPackageList); + FreePool(HiiPackageList); return FindGuid; } @@ -1168,7 +1168,7 @@ DevicePathToHiiHandle ( &TmpDevicePath, &DriverHandle ); - if (EFI_ERROR (Status) || !IsDevicePathEnd (TmpDevicePath)) { + if (EFI_ERROR(Status) || !IsDevicePathEnd (TmpDevicePath)) { return NULL; } @@ -1190,7 +1190,7 @@ DevicePathToHiiHandle ( HiiHandles[Index], &Handle ); - if (!EFI_ERROR (Status) && (Handle == DriverHandle)) { + if (!EFI_ERROR(Status) && (Handle == DriverHandle)) { if (GetFormsetGuidFromHiiHandle(HiiHandles[Index], FormsetGuid)) { HiiHandle = HiiHandles[Index]; break; @@ -1202,7 +1202,7 @@ DevicePathToHiiHandle ( } } - FreePool (HiiHandles); + FreePool(HiiHandles); return HiiHandle; } @@ -1251,7 +1251,7 @@ FormSetGuidToHiiHandle ( } } - FreePool (HiiHandles); + FreePool(HiiHandles); return HiiHandle; } @@ -1286,7 +1286,7 @@ ProcessChangedData ( case BROWSER_ACTION_SUBMIT: Status = SubmitForm (Selection->FormSet, Selection->Form, Scope); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { RetValue = FALSE; } break; @@ -1384,15 +1384,15 @@ ProcessGotoOpCode ( DevicePath = mPathFromText->ConvertTextToDevicePath(StringPtr); if (DevicePath != NULL) { HiiHandle = DevicePathToHiiHandle (DevicePath, &Statement->HiiValue.Value.ref.FormSetGuid); - FreePool (DevicePath); + FreePool(DevicePath); } - FreePool (StringPtr); + FreePool(StringPtr); } else { // // Not found the EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL protocol. // PopupErrorMessage(BROWSER_PROTOCOL_NOT_FOUND, NULL, NULL, NULL); - FreePool (StringPtr); + FreePool(StringPtr); return Status; } @@ -1613,7 +1613,7 @@ ProcessUserInput ( DeleteString(Statement->HiiValue.Value.string, gCurrentSelection->FormSet->HiiHandle); Statement->HiiValue.Value.string = UserInput->InputValue.Value.string; CopyMem (Statement->BufferValue, UserInput->InputValue.Buffer, (UINTN) UserInput->InputValue.BufferLen); - FreePool (UserInput->InputValue.Buffer); + FreePool(UserInput->InputValue.Buffer); break; case EFI_IFR_PASSWORD_OP: @@ -1628,7 +1628,7 @@ ProcessUserInput ( Statement->HiiValue.Value.string = UserInput->InputValue.Value.string; CopyMem (Statement->BufferValue, UserInput->InputValue.Buffer, (UINTN) UserInput->InputValue.BufferLen); ZeroMem (UserInput->InputValue.Buffer, (UINTN) UserInput->InputValue.BufferLen); - FreePool (UserInput->InputValue.Buffer); + FreePool(UserInput->InputValue.Buffer); // // Two password match, send it to Configuration Driver // @@ -1705,7 +1705,7 @@ DisplayForm ( } Status = EvaluateFormExpressions (gCurrentSelection->FormSet, gCurrentSelection->Form); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1713,7 +1713,7 @@ DisplayForm ( ASSERT (gDisplayFormData.BrowserStatus == BROWSER_SUCCESS); Status = mFormDisplay->FormDisplay (&gDisplayFormData, &UserInput); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreeDisplayFormData(); return Status; } @@ -1931,7 +1931,7 @@ ReconnectController ( EFI_STATUS Status; Status = gBS->DisconnectController(DriverHandle, NULL, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->ConnectController(DriverHandle, NULL, NULL, TRUE); } @@ -2048,7 +2048,7 @@ ProcessCallBackFunction ( TypeValue, &ActionRequest ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Need to sync the value between Statement->HiiValue->Value and Statement->BufferValue // @@ -2063,7 +2063,7 @@ ProcessCallBackFunction ( } else { CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth); } - FreePool (NewString); + FreePool(NewString); } // @@ -2125,7 +2125,7 @@ ProcessCallBackFunction ( // Do the question validation. // Status = ValueChangedValidation (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // //check whether the question value changed compared with edit buffer before updating edit buffer // if changed, set the ValueChanged flag to TRUE,in order to trig the CHANGED callback function @@ -2167,7 +2167,7 @@ ProcessCallBackFunction ( // Do the question validation. // InternalStatus = ValueChangedValidation (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement); - if (!EFI_ERROR (InternalStatus)) { + if (!EFI_ERROR(InternalStatus)) { // //check whether the question value changed compared with edit buffer before updating edit buffer // if changed, set the ValueChanged flag to TRUE,in order to trig the CHANGED callback function @@ -2202,7 +2202,7 @@ ProcessCallBackFunction ( } if (BackUpBuffer != NULL) { - FreePool (BackUpBuffer); + FreePool(BackUpBuffer); } // @@ -2303,7 +2303,7 @@ ProcessRetrieveForQuestion ( TypeValue, &ActionRequest ); - if (!EFI_ERROR (Status) && HiiValue->Type == EFI_IFR_TYPE_STRING) { + if (!EFI_ERROR(Status) && HiiValue->Type == EFI_IFR_TYPE_STRING) { NewString = GetToken (Statement->HiiValue.Value.string, FormSet->HiiHandle); ASSERT (NewString != NULL); @@ -2314,7 +2314,7 @@ ProcessRetrieveForQuestion ( } else { CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth); } - FreePool (NewString); + FreePool(NewString); } return Status; @@ -2357,7 +2357,7 @@ SetupBrowser ( EFI_HII_DATABASE_NOTIFY_REMOVE_PACK, &NotifyHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2453,7 +2453,7 @@ SetupBrowser ( if (ConfigAccess != NULL) { Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2472,7 +2472,7 @@ SetupBrowser ( // Load Questions' Value for display // Status = LoadFormSetConfig (Selection, Selection->FormSet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2484,7 +2484,7 @@ SetupBrowser ( if (ConfigAccess != NULL) { Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_RETRIEVE, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2503,7 +2503,7 @@ SetupBrowser ( // Display form // Status = DisplayForm (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2520,14 +2520,14 @@ SetupBrowser ( // // Process dynamic update ref opcode. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = ProcessGotoOpCode(Statement, Selection); } // // Callback return error status or status return from process goto opcode. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Cross reference will not be taken, restore all essential field // @@ -2540,7 +2540,7 @@ SetupBrowser ( } - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && (Statement->Operand != EFI_IFR_REF_OP) && ((Statement->Storage == NULL) || (Statement->Storage != NULL && Statement->ValueChanged))) { // @@ -2558,7 +2558,7 @@ SetupBrowser ( // Do the question validation. // Status = ValueChangedValidation (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement); - if (!EFI_ERROR (Status) && (Statement->Operand != EFI_IFR_PASSWORD_OP)) { + if (!EFI_ERROR(Status) && (Statement->Operand != EFI_IFR_PASSWORD_OP)) { SetQuestionValue (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer); // // Verify whether question value has checked, update the ValueChanged flag in Question. @@ -2616,7 +2616,7 @@ SetupBrowser ( (Selection->FormId != mCurrentFormId))) { Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_CLOSE, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -2626,7 +2626,7 @@ Done: // // Reset current form information to the initial setting when error happens or form exit. // - if (EFI_ERROR (Status) || Selection->Action == UI_ACTION_EXIT) { + if (EFI_ERROR(Status) || Selection->Action == UI_ACTION_EXIT) { mCurrentHiiHandle = NULL; CopyGuid (&mCurrentFormSetGuid, &gZeroGuid); mCurrentFormId = 0; diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 288f1c319..14ae38179 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -168,7 +168,7 @@ UiFindMenuList ( // if (RetMenu != NULL) { RemoveEntryList (&MenuList->Link); - FreePool (MenuList); + FreePool(MenuList); continue; } @@ -273,7 +273,7 @@ UiFreeMenuList ( MenuList = FORM_ENTRY_INFO_FROM_LINK (MenuListHead->ForwardLink); RemoveEntryList (&MenuList->Link); - FreePool (MenuList); + FreePool(MenuList); } } @@ -360,7 +360,7 @@ LoadAllHiiFormset ( ZeroMem (&ZeroGuid, sizeof (ZeroGuid)); Status = InitializeFormSet (HiiHandles[Index], &ZeroGuid, LocalFormSet); - if (EFI_ERROR (Status) || IsListEmpty (&LocalFormSet->FormListHead)) { + if (EFI_ERROR(Status) || IsListEmpty (&LocalFormSet->FormListHead)) { DestroyFormSet (LocalFormSet); continue; } @@ -370,7 +370,7 @@ LoadAllHiiFormset ( // Initilize Questions' Value // Status = LoadFormSetConfig (NULL, LocalFormSet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DestroyFormSet (LocalFormSet); continue; } @@ -379,7 +379,7 @@ LoadAllHiiFormset ( // // Free resources, and restore gOldFormSet and gClassOfVfr // - FreePool (HiiHandles); + FreePool(HiiHandles); mSystemLevelFormSet = OldFormset; } @@ -430,7 +430,7 @@ PopupErrorMessage ( gDisplayFormData.ErrorString = NULL; if (OpCode != NULL) { - FreePool (Statement); + FreePool(Statement); } return UserInputData.Action; @@ -529,7 +529,7 @@ SendForm ( // Initialize internal data structures of FormSet // Status = InitializeFormSet (Selection->Handle, &Selection->FormSetGuid, FormSet); - if (EFI_ERROR (Status) || IsListEmpty (&FormSet->FormListHead)) { + if (EFI_ERROR(Status) || IsListEmpty (&FormSet->FormListHead)) { DestroyFormSet (FormSet); break; } @@ -564,12 +564,12 @@ SendForm ( DestroyFormSet (FormSet); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } } while (Selection->Action == UI_ACTION_REFRESH_FORMSET); - FreePool (Selection); + FreePool(Selection); } if (ActionRequest != NULL) { @@ -587,7 +587,7 @@ SendForm ( while (!IsListEmpty (&mPrivateData.FormBrowserEx2.FormViewHistoryHead)) { MenuList = FORM_ENTRY_INFO_FROM_LINK (mPrivateData.FormBrowserEx2.FormViewHistoryHead.ForwardLink); RemoveEntryList (&MenuList->Link); - FreePool (MenuList); + FreePool(MenuList); } // @@ -637,7 +637,7 @@ ProcessStorage ( // Generate // Status = StorageToConfigResp (Storage, &ConfigResp, Storage->ConfigRequest, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -659,7 +659,7 @@ ProcessStorage ( } *ResultsDataSize = BufferSize; - FreePool (ConfigResp); + FreePool(ConfigResp); } else { // // Prepare @@ -680,8 +680,8 @@ ProcessStorage ( // Update Browser uncommited data // Status = ConfigRespToStorage (Storage, ConfigResp); - FreePool (ConfigResp); - if (EFI_ERROR (Status)) { + FreePool(ConfigResp); + if (EFI_ERROR(Status)) { return Status; } } @@ -784,7 +784,7 @@ BrowserCallback ( } Status = ProcessStorage (&TotalSize, &ResultsData, RetrieveData, Storage); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -822,7 +822,7 @@ BrowserCallback ( FormsetStorage = FORMSET_STORAGE_FROM_LINK (Link); Status = ProcessStorage (&TotalSize, &ResultsData, RetrieveData, FormsetStorage->BrowserStorage); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -890,14 +890,14 @@ InitializeSetup ( NULL, (VOID **) &mHiiDatabase ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->LocateProtocol ( &gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &mHiiConfigRouting ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->LocateProtocol ( &gEfiDevicePathFromTextProtocolGuid, @@ -915,7 +915,7 @@ InitializeSetup ( EFI_NATIVE_INTERFACE, &mPrivateData.FormBrowser2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install FormBrowserEx2 protocol @@ -929,7 +929,7 @@ InitializeSetup ( EFI_NATIVE_INTERFACE, &mPrivateData.FormBrowserEx2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->InstallProtocolInterface ( &mPrivateData.Handle, @@ -937,7 +937,7 @@ InitializeSetup ( EFI_NATIVE_INTERFACE, &mPrivateData.FormBrowserEx ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); InitializeDisplayFormData (); @@ -947,7 +947,7 @@ InitializeSetup ( (VOID **) &mFormDisplay ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { EfiCreateProtocolNotifyEvent ( &gEdkiiFormDisplayEngineProtocolGuid, TPL_CALLBACK, @@ -1054,7 +1054,7 @@ NewStringCpy ( ) { if (*Dest != NULL) { - FreePool (*Dest); + FreePool(*Dest); } *Dest = AllocateCopyPool (StrSize (Src), Src); ASSERT (*Dest != NULL); @@ -1089,7 +1089,7 @@ NewStringCat ( StrCpyS (NewString, MaxLen, *Dest); StrCatS (NewString, MaxLen, Src); - FreePool (*Dest); + FreePool(*Dest); *Dest = NewString; } @@ -1183,7 +1183,7 @@ SetValueByName ( Buffer = Node->Value; } if (Buffer != NULL) { - FreePool (Buffer); + FreePool(Buffer); } Buffer = AllocateCopyPool (StrSize (Value), Value); ASSERT (Buffer != NULL); @@ -1546,7 +1546,7 @@ BufferToValue ( if (Buffer != NULL && Question->QuestionReferToBitField) { GetBitsQuestionValue (Question, Buffer); - FreePool (Buffer); + FreePool(Buffer); } return Status; @@ -1601,7 +1601,7 @@ GetQuestionValue ( // if (Question->ValueExpression != NULL) { Status = EvaluateExpression (FormSet, Form, Question->ValueExpression); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Question->ValueExpression->Result.Type == EFI_IFR_TYPE_BUFFER) { ASSERT (Question->HiiValue.Type == EFI_IFR_TYPE_BUFFER && Question->HiiValue.Buffer != NULL); if (Question->StorageWidth > Question->ValueExpression->Result.BufferLen) { @@ -1611,7 +1611,7 @@ GetQuestionValue ( CopyMem (Question->HiiValue.Buffer, Question->ValueExpression->Result.Buffer, Question->StorageWidth); Question->HiiValue.BufferLen = Question->StorageWidth; } - FreePool (Question->ValueExpression->Result.Buffer); + FreePool(Question->ValueExpression->Result.Buffer); } Question->HiiValue.Type = Question->ValueExpression->Result.Type; CopyMem (&Question->HiiValue.Value, &Question->ValueExpression->Result.Value, sizeof (EFI_IFR_TYPE_VALUE)); @@ -1624,7 +1624,7 @@ GetQuestionValue ( // if (Question->ReadExpression != NULL && Form->FormType == STANDARD_MAP_FORM_TYPE) { Status = EvaluateExpression (FormSet, Form, Question->ReadExpression); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR(Status) && ((Question->ReadExpression->Result.Type < EFI_IFR_TYPE_OTHER) || (Question->ReadExpression->Result.Type == EFI_IFR_TYPE_BUFFER))) { // // Only update question value to the valid result. @@ -1638,7 +1638,7 @@ GetQuestionValue ( CopyMem (Question->HiiValue.Buffer, Question->ReadExpression->Result.Buffer, Question->StorageWidth); Question->HiiValue.BufferLen = Question->StorageWidth; } - FreePool (Question->ReadExpression->Result.Buffer); + FreePool(Question->ReadExpression->Result.Buffer); } Question->HiiValue.Type = Question->ReadExpression->Result.Type; CopyMem (&Question->HiiValue.Value, &Question->ReadExpression->Result.Value, sizeof (EFI_IFR_TYPE_VALUE)); @@ -1676,7 +1676,7 @@ GetQuestionValue ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (Question->Operand == EFI_IFR_DATE_OP){ QuestionValue->date.Year = 0xff; QuestionValue->date.Month = 0xff; @@ -1774,13 +1774,13 @@ GetQuestionValue ( } else { Value = NULL; Status = GetValueByName (Storage, Question->VariableName, &Value, GetValueFrom); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT (Value != NULL); Status = BufferToValue (Question, Value); - FreePool (Value); + FreePool(Value); } } else { FormsetStorage = GetFstStgFromVarId(FormSet, Question->VarStoreId); @@ -1818,8 +1818,8 @@ GetQuestionValue ( &Progress, &Result ); - FreePool (ConfigRequest); - if (EFI_ERROR (Status)) { + FreePool(ConfigRequest); + if (EFI_ERROR(Status)) { return Status; } @@ -1829,7 +1829,7 @@ GetQuestionValue ( if (IsBufferStorage) { Value = StrStr (Result, L"&VALUE"); if (Value == NULL) { - FreePool (Result); + FreePool(Result); return EFI_NOT_FOUND; } // @@ -1840,7 +1840,7 @@ GetQuestionValue ( Value = Result + Length; } if (*Value != '=') { - FreePool (Result); + FreePool(Result); return EFI_NOT_FOUND; } // @@ -1849,8 +1849,8 @@ GetQuestionValue ( Value = Value + 1; Status = BufferToValue (Question, Value); - if (EFI_ERROR (Status)) { - FreePool (Result); + if (EFI_ERROR(Status)) { + FreePool(Result); return Status; } @@ -1864,7 +1864,7 @@ GetQuestionValue ( } if (Result != NULL) { - FreePool (Result); + FreePool(Result); } } @@ -1933,7 +1933,7 @@ SetQuestionValue ( // if (Question->WriteExpression != NULL && Form->FormType == STANDARD_MAP_FORM_TYPE) { Status = EvaluateExpression (FormSet, Form, Question->WriteExpression); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1968,7 +1968,7 @@ SetQuestionValue ( return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2099,8 +2099,8 @@ SetQuestionValue ( } Status = SetValueByName (Storage, Question->VariableName, Value, SetValueTo, &Node); - FreePool (Value); - if (EFI_ERROR (Status)) { + FreePool(Value); + if (EFI_ERROR(Status)) { return Status; } } @@ -2188,11 +2188,11 @@ SetQuestionValue ( ConfigResp, &Progress ); - if (EFI_ERROR (Status)) { - FreePool (ConfigResp); + if (EFI_ERROR(Status)) { + FreePool(ConfigResp); return Status; } - FreePool (ConfigResp); + FreePool(ConfigResp); // // Sync storage, from editbuffer to buffer. @@ -2260,7 +2260,7 @@ ValidateQuestion ( // Evaluate the expression // Status = EvaluateExpression (FormSet, Form, Expression); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2299,7 +2299,7 @@ ValidateQuestion ( } if (ErrorStr != NULL) { - FreePool (ErrorStr); + FreePool(ErrorStr); } if (Type == EFI_HII_EXPRESSION_WARNING_IF) { @@ -2345,7 +2345,7 @@ ValueChangedValidation ( // if (!IsListEmpty (&Question->InconsistentListHead)) { Status = ValidateQuestion (FormSet, Form, Question, EFI_HII_EXPRESSION_INCONSISTENT_IF); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -2397,7 +2397,7 @@ NoSubmitCheck ( while (!IsNull (&Form->StatementListHead, Link)) { Question = FORM_BROWSER_STATEMENT_FROM_LINK (Link); Status = ValidateQuestion (FormSet, Form, Question, EFI_HII_EXPRESSION_NO_SUBMIT_IF); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (*CurrentForm == NULL) { *CurrentForm = Form; } @@ -2467,7 +2467,7 @@ SynchronizeStorage ( &Result, &Progress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2479,7 +2479,7 @@ SynchronizeStorage ( &Progress ); if (Result != NULL) { - FreePool (Result); + FreePool(Result); } } else { CopyMem (Dst, Src, BufferSize); @@ -2698,7 +2698,7 @@ ValidateHiiHandle ( } } - FreePool (HiiHandles); + FreePool(HiiHandles); return Find; } @@ -3111,8 +3111,8 @@ ConfirmSaveFail ( RetVal = PopupErrorMessage(BROWSER_SUBMIT_FAIL, NULL, NULL, StringBuffer); - FreePool (StringBuffer); - FreePool (FormTitle); + FreePool(StringBuffer); + FreePool(FormTitle); return RetVal; } @@ -3150,8 +3150,8 @@ ConfirmNoSubmitFail ( RetVal = PopupErrorMessage(BROWSER_SUBMIT_FAIL_NO_SUBMIT_IF, NULL, NULL, StringBuffer); - FreePool (StringBuffer); - FreePool (FormTitle); + FreePool(StringBuffer); + FreePool(FormTitle); return RetVal; } @@ -3320,7 +3320,7 @@ SubmitForForm ( } Status = NoSubmitCheck (FormSet, &Form, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -3345,7 +3345,7 @@ SubmitForForm ( // 1. Prepare // Status = StorageToConfigResp (ConfigInfo->Storage, &ConfigResp, ConfigInfo->ConfigRequest, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -3358,18 +3358,18 @@ SubmitForForm ( &Progress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Submit fail, to get the RestoreConfigRequest and SyncConfigRequest. // SubmitFormFail = TRUE; GetSyncRestoreConfigRequest (ConfigInfo->Storage, ConfigInfo->ConfigRequest, Progress, &ConfigInfo->RestoreConfigRequest, &ConfigInfo->SyncConfigRequest); InsertTailList (&gBrowserSaveFailFormSetList, &ConfigInfo->SaveFailLink); - FreePool (ConfigResp); + FreePool(ConfigResp); continue; } - FreePool (ConfigResp); + FreePool(ConfigResp); // // 3. Config success, update storage shadow Buffer, only update the data belong to this form. // @@ -3390,11 +3390,11 @@ SubmitForForm ( // base on the SyncConfigRequest to Sync the buffer. // SynchronizeStorage (ConfigInfo->Storage, ConfigInfo->RestoreConfigRequest, FALSE); - FreePool (ConfigInfo->RestoreConfigRequest); + FreePool(ConfigInfo->RestoreConfigRequest); ConfigInfo->RestoreConfigRequest = NULL; if (ConfigInfo->SyncConfigRequest != NULL) { SynchronizeStorage(ConfigInfo->Storage, ConfigInfo->SyncConfigRequest, TRUE); - FreePool (ConfigInfo->SyncConfigRequest); + FreePool(ConfigInfo->SyncConfigRequest); ConfigInfo->SyncConfigRequest = NULL; } @@ -3474,7 +3474,7 @@ SubmitForFormSet ( Form = NULL; Status = NoSubmitCheck (FormSet, &Form, &Question); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (SkipProcessFail) { // // Process NO_SUBMIT check first, so insert it at head. @@ -3513,7 +3513,7 @@ SubmitForFormSet ( // 1. Prepare // Status = StorageToConfigResp (Storage, &ConfigResp, FormSetStorage->ConfigRequest, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -3525,7 +3525,7 @@ SubmitForFormSet ( ConfigResp, &Progress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Submit fail, to get the RestoreConfigRequest and SyncConfigRequest. // @@ -3547,11 +3547,11 @@ SubmitForFormSet ( HasInserted = TRUE; } - FreePool (ConfigResp); + FreePool(ConfigResp); continue; } - FreePool (ConfigResp); + FreePool(ConfigResp); // // 3. Config success, update storage shadow Buffer // @@ -3578,11 +3578,11 @@ SubmitForFormSet ( // base on the SyncConfigRequest to Sync the buffer. // SynchronizeStorage (FormSetStorage->BrowserStorage, FormSetStorage->RestoreConfigRequest, FALSE); - FreePool (FormSetStorage->RestoreConfigRequest); + FreePool(FormSetStorage->RestoreConfigRequest); FormSetStorage->RestoreConfigRequest = NULL; if (FormSetStorage->SyncConfigRequest != NULL) { SynchronizeStorage(FormSetStorage->BrowserStorage, FormSetStorage->SyncConfigRequest, TRUE); - FreePool (FormSetStorage->SyncConfigRequest); + FreePool(FormSetStorage->SyncConfigRequest); FormSetStorage->SyncConfigRequest = NULL; } @@ -3678,7 +3678,7 @@ SubmitForSystem ( } Status = SubmitForFormSet (LocalFormSet, TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -3741,11 +3741,11 @@ SubmitForSystem ( // base on the SyncConfigRequest to Sync the buffer. // SynchronizeStorage (FormSetStorage->BrowserStorage, FormSetStorage->RestoreConfigRequest, FALSE); - FreePool (FormSetStorage->RestoreConfigRequest); + FreePool(FormSetStorage->RestoreConfigRequest); FormSetStorage->RestoreConfigRequest = NULL; if ( FormSetStorage->SyncConfigRequest != NULL) { SynchronizeStorage (FormSetStorage->BrowserStorage, FormSetStorage->SyncConfigRequest, TRUE); - FreePool (FormSetStorage->SyncConfigRequest); + FreePool(FormSetStorage->SyncConfigRequest); FormSetStorage->SyncConfigRequest = NULL; } } @@ -3939,7 +3939,7 @@ GetOffsetFromConfigResp ( ASSERT (BlockData != NULL); HiiToLower (BlockData); RequestElement = StrStr (ConfigResp, BlockData); - FreePool (BlockData); + FreePool(BlockData); if (RequestElement != NULL) { // @@ -4263,7 +4263,7 @@ ReGetDefault: TypeValue, &ActionRequest ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (HiiValue->Type == EFI_IFR_TYPE_STRING) { NewString = GetToken (Question->HiiValue.Value.string, FormSet->HiiHandle); ASSERT (NewString != NULL); @@ -4276,7 +4276,7 @@ ReGetDefault: CopyMem (Question->BufferValue, NewString, Question->StorageWidth); } - FreePool (NewString); + FreePool(NewString); } return Status; } @@ -4287,7 +4287,7 @@ ReGetDefault: // if (ConfigAccess != NULL) { Status = GetDefaultValueFromAltCfg(FormSet, Form, Question); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return Status; } } @@ -4306,7 +4306,7 @@ ReGetDefault: // Default is provided by an Expression, evaluate it // Status = EvaluateExpression (FormSet, Form, Default->ValueExpression); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -4319,7 +4319,7 @@ ReGetDefault: CopyMem (Question->HiiValue.Buffer, Default->ValueExpression->Result.Buffer, Question->StorageWidth); Question->HiiValue.BufferLen = Question->StorageWidth; } - FreePool (Default->ValueExpression->Result.Buffer); + FreePool(Default->ValueExpression->Result.Buffer); } HiiValue->Type = Default->ValueExpression->Result.Type; CopyMem (&HiiValue->Value, &Default->ValueExpression->Result.Value, sizeof (EFI_IFR_TYPE_VALUE)); @@ -4604,7 +4604,7 @@ ExtractAltCfgForForm ( &Progress, &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -4621,8 +4621,8 @@ ExtractAltCfgForForm ( &DefaultId, // it can be NULL to get the current setting. &ConfigResp ); - FreePool (Result); - if (EFI_ERROR (Status)) { + FreePool(Result); + if (EFI_ERROR(Status)) { continue; } @@ -4650,7 +4650,7 @@ CleanAltCfgForForm ( Link = GetNextNode (&Form->ConfigRequestHead, Link); if (ConfigInfo->ConfigAltResp != NULL) { - FreePool (ConfigInfo->ConfigAltResp); + FreePool(ConfigInfo->ConfigAltResp); ConfigInfo->ConfigAltResp = NULL; } } @@ -4711,7 +4711,7 @@ ExtractAltCfgForFormSet ( &Progress, &Result ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -4729,8 +4729,8 @@ ExtractAltCfgForFormSet ( &ConfigResp ); - FreePool (Result); - if (EFI_ERROR (Status)) { + FreePool(Result); + if (EFI_ERROR(Status)) { continue; } @@ -4759,7 +4759,7 @@ CleanAltCfgForFormSet ( Link = GetNextNode (&FormSet->StorageListHead, Link); if (FormSetStorage->ConfigAltResp != NULL) { - FreePool (FormSetStorage->ConfigAltResp); + FreePool(FormSetStorage->ConfigAltResp); FormSetStorage->ConfigAltResp = NULL; } @@ -4869,9 +4869,9 @@ ExtractDefault ( // // If not request to get the initial value or get initial value fail, then get default value. // - if (!RetrieveValueFirst || EFI_ERROR (Status)) { + if (!RetrieveValueFirst || EFI_ERROR(Status)) { Status = GetQuestionDefault (FormSet, Form, Question, DefaultId); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } } @@ -5046,11 +5046,11 @@ IsQuestionValueChanged ( CopyMem (&Question->HiiValue, &BackUpValue, sizeof (EFI_HII_VALUE)); if (BackUpBuffer != NULL) { CopyMem (Question->BufferValue, BackUpBuffer, BufferWidth); - FreePool (BackUpBuffer); + FreePool(BackUpBuffer); } if (BackUpBuffer2 != NULL) { - FreePool (BackUpBuffer2); + FreePool(BackUpBuffer2); } Question->ValueChanged = ValueChanged; @@ -5094,7 +5094,7 @@ LoadFormConfig ( } else { Status = GetQuestionValue (FormSet, Form, Question, GetSetValueWithEditBuffer); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -5138,7 +5138,7 @@ LoadFormSetConfig ( // Initialize local copy of Value for each Form // Status = LoadFormConfig (Selection, FormSet, Form); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -5266,7 +5266,7 @@ RemoveConfigRequest ( // If no request element remain, just remove the ConfigRequest string. // if (StrCmp (Storage->BrowserStorage->ConfigRequest, Storage->ConfigHdr) == 0) { - FreePool (Storage->BrowserStorage->ConfigRequest); + FreePool(Storage->BrowserStorage->ConfigRequest); Storage->BrowserStorage->ConfigRequest = NULL; Storage->BrowserStorage->SpareStrLen = 0; } @@ -5300,7 +5300,7 @@ CleanBrowserStorage ( } else if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_BUFFER || Storage->BrowserStorage->Type == EFI_HII_VARSTORE_NAME_VALUE) { if (Storage->BrowserStorage->ConfigRequest != NULL) { - FreePool (Storage->BrowserStorage->ConfigRequest); + FreePool(Storage->BrowserStorage->ConfigRequest); Storage->BrowserStorage->ConfigRequest = NULL; } Storage->BrowserStorage->Initialized = FALSE; @@ -5364,7 +5364,7 @@ AppendConfigRequest ( if (*ConfigRequest != NULL) { CopyMem (NewStr, *ConfigRequest, StringSize); - FreePool (*ConfigRequest); + FreePool(*ConfigRequest); } *ConfigRequest = NewStr; *SpareStrLen = CONFIG_REQUEST_STRING_INCREMENTAL; @@ -5585,7 +5585,7 @@ LoadStorage ( // // If get value fail, extract default from IFR binary // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ExtractDefault (FormSet, NULL, EFI_HII_DEFAULT_CLASS_STANDARD, FormSetLevel, GetDefaultForStorage, Storage->BrowserStorage, TRUE, TRUE); } else { // @@ -5597,7 +5597,7 @@ LoadStorage ( } Status = ConfigRespToStorage (Storage->BrowserStorage, Result); - FreePool (Result); + FreePool(Result); } Storage->BrowserStorage->ConfigRequest = AllocateCopyPool (StrSize (Storage->ConfigRequest), Storage->ConfigRequest); @@ -5609,7 +5609,7 @@ LoadStorage ( if (Storage->BrowserStorage->Type != EFI_HII_VARSTORE_NAME_VALUE) { if (ConfigRequest != NULL) { - FreePool (ConfigRequest); + FreePool(ConfigRequest); } } } @@ -5815,7 +5815,7 @@ GetIfrBinaryData ( Status = mHiiDatabase->ExportPackageLists (mHiiDatabase, Handle, &BufferSize, HiiPackageList); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } ASSERT (HiiPackageList != NULL); @@ -5888,7 +5888,7 @@ GetIfrBinaryData ( // // Form package not found in this Package List // - FreePool (HiiPackageList); + FreePool(HiiPackageList); return EFI_NOT_FOUND; } @@ -5907,7 +5907,7 @@ GetIfrBinaryData ( *BinaryLength = PackageHeader.Length - Offset2; *BinaryData = AllocateCopyPool (*BinaryLength, OpCodeData); - FreePool (HiiPackageList); + FreePool(HiiPackageList); if (*BinaryData == NULL) { return EFI_OUT_OF_RESOURCES; @@ -5943,7 +5943,7 @@ InitializeFormSet ( EFI_HANDLE DriverHandle; Status = GetIfrBinaryData (Handle, FormSetGuid, &FormSet->IfrBinaryLength, &FormSet->IfrBinaryData); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -5956,7 +5956,7 @@ InitializeFormSet ( // Retrieve ConfigAccess Protocol associated with this HiiPackageList // Status = mHiiDatabase->GetPackageListHandle (mHiiDatabase, Handle, &DriverHandle); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } FormSet->DriverHandle = DriverHandle; @@ -5965,7 +5965,7 @@ InitializeFormSet ( &gEfiHiiConfigAccessProtocolGuid, (VOID **) &FormSet->ConfigAccess ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Configuration Driver don't attach ConfigAccess protocol to its HII package // list, then there will be no configuration action required @@ -6123,7 +6123,7 @@ RestoreBrowserContext ( // Remove from FormBrowser context list // RemoveEntryList (&Context->Link); - gBS->FreePool (Context); + gBS->FreePool(Context); } /** @@ -6390,8 +6390,8 @@ RegisterHotKey ( // Remove it from List, and free its resource. // RemoveEntryList (&HotKey->Link); - FreePool (HotKey->KeyData); - FreePool (HotKey->HelpString); + FreePool(HotKey->KeyData); + FreePool(HotKey->HelpString); return EFI_SUCCESS; } else { // @@ -6420,7 +6420,7 @@ RegisterHotKey ( HotKey->Action = Action; HotKey->DefaultId = DefaultId; if (HotKey->HelpString != NULL) { - FreePool (HotKey->HelpString); + FreePool(HotKey->HelpString); } HotKey->HelpString = AllocateCopyPool (StrSize (HelpString), HelpString); @@ -6532,7 +6532,7 @@ ExecuteAction ( // if ((Action & BROWSER_ACTION_DISCARD) != 0) { Status = DiscardForm (FormSet, Form, gBrowserSettingScope); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -6542,7 +6542,7 @@ ExecuteAction ( // if ((Action & BROWSER_ACTION_DEFAULT) != 0) { Status = ExtractDefault (FormSet, Form, DefaultId, gBrowserSettingScope, GetDefaultForAll, NULL, FALSE, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } UpdateStatementStatus (FormSet, Form, gBrowserSettingScope); @@ -6553,7 +6553,7 @@ ExecuteAction ( // if ((Action & BROWSER_ACTION_SUBMIT) != 0) { Status = SubmitForm (FormSet, Form, gBrowserSettingScope); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c index 3cdb0b1ed..ccd4bdb9b 100644 --- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c +++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c @@ -455,7 +455,7 @@ SmbiosAdd ( // Enter into critical section // Status = EfiAcquireLockOrFail (&Private->DataLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -610,7 +610,7 @@ SmbiosUpdateString ( // Enter into critical section // Status = EfiAcquireLockOrFail (&Private->DataLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -814,7 +814,7 @@ SmbiosRemove ( // Enter into critical section // Status = EfiAcquireLockOrFail (&Private->DataLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1063,7 +1063,7 @@ SmbiosCreateTable ( EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)), &PhysicalAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SmbiosCreateTable () could not allocate EntryPointStructure < 4GB\n")); Status = gBS->AllocatePages ( AllocateAnyPages, @@ -1071,7 +1071,7 @@ SmbiosCreateTable ( EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)), &PhysicalAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } } @@ -1158,7 +1158,7 @@ SmbiosCreateTable ( EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength), &PhysicalAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SmbiosCreateTable() could not allocate SMBIOS table < 4GB\n")); EntryPointStructure->TableAddress = 0; return EFI_OUT_OF_RESOURCES; @@ -1254,7 +1254,7 @@ SmbiosCreate64BitTable ( EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_3_0_ENTRY_POINT)), &PhysicalAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SmbiosCreate64BitTable() could not allocate Smbios30EntryPointStructure\n")); return EFI_OUT_OF_RESOURCES; } @@ -1326,7 +1326,7 @@ SmbiosCreate64BitTable ( EFI_SIZE_TO_PAGES (Smbios30EntryPointStructure->TableMaximumSize), &PhysicalAddress ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((EFI_D_ERROR, "SmbiosCreateTable() could not allocate SMBIOS 64-bit table\n")); Smbios30EntryPointStructure->TableAddress = 0; return EFI_OUT_OF_RESOURCES; @@ -1395,14 +1395,14 @@ SmbiosTableConstruction ( if (Smbios32BitTable) { Status = SmbiosCreateTable ((VOID **) &Eps); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->InstallConfigurationTable (&gEfiSmbiosTableGuid, Eps); } } if (Smbios64BitTable) { Status = SmbiosCreate64BitTable ((VOID **) &Eps64Bit); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->InstallConfigurationTable (&gEfiSmbios3TableGuid, Eps64Bit); } } diff --git a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c index 7b5d47314..8ba1f8f69 100644 --- a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c +++ b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c @@ -476,7 +476,7 @@ MeasureSmbiosTable ( &gEfiSmbios3TableGuid, (VOID **) &Smbios3Table ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "Smbios3Table:\n")); DEBUG ((EFI_D_INFO, " AnchorString - '%c%c%c%c%c'\n", Smbios3Table->AnchorString[0], @@ -501,7 +501,7 @@ MeasureSmbiosTable ( &gEfiSmbiosTableGuid, (VOID **) &SmbiosTable ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "SmbiosTable:\n")); DEBUG ((EFI_D_INFO, " AnchorString - '%c%c%c%c'\n", SmbiosTable->AnchorString[0], @@ -577,7 +577,7 @@ MeasureSmbiosTable ( TableAddress, // HashData TableLength // HashDataLen ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } } @@ -606,7 +606,7 @@ SmbiosMeasurementDriverEntryPoint ( EFI_EVENT Event; Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **) &mSmbios); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); DEBUG ((DEBUG_INFO, "The Smbios Table Version: %x.%x\n", mSmbios->MajorVersion, mSmbios->MinorVersion)); if (mSmbios->MajorVersion < 2 || (mSmbios->MajorVersion == 2 && mSmbios->MinorVersion < 7)){ diff --git a/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c b/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c index 9a5dbb272..4e73e679c 100644 --- a/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c +++ b/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c @@ -86,7 +86,7 @@ SmmCommunicationBufferEntryPoint ( // Publish this table, so that other driver can use the buffer. // Status = gBS->InstallConfigurationTable (&gEdkiiPiSmmCommunicationRegionTableGuid, PiSmmCommunicationRegionTable); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.c b/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.c index 1b07f92f3..f9740eb9a 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.c +++ b/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.c @@ -38,7 +38,7 @@ StatusCodeHandlerPeiEntry ( NULL, (VOID **) &RscHandlerPpi ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Dispatch initialization request to sub-statuscode-devices. @@ -47,15 +47,15 @@ StatusCodeHandlerPeiEntry ( // if (FeaturePcdGet (PcdStatusCodeUseSerial)) { Status = SerialPortInitialize(); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = RscHandlerPpi->Register (SerialStatusCodeReportWorker); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (FeaturePcdGet (PcdStatusCodeUseMemory)) { Status = MemoryStatusCodeInitializeWorker (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = RscHandlerPpi->Register (MemoryStatusCodeReportWorker); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } return EFI_SUCCESS; diff --git a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c index 79cc48fa5..c0bf0f570 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c +++ b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c @@ -85,11 +85,11 @@ InitializationDispatcherWorker ( // Call Serial Port Lib API to initialize serial port. // Status = SerialPortInitialize (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (FeaturePcdGet (PcdStatusCodeUseMemory)) { Status = RtMemoryStatusCodeInitializeWorker (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // @@ -164,7 +164,7 @@ StatusCodeHandlerRuntimeDxeEntry ( NULL, (VOID **) &mRscHandlerProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Dispatch initialization request to supported devices @@ -195,7 +195,7 @@ StatusCodeHandlerRuntimeDxeEntry ( &gEfiEventVirtualAddressChangeGuid, &mVirtualAddressChangeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c index f54991ed3..8353194ee 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c @@ -33,11 +33,11 @@ InitializationDispatcherWorker ( // Call Serial Port Lib API to initialize serial port. // Status = SerialPortInitialize (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } if (FeaturePcdGet (PcdStatusCodeUseMemory)) { Status = MemoryStatusCodeInitializeWorker (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -66,7 +66,7 @@ StatusCodeHandlerSmmEntry ( NULL, (VOID **) &mRscHandlerProtocol ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Dispatch initialization request to supported devices diff --git a/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.c b/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.c index 2ca4ae5cd..3a44fd20a 100644 --- a/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.c +++ b/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.c @@ -154,7 +154,7 @@ TimestampDriverInitialize ( NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c b/MdeModulePkg/Universal/Variable/Pei/Variable.c index 715802f33..263f114c5 100644 --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c @@ -966,7 +966,7 @@ FindVariable ( VendorGuid, PtrTrack ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return Status; } } @@ -1032,7 +1032,7 @@ PeiGetVariable ( // Find existing variable // Status = FindVariable (VariableName, VariableGuid, &Variable, &StoreInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } GetVariableHeader (&StoreInfo, Variable.CurrPtr, &VariableHeader); @@ -1181,7 +1181,7 @@ PeiGetNextVariableName ( GetVendorGuidPtr (VariableHeader, StoreInfo.AuthFlag), &VariablePtrTrack ); - if (!EFI_ERROR (Status) && VariablePtrTrack.CurrPtr != Variable.CurrPtr) { + if (!EFI_ERROR(Status) && VariablePtrTrack.CurrPtr != Variable.CurrPtr) { Variable.CurrPtr = GetNextVariablePtr (&StoreInfo, Variable.CurrPtr, VariableHeader); continue; } @@ -1199,7 +1199,7 @@ PeiGetNextVariableName ( GetVendorGuidPtr (VariableHeader, StoreInfo.AuthFlag), &VariableInHob ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Variable.CurrPtr = GetNextVariablePtr (&StoreInfo, Variable.CurrPtr, VariableHeader); continue; } diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c index 75350ca2e..cf9ac3129 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c @@ -132,7 +132,7 @@ MeasureVariable ( VarLog, VarLogSize ); - FreePool (VarLog); + FreePool(VarLog); return Status; } @@ -192,7 +192,7 @@ InternalGetVariable ( // Get the variable data. // Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreePool(*Value); *Value = NULL; } @@ -237,7 +237,7 @@ SecureBootHook ( &VariableData, &VariableDataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Measure DBT only if present and not empty // @@ -260,7 +260,7 @@ SecureBootHook ( DEBUG ((EFI_D_INFO, "MeasureBootPolicyVariable - %r\n", Status)); if (VariableData != NULL) { - FreePool (VariableData); + FreePool(VariableData); } // @@ -274,7 +274,7 @@ SecureBootHook ( &VariableData, &VariableDataSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Reclaim.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Reclaim.c index 1def8e249..fe27a2456 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Reclaim.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Reclaim.c @@ -48,7 +48,7 @@ GetLbaAndOffsetByAddress ( // Get the proper FVB protocol. // Status = GetFvbInfoByAddress (Address, NULL, &Fvb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -56,7 +56,7 @@ GetLbaAndOffsetByAddress ( // Get the Base Address of FV. // Status = Fvb->GetPhysicalAddress (Fvb, &FvbBaseAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -117,21 +117,21 @@ FtwVariableSpace ( // Locate fault tolerant write protocol. // Status = GetFtwProtocol((VOID **) &FtwProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } // // Locate Fvb handle by address. // Status = GetFvbInfoByAddress (VariableBase, &FvbHandle, NULL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // // Get LBA and Offset by address. // Status = GetLbaAndOffsetByAddress (VariableBase, &VarLba, &VarOffset); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_ABORTED; } diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c index 6d80eb643..7f44e4757 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c @@ -197,7 +197,7 @@ SetVariableCheckHandlerMorLock ( // Unlock // Status = SetMorLockVariable (MOR_LOCK_DATA_UNLOCKED); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // return EFI_ALREADY_STARTED to skip variable set. // @@ -213,7 +213,7 @@ SetVariableCheckHandlerMorLock ( // Lock without key // Status = SetMorLockVariable (MOR_LOCK_DATA_LOCKED_WITHOUT_KEY); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Lock success // @@ -277,7 +277,7 @@ SetVariableCheckHandlerMorLock ( // Need set here because the data value on flash is different // Status = SetMorLockVariable (MOR_LOCK_DATA_UNLOCKED); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // SetVar fail // @@ -436,7 +436,7 @@ MorLockInitAtEndOfDxe ( // // We provided a zero-sized buffer, so the above call can never succeed. // - ASSERT (EFI_ERROR (MorStatus)); + ASSERT (EFI_ERROR(MorStatus)); if (MorStatus == EFI_BUFFER_TOO_SMALL) { // diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VarCheck.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VarCheck.c index f15219df5..b65fb5e72 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VarCheck.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VarCheck.c @@ -39,7 +39,7 @@ VariableLockRequestToLock ( AcquireLockOnlyAtBootTime (&mVariableModuleGlobal->VariableGlobal.VariableServicesLock); Status = VarCheckLibVariablePropertyGet (VariableName, VendorGuid, &Property); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Property.Property |= VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY; } else { Property.Revision = VAR_CHECK_VARIABLE_PROPERTY_REVISION; diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 58d93789e..ae28d2e1b 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -273,7 +273,7 @@ UpdateVariableStore ( return EFI_UNSUPPORTED; } Status = Fvb->GetPhysicalAddress(Fvb, &FvVolHdr); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Data Pointer should point to the actual Address where data is to be @@ -358,7 +358,7 @@ UpdateVariableStore ( &Size, CurrBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -773,7 +773,7 @@ RecordVarErrorFlag ( &mVariableModuleGlobal->VariableGlobal, FALSE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { VarErrFlag = (VAR_ERROR_FLAG *) GetVariableDataPtr (Variable.CurrPtr); TempFlag = *VarErrFlag; TempFlag &= Flag; @@ -789,7 +789,7 @@ RecordVarErrorFlag ( sizeof (TempFlag), &TempFlag ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update the data in NV cache. // @@ -831,7 +831,7 @@ InitializeVarErrorFlag ( &mVariableModuleGlobal->VariableGlobal, FALSE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { VarErrFlag = *((VAR_ERROR_FLAG *) GetVariableDataPtr (Variable.CurrPtr)); if (VarErrFlag == Flag) { return; @@ -1187,7 +1187,7 @@ Reclaim ( VariableBase, (VARIABLE_STORE_HEADER *) ValidBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { *LastVariableOffset = (UINTN) CurrPtr - (UINTN) ValidBuffer; mVariableModuleGlobal->HwErrVariableTotalSize = HwErrVariableTotalSize; mVariableModuleGlobal->CommonVariableTotalSize = CommonVariableTotalSize; @@ -1217,7 +1217,7 @@ Reclaim ( Done: if (IsVolatile || mVariableModuleGlobal->VariableGlobal.EmuNvMode) { - FreePool (ValidBuffer); + FreePool(ValidBuffer); } else { // // For NV variable reclaim, we use mNvVariableCache as the buffer, so copy the data back. @@ -1362,7 +1362,7 @@ FindVariable ( PtrTrack->Volatile = (BOOLEAN) (Type == VariableStoreTypeVolatile); Status = FindVariableEx (VariableName, VendorGuid, IgnoreRtCheck, PtrTrack); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return Status; } } @@ -1718,7 +1718,7 @@ CheckRemainingSpaceForConsistencyInternal ( &RemainingVariableStorageSize, &MaximumVariableSize ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); TotalNeededSize = 0; VA_COPY (Args, Marker); @@ -1766,7 +1766,7 @@ CheckRemainingSpaceForConsistencyInternal ( FALSE, &VariablePtrTrack ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Get size of Variable[Index]. // @@ -1893,7 +1893,7 @@ AutoUpdateLangVariable ( // Therefore, in variable driver, only store the original value for other use. // if (mVariableModuleGlobal->PlatformLangCodes != NULL) { - FreePool (mVariableModuleGlobal->PlatformLangCodes); + FreePool(mVariableModuleGlobal->PlatformLangCodes); } mVariableModuleGlobal->PlatformLangCodes = AllocateRuntimeCopyPool (DataSize, Data); ASSERT (mVariableModuleGlobal->PlatformLangCodes != NULL); @@ -1903,7 +1903,7 @@ AutoUpdateLangVariable ( // so the size of PlatformLangCodes is enough for the PlatformLang. // if (mVariableModuleGlobal->PlatformLang != NULL) { - FreePool (mVariableModuleGlobal->PlatformLang); + FreePool(mVariableModuleGlobal->PlatformLang); } mVariableModuleGlobal->PlatformLang = AllocateRuntimePool (DataSize); ASSERT (mVariableModuleGlobal->PlatformLang != NULL); @@ -1923,7 +1923,7 @@ AutoUpdateLangVariable ( // Therefore, in variable driver, only store the original value for other use. // if (mVariableModuleGlobal->LangCodes != NULL) { - FreePool (mVariableModuleGlobal->LangCodes); + FreePool(mVariableModuleGlobal->LangCodes); } mVariableModuleGlobal->LangCodes = AllocateRuntimeCopyPool (DataSize, Data); ASSERT (mVariableModuleGlobal->LangCodes != NULL); @@ -1937,7 +1937,7 @@ AutoUpdateLangVariable ( // Update PlatformLang if Lang is already set // Status = FindVariable (EFI_PLATFORM_LANG_VARIABLE_NAME, &gEfiGlobalVariableGuid, &Variable, &mVariableModuleGlobal->VariableGlobal, FALSE); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update Lang // @@ -1946,7 +1946,7 @@ AutoUpdateLangVariable ( DataSize = DataSizeOfVariable (Variable.CurrPtr); } else { Status = FindVariable (EFI_LANG_VARIABLE_NAME, &gEfiGlobalVariableGuid, &Variable, &mVariableModuleGlobal->VariableGlobal, FALSE); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update PlatformLang // @@ -2195,7 +2195,7 @@ UpdateVariable ( CacheVariable->EndPtr = GetEndPointer (mNvVariableCache); CacheVariable->Volatile = FALSE; Status = FindVariableEx (VariableName, VendorGuid, FALSE, CacheVariable); - if (CacheVariable->CurrPtr == NULL || EFI_ERROR (Status)) { + if (CacheVariable->CurrPtr == NULL || EFI_ERROR(Status)) { // // There is no matched variable in NV variable cache. // @@ -2300,7 +2300,7 @@ UpdateVariable ( sizeof (UINT8), &State ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (!Variable->Volatile) { CacheVariable->InDeletedTransitionPtr->State = State; } @@ -2321,7 +2321,7 @@ UpdateVariable ( sizeof (UINT8), &State ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UpdateVariableInfo (VariableName, VendorGuid, Variable->Volatile, FALSE, FALSE, TRUE, FALSE); if (!Variable->Volatile) { CacheVariable->CurrPtr->State = State; @@ -2411,7 +2411,7 @@ UpdateVariable ( sizeof (UINT8), &State ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } if (!Variable->Volatile) { @@ -2562,7 +2562,7 @@ UpdateVariable ( NextVariable, HEADER_ALIGN (VarSize) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The new variable has been integrated successfully during reclaiming. // @@ -2604,7 +2604,7 @@ UpdateVariable ( (UINT8 *) NextVariable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2622,7 +2622,7 @@ UpdateVariable ( &NextVariable->State ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -2638,7 +2638,7 @@ UpdateVariable ( (UINT8 *) NextVariable + GetVariableHeaderSize () ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } // @@ -2655,7 +2655,7 @@ UpdateVariable ( &NextVariable->State ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2678,7 +2678,7 @@ UpdateVariable ( (UINT8 *) NextVariable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } } @@ -2712,7 +2712,7 @@ UpdateVariable ( NextVariable, HEADER_ALIGN (VarSize) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The new variable has been integrated successfully during reclaiming. // @@ -2736,7 +2736,7 @@ UpdateVariable ( (UINT8 *) NextVariable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -2746,7 +2746,7 @@ UpdateVariable ( // // Mark the old variable as deleted. // - if (!EFI_ERROR (Status) && Variable->CurrPtr != NULL) { + if (!EFI_ERROR(Status) && Variable->CurrPtr != NULL) { if (Variable->InDeletedTransitionPtr != NULL) { // // Both ADDED and IN_DELETED_TRANSITION old variable are present, @@ -2764,7 +2764,7 @@ UpdateVariable ( sizeof (UINT8), &State ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (!Variable->Volatile) { CacheVariable->InDeletedTransitionPtr->State = State; } @@ -2785,12 +2785,12 @@ UpdateVariable ( sizeof (UINT8), &State ); - if (!EFI_ERROR (Status) && !Variable->Volatile) { + if (!EFI_ERROR(Status) && !Variable->Volatile) { CacheVariable->CurrPtr->State = State; } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UpdateVariableInfo (VariableName, VendorGuid, Volatile, FALSE, TRUE, FALSE, FALSE); if (!Volatile) { FlushHobVariableToFlash (VariableName, VendorGuid); @@ -2848,7 +2848,7 @@ VariableServiceGetVariable ( AcquireLockOnlyAtBootTime(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock); Status = FindVariable (VariableName, VendorGuid, &Variable, &mVariableModuleGlobal->VariableGlobal, FALSE); - if (Variable.CurrPtr == NULL || EFI_ERROR (Status)) { + if (Variable.CurrPtr == NULL || EFI_ERROR(Status)) { goto Done; } @@ -2923,7 +2923,7 @@ VariableServiceGetNextVariableInternal ( VARIABLE_STORE_HEADER *VariableStoreHeader[VariableStoreTypeMax]; Status = FindVariable (VariableName, VendorGuid, &Variable, &mVariableModuleGlobal->VariableGlobal, FALSE); - if (Variable.CurrPtr == NULL || EFI_ERROR (Status)) { + if (Variable.CurrPtr == NULL || EFI_ERROR(Status)) { // // For VariableName is an empty string, FindVariable() will try to find and return // the first qualified variable, and if FindVariable() returns error (EFI_NOT_FOUND) @@ -3011,7 +3011,7 @@ VariableServiceGetNextVariableInternal ( FALSE, &VariablePtrTrack ); - if (!EFI_ERROR (Status) && VariablePtrTrack.CurrPtr->State == VAR_ADDED) { + if (!EFI_ERROR(Status) && VariablePtrTrack.CurrPtr->State == VAR_ADDED) { Variable.CurrPtr = GetNextVariablePtr (Variable.CurrPtr); continue; } @@ -3031,7 +3031,7 @@ VariableServiceGetNextVariableInternal ( FALSE, &VariableInHob ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Variable.CurrPtr = GetNextVariablePtr (Variable.CurrPtr); continue; } @@ -3107,7 +3107,7 @@ VariableServiceGetNextVariableName ( AcquireLockOnlyAtBootTime(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock); Status = VariableServiceGetNextVariableInternal (VariableName, VendorGuid, &VariablePtr); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { VarNameSize = NameSizeOfVariable (VariablePtr); ASSERT (VarNameSize != 0); if (VarNameSize <= *VariableNameSize) { @@ -3327,12 +3327,12 @@ VariableServiceSetVariable ( // return EFI_SUCCESS; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = VarCheckLibSetVariableCheck (VariableName, VendorGuid, Attributes, PayloadSize, (VOID *) ((UINTN) Data + DataSize - PayloadSize), mRequestSource); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -3357,7 +3357,7 @@ VariableServiceSetVariable ( // Check whether the input variable is already existed. // Status = FindVariable (VariableName, VendorGuid, &Variable, &mVariableModuleGlobal->VariableGlobal, TRUE); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (((Variable.CurrPtr->Attributes & EFI_VARIABLE_RUNTIME_ACCESS) == 0) && AtRuntime ()) { Status = EFI_WRITE_PROTECTED; goto Done; @@ -3380,7 +3380,7 @@ VariableServiceSetVariable ( // Hook the operation of setting PlatformLangCodes/PlatformLang and LangCodes/Lang. // Status = AutoUpdateLangVariable (VariableName, Data, DataSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // The auto update operation failed, directly return to avoid inconsistency between PlatformLang and Lang. // @@ -3399,7 +3399,7 @@ Done: ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal->VariableGlobal.VariableServicesLock); if (!AtRuntime ()) { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SecureBootHook ( VariableName, VendorGuid @@ -3544,7 +3544,7 @@ VariableServiceQueryVariableInfoInternal ( FALSE, &VariablePtrTrack ); - if (!EFI_ERROR (Status) && VariablePtrTrack.CurrPtr->State != VAR_ADDED) { + if (!EFI_ERROR(Status) && VariablePtrTrack.CurrPtr->State != VAR_ADDED) { if ((Variable->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) { HwErrVariableTotalSize += VariableSize; } else { @@ -3721,7 +3721,7 @@ ReclaimForOS( NULL, 0 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -3823,7 +3823,7 @@ InitRealNonVolatileVariableStore ( // // If FTW protocol has been installed, no need to check FTW last write data hob. // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Check the FTW last write data hob. // @@ -3858,7 +3858,7 @@ InitRealNonVolatileVariableStore ( // Check if the Firmware Volume is not corrupted // if ((FvHeader->Signature != EFI_FVH_SIGNATURE) || (!CompareGuid (&gEfiSystemNvDataFvGuid, &FvHeader->FileSystemGuid))) { - FreePool (NvStorageData); + FreePool(NvStorageData); DEBUG ((EFI_D_ERROR, "Firmware Volume for Variable Store is corrupted\n")); return EFI_VOLUME_CORRUPTED; } @@ -3872,7 +3872,7 @@ InitRealNonVolatileVariableStore ( // Check if the Variable Store header is not corrupted // if (GetVariableStoreStatus (VariableStore) != EfiValid) { - FreePool (NvStorageData); + FreePool(NvStorageData); DEBUG((EFI_D_ERROR, "Variable Store header is corrupted\n")); return EFI_VOLUME_CORRUPTED; } @@ -4025,14 +4025,14 @@ InitNonVolatileVariableStore ( if (PcdGetBool (PcdEmuVariableNvModeEnable)) { Status = InitEmuNonVolatileVariableStore (&VariableStoreBase); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } mVariableModuleGlobal->VariableGlobal.EmuNvMode = TRUE; DEBUG ((DEBUG_INFO, "Variable driver will work at emulated non-volatile variable mode!\n")); } else { Status = InitRealNonVolatileVariableStore (&VariableStoreBase); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } mVariableModuleGlobal->VariableGlobal.EmuNvMode = FALSE; @@ -4132,7 +4132,7 @@ FlushHobVariableToFlash ( // Status = EFI_SUCCESS; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // If set variable successful, or the updated or deleted variable is matched with the HOB variable, // set the HOB variable to DELETED state in local. @@ -4154,7 +4154,7 @@ FlushHobVariableToFlash ( // DEBUG ((EFI_D_INFO, "Variable driver: all HOB variables have been flushed in flash.\n")); if (!AtRuntime ()) { - FreePool ((VOID *) VariableStoreHeader); + FreePool((VOID *) VariableStoreHeader); } } } @@ -4197,7 +4197,7 @@ VariableWriteServiceInitialize ( NULL, 0 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal->VariableGlobal.VariableServicesLock); return Status; } @@ -4216,7 +4216,7 @@ VariableWriteServiceInitialize ( mAuthContextIn.StructSize = sizeof (AUTH_VAR_LIB_CONTEXT_IN); mAuthContextIn.MaxAuthVariableSize = mVariableModuleGlobal->MaxAuthVariableSize - GetVariableHeaderSize (); Status = AuthVariableLibInitialize (&mAuthContextIn, &mAuthContextOut); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((EFI_D_INFO, "Variable driver will work with auth variable support!\n")); mVariableModuleGlobal->VariableGlobal.AuthSupport = TRUE; if (mAuthContextOut.AuthVarEntry != NULL) { @@ -4227,7 +4227,7 @@ VariableWriteServiceInitialize ( VariableEntry->Guid, &VariableEntry->VariableProperty ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } } else if (Status == EFI_UNSUPPORTED) { @@ -4238,11 +4238,11 @@ VariableWriteServiceInitialize ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < ARRAY_SIZE (mVariableEntryProperty); Index++) { VariableEntry = &mVariableEntryProperty[Index]; Status = VarCheckLibVariablePropertySet (VariableEntry->Name, VariableEntry->Guid, &VariableEntry->VariableProperty); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } @@ -4468,8 +4468,8 @@ VariableCommonInitialize ( // Init non-volatile variable store. // Status = InitNonVolatileVariableStore (); - if (EFI_ERROR (Status)) { - FreePool (mVariableModuleGlobal); + if (EFI_ERROR(Status)) { + FreePool(mVariableModuleGlobal); return Status; } @@ -4494,11 +4494,11 @@ VariableCommonInitialize ( // Get HOB variable store. // Status = GetHobVariableStore (VariableGuid); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (mNvFvHeaderCache != NULL) { - FreePool (mNvFvHeaderCache); + FreePool(mNvFvHeaderCache); } - FreePool (mVariableModuleGlobal); + FreePool(mVariableModuleGlobal); return Status; } @@ -4514,12 +4514,12 @@ VariableCommonInitialize ( VolatileVariableStore = AllocateRuntimePool (PcdGet32 (PcdVariableStoreSize) + ScratchSize); if (VolatileVariableStore == NULL) { if (mVariableModuleGlobal->VariableGlobal.HobVariableBase != 0) { - FreePool ((VOID *) (UINTN) mVariableModuleGlobal->VariableGlobal.HobVariableBase); + FreePool((VOID *) (UINTN) mVariableModuleGlobal->VariableGlobal.HobVariableBase); } if (mNvFvHeaderCache != NULL) { - FreePool (mNvFvHeaderCache); + FreePool(mNvFvHeaderCache); } - FreePool (mVariableModuleGlobal); + FreePool(mVariableModuleGlobal); return EFI_OUT_OF_RESOURCES; } @@ -4572,7 +4572,7 @@ GetFvbInfoByAddress ( // Get all FVB handles. // Status = GetFvbCountAndBuffer (&HandleCount, &HandleBuffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -4582,7 +4582,7 @@ GetFvbInfoByAddress ( Fvb = NULL; for (Index = 0; Index < HandleCount; Index += 1, Status = EFI_NOT_FOUND, Fvb = NULL) { Status = GetFvbByHandle (HandleBuffer[Index], &Fvb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; break; } @@ -4591,7 +4591,7 @@ GetFvbInfoByAddress ( // Ensure this FVB protocol supported Write operation. // Status = Fvb->GetAttributes (Fvb, &Attributes); - if (EFI_ERROR (Status) || ((Attributes & EFI_FVB2_WRITE_STATUS) == 0)) { + if (EFI_ERROR(Status) || ((Attributes & EFI_FVB2_WRITE_STATUS) == 0)) { continue; } @@ -4599,7 +4599,7 @@ GetFvbInfoByAddress ( // Compare the address and select the right one. // Status = Fvb->GetPhysicalAddress (Fvb, &FvbBaseAddress); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -4607,7 +4607,7 @@ GetFvbInfoByAddress ( // Assume one FVB has one type of BlockSize. // Status = Fvb->GetBlockSize (Fvb, 0, &BlockSize, &NumberOfBlocks); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -4622,7 +4622,7 @@ GetFvbInfoByAddress ( break; } } - FreePool (HandleBuffer); + FreePool(HandleBuffer); if (Fvb == NULL) { Status = EFI_NOT_FOUND; diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c index 3d232bb36..fec4a3d00 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c @@ -349,7 +349,7 @@ VariableWriteServiceInitializeDxe ( EFI_STATUS Status; Status = VariableWriteServiceInitialize (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Variable write service initialization failed. Status = %r\n", Status)); } @@ -368,7 +368,7 @@ VariableWriteServiceInitializeDxe ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -403,12 +403,12 @@ FtwNotificationEvent ( // Ensure FTW protocol is installed. // Status = GetFtwProtocol ((VOID**) &FtwProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } Status = FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (PcdGet32 (PcdFlashNvStorageVariableSize) <= FtwMaxBlockSize); } @@ -424,7 +424,7 @@ FtwNotificationEvent ( // Find the proper FVB protocol for variable. // Status = GetFvbInfoByAddress (NvStorageVariableBase, NULL, &FvbProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } mVariableModuleGlobal->FvbInstance = FvbProtocol; @@ -438,7 +438,7 @@ FtwNotificationEvent ( Length = (Length + EFI_PAGE_SIZE - 1) & (~EFI_PAGE_MASK); Status = gDS->GetMemorySpaceDescriptor (BaseAddress, &GcdDescriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "Variable driver failed to get flash memory attribute.\n")); } else { if ((GcdDescriptor.Attributes & EFI_MEMORY_RUNTIME) == 0) { @@ -447,7 +447,7 @@ FtwNotificationEvent ( Length, GcdDescriptor.Attributes | EFI_MEMORY_RUNTIME ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_WARN, "Variable driver failed to add EFI_MEMORY_RUNTIME attribute to Flash.\n")); } } @@ -490,7 +490,7 @@ VariableServiceInitialize ( EFI_EVENT EndOfDxeEvent; Status = VariableCommonInitialize (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->InstallMultipleProtocolInterfaces ( &mHandle, @@ -498,7 +498,7 @@ VariableServiceInitialize ( &mVariableLock, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->InstallMultipleProtocolInterfaces ( &mHandle, @@ -506,7 +506,7 @@ VariableServiceInitialize ( &mVarCheck, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); SystemTable->RuntimeServices->GetVariable = VariableServiceGetVariable; SystemTable->RuntimeServices->GetNextVariableName = VariableServiceGetNextVariableName; @@ -522,7 +522,7 @@ VariableServiceInitialize ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (!PcdGetBool (PcdEmuVariableNvModeEnable)) { // @@ -550,7 +550,7 @@ VariableServiceInitialize ( &gEfiEventVirtualAddressChangeGuid, &mVirtualAddressChangeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register the event handling function to reclaim variable for OS usage. @@ -561,7 +561,7 @@ VariableServiceInitialize ( NULL, &ReadyToBootEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register the event handling function to set the End Of DXE flag. @@ -574,7 +574,7 @@ VariableServiceInitialize ( &gEfiEndOfDxeEventGroupGuid, &EndOfDxeEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c index cb6fcebe2..ed235acf7 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c @@ -45,7 +45,7 @@ VariableExLibFindVariable ( &mVariableModuleGlobal->VariableGlobal, FALSE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AuthVariableInfo->Data = NULL; AuthVariableInfo->DataSize = 0; AuthVariableInfo->Attributes = 0; @@ -103,7 +103,7 @@ VariableExLibFindNextVariable ( VendorGuid, &VariablePtr ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AuthVariableInfo->VariableName = NULL; AuthVariableInfo->VendorGuid = NULL; AuthVariableInfo->Data = NULL; diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c index ec463d063..6a4b95a96 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c @@ -303,7 +303,7 @@ GetFvbCountAndBuffer ( *NumberHandles = BufferSize / sizeof(EFI_HANDLE); if (EFI_ERROR(Status)) { *NumberHandles = 0; - FreePool (*Buffer); + FreePool(*Buffer); *Buffer = NULL; } @@ -845,7 +845,7 @@ VariableWriteServiceInitializeSmm ( EFI_STATUS Status; Status = VariableWriteServiceInitialize (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Variable write service initialization failed. Status = %r\n", Status)); } @@ -892,12 +892,12 @@ SmmFtwNotificationEvent ( // Ensure SMM FTW protocol is installed. // Status = GetFtwProtocol ((VOID **)&FtwProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (PcdGet32 (PcdFlashNvStorageVariableSize) <= FtwMaxBlockSize); } @@ -913,7 +913,7 @@ SmmFtwNotificationEvent ( // Find the proper FVB protocol for variable. // Status = GetFvbInfoByAddress (NvStorageVariableBase, NULL, &FvbProtocol); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -952,7 +952,7 @@ MmVariableServiceInitialize ( // Variable initialize. // Status = VariableCommonInitialize (); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install the Smm Variable Protocol on a new handle. @@ -964,7 +964,7 @@ MmVariableServiceInitialize ( EFI_NATIVE_INTERFACE, &gSmmVariable ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gMmst->MmInstallProtocolInterface ( &VariableHandle, @@ -972,7 +972,7 @@ MmVariableServiceInitialize ( EFI_NATIVE_INTERFACE, &mSmmVarCheck ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mVariableBufferPayloadSize = GetMaxVariableSize () + OFFSET_OF (SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY, Name) - GetVariableHeaderSize (); @@ -982,14 +982,14 @@ MmVariableServiceInitialize ( mVariableBufferPayloadSize, (VOID **)&mVariableBufferPayload ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); /// /// Register SMM variable SMI handler /// VariableHandle = NULL; Status = gMmst->MmiHandlerRegister (SmmVariableHandler, &gEfiSmmVariableProtocolGuid, &VariableHandle); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Notify the variable wrapper driver the variable service is ready @@ -1004,7 +1004,7 @@ MmVariableServiceInitialize ( SmmEndOfDxeCallback, &SmmEndOfDxeRegistration ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (!PcdGetBool (PcdEmuVariableNvModeEnable)) { // @@ -1015,7 +1015,7 @@ MmVariableServiceInitialize ( SmmFtwNotificationEvent, &SmmFtwRegistration ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); SmmFtwNotificationEvent (NULL, NULL, NULL); } else { diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c index 0a1888e5e..d97927e03 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -174,7 +174,7 @@ SendCommunicateBuffer ( CommSize = DataSize + SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE; Status = mSmmCommunication->Communicate (mSmmCommunication, mVariableBufferPhysical, &CommSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); SmmCommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *) mVariableBuffer; SmmVariableFunctionHeader = (SMM_VARIABLE_COMMUNICATE_HEADER *)SmmCommunicateHeader->Data; @@ -231,7 +231,7 @@ VariableLockRequestToLock ( // PayloadSize = OFFSET_OF (SMM_VARIABLE_COMMUNICATE_LOCK_VARIABLE, Name) + VariableNameSize; Status = InitCommunicateBuffer ((VOID **) &VariableToLock, PayloadSize, SMM_VARIABLE_FUNCTION_LOCK_VARIABLE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (VariableToLock != NULL); @@ -331,7 +331,7 @@ VarCheckVariablePropertySet ( // PayloadSize = OFFSET_OF (SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY, Name) + VariableNameSize; Status = InitCommunicateBuffer ((VOID **) &CommVariableProperty, PayloadSize, SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_SET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (CommVariableProperty != NULL); @@ -402,7 +402,7 @@ VarCheckVariablePropertyGet ( // PayloadSize = OFFSET_OF (SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY, Name) + VariableNameSize; Status = InitCommunicateBuffer ((VOID **) &CommVariableProperty, PayloadSize, SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_GET); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (CommVariableProperty != NULL); @@ -489,7 +489,7 @@ RuntimeServiceGetVariable ( PayloadSize = OFFSET_OF (SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE, Name) + VariableNameSize + TempDataSize; Status = InitCommunicateBuffer ((VOID **)&SmmVariableHeader, PayloadSize, SMM_VARIABLE_FUNCTION_GET_VARIABLE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (SmmVariableHeader != NULL); @@ -523,7 +523,7 @@ RuntimeServiceGetVariable ( *Attributes = SmmVariableHeader->Attributes; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -599,7 +599,7 @@ RuntimeServiceGetNextVariableName ( PayloadSize = OFFSET_OF (SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME, Name) + MAX (OutVariableNameSize, InVariableNameSize); Status = InitCommunicateBuffer ((VOID **)&SmmGetNextVariableName, PayloadSize, SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (SmmGetNextVariableName != NULL); @@ -633,7 +633,7 @@ RuntimeServiceGetNextVariableName ( // *VariableNameSize = SmmGetNextVariableName->NameSize; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -710,7 +710,7 @@ RuntimeServiceSetVariable ( // PayloadSize = OFFSET_OF (SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE, Name) + VariableNameSize + DataSize; Status = InitCommunicateBuffer ((VOID **)&SmmVariableHeader, PayloadSize, SMM_VARIABLE_FUNCTION_SET_VARIABLE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (SmmVariableHeader != NULL); @@ -731,7 +731,7 @@ Done: ReleaseLockOnlyAtBootTime (&mVariableServicesLock); if (!EfiAtRuntime ()) { - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SecureBootHook ( VariableName, VendorGuid @@ -786,7 +786,7 @@ RuntimeServiceQueryVariableInfo ( // PayloadSize = sizeof (SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO); Status = InitCommunicateBuffer ((VOID **)&SmmQueryVariableInfo, PayloadSize, SMM_VARIABLE_FUNCTION_QUERY_VARIABLE_INFO); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } ASSERT (SmmQueryVariableInfo != NULL); @@ -797,7 +797,7 @@ RuntimeServiceQueryVariableInfo ( // Send data to SMM. // Status = SendCommunicateBuffer (PayloadSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -949,10 +949,10 @@ GetVariablePayloadSize ( // Send data to SMM. // Status = mSmmCommunication->Communicate (mSmmCommunication, CommBuffer, &CommSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = SmmVariableFunctionHeader->ReturnStatus; - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -963,7 +963,7 @@ GetVariablePayloadSize ( Done: if (CommBuffer != NULL) { - FreePool (CommBuffer); + FreePool(CommBuffer); } ReleaseLockOnlyAtBootTime (&mVariableServicesLock); return Status; @@ -986,18 +986,18 @@ SmmVariableReady ( EFI_STATUS Status; Status = gBS->LocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOID **)&mSmmVariable); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Allocate memory for variable communicate buffer. // Status = GetVariablePayloadSize (&mVariableBufferPayloadSize); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mVariableBufferSize = SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + mVariableBufferPayloadSize; mVariableBuffer = AllocateRuntimePool (mVariableBufferSize); ASSERT (mVariableBuffer != NULL); @@ -1021,7 +1021,7 @@ SmmVariableReady ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mVariableLock.RequestToLock = VariableLockRequestToLock; Status = gBS->InstallMultipleProtocolInterfaces ( @@ -1030,7 +1030,7 @@ SmmVariableReady ( &mVariableLock, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mVarCheck.RegisterSetVariableCheckHandler = VarCheckRegisterSetVariableCheckHandler; mVarCheck.VariablePropertySet = VarCheckVariablePropertySet; @@ -1041,7 +1041,7 @@ SmmVariableReady ( &mVarCheck, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); gBS->CloseEvent (Event); } @@ -1068,7 +1068,7 @@ SmmVariableWriteReady ( // Check whether the protocol is installed or not. // Status = gBS->LocateProtocol (&gSmmVariableWriteGuid, NULL, (VOID **) &ProtocolOps); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -1084,7 +1084,7 @@ SmmVariableWriteReady ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); gBS->CloseEvent (Event); } diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c index ac43d297f..787da5881 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c @@ -51,7 +51,7 @@ VariableNotifySmmReady ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -72,7 +72,7 @@ VariableNotifySmmWriteReady ( EFI_NATIVE_INTERFACE, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -117,7 +117,7 @@ VariableHaveTcgProtocols ( NULL, // Registration &Interface ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return TRUE; } @@ -126,5 +126,5 @@ VariableHaveTcgProtocols ( NULL, // Registration &Interface ); - return !EFI_ERROR (Status); + return !EFI_ERROR(Status); } diff --git a/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.c b/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.c index f72b4df80..b4a3ab448 100644 --- a/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.c +++ b/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.c @@ -228,7 +228,7 @@ WatchdogTimerDriverInitialize ( NULL, &mWatchdogTimerEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install the Watchdog Timer Arch Protocol onto a new handle @@ -239,7 +239,7 @@ WatchdogTimerDriverInitialize ( &mWatchdogTimer, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h index 2a75bc023..b7a8a94bc 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -2009,7 +2009,7 @@ AsciiStrSize ( **/ INTN EFIAPI -AsciiStrCmp ( +AsciiStrCmp( IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString ); diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h index f1d55cf62..89211689e 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -382,9 +382,9 @@ DebugPrintLevelEnabled ( #define ASSERT_EFI_ERROR(StatusParameter) \ do { \ if (DebugAssertEnabled ()) { \ - if (EFI_ERROR (StatusParameter)) { \ - DEBUG ((EFI_D_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \ - _ASSERT (!EFI_ERROR (StatusParameter)); \ + if (EFI_ERROR(StatusParameter)) { \ + DEBUG ((EFI_D_ERROR, "\nASSERT_EFI_ERROR(Status = %r)\n", StatusParameter)); \ + _ASSERT (!EFI_ERROR(StatusParameter)); \ } \ } \ } while (FALSE) @@ -448,11 +448,11 @@ DebugPrintLevelEnabled ( VOID *Instance; \ ASSERT (Guid != NULL); \ if (Handle == NULL) { \ - if (!EFI_ERROR (gBS->LocateProtocol ((EFI_GUID *)Guid, NULL, &Instance))) { \ + if (!EFI_ERROR(gBS->LocateProtocol ((EFI_GUID *)Guid, NULL, &Instance))) { \ _ASSERT (Guid already installed in database); \ } \ } else { \ - if (!EFI_ERROR (gBS->HandleProtocol (Handle, (EFI_GUID *)Guid, &Instance))) { \ + if (!EFI_ERROR(gBS->HandleProtocol (Handle, (EFI_GUID *)Guid, &Instance))) { \ _ASSERT (Guid already installed on Handle); \ } \ } \ diff --git a/MdePkg/Include/Library/MemoryAllocationLib.h b/MdePkg/Include/Library/MemoryAllocationLib.h index 6b668093b..be46c7fb5 100644 --- a/MdePkg/Include/Library/MemoryAllocationLib.h +++ b/MdePkg/Include/Library/MemoryAllocationLib.h @@ -480,7 +480,7 @@ ReallocateReservedPool ( **/ VOID EFIAPI -FreePool ( +FreePool( IN JCONST VOID *Buffer ); diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c index 7d459d1c8..cf1d62cd0 100644 --- a/MdePkg/Library/BaseLib/String.c +++ b/MdePkg/Library/BaseLib/String.c @@ -1273,7 +1273,7 @@ AsciiStrSize ( **/ INTN EFIAPI -AsciiStrCmp ( +AsciiStrCmp( IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString ) diff --git a/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c b/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c index 650a76148..09a5fb0ce 100644 --- a/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c +++ b/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c @@ -171,7 +171,7 @@ OrderedCollectionUninit ( ) { ASSERT (OrderedCollectionIsEmpty (Tree)); - FreePool (Tree); + FreePool(Tree); } @@ -1102,7 +1102,7 @@ OrderedCollectionDelete ( } } - FreePool (Node); + FreePool(Node); // // If the node that we unlinked from its original spot (ie. Node itself, or diff --git a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c index 4dfe450be..fac1d1459 100644 --- a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c +++ b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c @@ -82,13 +82,13 @@ ReallocateExtractHandlerTable ( Done: if (mExtractHandlerGuidTable != NULL) { - FreePool (mExtractHandlerGuidTable); + FreePool(mExtractHandlerGuidTable); } if (mExtractDecodeHandlerTable != NULL) { - FreePool (mExtractDecodeHandlerTable); + FreePool(mExtractDecodeHandlerTable); } if (mExtractGetInfoHandlerTable != NULL) { - FreePool (mExtractGetInfoHandlerTable); + FreePool(mExtractGetInfoHandlerTable); } return RETURN_OUT_OF_RESOURCES; diff --git a/MdePkg/Library/DxeHobLib/HobLib.c b/MdePkg/Library/DxeHobLib/HobLib.c index ba1025aed..dc97af3de 100644 --- a/MdePkg/Library/DxeHobLib/HobLib.c +++ b/MdePkg/Library/DxeHobLib/HobLib.c @@ -45,7 +45,7 @@ GetHobList ( if (mHobList == NULL) { Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, &mHobList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return NULL; } diff --git a/MdePkg/Library/DxeHstiLib/HstiAip.c b/MdePkg/Library/DxeHstiLib/HstiAip.c index 1a3dfc148..aeaa4a55a 100644 --- a/MdePkg/Library/DxeHstiLib/HstiAip.c +++ b/MdePkg/Library/DxeHstiLib/HstiAip.c @@ -108,7 +108,7 @@ HstiAipSetInfo ( if (NewHsti == NULL) { return EFI_OUT_OF_RESOURCES; } - FreePool (HstiAip->Hsti); + FreePool(HstiAip->Hsti); HstiAip->Hsti = NewHsti; HstiAip->HstiSize = 0; HstiAip->HstiMaxSize = InformationBlockSize; diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c b/MdePkg/Library/DxeHstiLib/HstiDxe.c index 4e1c67616..d99f4c375 100644 --- a/MdePkg/Library/DxeHstiLib/HstiDxe.c +++ b/MdePkg/Library/DxeHstiLib/HstiDxe.c @@ -51,7 +51,7 @@ InternalHstiFindAip ( &NoHandles, &Handles ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -65,7 +65,7 @@ InternalHstiFindAip ( &gEfiAdapterInformationProtocolGuid, (VOID **)&Aip ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -77,7 +77,7 @@ InternalHstiFindAip ( &InfoTypesBuffer, &InfoTypesBufferCount ); - if (EFI_ERROR (Status) || (InfoTypesBuffer == NULL) || (InfoTypesBufferCount == 0)) { + if (EFI_ERROR(Status) || (InfoTypesBuffer == NULL) || (InfoTypesBufferCount == 0)) { continue; } @@ -88,7 +88,7 @@ InternalHstiFindAip ( break; } } - FreePool (InfoTypesBuffer); + FreePool(InfoTypesBuffer); if (AipCandidate == NULL) { continue; @@ -104,7 +104,7 @@ InternalHstiFindAip ( &InformationBlock, &InformationBlockSize ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -114,11 +114,11 @@ InternalHstiFindAip ( break; } else { Hsti = NULL; - FreePool (InformationBlock); + FreePool(InformationBlock); continue; } } - FreePool (Handles); + FreePool(Handles); if (Hsti == NULL) { return NULL; @@ -292,7 +292,7 @@ HstiLibSetTable ( } HstiAip->Hsti = AllocateCopyPool (HstiSize, Hsti); if (HstiAip->Hsti == NULL) { - FreePool (HstiAip); + FreePool(HstiAip); return EFI_OUT_OF_RESOURCES; } if (Role != PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE) { @@ -313,9 +313,9 @@ HstiLibSetTable ( &HstiAip->Aip, NULL ); - if (EFI_ERROR (Status)) { - FreePool (HstiAip->Hsti); - FreePool (HstiAip); + if (EFI_ERROR(Status)) { + FreePool(HstiAip->Hsti); + FreePool(HstiAip); } return Status; @@ -410,7 +410,7 @@ InternalHstiRecordFeaturesVerified ( Hsti, HstiSize ); - FreePool (Hsti); + FreePool(Hsti); return Status; } @@ -540,8 +540,8 @@ InternalHstiRecordErrorString ( NewHsti, NewHstiSize ); - FreePool (Hsti); - FreePool (NewHsti); + FreePool(Hsti); + FreePool(NewHsti); return Status; } diff --git a/MdePkg/Library/DxeIoLibCpuIo2/IoLib.c b/MdePkg/Library/DxeIoLibCpuIo2/IoLib.c index b37e7a299..ac022c229 100644 --- a/MdePkg/Library/DxeIoLibCpuIo2/IoLib.c +++ b/MdePkg/Library/DxeIoLibCpuIo2/IoLib.c @@ -37,7 +37,7 @@ IoLibConstructor ( EFI_STATUS Status; Status = gBS->LocateProtocol (&gEfiCpuIo2ProtocolGuid, NULL, (VOID **) &mCpuIo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -69,7 +69,7 @@ IoReadWorker ( UINT64 Data; Status = mCpuIo->Io.Read (mCpuIo, Width, Port, 1, &Data); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Data; } @@ -102,7 +102,7 @@ IoWriteWorker ( EFI_STATUS Status; Status = mCpuIo->Io.Write (mCpuIo, Width, Port, 1, &Data); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Data; } @@ -135,7 +135,7 @@ IoReadFifoWorker ( EFI_STATUS Status; Status = mCpuIo->Io.Read (mCpuIo, Width, Port, Count, Buffer); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -166,7 +166,7 @@ IoWriteFifoWorker ( EFI_STATUS Status; Status = mCpuIo->Io.Write (mCpuIo, Width, Port, Count, Buffer); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -194,7 +194,7 @@ MmioReadWorker ( UINT64 Data; Status = mCpuIo->Mem.Read (mCpuIo, Width, Address, 1, &Data); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Data; } @@ -225,7 +225,7 @@ MmioWriteWorker ( EFI_STATUS Status; Status = mCpuIo->Mem.Write (mCpuIo, Width, Address, 1, &Data); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Data; } diff --git a/MdePkg/Library/DxePcdLib/DxePcdLib.c b/MdePkg/Library/DxePcdLib/DxePcdLib.c index 46c98249a..381253437 100644 --- a/MdePkg/Library/DxePcdLib/DxePcdLib.c +++ b/MdePkg/Library/DxePcdLib/DxePcdLib.c @@ -44,7 +44,7 @@ GetPiPcdProtocol ( // access DynamicEx type PCD. // Status = gBS->LocateProtocol (&gEfiPcdProtocolGuid, NULL, (VOID **) &mPiPcd); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return NULL; } @@ -72,7 +72,7 @@ GetPcdProtocol ( // But dynamic type PCD is not required in PI 1.2 specification. // Status = gBS->LocateProtocol (&gPcdProtocolGuid, NULL, (VOID **)&mPcd); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return NULL; } @@ -95,7 +95,7 @@ GetPiPcdInfoProtocolPointer ( if (mPiPcdInfo == NULL) { Status = gBS->LocateProtocol (&gEfiGetPcdInfoProtocolGuid, NULL, (VOID **)&mPiPcdInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return NULL; } @@ -118,7 +118,7 @@ GetPcdInfoProtocolPointer ( if (mPcdInfo == NULL) { Status = gBS->LocateProtocol (&gGetPcdInfoProtocolGuid, NULL, (VOID **)&mPcdInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return NULL; } @@ -633,7 +633,7 @@ LibPcdSetPtr ( InputSizeOfBuffer = *SizeOfBuffer; Status = GetPcdProtocol()->SetPtr (TokenNumber, SizeOfBuffer, (VOID *) Buffer); - if (EFI_ERROR (Status) && (*SizeOfBuffer < InputSizeOfBuffer)) { + if (EFI_ERROR(Status) && (*SizeOfBuffer < InputSizeOfBuffer)) { return NULL; } @@ -844,7 +844,7 @@ LibPcdSetExPtr ( InputSizeOfBuffer = *SizeOfBuffer; Status = GetPiPcdProtocol()->SetPtr (Guid, TokenNumber, SizeOfBuffer, Buffer); - if (EFI_ERROR (Status) && (*SizeOfBuffer < InputSizeOfBuffer)) { + if (EFI_ERROR(Status) && (*SizeOfBuffer < InputSizeOfBuffer)) { return NULL; } @@ -1259,7 +1259,7 @@ LibPcdCallbackOnSet ( ASSERT (NotificationFunction != NULL); /* Status = */GetPiPcdProtocol()->CallbackOnSet (Guid, TokenNumber, (EFI_PCD_PROTOCOL_CALLBACK) NotificationFunction); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return; } @@ -1292,7 +1292,7 @@ LibPcdCancelCallback ( ASSERT (NotificationFunction != NULL); /* Status = */GetPiPcdProtocol()->CancelCallback (Guid, TokenNumber, (EFI_PCD_PROTOCOL_CALLBACK) NotificationFunction); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); return; } @@ -1328,8 +1328,8 @@ LibPcdGetNextToken ( EFI_STATUS Status; Status = GetPiPcdProtocol()->GetNextToken (Guid, &TokenNumber); - ASSERT (!EFI_ERROR (Status) || TokenNumber == 0); - if (EFI_ERROR (Status)) { + ASSERT (!EFI_ERROR(Status) || TokenNumber == 0); + if (EFI_ERROR(Status)) { TokenNumber = 0; } @@ -1596,7 +1596,7 @@ LibPcdGetInfo ( EFI_STATUS Status; Status = GetPcdInfoProtocolPointer()->GetInfo (TokenNumber, (EFI_PCD_INFO *) PcdInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -1623,7 +1623,7 @@ LibPcdGetInfoEx ( EFI_STATUS Status; Status = GetPiPcdInfoProtocolPointer()->GetInfo (Guid, TokenNumber, (EFI_PCD_INFO *) PcdInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** diff --git a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c index 862c6bff0..3a5ae92a3 100644 --- a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c +++ b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c @@ -73,7 +73,7 @@ DxeRuntimeDebugLibSerialPortConstructor ( EFI_STATUS Status; Status = SerialPortInitialize (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c b/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c index 6e784763b..3c112c743 100644 --- a/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c +++ b/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c @@ -132,7 +132,7 @@ DxeRuntimePciExpressLibConstructor ( &gEfiEventVirtualAddressChangeGuid, &mDxeRuntimePciExpressLibVirtualNotifyEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -162,14 +162,14 @@ DxeRuntimePciExpressLibDestructor ( // free the registration table. // if (mDxeRuntimePciExpressLibRegistrationTable != NULL) { - FreePool (mDxeRuntimePciExpressLibRegistrationTable); + FreePool(mDxeRuntimePciExpressLibRegistrationTable); } // // Close the Set Virtual Address Map event // Status = gBS->CloseEvent (mDxeRuntimePciExpressLibVirtualNotifyEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -311,7 +311,7 @@ PciExpressRegisterForRuntimeAccess ( // Get the GCD Memory Descriptor for the PCI Express Bus/Dev/Func specified by Address // Status = gDS->GetMemorySpaceDescriptor (Address, &Descriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_UNSUPPORTED; } @@ -320,7 +320,7 @@ PciExpressRegisterForRuntimeAccess ( // will allocate a virtual address range for the 4KB PCI Configuration Header. // Status = gDS->SetMemorySpaceAttributes (Address, 0x1000, Descriptor.Attributes | EFI_MEMORY_RUNTIME); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_UNSUPPORTED; } diff --git a/MdePkg/Library/DxeServicesLib/Allocate.c b/MdePkg/Library/DxeServicesLib/Allocate.c index efb65768b..7bf7abfc4 100644 --- a/MdePkg/Library/DxeServicesLib/Allocate.c +++ b/MdePkg/Library/DxeServicesLib/Allocate.c @@ -41,7 +41,7 @@ AllocatePeiAccessiblePages ( } Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return (VOID *)(UINTN)Memory; diff --git a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c index c416b2dd8..4c16f75ab 100644 --- a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c +++ b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c @@ -54,7 +54,7 @@ InternalImageHandleToFvHandle ( (VOID **) &LoadedImage ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // The LoadedImage->DeviceHandle may be NULL. @@ -139,7 +139,7 @@ InternalGetSectionFromFv ( &gEfiFirmwareVolume2ProtocolGuid, (VOID **) &Fv ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } @@ -158,7 +158,7 @@ InternalGetSectionFromFv ( &AuthenticationStatus ); - if (EFI_ERROR (Status) && (SectionType == EFI_SECTION_TE)) { + if (EFI_ERROR(Status) && (SectionType == EFI_SECTION_TE)) { // // Try reading PE32 section, if the required section is TE type // @@ -261,7 +261,7 @@ GetSectionFromAnyFvByFileType ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -274,7 +274,7 @@ GetSectionFromAnyFvByFileType ( &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -285,7 +285,7 @@ GetSectionFromAnyFvByFileType ( Key = 0; do { Status = Fv->GetNextFile (Fv, &Key, &FileType, &NameGuid, &Attributes, Size); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } IndexFile --; @@ -305,7 +305,7 @@ GetSectionFromAnyFvByFileType ( Size ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { goto Done; } } @@ -400,7 +400,7 @@ GetSectionFromAnyFv ( Buffer, Size ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { return EFI_SUCCESS; } @@ -412,7 +412,7 @@ GetSectionFromAnyFv ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -430,7 +430,7 @@ GetSectionFromAnyFv ( Size ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { goto Done; } } @@ -666,7 +666,7 @@ GetFileBufferByFilePath ( // DevicePathNode = OrigDevicePathNode; Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &DevicePathNode, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // For FwVol File system there is only a single file name that is a GUID. // @@ -678,7 +678,7 @@ GetFileBufferByFilePath ( // Read image from the firmware file // Status = gBS->HandleProtocol (Handle, &gEfiFirmwareVolume2ProtocolGuid, (VOID**)&FwVol); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SectionType = EFI_SECTION_PE32; ImageBuffer = NULL; Status = FwVol->ReadSection ( @@ -690,12 +690,12 @@ GetFileBufferByFilePath ( &ImageBufferSize, AuthenticationStatus ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Try a raw file, since a PE32 SECTION does not exist // if (ImageBuffer != NULL) { - FreePool (ImageBuffer); + FreePool(ImageBuffer); *AuthenticationStatus = 0; } ImageBuffer = NULL; @@ -711,7 +711,7 @@ GetFileBufferByFilePath ( } } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { goto Finish; } } @@ -721,14 +721,14 @@ GetFileBufferByFilePath ( // DevicePathNode = OrigDevicePathNode; Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &DevicePathNode, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID**)&Volume); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Open the Volume to get the File System handle // Status = Volume->OpenVolume (Volume, &FileHandle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Duplicate the device path to avoid the access to unaligned device path node. // Because the device path consists of one or more FILE PATH MEDIA DEVICE PATH @@ -749,7 +749,7 @@ GetFileBufferByFilePath ( // our way down each device path node and close the previous node // DevicePathNode = TempDevicePathNode; - while (!EFI_ERROR (Status) && !IsDevicePathEnd (DevicePathNode)) { + while (!EFI_ERROR(Status) && !IsDevicePathEnd (DevicePathNode)) { if (DevicePathType (DevicePathNode) != MEDIA_DEVICE_PATH || DevicePathSubType (DevicePathNode) != MEDIA_FILEPATH_DP) { Status = EFI_UNSUPPORTED; @@ -775,7 +775,7 @@ GetFileBufferByFilePath ( DevicePathNode = NextDevicePathNode (DevicePathNode); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // We have found the file. Now we need to read it. Before we can read the file we need to // figure out how big the file is. @@ -803,7 +803,7 @@ GetFileBufferByFilePath ( } } - if (!EFI_ERROR (Status) && (FileInfo != NULL)) { + if (!EFI_ERROR(Status) && (FileInfo != NULL)) { if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == 0) { // // Allocate space for the file @@ -825,17 +825,17 @@ GetFileBufferByFilePath ( // Close the file and Free FileInfo and TempDevicePathNode since we are done // if (FileInfo != NULL) { - FreePool (FileInfo); + FreePool(FileInfo); } if (FileHandle != NULL) { FileHandle->Close (FileHandle); } if (TempDevicePathNode != NULL) { - FreePool (TempDevicePathNode); + FreePool(TempDevicePathNode); } } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { goto Finish; } } @@ -846,9 +846,9 @@ GetFileBufferByFilePath ( if (!BootPolicy) { DevicePathNode = OrigDevicePathNode; Status = gBS->LocateDevicePath (&gEfiLoadFile2ProtocolGuid, &DevicePathNode, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (Handle, &gEfiLoadFile2ProtocolGuid, (VOID**)&LoadFile2); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Call LoadFile2 with the correct buffer size // @@ -876,7 +876,7 @@ GetFileBufferByFilePath ( } } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { goto Finish; } } @@ -887,9 +887,9 @@ GetFileBufferByFilePath ( // DevicePathNode = OrigDevicePathNode; Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &DevicePathNode, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->HandleProtocol (Handle, &gEfiLoadFileProtocolGuid, (VOID**)&LoadFile); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Call LoadFile with the correct buffer size // @@ -921,9 +921,9 @@ GetFileBufferByFilePath ( Finish: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (ImageBuffer != NULL) { - FreePool (ImageBuffer); + FreePool(ImageBuffer); ImageBuffer = NULL; } *FileSize = 0; @@ -931,7 +931,7 @@ Finish: *FileSize = ImageBufferSize; } - FreePool (OrigDevicePathNode); + FreePool(OrigDevicePathNode); return ImageBuffer; } @@ -1013,7 +1013,7 @@ GetFileDevicePathFromAnyFv ( &Buffer, &Size ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { goto Done; } @@ -1024,7 +1024,7 @@ GetFileDevicePathFromAnyFv ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -1042,7 +1042,7 @@ GetFileDevicePathFromAnyFv ( &Size ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update FvHandle to the current handle. // @@ -1062,7 +1062,7 @@ Done: // Build a device path to the file in the FV to pass into gBS->LoadImage // Status = gBS->HandleProtocol (FvHandle, &gEfiDevicePathProtocolGuid, (VOID **)&FvDevicePath); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *FvFileDevicePath = NULL; } else { TempFvFileDevicePath = AllocateZeroPool (sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH) + END_DEVICE_PATH_LENGTH); @@ -1076,16 +1076,16 @@ Done: FvDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)TempFvFileDevicePath ); - FreePool (TempFvFileDevicePath); + FreePool(TempFvFileDevicePath); } } if (Buffer != NULL) { - FreePool (Buffer); + FreePool(Buffer); } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } return Status; diff --git a/MdePkg/Library/DxeServicesLib/X64/Allocate.c b/MdePkg/Library/DxeServicesLib/X64/Allocate.c index 41c4cea39..5a2a98c0f 100644 --- a/MdePkg/Library/DxeServicesLib/X64/Allocate.c +++ b/MdePkg/Library/DxeServicesLib/X64/Allocate.c @@ -56,7 +56,7 @@ AllocatePeiAccessiblePages ( } Status = gBS->AllocatePages (AllocType, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return (VOID *)(UINTN)Memory; diff --git a/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c b/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c index 6783e4d75..99f8b67d5 100644 --- a/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c +++ b/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c @@ -55,7 +55,7 @@ DxeServicesTableLibConstructor ( // Cache copy of the DXE Services Table // Status = EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (gDS != NULL); return Status; diff --git a/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c b/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c index f6e3d4508..81881b3c6 100644 --- a/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c +++ b/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c @@ -38,7 +38,7 @@ SmbusLibConstructor ( EFI_STATUS Status; Status = gBS->LocateProtocol (&gEfiSmbusHcProtocolGuid, NULL, (VOID**) &mSmbus); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (mSmbus != NULL); return Status; diff --git a/MdePkg/Library/MmServicesTableLib/MmServicesTableLib.c b/MdePkg/Library/MmServicesTableLib/MmServicesTableLib.c index 27f9d526e..03aeafd2e 100644 --- a/MdePkg/Library/MmServicesTableLib/MmServicesTableLib.c +++ b/MdePkg/Library/MmServicesTableLib/MmServicesTableLib.c @@ -44,7 +44,7 @@ MmServicesTableLibConstructor ( NULL, (VOID **)&InternalMmBase ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (InternalMmBase != NULL); // diff --git a/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c b/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c index 2f503ecff..b488dbf92 100644 --- a/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c +++ b/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c @@ -76,14 +76,14 @@ DxeRuntimePciSegmentLibVirtualNotify ( // for (Index = 0; Index < mDxeRuntimePciSegmentLibNumberOfRuntimeRanges; Index++) { Status = EfiConvertPointer (0, (VOID **) &(mDxeRuntimePciSegmentLibRegistrationTable[Index].VirtualAddress)); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } // // Convert table pointer that is allocated from EfiRuntimeServicesData to a virtual address. // Status = EfiConvertPointer (0, (VOID **) &mDxeRuntimePciSegmentLibRegistrationTable); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -117,7 +117,7 @@ DxeRuntimePciSegmentLibConstructor ( &gEfiEventVirtualAddressChangeGuid, &mDxeRuntimePciSegmentLibVirtualNotifyEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -147,14 +147,14 @@ DxeRuntimePciSegmentLibDestructor ( // free the registration table. // if (mDxeRuntimePciSegmentLibRegistrationTable != NULL) { - FreePool (mDxeRuntimePciSegmentLibRegistrationTable); + FreePool(mDxeRuntimePciSegmentLibRegistrationTable); } // // Close the Set Virtual Address Map event // Status = gBS->CloseEvent (mDxeRuntimePciSegmentLibVirtualNotifyEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -223,7 +223,7 @@ PciSegmentRegisterForRuntimeAccess ( // Get the GCD Memory Descriptor for the ECAM Address // Status = gDS->GetMemorySpaceDescriptor (Address, &Descriptor); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_UNSUPPORTED; } @@ -232,7 +232,7 @@ PciSegmentRegisterForRuntimeAccess ( // will allocate a virtual address range for the 4KB PCI Configuration Header. // Status = gDS->SetMemorySpaceAttributes (Address, EFI_PAGE_SIZE, Descriptor.Attributes | EFI_MEMORY_RUNTIME); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return RETURN_UNSUPPORTED; } diff --git a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c index 9feb35056..df6914a1e 100644 --- a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c +++ b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c @@ -142,7 +142,7 @@ ExtractGuidedSectionGetGuidList ( // Get all registered handler information // Status = PeiGetExtractGuidedSectionHandlerInfo (&HandlerInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { *ExtractHandlerGuidTable = NULL; return 0; } @@ -204,7 +204,7 @@ ExtractGuidedSectionRegisterHandlers ( // Get the registered handler information // Status = PeiGetExtractGuidedSectionHandlerInfo (&HandlerInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -310,7 +310,7 @@ ExtractGuidedSectionGetInfo ( // Get all registered handler information. // Status = PeiGetExtractGuidedSectionHandlerInfo (&HandlerInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -404,7 +404,7 @@ ExtractGuidedSectionDecode ( // Get all registered handler information. // Status = PeiGetExtractGuidedSectionHandlerInfo (&HandlerInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -486,7 +486,7 @@ ExtractGuidedSectionGetHandlers ( // Get the registered handler information // Status = PeiGetExtractGuidedSectionHandlerInfo (&HandlerInfo); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MdePkg/Library/PeiHobLib/HobLib.c b/MdePkg/Library/PeiHobLib/HobLib.c index ed40b6806..6e1c90d82 100644 --- a/MdePkg/Library/PeiHobLib/HobLib.c +++ b/MdePkg/Library/PeiHobLib/HobLib.c @@ -41,7 +41,7 @@ GetHobList ( VOID *HobList; Status = PeiServicesGetHobList (&HobList); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (HobList != NULL); return HobList; @@ -207,7 +207,7 @@ GetBootModeHob ( EFI_BOOT_MODE BootMode; Status = PeiServicesGetBootMode (&BootMode); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return BootMode; } @@ -235,7 +235,7 @@ InternalPeiCreateHob ( VOID *Hob; Status = PeiServicesCreateHob (Type, Length, &Hob); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Hob = NULL; } // diff --git a/MdePkg/Library/PeiIoLibCpuIo/IoLib.c b/MdePkg/Library/PeiIoLibCpuIo/IoLib.c index 87002e428..3112eb06b 100644 --- a/MdePkg/Library/PeiIoLibCpuIo/IoLib.c +++ b/MdePkg/Library/PeiIoLibCpuIo/IoLib.c @@ -51,7 +51,7 @@ IoReadFifoWorker ( ASSERT (CpuIo != NULL); Status = CpuIo->Io.Read (PeiServices, CpuIo, Width, Port, Count, Buffer); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -88,7 +88,7 @@ IoWriteFifoWorker ( ASSERT (CpuIo != NULL); Status = CpuIo->Io.Write (PeiServices, CpuIo, Width, Port, Count, Buffer); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c index b3f9df74f..e34ab1f41 100644 --- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c @@ -45,7 +45,7 @@ InternalAllocatePages ( } Status = PeiServicesAllocatePages (MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } @@ -146,7 +146,7 @@ FreePages ( ASSERT (Pages != 0); Status = PeiServicesFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -202,7 +202,7 @@ InternalAllocateAlignedPages ( ASSERT (RealPages > Pages); Status = PeiServicesAllocatePages (MemoryType, RealPages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -212,7 +212,7 @@ InternalAllocateAlignedPages ( // Free first unaligned page(s). // Status = PeiServicesFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Memory = AlignedMemory + EFI_PAGES_TO_SIZE (Pages); UnalignedPages = RealPages - Pages - UnalignedPages; @@ -221,14 +221,14 @@ InternalAllocateAlignedPages ( // Free last unaligned page(s). // Status = PeiServicesFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } else { // // Do not over-allocate pages in this case. // Status = PeiServicesAllocatePages (MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = (UINTN) Memory; @@ -351,7 +351,7 @@ FreeAlignedPages ( ASSERT (Pages != 0); Status = PeiServicesFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -403,7 +403,7 @@ AllocatePool ( VOID *Buffer; Status = PeiServicesAllocatePool (AllocationSize, &Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Buffer = NULL; } return Buffer; @@ -713,7 +713,7 @@ InternalReallocatePool ( NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); - FreePool (OldBuffer); + FreePool(OldBuffer); } return NewBuffer; } @@ -830,7 +830,7 @@ ReallocateReservedPool ( **/ VOID EFIAPI -FreePool ( +FreePool( IN VOID *Buffer ) { diff --git a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c index 916a2c084..34e5b5bce 100644 --- a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c +++ b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c @@ -40,7 +40,7 @@ GetPcdPpiPointer ( PCD_PPI *PcdPpi; Status = PeiServicesLocatePpi (&gPcdPpiGuid, 0, NULL, (VOID **)&PcdPpi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return PcdPpi; } @@ -63,7 +63,7 @@ GetPiPcdPpiPointer ( EFI_PEI_PCD_PPI *PiPcdPpi; Status = PeiServicesLocatePpi (&gEfiPeiPcdPpiGuid, 0, NULL, (VOID **)&PiPcdPpi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return PiPcdPpi; } @@ -86,7 +86,7 @@ GetPcdInfoPpiPointer ( GET_PCD_INFO_PPI *PcdInfoPpi; Status = PeiServicesLocatePpi (&gGetPcdInfoPpiGuid, 0, NULL, (VOID **)&PcdInfoPpi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return PcdInfoPpi; } @@ -109,7 +109,7 @@ GetPiPcdInfoPpiPointer ( EFI_GET_PCD_INFO_PPI *PiPcdInfoPpi; Status = PeiServicesLocatePpi (&gEfiGetPcdInfoPpiGuid, 0, NULL, (VOID **)&PiPcdInfoPpi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return PiPcdInfoPpi; } @@ -621,7 +621,7 @@ LibPcdSetPtr ( InputSizeOfBuffer = *SizeOfBuffer; Status = (GetPcdPpiPointer ())->SetPtr (TokenNumber, SizeOfBuffer, (VOID *) Buffer); - if (EFI_ERROR (Status) && (*SizeOfBuffer < InputSizeOfBuffer)) { + if (EFI_ERROR(Status) && (*SizeOfBuffer < InputSizeOfBuffer)) { return NULL; } @@ -830,7 +830,7 @@ LibPcdSetExPtr ( InputSizeOfBuffer = *SizeOfBuffer; Status = (GetPiPcdPpiPointer ())->SetPtr (Guid, TokenNumber, SizeOfBuffer, Buffer); - if (EFI_ERROR (Status) && (*SizeOfBuffer < InputSizeOfBuffer)) { + if (EFI_ERROR(Status) && (*SizeOfBuffer < InputSizeOfBuffer)) { return NULL; } @@ -1237,7 +1237,7 @@ LibPcdCallbackOnSet ( Status = (GetPiPcdPpiPointer ())->CallbackOnSet (Guid, TokenNumber, (EFI_PEI_PCD_PPI_CALLBACK) NotificationFunction); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return; } @@ -1271,7 +1271,7 @@ LibPcdCancelCallback ( Status = (GetPiPcdPpiPointer ())->CancelCallback (Guid, TokenNumber, (EFI_PEI_PCD_PPI_CALLBACK) NotificationFunction); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return; } @@ -1307,7 +1307,7 @@ LibPcdGetNextToken ( EFI_STATUS Status; Status = (GetPiPcdPpiPointer ())->GetNextToken (Guid, &TokenNumber); - ASSERT (!EFI_ERROR (Status) || TokenNumber == 0); + ASSERT (!EFI_ERROR(Status) || TokenNumber == 0); return TokenNumber; } @@ -1572,7 +1572,7 @@ LibPcdGetInfo ( EFI_STATUS Status; Status = GetPcdInfoPpiPointer()->GetInfo (TokenNumber, (EFI_PCD_INFO *) PcdInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -1599,7 +1599,7 @@ LibPcdGetInfoEx ( EFI_STATUS Status; Status = GetPiPcdInfoPpiPointer()->GetInfo (Guid, TokenNumber, (EFI_PCD_INFO *) PcdInfo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** diff --git a/MdePkg/Library/PeiPciLibPciCfg2/PciLib.c b/MdePkg/Library/PeiPciLibPciCfg2/PciLib.c index b9ed2d2d9..cb3425f52 100644 --- a/MdePkg/Library/PeiPciLibPciCfg2/PciLib.c +++ b/MdePkg/Library/PeiPciLibPciCfg2/PciLib.c @@ -63,7 +63,7 @@ PeiPciLibPciCfg2ReadWorker ( UINT64 PciCfg2Address; Status = PeiServicesLocatePpi (&gEfiPciCfg2PpiGuid, 0, NULL, (VOID **) &PciCfg2Ppi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (PciCfg2Ppi != NULL); PciCfg2Address = PCI_TO_PCICFG2_ADDRESS (Address); @@ -106,7 +106,7 @@ PeiPciLibPciCfg2WriteWorker ( UINT64 PciCfg2Address; Status = PeiServicesLocatePpi (&gEfiPciCfg2PpiGuid, 0, NULL, (VOID **) &PciCfg2Ppi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (PciCfg2Ppi != NULL); PciCfg2Address = PCI_TO_PCICFG2_ADDRESS (Address); diff --git a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c index 1128c917f..052a89891 100644 --- a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c +++ b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c @@ -72,7 +72,7 @@ InternalGetPciCfg2Ppi ( NULL, (VOID**) &PciCfg2Ppi ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Instance++; } while (PciCfg2Ppi->Segment != SegmentNumber); diff --git a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c index e8eaed71c..33190de47 100644 --- a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c +++ b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c @@ -691,7 +691,7 @@ InternalPeiServicesInstallFvInfoPpi ( FvInfoPpiDescriptor->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST; FvInfoPpiDescriptor->Ppi = (VOID *) FvInfoPpi; Status = PeiServicesInstallPpi (FvInfoPpiDescriptor); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c index dac31c998..9318df8a1 100644 --- a/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c +++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c @@ -111,7 +111,7 @@ MigratePeiServicesTablePointer ( EFI_SIZE_TO_PAGES(Idtr.Limit + 1 + sizeof (UINTN)), &IdtBase ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Idt table needs to be migrated into memory. // diff --git a/MdePkg/Library/PeiSmbusLibSmbus2Ppi/PeiSmbusLib.c b/MdePkg/Library/PeiSmbusLibSmbus2Ppi/PeiSmbusLib.c index 06a5f67e2..8ae29a533 100644 --- a/MdePkg/Library/PeiSmbusLibSmbus2Ppi/PeiSmbusLib.c +++ b/MdePkg/Library/PeiSmbusLibSmbus2Ppi/PeiSmbusLib.c @@ -27,7 +27,7 @@ InternalGetSmbusPpi ( EFI_PEI_SMBUS2_PPI *SmbusPpi; Status = PeiServicesLocatePpi (&gEfiPeiSmbus2PpiGuid, 0, NULL, (VOID **) &SmbusPpi); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (SmbusPpi != NULL); return SmbusPpi; diff --git a/MdePkg/Library/SmmIoLib/SmmIoLib.c b/MdePkg/Library/SmmIoLib/SmmIoLib.c index 31b1bb3ec..89141d2b2 100644 --- a/MdePkg/Library/SmmIoLib/SmmIoLib.c +++ b/MdePkg/Library/SmmIoLib/SmmIoLib.c @@ -227,19 +227,19 @@ SmmIoLibInternalEndOfDxeNotify ( EFI_STATUS Status; Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemSpaceMap); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { MergeGcdMmioEntry (MemSpaceMap, &NumberOfDescriptors); mSmmIoLibGcdMemSpace = AllocateCopyPool (NumberOfDescriptors * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR), MemSpaceMap); ASSERT (mSmmIoLibGcdMemSpace != NULL); if (mSmmIoLibGcdMemSpace == NULL) { - gBS->FreePool (MemSpaceMap); + gBS->FreePool(MemSpaceMap); return EFI_OUT_OF_RESOURCES; } mSmmIoLibGcdMemNumberOfDesc = NumberOfDescriptors; - gBS->FreePool (MemSpaceMap); + gBS->FreePool(MemSpaceMap); } return EFI_SUCCESS; @@ -293,13 +293,13 @@ SmmIoLibConstructor ( // Register EndOfDxe to get GCD resource map // Status = gSmst->SmmRegisterProtocolNotify (&gEfiSmmEndOfDxeProtocolGuid, SmmIoLibInternalEndOfDxeNotify, &mSmmIoLibRegistrationEndOfDxe); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register ready to lock so that we can know when to check valid resource region // Status = gSmst->SmmRegisterProtocolNotify (&gEfiSmmReadyToLockProtocolGuid, SmmIoLibInternalReadyToLockNotify, &mSmmIoLibRegistrationReadyToLock); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } diff --git a/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c b/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c index 9163890b4..9d16257a4 100644 --- a/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c +++ b/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c @@ -37,7 +37,7 @@ IoReadWorker ( UINT64 Data; Status = gSmst->SmmIo.Io.Read (&gSmst->SmmIo, Width, Port, 1, &Data); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Data; } @@ -68,7 +68,7 @@ IoWriteWorker ( EFI_STATUS Status; Status = gSmst->SmmIo.Io.Write (&gSmst->SmmIo, Width, Port, 1, &Data); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Data; } @@ -98,7 +98,7 @@ MmioReadWorker ( UINT64 Data; Status = gSmst->SmmIo.Mem.Read (&gSmst->SmmIo, Width, Address, 1, &Data); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Data; } @@ -129,7 +129,7 @@ MmioWriteWorker ( EFI_STATUS Status; Status = gSmst->SmmIo.Mem.Write (&gSmst->SmmIo, Width, Address, 1, &Data); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Data; } diff --git a/MdePkg/Library/SmmMemLib/SmmMemLib.c b/MdePkg/Library/SmmMemLib/SmmMemLib.c index 7169bbdd1..ca6259834 100644 --- a/MdePkg/Library/SmmMemLib/SmmMemLib.c +++ b/MdePkg/Library/SmmMemLib/SmmMemLib.c @@ -380,7 +380,7 @@ SmmMemLibInternalGetGcdMemoryMap ( UINTN Index; Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemSpaceMap); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return ; } @@ -398,7 +398,7 @@ SmmMemLibInternalGetGcdMemoryMap ( ASSERT (mSmmMemLibGcdMemSpace != NULL); if (mSmmMemLibGcdMemSpace == NULL) { mSmmMemLibGcdMemNumberOfDesc = 0; - gBS->FreePool (MemSpaceMap); + gBS->FreePool(MemSpaceMap); return ; } @@ -417,7 +417,7 @@ SmmMemLibInternalGetGcdMemoryMap ( } } - gBS->FreePool (MemSpaceMap); + gBS->FreePool(MemSpaceMap); } /** @@ -433,7 +433,7 @@ SmmMemLibInternalGetUefiMemoryAttributesTable ( UINTN MemoryAttributesTableSize; Status = EfiGetSystemConfigurationTable (&gEfiMemoryAttributesTableGuid, (VOID **)&MemoryAttributesTable); - if (!EFI_ERROR (Status) && (MemoryAttributesTable != NULL)) { + if (!EFI_ERROR(Status) && (MemoryAttributesTable != NULL)) { MemoryAttributesTableSize = sizeof(EFI_MEMORY_ATTRIBUTES_TABLE) + MemoryAttributesTable->DescriptorSize * MemoryAttributesTable->NumberOfEntries; mSmmMemLibMemoryAttributesTable = AllocateCopyPool (MemoryAttributesTableSize, MemoryAttributesTable); ASSERT (mSmmMemLibMemoryAttributesTable != NULL); @@ -490,8 +490,8 @@ SmmLibInternalEndOfDxeNotify ( &DescriptorSize, &DescriptorVersion ); - if (EFI_ERROR (Status)) { - gBS->FreePool (MemoryMap); + if (EFI_ERROR(Status)) { + gBS->FreePool(MemoryMap); } } while (Status == EFI_BUFFER_TOO_SMALL); @@ -536,7 +536,7 @@ SmmLibInternalEndOfDxeNotify ( mMemoryMap = SmmMemoryMapStart; MemoryMap = MemoryMapStart; - gBS->FreePool (MemoryMap); + gBS->FreePool(MemoryMap); // // Get additional information from GCD memory map. @@ -595,7 +595,7 @@ SmmMemLibConstructor ( // Get SMRAM information // Status = gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (VOID **)&SmmAccess); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Size = 0; Status = SmmAccess->GetCapabilities (SmmAccess, &Size, NULL); @@ -605,7 +605,7 @@ SmmMemLibConstructor ( ASSERT (mSmmMemLibInternalSmramRanges != NULL); Status = SmmAccess->GetCapabilities (SmmAccess, &Size, mSmmMemLibInternalSmramRanges); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mSmmMemLibInternalSmramCount = Size / sizeof (EFI_SMRAM_DESCRIPTOR); @@ -618,13 +618,13 @@ SmmMemLibConstructor ( // Register EndOfDxe to get UEFI memory map // Status = gSmst->SmmRegisterProtocolNotify (&gEfiSmmEndOfDxeProtocolGuid, SmmLibInternalEndOfDxeNotify, &mRegistrationEndOfDxe); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Register ready to lock so that we can know when to check valid SMRAM region // Status = gSmst->SmmRegisterProtocolNotify (&gEfiSmmReadyToLockProtocolGuid, SmmLibInternalReadyToLockNotify, &mRegistrationReadyToLock); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return EFI_SUCCESS; } @@ -644,7 +644,7 @@ SmmMemLibDestructor ( IN EFI_SYSTEM_TABLE *SystemTable ) { - FreePool (mSmmMemLibInternalSmramRanges); + FreePool(mSmmMemLibInternalSmramRanges); gSmst->SmmRegisterProtocolNotify (&gEfiSmmEndOfDxeProtocolGuid, NULL, &mRegistrationEndOfDxe); gSmst->SmmRegisterProtocolNotify (&gEfiSmmReadyToLockProtocolGuid, NULL, &mRegistrationReadyToLock); diff --git a/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c index c0247a3a4..926f2a19d 100644 --- a/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c @@ -62,7 +62,7 @@ SmmMemoryAllocationLibConstructor ( NULL, (VOID **)&SmmAccess ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Get SMRAM range information @@ -75,7 +75,7 @@ SmmMemoryAllocationLibConstructor ( ASSERT (mSmramRanges != NULL); Status = SmmAccess->GetCapabilities (SmmAccess, &Size, mSmramRanges); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mSmramRangeCount = Size / sizeof (EFI_SMRAM_DESCRIPTOR); @@ -98,7 +98,7 @@ SmmMemoryAllocationLibDestructor ( IN EFI_SYSTEM_TABLE *SystemTable ) { - FreePool (mSmramRanges); + FreePool(mSmramRanges); return EFI_SUCCESS; } @@ -157,7 +157,7 @@ InternalAllocatePages ( } Status = gSmst->SmmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return (VOID *) (UINTN) Memory; @@ -269,7 +269,7 @@ FreePages ( // Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -325,7 +325,7 @@ InternalAllocateAlignedPages ( ASSERT (RealPages > Pages); Status = gSmst->SmmAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -335,7 +335,7 @@ InternalAllocateAlignedPages ( // Free first unaligned page(s). // Status = gSmst->SmmFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } Memory = AlignedMemory + EFI_PAGES_TO_SIZE (Pages); UnalignedPages = RealPages - Pages - UnalignedPages; @@ -344,14 +344,14 @@ InternalAllocateAlignedPages ( // Free last unaligned page(s). // Status = gSmst->SmmFreePages (Memory, UnalignedPages); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } } else { // // Do not over-allocate pages in this case. // Status = gSmst->SmmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = (UINTN) Memory; @@ -486,7 +486,7 @@ FreeAlignedPages ( // Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } /** @@ -513,7 +513,7 @@ InternalAllocatePool ( VOID *Memory; Status = gSmst->SmmAllocatePool (MemoryType, AllocationSize, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Memory = NULL; } return Memory; @@ -835,7 +835,7 @@ InternalReallocatePool ( NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); - FreePool (OldBuffer); + FreePool(OldBuffer); } return NewBuffer; } @@ -953,7 +953,7 @@ ReallocateReservedPool ( **/ VOID EFIAPI -FreePool ( +FreePool( IN VOID *Buffer ) { @@ -964,13 +964,13 @@ FreePool ( // When Buffer is in SMRAM range, it should be allocated by gSmst->SmmAllocatePool() service. // So, gSmst->SmmFreePool() service is used to free it. // - Status = gSmst->SmmFreePool (Buffer); + Status = gSmst->SmmFreePool(Buffer); } else { // // When Buffer is out of SMRAM range, it should be allocated by gBS->AllocatePool() service. // So, gBS->FreePool() service is used to free it. // - Status = gBS->FreePool (Buffer); + Status = gBS->FreePool(Buffer); } - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); } diff --git a/MdePkg/Library/SmmPciLibPciRootBridgeIo/PciLib.c b/MdePkg/Library/SmmPciLibPciRootBridgeIo/PciLib.c index c9660f48d..1d8e4b7a3 100644 --- a/MdePkg/Library/SmmPciLibPciRootBridgeIo/PciLib.c +++ b/MdePkg/Library/SmmPciLibPciRootBridgeIo/PciLib.c @@ -61,7 +61,7 @@ PciLibConstructor ( EFI_STATUS Status; Status = gSmst->SmmLocateProtocol (&gEfiSmmPciRootBridgeIoProtocolGuid, NULL, (VOID**) &mSmmPciRootBridgeIo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (mSmmPciRootBridgeIo != NULL); return EFI_SUCCESS; diff --git a/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c b/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c index ba01910b6..191ca774b 100644 --- a/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c +++ b/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c @@ -825,7 +825,7 @@ PeriodicSmiDispatchFunction ( PeriodicSmiLibraryHandler->Cpu, PeriodicSmiLibraryHandler ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Wait for the AP to release the spin lock. // @@ -969,7 +969,7 @@ PeriodicSmiEnable ( &PeriodicSmiLibraryHandler->RegisterContext, &PeriodicSmiLibraryHandler->DispatchHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { PeriodicSmiLibraryHandler->DispatchHandle = NULL; ReclaimPeriodicSmiLibraryHandler (PeriodicSmiLibraryHandler); return EFI_OUT_OF_RESOURCES; @@ -1025,7 +1025,7 @@ PeriodicSmiDisable ( gSmmPeriodicTimerDispatch2, PeriodicSmiLibraryHandler->DispatchHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return FALSE; } @@ -1072,7 +1072,7 @@ SmmPeriodicSmiLibConstructor ( NULL, (VOID **)&gSmmPeriodicTimerDispatch2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (gSmmPeriodicTimerDispatch2 != NULL); // @@ -1144,7 +1144,7 @@ SmmPeriodicSmiLibDestructor ( // Free the table of supported periodic SMI tick rates // if (gSmiTickPeriodTable != NULL) { - FreePool (gSmiTickPeriodTable); + FreePool(gSmiTickPeriodTable); } // @@ -1162,7 +1162,7 @@ SmmPeriodicSmiLibDestructor ( for (Link = GetFirstNode (&gFreePeriodicSmiLibraryHandlers); !IsNull (&gFreePeriodicSmiLibraryHandlers, Link);) { PeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK (Link); Link = RemoveEntryList (Link); - FreePool (PeriodicSmiLibraryHandler); + FreePool(PeriodicSmiLibraryHandler); } return EFI_SUCCESS; diff --git a/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c b/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c index d95e9d473..fa36fd081 100644 --- a/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c +++ b/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c @@ -43,7 +43,7 @@ SmmServicesTableLibConstructor ( NULL, (VOID **)&InternalSmmBase2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (InternalSmmBase2 != NULL); // diff --git a/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.c b/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.c index 2c41e23a0..7c362967f 100644 --- a/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.c +++ b/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.c @@ -70,7 +70,7 @@ _ModuleEntryPoint ( // // If all of the drivers returned errors, then invoke all of the library destructors // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ProcessLibraryDestructorList (ImageHandle, MmSystemTable); } diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c index cd7e2abbd..0990af150 100644 --- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c +++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c @@ -64,7 +64,7 @@ UefiDebugLibDebugPortProtocolWrite ( // if (mDebugPort == NULL) { Status = mDebugBS->LocateProtocol (&gEfiDebugPortProtocolGuid, NULL, (VOID **)&mDebugPort); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -78,7 +78,7 @@ UefiDebugLibDebugPortProtocolWrite ( Length = BufferLength; Status = mDebugPort->Write (mDebugPort, WRITE_TIMEOUT, &Length, (VOID *) Buffer); - if (EFI_ERROR (Status) || BufferLength < Length) { + if (EFI_ERROR(Status) || BufferLength < Length) { break; } diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c index 1515d2d59..4bb7d7893 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c @@ -2787,7 +2787,7 @@ DevPathFromTextDns ( DnsServerIpCount ++; } - FreePool (DeviceNodeStr); + FreePool(DeviceNodeStr); DeviceNodeStr = NULL; // @@ -3595,10 +3595,10 @@ UefiDevicePathLibConvertTextToDeviceNode ( DeviceNode = FromText (DeviceNodeStr); } else { DeviceNode = FromText (ParamStr); - FreePool (ParamStr); + FreePool(ParamStr); } - FreePool (DeviceNodeStr); + FreePool(DeviceNodeStr); return DeviceNode; } @@ -3644,8 +3644,8 @@ UefiDevicePathLibConvertTextToDevicePath ( DeviceNode = UefiDevicePathLibConvertTextToDeviceNode (DeviceNodeStr); NewDevicePath = AppendDevicePathNode (DevicePath, DeviceNode); - FreePool (DevicePath); - FreePool (DeviceNode); + FreePool(DevicePath); + FreePool(DeviceNode); DevicePath = NewDevicePath; if (IsInstanceEnd) { @@ -3655,12 +3655,12 @@ UefiDevicePathLibConvertTextToDevicePath ( DeviceNode->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; NewDevicePath = AppendDevicePathNode (DevicePath, DeviceNode); - FreePool (DevicePath); - FreePool (DeviceNode); + FreePool(DevicePath); + FreePool(DeviceNode); DevicePath = NewDevicePath; } } - FreePool (DevicePathStr); + FreePool(DevicePathStr); return DevicePath; } diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c index fb65ebd8f..bb3ad2c53 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c @@ -1803,7 +1803,7 @@ DevPathToTextUri ( CopyMem (UriStr, Uri->Uri, UriLength); UriStr[UriLength] = '\0'; UefiDevicePathLibCatPrint (Str, L"Uri(%a)", UriStr); - FreePool (UriStr); + FreePool(UriStr); } /** @@ -2439,7 +2439,7 @@ UefiDevicePathLibConvertDevicePathToText ( // Print this node of the device path // ToText (&Str, AlignedNode, DisplayOnly, AllowShortcuts); - FreePool (AlignedNode); + FreePool(AlignedNode); // // Next device path node diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c index 9274ef8dd..1dcfbdc76 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c @@ -560,7 +560,7 @@ UefiDevicePathLibAppendDevicePathNode ( // NewDevicePath = AppendDevicePath (DevicePath, TempDevicePath); - FreePool (TempDevicePath); + FreePool(TempDevicePath); return NewDevicePath; } @@ -833,7 +833,7 @@ DevicePathFromHandle ( &gEfiDevicePathProtocolGuid, (VOID *) &DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DevicePath = NULL; } return DevicePath; @@ -889,7 +889,7 @@ FileDevicePath ( } DevicePath = AppendDevicePath (DevicePath, FileDevicePath); - FreePool (FileDevicePath); + FreePool(FileDevicePath); } return DevicePath; diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.c b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.c index 106ff245c..ae2d82d2a 100644 --- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.c +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.c @@ -48,7 +48,7 @@ UefiDevicePathLibOptionalDevicePathProtocolConstructor ( NULL, (VOID**) &mDevicePathLibDevicePathUtilities ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (mDevicePathLibDevicePathUtilities != NULL); return Status; } @@ -348,7 +348,7 @@ UefiDevicePathLibLocateProtocol ( NULL, (VOID**) &Protocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } else { return Protocol; diff --git a/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c index 5a8f293f9..ae40130fd 100644 --- a/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c +++ b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c @@ -64,7 +64,7 @@ DevicePathLibConstructor ( NULL, (VOID**) &mDevicePathLibDevicePathUtilities ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (mDevicePathLibDevicePathUtilities != NULL); return Status; } @@ -653,7 +653,7 @@ DevicePathFromHandle ( &gEfiDevicePathProtocolGuid, (VOID *) &DevicePath ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DevicePath = NULL; } return DevicePath; @@ -710,7 +710,7 @@ FileDevicePath ( } DevicePath = AppendDevicePath (DevicePath, FileDevicePath); - FreePool (FileDevicePath); + FreePool(FileDevicePath); } return DevicePath; @@ -735,7 +735,7 @@ UefiDevicePathLibLocateProtocol ( NULL, (VOID**) &Protocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } else { return Protocol; diff --git a/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c b/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c index c3ccf0fe9..22dca2203 100644 --- a/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c +++ b/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c @@ -47,7 +47,7 @@ _DriverUnloadHandler ( // library destructors. If the unload handler returned an error, then the driver can not be // unloaded, and the library destructors should not be called // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ProcessLibraryDestructorList (ImageHandle, gST); } @@ -117,7 +117,7 @@ _ModuleEntryPoint ( &gEfiLoadedImageProtocolGuid, (VOID **)&LoadedImage ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); LoadedImage->Unload = _DriverUnloadHandler; } @@ -129,7 +129,7 @@ _ModuleEntryPoint ( // // If all of the drivers returned errors, then invoke all of the library destructors // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ProcessLibraryDestructorList (ImageHandle, SystemTable); } diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c index 96913c5c0..9eb274ec7 100644 --- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c +++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c @@ -419,13 +419,13 @@ FileHandleIsDirectory ( // // Attributes say this is not a directory // - FreePool (DirInfo); + FreePool(DirInfo); return (EFI_NOT_FOUND); } // // all good... // - FreePool (DirInfo); + FreePool(DirInfo); return (EFI_SUCCESS); } @@ -839,7 +839,7 @@ FileHandleGetFileName ( // Move to the parent directory // Status = CurrentHandle->Open (CurrentHandle, &NextHigherHandle, L"..", EFI_FILE_MODE_READ, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } @@ -970,7 +970,7 @@ FileHandleReadLine( } Status = FileHandleGetSize (Handle, &FileSize); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } else if (FileSize == 0) { *Ascii = TRUE; @@ -1111,7 +1111,7 @@ FileHandleWriteLine( } else { CharSize = sizeof (CHAR16); Status = FileHandleRead (Handle, &CharSize, &CharBuffer); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (CharBuffer == gUnicodeFileTag) { Ascii = FALSE; } else { @@ -1141,7 +1141,7 @@ FileHandleWriteLine( Size = AsciiStrSize(AsciiBuffer) - sizeof(CHAR8); Status = FileHandleWrite(Handle, &Size, AsciiBuffer); if (EFI_ERROR(Status)) { - FreePool (AsciiBuffer); + FreePool(AsciiBuffer); return (Status); } Size = AsciiStrSize("\r\n") - sizeof(CHAR8); @@ -1163,7 +1163,7 @@ FileHandleWriteLine( } if (AsciiBuffer != NULL) { - FreePool (AsciiBuffer); + FreePool(AsciiBuffer); } return Status; } @@ -1260,7 +1260,7 @@ FileHandleEof( RetVal = FALSE; } - FreePool (Info); + FreePool(Info); return (RetVal); } diff --git a/MdePkg/Library/UefiLib/Acpi.c b/MdePkg/Library/UefiLib/Acpi.c index d8f147bfe..1a1214b9a 100644 --- a/MdePkg/Library/UefiLib/Acpi.c +++ b/MdePkg/Library/UefiLib/Acpi.c @@ -195,7 +195,7 @@ LocateAcpiTableInAcpiConfigurationTable ( // Get ACPI ConfigurationTable (RSD_PTR) // Status = EfiGetSystemConfigurationTable(AcpiGuid, (VOID **)&Rsdp); - if (EFI_ERROR (Status) || (Rsdp == NULL)) { + if (EFI_ERROR(Status) || (Rsdp == NULL)) { return NULL; } diff --git a/MdePkg/Library/UefiLib/Console.c b/MdePkg/Library/UefiLib/Console.c index 17ec31c96..aff32aece 100644 --- a/MdePkg/Library/UefiLib/Console.c +++ b/MdePkg/Library/UefiLib/Console.c @@ -516,7 +516,7 @@ CreatePopUp ( ConOut->SetCursorPosition (ConOut, Column + 1, Row++); ConOut->OutputString (ConOut, TmpString); - FreePool (TmpString); + FreePool(TmpString); } NumberOfLines--; } @@ -535,7 +535,7 @@ CreatePopUp ( // // Free the allocated line buffer // - FreePool (Line); + FreePool(Line); // // Restore the cursor visibility, position, and attributes @@ -550,7 +550,7 @@ CreatePopUp ( if (Key != NULL) { while (TRUE) { Status = gST->ConIn->ReadKeyStroke (gST->ConIn, Key); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { break; } diff --git a/MdePkg/Library/UefiLib/UefiDriverModel.c b/MdePkg/Library/UefiLib/UefiDriverModel.c index 2f8bf8d2b..3a96c7c99 100644 --- a/MdePkg/Library/UefiLib/UefiDriverModel.c +++ b/MdePkg/Library/UefiLib/UefiDriverModel.c @@ -60,7 +60,7 @@ EfiLibInstallDriverBinding ( // // ASSERT if the call to InstallMultipleProtocolInterfaces() failed // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -97,7 +97,7 @@ EfiLibUninstallDriverBinding ( // // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -229,7 +229,7 @@ EfiLibInstallAllDriverProtocols ( // // ASSERT if the call to InstallMultipleProtocolInterfaces() failed // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -342,7 +342,7 @@ EfiLibUninstallAllDriverProtocols ( // // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -430,7 +430,7 @@ EfiLibInstallDriverBindingComponentName2 ( // // ASSERT if the call to InstallMultipleProtocolInterfaces() failed // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -500,7 +500,7 @@ EfiLibUninstallDriverBindingComponentName2 ( // // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -1266,7 +1266,7 @@ EfiLibInstallAllDriverProtocols2 ( // // ASSERT if the call to InstallMultipleProtocolInterfaces() failed // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -2014,7 +2014,7 @@ EfiLibUninstallAllDriverProtocols2 ( // // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed // - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c index 8cd808b4c..1f0383a56 100644 --- a/MdePkg/Library/UefiLib/UefiLib.c +++ b/MdePkg/Library/UefiLib/UefiLib.c @@ -158,7 +158,7 @@ EfiCreateProtocolNotifyEvent( NotifyContext, &Event ); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return NULL; } @@ -173,7 +173,7 @@ EfiCreateProtocolNotifyEvent( Registration ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return NULL; } @@ -235,7 +235,7 @@ EfiNamedEventListen ( (VOID *) NotifyContext, &Event ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return Status; } @@ -259,7 +259,7 @@ EfiNamedEventListen ( Event, RegistrationLocal ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -295,7 +295,7 @@ EfiNamedEventSignal ( EFI_NATIVE_INTERFACE, NULL ); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return Status; } @@ -305,7 +305,7 @@ EfiNamedEventSignal ( (EFI_GUID *) Name, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -343,7 +343,7 @@ EfiEventGroupSignal ( EventGroup, &Event ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -585,7 +585,7 @@ EfiTestManagedDevice ( ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseProtocol ( ControllerHandle, (EFI_GUID *) ProtocolGuid, @@ -649,7 +649,7 @@ EfiTestChildHandle ( &OpenInfoBuffer, &EntryCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -665,7 +665,7 @@ EfiTestChildHandle ( } } - FreePool (OpenInfoBuffer); + FreePool(OpenInfoBuffer); return Status; } @@ -992,7 +992,7 @@ AddUnicodeString ( // NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (3, Language); if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) { - FreePool (NewUnicodeStringTable); + FreePool(NewUnicodeStringTable); return EFI_OUT_OF_RESOURCES; } @@ -1010,8 +1010,8 @@ AddUnicodeString ( UnicodeString ); if (NewUnicodeStringTable[NumberOfEntries].UnicodeString == NULL) { - FreePool (NewUnicodeStringTable[NumberOfEntries].Language); - FreePool (NewUnicodeStringTable); + FreePool(NewUnicodeStringTable[NumberOfEntries].Language); + FreePool(NewUnicodeStringTable); return EFI_OUT_OF_RESOURCES; } @@ -1025,7 +1025,7 @@ AddUnicodeString ( // Free the old Unicode String Table // if (*UnicodeStringTable != NULL) { - FreePool (*UnicodeStringTable); + FreePool(*UnicodeStringTable); } // @@ -1203,7 +1203,7 @@ AddUnicodeString2 ( // NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (AsciiStrSize(Language), Language); if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) { - FreePool (NewUnicodeStringTable); + FreePool(NewUnicodeStringTable); return EFI_OUT_OF_RESOURCES; } @@ -1217,8 +1217,8 @@ AddUnicodeString2 ( // NewUnicodeStringTable[NumberOfEntries].UnicodeString = AllocateCopyPool (StrSize (UnicodeString), UnicodeString); if (NewUnicodeStringTable[NumberOfEntries].UnicodeString == NULL) { - FreePool (NewUnicodeStringTable[NumberOfEntries].Language); - FreePool (NewUnicodeStringTable); + FreePool(NewUnicodeStringTable[NumberOfEntries].Language); + FreePool(NewUnicodeStringTable); return EFI_OUT_OF_RESOURCES; } @@ -1232,7 +1232,7 @@ AddUnicodeString2 ( // Free the old Unicode String Table // if (*UnicodeStringTable != NULL) { - FreePool (*UnicodeStringTable); + FreePool(*UnicodeStringTable); } // @@ -1278,20 +1278,20 @@ FreeUnicodeStringTable ( // // Free the Language string from the Unicode String Table // - FreePool (UnicodeStringTable[Index].Language); + FreePool(UnicodeStringTable[Index].Language); // // Free the Unicode String from the Unicode String Table // if (UnicodeStringTable[Index].UnicodeString != NULL) { - FreePool (UnicodeStringTable[Index].UnicodeString); + FreePool(UnicodeStringTable[Index].UnicodeString); } } // // Free the Unicode String Table itself // - FreePool (UnicodeStringTable); + FreePool(UnicodeStringTable); return EFI_SUCCESS; } @@ -1356,7 +1356,7 @@ GetVariable ( // Get the variable data. // Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &Size, Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreePool(Value); return NULL; } @@ -1456,7 +1456,7 @@ GetVariable2 ( // Get the variable data. // Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreePool(*Value); *Value = NULL; } @@ -1781,7 +1781,7 @@ EfiLocateProtocolBuffer ( &NoHandles, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1793,11 +1793,11 @@ EfiLocateProtocolBuffer ( NoHandles * sizeof (VOID *), (VOID **)Buffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Free the handle buffer // - gBS->FreePool (HandleBuffer); + gBS->FreePool(HandleBuffer); return EFI_OUT_OF_RESOURCES; } ZeroMem (*Buffer, NoHandles * sizeof (VOID *)); @@ -1814,7 +1814,7 @@ EfiLocateProtocolBuffer ( Protocol, &((*Buffer)[*NoProtocols]) ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { (*NoProtocols)++; } } @@ -1822,13 +1822,13 @@ EfiLocateProtocolBuffer ( // // Free the handle buffer // - gBS->FreePool (HandleBuffer); + gBS->FreePool(HandleBuffer); // // Make sure at least one protocol instance was found // if (*NoProtocols == 0) { - gBS->FreePool (*Buffer); + gBS->FreePool(*Buffer); *Buffer = NULL; return EFI_NOT_FOUND; } @@ -1935,7 +1935,7 @@ EfiOpenFileByDevicePath ( FilePath, &FileSystemHandle ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = gBS->OpenProtocol ( @@ -1946,7 +1946,7 @@ EfiOpenFileByDevicePath ( NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -1955,7 +1955,7 @@ EfiOpenFileByDevicePath ( // we have to release LastFile on error. // Status = FileSystem->OpenVolume (FileSystem, &LastFile); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -2007,9 +2007,9 @@ EfiOpenFileByDevicePath ( // no longer needed. // if (AlignedPathName != NULL) { - FreePool (AlignedPathName); + FreePool(AlignedPathName); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto CloseLastFile; } @@ -2031,6 +2031,6 @@ CloseLastFile: // We are on the error path; we must have set an error Status for returning // to the caller. // - ASSERT (EFI_ERROR (Status)); + ASSERT (EFI_ERROR(Status)); return Status; } diff --git a/MdePkg/Library/UefiLib/UefiLibPrint.c b/MdePkg/Library/UefiLib/UefiLibPrint.c index a14822e9f..637cf9402 100644 --- a/MdePkg/Library/UefiLib/UefiLibPrint.c +++ b/MdePkg/Library/UefiLib/UefiLibPrint.c @@ -80,12 +80,12 @@ InternalPrint ( // To be extra safe make sure Console has been initialized // Status = Console->OutputString (Console, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Return = 0; } } - FreePool (Buffer); + FreePool(Buffer); return Return; } @@ -221,12 +221,12 @@ AsciiInternalPrint ( // To be extra safe make sure Console has been initialized // Status = Console->OutputString (Console, Buffer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Return = 0; } } - FreePool (Buffer); + FreePool(Buffer); return Return; } @@ -390,7 +390,7 @@ InternalPrintGraphic ( ); UgaDraw = NULL; - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { + if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { // // If no GOP available, try to open UGA Draw protocol if supported. // @@ -402,7 +402,7 @@ InternalPrintGraphic ( (VOID **) &UgaDraw ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -412,7 +412,7 @@ InternalPrintGraphic ( (VOID **) &Sto ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -428,7 +428,7 @@ InternalPrintGraphic ( ASSERT ((HorizontalResolution != 0) && (VerticalResolution !=0)); Status = gBS->LocateProtocol (&gEfiHiiFontProtocolGuid, NULL, (VOID **) &HiiFont); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -479,7 +479,7 @@ InternalPrintGraphic ( &RowInfoArraySize, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Error; } @@ -518,7 +518,7 @@ InternalPrintGraphic ( NULL ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { ASSERT (RowInfoArray != NULL); if (!RowInfoArray) { goto Error; @@ -553,7 +553,7 @@ InternalPrintGraphic ( } else { goto Error; } - FreePool (Blt->Image.Bitmap); + FreePool(Blt->Image.Bitmap); } else { goto Error; } @@ -566,13 +566,13 @@ InternalPrintGraphic ( PrintNum = 0; } - FreePool (RowInfoArray); - FreePool (Blt); + FreePool(RowInfoArray); + FreePool(Blt); return PrintNum; Error: if (Blt != NULL) { - FreePool (Blt); + FreePool(Blt); } return 0; } @@ -659,7 +659,7 @@ PrintXY ( ReturnNum = InternalPrintGraphic (PointX, PointY, ForeGround, BackGround, Buffer, PrintNum); - FreePool (Buffer); + FreePool(Buffer); return ReturnNum; } @@ -743,7 +743,7 @@ AsciiPrintXY ( ReturnNum = InternalPrintGraphic (PointX, PointY, ForeGround, BackGround, Buffer, PrintNum); - FreePool (Buffer); + FreePool(Buffer); return ReturnNum; } diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c index 8f5847096..8e240be66 100644 --- a/MdePkg/Library/UefiLib/UefiNotTiano.c +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c @@ -231,7 +231,7 @@ EfiSignalEventReadyToBoot ( EFI_EVENT ReadyToBootEvent; Status = EfiCreateEventReadyToBoot (&ReadyToBootEvent); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->SignalEvent (ReadyToBootEvent); gBS->CloseEvent (ReadyToBootEvent); } @@ -256,7 +256,7 @@ EfiSignalEventLegacyBoot ( EFI_EVENT LegacyBootEvent; Status = EfiCreateEventLegacyBoot (&LegacyBootEvent); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->SignalEvent (LegacyBootEvent); gBS->CloseEvent (LegacyBootEvent); } diff --git a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c index 4151c8e22..2edd94a97 100644 --- a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c @@ -43,7 +43,7 @@ InternalAllocatePages ( } Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } return (VOID *) (UINTN) Memory; @@ -146,8 +146,8 @@ FreePages ( return; } Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return; } } @@ -210,7 +210,7 @@ InternalAllocateAlignedPages ( } Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask; @@ -220,8 +220,8 @@ InternalAllocateAlignedPages ( // Free first unaligned page(s). // Status = gBS->FreePages (Memory, UnalignedPages); - // ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + // ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return NULL; } } @@ -232,8 +232,8 @@ InternalAllocateAlignedPages ( // Free last unaligned page(s). // Status = gBS->FreePages (Memory, UnalignedPages); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return NULL; } } @@ -242,7 +242,7 @@ InternalAllocateAlignedPages ( // Do not over-allocate pages in this case. // Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return NULL; } AlignedMemory = (UINTN) Memory; @@ -365,7 +365,7 @@ FreeAlignedPages ( return; } /* Status = */gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); } /** @@ -395,7 +395,7 @@ InternalAllocatePool ( } */ Status = gBS->AllocatePool (MemoryType, AllocationSize, &Memory); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Memory = NULL; } return Memory; @@ -717,7 +717,7 @@ InternalReallocatePool ( NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); - FreePool (OldBuffer); + FreePool(OldBuffer); } return NewBuffer; } @@ -834,7 +834,7 @@ ReallocateReservedPool ( **/ VOID EFIAPI -FreePool ( +FreePool( IN VOID *Buffer ) { @@ -842,7 +842,7 @@ FreePool ( if (Buffer) { gBS->FreePool(Buffer); } -// Status = gBS->FreePool (Buffer); -// ASSERT_EFI_ERROR (Status); +// Status = gBS->FreePool(Buffer); +// ASSERT_EFI_ERROR(Status); } diff --git a/MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c b/MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c index 57eb37c3e..e1e3dc905 100644 --- a/MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c +++ b/MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c @@ -61,7 +61,7 @@ PciLibConstructor ( EFI_STATUS Status; Status = gBS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**) &mPciRootBridgeIo); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); ASSERT (mPciRootBridgeIo != NULL); return EFI_SUCCESS; diff --git a/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c b/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c index 65f2fa307..578ccacb4 100644 --- a/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c +++ b/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c @@ -53,7 +53,7 @@ PciSegmentLibConstructor ( &HandleCount, &HandleBuffer ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mNumberOfPciRootBridges = HandleCount; @@ -70,13 +70,13 @@ PciSegmentLibConstructor ( &gEfiPciRootBridgeIoProtocolGuid, (VOID **) &PciRootBridgeIo ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); mPciRootBridgeData[Index].PciRootBridgeIo = PciRootBridgeIo; mPciRootBridgeData[Index].SegmentNumber = PciRootBridgeIo->SegmentNumber; Status = PciRootBridgeIo->Configuration (PciRootBridgeIo, (VOID **) &Descriptors); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); while (Descriptors->Desc != ACPI_END_TAG_DESCRIPTOR) { if (Descriptors->ResType == ACPI_ADDRESS_SPACE_TYPE_BUS) { @@ -113,7 +113,7 @@ PciSegmentLibDestructor ( IN EFI_SYSTEM_TABLE *SystemTable ) { - FreePool (mPciRootBridgeData); + FreePool(mPciRootBridgeData); return EFI_SUCCESS; } diff --git a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c index 933e0099c..472844c38 100644 --- a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c +++ b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c @@ -102,7 +102,7 @@ RuntimeDriverLibConstruct ( &mEfiVirtualNotifyEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, @@ -113,7 +113,7 @@ RuntimeDriverLibConstruct ( &mEfiExitBootServicesEvent ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -144,10 +144,10 @@ RuntimeDriverLibDeconstruct ( // ASSERT (gBS != NULL); Status = gBS->CloseEvent (mEfiVirtualNotifyEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CloseEvent (mEfiExitBootServicesEvent); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/MdePkg/Library/UefiScsiLib/UefiScsiLib.c b/MdePkg/Library/UefiScsiLib/UefiScsiLib.c index c7491d143..3e0f5450c 100644 --- a/MdePkg/Library/UefiScsiLib/UefiScsiLib.c +++ b/MdePkg/Library/UefiScsiLib/UefiScsiLib.c @@ -1316,9 +1316,9 @@ ScsiLibNotify ( } if (CommandPacket->Cdb != NULL) { - FreePool (CommandPacket->Cdb); + FreePool(CommandPacket->Cdb); } - FreePool (Context); + FreePool(Context); gBS->CloseEvent (Event); gBS->SignalEvent (CallerEvent); @@ -1502,7 +1502,7 @@ ScsiRead10CommandEx ( ErrorExit: if (Context != NULL) { - FreePool (Context); + FreePool(Context); } return Status; @@ -1686,7 +1686,7 @@ ScsiWrite10CommandEx ( ErrorExit: if (Context != NULL) { - FreePool (Context); + FreePool(Context); } return Status; @@ -1870,7 +1870,7 @@ ScsiRead16CommandEx ( ErrorExit: if (Context != NULL) { - FreePool (Context); + FreePool(Context); } return Status; @@ -2054,7 +2054,7 @@ ScsiWrite16CommandEx ( ErrorExit: if (Context != NULL) { - FreePool (Context); + FreePool(Context); } return Status; diff --git a/MdePkg/Library/UefiUsbLib/UsbDxeLib.c b/MdePkg/Library/UefiUsbLib/UsbDxeLib.c index e75df8d04..90de7d146 100644 --- a/MdePkg/Library/UefiUsbLib/UsbDxeLib.c +++ b/MdePkg/Library/UefiUsbLib/UsbDxeLib.c @@ -627,7 +627,7 @@ UsbClearEndpointHalt ( UsbIo, &InterfaceDescriptor ); - if (EFI_ERROR (Result)) { + if (EFI_ERROR(Result)) { return Result; } @@ -637,7 +637,7 @@ UsbClearEndpointHalt ( Index, &EndpointDescriptor ); - if (EFI_ERROR (Result)) { + if (EFI_ERROR(Result)) { continue; } diff --git a/MemoryFix/AptioMemoryFix/AptioMemoryFix.c b/MemoryFix/AptioMemoryFix/AptioMemoryFix.c index c45db3b53..eb854ad8e 100644 --- a/MemoryFix/AptioMemoryFix/AptioMemoryFix.c +++ b/MemoryFix/AptioMemoryFix/AptioMemoryFix.c @@ -54,7 +54,7 @@ AptioMemoryFixEntrypoint ( &Interface ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // In case for whatever reason one tried to reload the driver. // @@ -68,7 +68,7 @@ AptioMemoryFixEntrypoint ( &mAptioMemoryFixProtocol ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print(L"AMF: protocol install failure - %r\n", Status); return Status; } @@ -82,7 +82,7 @@ AptioMemoryFixEntrypoint ( // Init VMem memory pool - will be used after ExitBootServices // Status = VmAllocateMemoryPool (); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/MemoryFix/AptioMemoryFix/BootFixes.c b/MemoryFix/AptioMemoryFix/BootFixes.c index f4004edc0..db5d55404 100644 --- a/MemoryFix/AptioMemoryFix/BootFixes.c +++ b/MemoryFix/AptioMemoryFix/BootFixes.c @@ -228,7 +228,7 @@ ReadBooterArguments ( &BootArgsVar[0] ); - if (!EFI_ERROR (Status) && BootArgsVarLen > 0) { + if (!EFI_ERROR(Status) && BootArgsVarLen > 0) { // // Just in case we do not have 0-termination // @@ -584,7 +584,7 @@ GetAppleBootLoadedImage ( Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **)&LoadedImage); - if (!EFI_ERROR (Status) && LoadedImage->FilePath) { + if (!EFI_ERROR(Status) && LoadedImage->FilePath) { for (CurrNode = LoadedImage->FilePath; !IsDevicePathEnd (CurrNode); CurrNode = NextDevicePathNode (CurrNode)) { if (CurrNode->Type == MEDIA_DEVICE_PATH && CurrNode->SubType == MEDIA_FILEPATH_DP) { LastNode = (FILEPATH_DEVICE_PATH *)CurrNode; diff --git a/MemoryFix/AptioMemoryFix/CustomSlide.c b/MemoryFix/AptioMemoryFix/CustomSlide.c index 24e564149..c9b5c03e6 100644 --- a/MemoryFix/AptioMemoryFix/CustomSlide.c +++ b/MemoryFix/AptioMemoryFix/CustomSlide.c @@ -164,10 +164,10 @@ HideSlideFromOS ( // DTInit ((VOID *)(UINTN)(*BootArgs->deviceTreeP), BootArgs->deviceTreeLength); Status = DTLookupEntry (NULL, "/chosen", &Chosen); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_VERBOSE, "Found /chosen\n")); - Status = DTGetProperty (Chosen, "boot-args", (VOID **)&ArgsStr, &ArgsSize); - if (!EFI_ERROR (Status) && ArgsSize > 0) { + Status = DTGetProperty(Chosen, "boot-args", (VOID **)&ArgsStr, &ArgsSize); + if (!EFI_ERROR(Status) && ArgsSize > 0) { DEBUG ((DEBUG_VERBOSE, "Found boot-args in /chosen\n")); RemoveArgumentFromCommandLine (ArgsStr, "slide="); } @@ -361,7 +361,7 @@ GetVariableCsrActiveConfig ( // Otherwise call the original function. // Status = OrgGetVariable (VariableName, VendorGuid, Attributes, DataSize, Data); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "GetVariable csr-active-config returned %r\n", Status)); *Config = 0; @@ -403,7 +403,7 @@ GetVariableBootArgs ( if (!mStoredBootArgsVarSet) { Slide = GenerateRandomSlideValue (); Status = OrgGetVariable (VariableName, VendorGuid, Attributes, &StoredBootArgsSize, mStoredBootArgsVar); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { mStoredBootArgsVar[0] = '\0'; } diff --git a/MemoryFix/AptioMemoryFix/MemoryMap.c b/MemoryFix/AptioMemoryFix/MemoryMap.c index ef0fdbad6..b567168d7 100644 --- a/MemoryFix/AptioMemoryFix/MemoryMap.c +++ b/MemoryFix/AptioMemoryFix/MemoryMap.c @@ -258,7 +258,7 @@ GetMemoryMapAlloc ( (EFI_PHYSICAL_ADDRESS *)MemoryMap, FALSE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "Temp memory map allocation from top failure %r\n", Status)); *MemoryMap = NULL; return Status; @@ -279,11 +279,11 @@ GetMemoryMapAlloc ( DescriptorVersion ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (AllocatedTopPages) { gBS->FreePages ((EFI_PHYSICAL_ADDRESS)*MemoryMap, *AllocatedTopPages); } else { - FreePool (*MemoryMap); + FreePool(*MemoryMap); } *MemoryMap = NULL; } @@ -314,7 +314,7 @@ AllocatePagesFromTop ( EFI_MEMORY_DESCRIPTOR *Desc; Status = GetMemoryMapAlloc (NULL, &MemoryMapSize, &MemoryMap, &MapKey, &DescriptorSize, &DescriptorVersion); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -360,7 +360,7 @@ AllocatePagesFromTop ( } } - FreePool (MemoryMap); + FreePool(MemoryMap); return Status; } diff --git a/MemoryFix/AptioMemoryFix/RtShims.c b/MemoryFix/AptioMemoryFix/RtShims.c index 65c2ac16b..e2de02ccb 100644 --- a/MemoryFix/AptioMemoryFix/RtShims.c +++ b/MemoryFix/AptioMemoryFix/RtShims.c @@ -111,12 +111,12 @@ VOID InstallRtShims ( &RtShims, FALSE ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gRtShims = (VOID *)(UINTN)RtShims; } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gGetVariable = (UINTN)gRT->GetVariable; gSetVariable = (UINTN)gRT->SetVariable; gGetNextVariableName = (UINTN)gRT->GetNextVariableName; @@ -347,7 +347,7 @@ SetBootVariableRedirect ( &Enable ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Enable = FALSE; } } diff --git a/MemoryFix/AptioMemoryFix/ServiceOverrides.c b/MemoryFix/AptioMemoryFix/ServiceOverrides.c index 2b6c52f26..9014dd26c 100644 --- a/MemoryFix/AptioMemoryFix/ServiceOverrides.c +++ b/MemoryFix/AptioMemoryFix/ServiceOverrides.c @@ -96,7 +96,7 @@ InstallBsOverrides ( // Enforce memory pool creation when -aptiodump argument is used, but let it slip otherwise. // Status = AllocatePagesFromTop (EfiBootServicesData, PageNum, &UmmHeap, !gDumpMemArgPresent); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { SetMem((VOID *)UmmHeap, APTIOFIX_CUSTOM_POOL_ALLOCATOR_SIZE, 0); UmmSetHeap ((VOID *)UmmHeap); @@ -225,9 +225,9 @@ MOStartImage ( // Gop = NULL; Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, &Gop); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->LocateProtocol (&gEfiGraphicsOutputProtocolGuid, NULL, &Gop); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->InstallMultipleProtocolInterfaces ( &gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, @@ -261,7 +261,7 @@ MOStartImage ( // proper place and jumping back to it) // Status = PrepareJumpFromKernel (); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Force boot.efi to use our copy of system table // @@ -385,7 +385,7 @@ MOAllocatePool ( */ EFI_STATUS EFIAPI -MOFreePool ( +MOFreePool( IN VOID *Buffer ) { @@ -395,7 +395,7 @@ MOFreePool ( if (UmmFree (Buffer)) return EFI_SUCCESS; - return mStoredFreePool (Buffer); + return mStoredFreePool(Buffer); } /** gBS->GetMemoryMap override: @@ -497,7 +497,7 @@ MOExitBootServices ( Status = ForceExitBootServices (mStoredExitBootServices, ImageHandle, MapKey); } - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; if (!gHibernateWake) { @@ -537,7 +537,7 @@ ForceExitBootServices ( // Status = ExitBs (ImageHandle, MapKey); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Just report error as var in nvram to be visible from macOS with "nvram -p" // @@ -560,14 +560,14 @@ ForceExitBootServices ( // We have the latest memory map and its key, try again! // Status = ExitBs (ImageHandle, MapKey); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) Print (L"AMF: ExitBootServices failed twice - %r\n", Status); } else { Print (L"AMF: Failed to get MapKey for ExitBootServices - %r\n", Status); Status = EFI_INVALID_PARAMETER; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"Waiting 10 secs...\n"); gBS->Stall (SECONDS_TO_MICROSECONDS (10)); } diff --git a/MemoryFix/AptioMemoryFix/ServiceOverrides.h b/MemoryFix/AptioMemoryFix/ServiceOverrides.h index 1d07139c5..499706f32 100644 --- a/MemoryFix/AptioMemoryFix/ServiceOverrides.h +++ b/MemoryFix/AptioMemoryFix/ServiceOverrides.h @@ -72,7 +72,7 @@ MOAllocatePool ( EFI_STATUS EFIAPI -MOFreePool ( +MOFreePool( IN VOID *Buffer ); diff --git a/MemoryFix/AptioMemoryFix/VMem.c b/MemoryFix/AptioMemoryFix/VMem.c index c67bb8ed7..dcf706b83 100644 --- a/MemoryFix/AptioMemoryFix/VMem.c +++ b/MemoryFix/AptioMemoryFix/VMem.c @@ -292,7 +292,7 @@ VmAllocateMemoryPool ( Addr = BASE_4GB; // max address Status = AllocatePagesFromTop (EfiBootServicesData, VmMemoryPoolFreePages, &Addr, FALSE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Print (L"AMF: vm memory pool allocation failure - %r\n", Status); } else { VmMemoryPool = (UINT8*)Addr; diff --git a/MemoryFix/OsxAptioFixDrv/BootFixes.c b/MemoryFix/OsxAptioFixDrv/BootFixes.c index 75aedd101..03b7ed6c1 100644 --- a/MemoryFix/OsxAptioFixDrv/BootFixes.c +++ b/MemoryFix/OsxAptioFixDrv/BootFixes.c @@ -570,7 +570,7 @@ RuntimeServicesFix(BootArgs *BA) Status = ExecSetVirtualAddressesToMemMap(MemoryMapSize, DescriptorSize, DescriptorVersion, MemoryMap); //DBG("SetVirtualAddressMap() = Status: %r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { CpuDeadLoop(); } diff --git a/MemoryFix/OsxAptioFixDrv/BootFixes3.c b/MemoryFix/OsxAptioFixDrv/BootFixes3.c index 7743d3576..b811100f3 100644 --- a/MemoryFix/OsxAptioFixDrv/BootFixes3.c +++ b/MemoryFix/OsxAptioFixDrv/BootFixes3.c @@ -733,7 +733,7 @@ RuntimeServicesFix(BootArgs *BA) Status = ExecSetVirtualAddressesToMemMap(MemoryMapSize, DescriptorSize, DescriptorVersion, MemoryMap); //DBG("SetVirtualAddressMap() = Status: %r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { CpuDeadLoop(); } diff --git a/MemoryFix/OsxAptioFixDrv/DecodedKernelCheck.c b/MemoryFix/OsxAptioFixDrv/DecodedKernelCheck.c index b76188fe6..9c2243fd3 100644 --- a/MemoryFix/OsxAptioFixDrv/DecodedKernelCheck.c +++ b/MemoryFix/OsxAptioFixDrv/DecodedKernelCheck.c @@ -191,7 +191,7 @@ CheckDecodedKernel ( for (i = 0; i < mySegDataNum; i++) { segStatus = CheckDecodedSegment(&mySegData[i]); - if (EFI_ERROR (segStatus)) { + if (EFI_ERROR(segStatus)) { Status = segStatus; } } diff --git a/MemoryFix/OsxAptioFixDrv/FlatDevTree/device_tree.c b/MemoryFix/OsxAptioFixDrv/FlatDevTree/device_tree.c index 370bee088..0cc160617 100644 --- a/MemoryFix/OsxAptioFixDrv/FlatDevTree/device_tree.c +++ b/MemoryFix/OsxAptioFixDrv/FlatDevTree/device_tree.c @@ -174,7 +174,7 @@ INTN find_entry(CONST CHAR8 *propName, CONST CHAR8 *propValue, DTEntry *entryH) startingP += sizeof (*propP) + ((propP->length + 3) & -4); - if (AsciiStrCmp ((CHAR8*)propP->name, (CHAR8*)propName) == 0) { + if (AsciiStrCmp((CHAR8*)propP->name, (CHAR8*)propName) == 0) { if (propValue == NULL || AsciiStrCmp( (CHAR8*)(propP + 1), (CHAR8*)propValue) == 0) { *entryH = (DTEntry)nodeP; diff --git a/MemoryFix/OsxAptioFixDrv/OsxAptioFix2Drv.c b/MemoryFix/OsxAptioFixDrv/OsxAptioFix2Drv.c index 179b4ea0d..7ec4a4534 100644 --- a/MemoryFix/OsxAptioFixDrv/OsxAptioFix2Drv.c +++ b/MemoryFix/OsxAptioFixDrv/OsxAptioFix2Drv.c @@ -291,7 +291,7 @@ MOExitBootServices ( //Print(L"ExitBootServices()\n"); Status = gStoredExitBootServices(ImageHandle, MapKey); DBGnvr("ExitBootServices: = %r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // just report error as var in nvram to be visible from OSX with "nvram -p" gRT->SetVariable(L"OsxAptioFixDrv-ErrorExitingBootServices", &gEfiAppleBootGuid, @@ -307,7 +307,7 @@ MOExitBootServices ( // we'll try again ExitBootServices with NewMapKey Status = gStoredExitBootServices(ImageHandle, NewMapKey); DBGnvr("ExitBootServices: 2nd try = %r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // Error! Print(L"OsxAptioFixDrv: Error ExitBootServices() 2nd try = Status: %r\n", Status); } diff --git a/MemoryFix/OsxAptioFixDrv/OsxAptioFix3Drv.c b/MemoryFix/OsxAptioFixDrv/OsxAptioFix3Drv.c index 3d523309a..a377828fb 100644 --- a/MemoryFix/OsxAptioFixDrv/OsxAptioFix3Drv.c +++ b/MemoryFix/OsxAptioFixDrv/OsxAptioFix3Drv.c @@ -292,7 +292,7 @@ MOExitBootServices ( //Print(L"ExitBootServices()\n"); Status = gStoredExitBootServices(ImageHandle, MapKey); DBGnvr("ExitBootServices: = %r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // just report error as var in nvram to be visible from OSX with "nvram -p" gRT->SetVariable(L"OsxAptioFixDrv-ErrorExitingBootServices", &gEfiAppleBootGuid, @@ -308,7 +308,7 @@ MOExitBootServices ( // we'll try again ExitBootServices with NewMapKey Status = gStoredExitBootServices(ImageHandle, NewMapKey); DBGnvr("ExitBootServices: 2nd try = %r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // Error! Print(L"OsxAptioFix3Drv: Error ExitBootServices() 2nd try = Status: %r\n", Status); } @@ -453,7 +453,7 @@ RunImageWithOverrides( &RTShims ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gGetVariable = (UINTN)gRT->GetVariable; gGetNextVariableName = (UINTN)gRT->GetNextVariableName; gSetVariable = (UINTN)gRT->SetVariable; diff --git a/MemoryFix/OsxAptioFixDrv/OsxAptioFixDrv.c b/MemoryFix/OsxAptioFixDrv/OsxAptioFixDrv.c index fbd98eca1..e54b72ede 100644 --- a/MemoryFix/OsxAptioFixDrv/OsxAptioFixDrv.c +++ b/MemoryFix/OsxAptioFixDrv/OsxAptioFixDrv.c @@ -377,7 +377,7 @@ MOExitBootServices ( //Print(L"ExitBootServices()\n"); Status = gStoredExitBootServices(ImageHandle, MapKey); DBGnvr("ExitBootServices: = %r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // just report error as var in nvram to be visible from OSX with "nvrap -p" gRT->SetVariable(L"OsxAptioFixDrv-ErrorExitingBootServices", &gEfiAppleBootGuid, @@ -393,7 +393,7 @@ MOExitBootServices ( // we'll try again ExitBootServices with NewMapKey Status = gStoredExitBootServices(ImageHandle, NewMapKey); DBGnvr("ExitBootServices: 2nd try = %r\n", Status); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // Error! Print(L"OsxAptioFixDrv: Error ExitBootServices() 2nd try = Status: %r\n", Status); } diff --git a/PcAtChipsetPkg/8254TimerDxe/Timer.c b/PcAtChipsetPkg/8254TimerDxe/Timer.c index 1cf948b6f..5d6bd9de1 100644 --- a/PcAtChipsetPkg/8254TimerDxe/Timer.c +++ b/PcAtChipsetPkg/8254TimerDxe/Timer.c @@ -296,7 +296,7 @@ TimerDriverGenerateSoftInterrupt ( // If the timer interrupt is enabled, then the registered handler will be invoked. // Status = mLegacy8259->GetMask (mLegacy8259, NULL, NULL, &IRQMask, NULL); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if ((IRQMask & 0x1) == 0) { // // Invoke the registered handler @@ -353,38 +353,38 @@ TimerDriverInitialize ( // Find the CPU architectural protocol. // Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &mCpu); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Find the Legacy8259 protocol. // Status = gBS->LocateProtocol (&gEfiLegacy8259ProtocolGuid, NULL, (VOID **) &mLegacy8259); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Force the timer to be disabled // Status = TimerDriverSetTimerPeriod (&mTimer, 0); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Get the interrupt vector number corresponding to IRQ0 from the 8259 driver // TimerVector = 0; Status = mLegacy8259->GetVector (mLegacy8259, Efi8259Irq0, (UINT8 *) &TimerVector); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install interrupt handler for 8254 Timer #0 (ISA IRQ0) // Status = mCpu->RegisterInterruptHandler (mCpu, TimerVector, TimerInterruptHandler); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Force the timer to be enabled at its default period // Status = TimerDriverSetTimerPeriod (&mTimer, DEFAULT_TIMER_TICK_DURATION); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Install the Timer Architectural Protocol onto a new handle @@ -394,7 +394,7 @@ TimerDriverInitialize ( &gEfiTimerArchProtocolGuid, &mTimer, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.c b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.c index d77e07276..fdd5ce283 100644 --- a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.c +++ b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.c @@ -516,7 +516,7 @@ Interrupt8259GetInterruptLine ( &gEfiPciIoProtocolGuid, (VOID **) &PciIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } diff --git a/PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/ComponentName.c b/PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/ComponentName.c index 4f08ec159..bcd7f2355 100644 --- a/PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/ComponentName.c +++ b/PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/ComponentName.c @@ -153,7 +153,7 @@ IdeControllerComponentNameGetControllerName ( gIdeControllerDriverBinding.DriverBindingHandle, &gEfiPciIoProtocolGuid ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeController.c b/PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeController.c index 8f41c7c3f..983f9b3d0 100644 --- a/PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeController.c +++ b/PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeController.c @@ -90,7 +90,7 @@ InitializeIdeControllerDriver ( &gIdeControllerComponentName, &gIdeControllerComponentName2 ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } @@ -130,7 +130,7 @@ IdeControllerSupported ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -145,7 +145,7 @@ IdeControllerSupported ( 1, &PciClass ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -156,7 +156,7 @@ IdeControllerSupported ( 1, &PciSubClass ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -221,7 +221,7 @@ IdeControllerStart ( // opened 'again' by this call. // Status != ALREADY_STARTED - Error status, terminate program execution // - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -269,7 +269,7 @@ IdeControllerStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_UNSUPPORTED; } @@ -288,7 +288,7 @@ IdeControllerStop ( &gEfiIdeControllerInitProtocolGuid, &gEfiIdeControllerInit, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } diff --git a/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c b/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c index ded3b5361..5435bb05f 100644 --- a/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c +++ b/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c @@ -773,7 +773,7 @@ TimerDriverInitialize ( // Find the CPU architectural protocol. // Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &mCpu); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Retrieve HPET Capabilities and Configuration Information @@ -939,8 +939,8 @@ TimerDriverInitialize ( // Install interrupt handler for selected HPET Timer // Status = mCpu->RegisterInterruptHandler (mCpu, PcdGet8 (PcdHpetLocalApicVector), TimerInterruptHandler); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Unable to register HPET interrupt with CPU Arch Protocol. Unload HPET driver.\n")); return EFI_DEVICE_ERROR; } @@ -949,8 +949,8 @@ TimerDriverInitialize ( // Force the HPET Timer to be enabled at its default period // Status = TimerDriverSetTimerPeriod (&mTimer, PcdGet64 (PcdHpetDefaultTimerPeriod)); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Unable to set HPET default timer rate. Unload HPET driver.\n")); return EFI_DEVICE_ERROR; } @@ -987,7 +987,7 @@ TimerDriverInitialize ( &gEfiTimerArchProtocolGuid, &mTimer, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c b/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c index 84aa7e322..fa67f35d0 100644 --- a/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c +++ b/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c @@ -94,7 +94,7 @@ PcatIsaAcpiDriverBindingSupported ( sizeof(Pci) / sizeof(UINT32), &Pci); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; if ((Pci.Hdr.Command & 0x03) == 0x03) { if (Pci.Hdr.ClassCode[2] == PCI_CLASS_BRIDGE) { @@ -122,7 +122,7 @@ PcatIsaAcpiDriverBindingSupported ( &DeviceNumber, &FunctionNumber ); - if (!EFI_ERROR (Status) && FunctionNumber == 0) { + if (!EFI_ERROR(Status) && FunctionNumber == 0) { Status = EFI_SUCCESS; } else { Status = EFI_UNSUPPORTED; @@ -185,7 +185,7 @@ PcatIsaAcpiDriverBindingStart ( Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -198,7 +198,7 @@ PcatIsaAcpiDriverBindingStart ( 0, &Supports ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -214,7 +214,7 @@ PcatIsaAcpiDriverBindingStart ( 0, &OriginalAttributes ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -224,7 +224,7 @@ PcatIsaAcpiDriverBindingStart ( EFI_PCI_DEVICE_ENABLE | Supports | EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -238,7 +238,7 @@ PcatIsaAcpiDriverBindingStart ( sizeof(PCAT_ISA_ACPI_DEV), (VOID**)&PcatIsaAcpiDev ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { goto Done; } @@ -277,7 +277,7 @@ PcatIsaAcpiDriverBindingStart ( ); Done: - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (PciIo != NULL && Enabled) { PciIo->Attributes ( PciIo, @@ -293,7 +293,7 @@ Done: Controller ); if (PcatIsaAcpiDev != NULL) { - gBS->FreePool (PcatIsaAcpiDev); + gBS->FreePool(PcatIsaAcpiDev); } return Status; } @@ -340,7 +340,7 @@ PcatIsaAcpiDriverBindingStop ( Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -358,7 +358,7 @@ PcatIsaAcpiDriverBindingStop ( PcatIsaAcpiDev->OriginalAttributes, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -369,7 +369,7 @@ PcatIsaAcpiDriverBindingStop ( Controller, &gEfiIsaAcpiProtocolGuid, &PcatIsaAcpiDev->IsaAcpi ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -380,7 +380,7 @@ PcatIsaAcpiDriverBindingStop ( Controller ); - gBS->FreePool (PcatIsaAcpiDev); + gBS->FreePool(PcatIsaAcpiDev); return EFI_SUCCESS; } diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c index d08ad0e22..0ab8d2b95 100644 --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c @@ -155,7 +155,7 @@ PcRtcInit ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Set the variable with default value if the RTC is functioning incorrectly. // @@ -202,7 +202,7 @@ PcRtcInit ( &DataSize, &TimerVar ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Time.TimeZone = (INT16) TimerVar; Time.Daylight = (UINT8) (TimerVar >> 16); } else { @@ -214,10 +214,10 @@ PcRtcInit ( // Validate time fields // Status = ConvertRtcTimeToEfiTime (&Time, RegisterB); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = RtcTimeFieldsValid (&Time); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Time.Second = RTC_INIT_SECOND; Time.Minute = RTC_INIT_MINUTE; Time.Hour = RTC_INIT_HOUR; @@ -233,7 +233,7 @@ PcRtcInit ( // Reset time value according to new RTC configuration // Status = PcRtcSetTime (&Time, Global); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -243,7 +243,7 @@ PcRtcInit ( // so we can use them to get and set wakeup time. // Status = PcRtcGetWakeupTime (&Enabled, &Pending, &Time, Global); - if ((Enabled) || (!EFI_ERROR (Status))) { + if ((Enabled) || (!EFI_ERROR(Status))) { return EFI_SUCCESS; } @@ -271,7 +271,7 @@ PcRtcInit ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -290,7 +290,7 @@ PcRtcInit ( sizeof (Time), &Time ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -366,7 +366,7 @@ PcRtcGetTime ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -404,10 +404,10 @@ PcRtcGetTime ( // Make sure all field values are in correct range // Status = ConvertRtcTimeToEfiTime (Time, RegisterB); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = RtcTimeFieldsValid (Time); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -458,7 +458,7 @@ PcRtcSetTime ( // Make sure that the time fields are valid // Status = RtcTimeFieldsValid (Time); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -474,7 +474,7 @@ PcRtcSetTime ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -507,7 +507,7 @@ PcRtcSetTime ( ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -605,7 +605,7 @@ PcRtcGetWakeupTime ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -643,7 +643,7 @@ PcRtcGetWakeupTime ( &DataSize, &RtcTime ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // The alarm variable exists. In this case, we read variable to get info. // @@ -663,10 +663,10 @@ PcRtcGetWakeupTime ( // Make sure all field values are in correct range // Status = ConvertRtcTimeToEfiTime (Time, RegisterB); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = RtcTimeFieldsValid (Time); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } @@ -711,7 +711,7 @@ PcRtcSetWakeupTime ( // Make sure that the time fields are valid // Status = RtcTimeFieldsValid (Time); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_INVALID_PARAMETER; } // @@ -719,7 +719,7 @@ PcRtcSetWakeupTime ( // PcRtcGetTime (&RtcTime, &Capabilities, Global); Status = RtcTimeFieldsValid (&RtcTime); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return EFI_DEVICE_ERROR; } if (!IsWithinOneDay (&RtcTime, Time)) { @@ -741,7 +741,7 @@ PcRtcSetWakeupTime ( // Wait for up to 0.1 seconds for the RTC to be updated // Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout)); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -778,7 +778,7 @@ PcRtcSetWakeupTime ( sizeof (RtcTime), &RtcTime ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (!EfiAtRuntime ()) { EfiReleaseLock (&Global->RtcLock); } @@ -1248,7 +1248,7 @@ PcRtcAcpiTableChangeCallback ( if ((CenturyRtcAddress != 0) && (mModuleGlobal.CenturyRtcAddress != CenturyRtcAddress)) { mModuleGlobal.CenturyRtcAddress = CenturyRtcAddress; Status = PcRtcGetTime (&Time, NULL, &mModuleGlobal); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Century = (UINT8) (Time.Year / 100); Century = DecimalToBcd8 (Century); DEBUG ((EFI_D_INFO, "PcRtc: Write 0x%x to CMOS location 0x%x\n", Century, mModuleGlobal.CenturyRtcAddress)); diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c index a53d1b1c2..e16d17c9d 100644 --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c @@ -132,7 +132,7 @@ InitializePcRtc ( mModuleGlobal.CenturyRtcAddress = GetCenturyRtcAddress (); Status = PcRtcInit (&mModuleGlobal); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return Status; } @@ -145,7 +145,7 @@ InitializePcRtc ( &gEfiAcpi10TableGuid, &Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return Status; } @@ -158,7 +158,7 @@ InitializePcRtc ( &gEfiAcpiTableGuid, &Event ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { return Status; } @@ -174,7 +174,7 @@ InitializePcRtc ( NULL, NULL ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); return Status; } diff --git a/Protocols/AppleKeyAggregator/AppleKeyAggregator.c b/Protocols/AppleKeyAggregator/AppleKeyAggregator.c index bb06a61d2..c114e6ec8 100644 --- a/Protocols/AppleKeyAggregator/AppleKeyAggregator.c +++ b/Protocols/AppleKeyAggregator/AppleKeyAggregator.c @@ -124,7 +124,7 @@ KeyMapCreateKeyStrokesBuffer ( Aggregator = APPLE_KEY_MAP_AGGREGATOR_PRIVATE_FROM_DATABASE (This); if (Aggregator->KeyBuffer != NULL) { - gBS->FreePool ((VOID *)Aggregator->KeyBuffer); + gBS->FreePool((VOID *)Aggregator->KeyBuffer); } BufferSize = (Aggregator->KeyBuffersSize + KeyBufferSize); @@ -179,7 +179,7 @@ KeyMapRemoveKeyStrokesBuffer ( Aggregator->KeyBuffersSize -= KeyStrokesInfo->Hdr.KeyBufferSize; RemoveEntryList (&KeyStrokesInfo->Hdr.This); - gBS->FreePool ((VOID *)KeyStrokesInfo); + gBS->FreePool((VOID *)KeyStrokesInfo); Status = EFI_SUCCESS; } @@ -336,7 +336,7 @@ SearchKeyStroke (APPLE_KEY_STATE_PROTOCOL* This, DbNoKeys = DB_KEYS_NUM; Status = This->ReadKeyState(This, &DbModifiers, &DbNoKeys, DbKeys); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (ExactMatch) { Status = EFI_NOT_FOUND; @@ -403,11 +403,11 @@ AggregatorEntryPoint ( &Buffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; if (Buffer != NULL) { - gBS->FreePool ((VOID *)Buffer); + gBS->FreePool((VOID *)Buffer); } } else { Aggregator = AllocateZeroPool(sizeof(APPLE_KEY_MAP_AGGREGATOR)); @@ -434,7 +434,7 @@ AggregatorEntryPoint ( NULL ); /* - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->InstallProtocolInterface(ImageHandle, &gAppleEventProtocolGuid, EFI_NATIVE_INTERFACE, &mAppleEventProtocol); } */ diff --git a/Protocols/AppleKeyFeeder/AppleKeyFeeder.c b/Protocols/AppleKeyFeeder/AppleKeyFeeder.c index 1568b20d9..ae0a0b239 100644 --- a/Protocols/AppleKeyFeeder/AppleKeyFeeder.c +++ b/Protocols/AppleKeyFeeder/AppleKeyFeeder.c @@ -72,12 +72,12 @@ DBG("AppleKeyFeederEntrypoint\n"); EFI_STATUS Status = EFI_SUCCESS; Status = AppleKeyMapUtilsInit(ImageHandle, SystemTable); - if ( EFI_ERROR (Status) ) { + if ( EFI_ERROR(Status) ) { DBG("AppleKeyFeederEntrypoint: AppleKeyMapUtilsInit failed, Status=%x\n", Status); } Status = SimpleTextProxyInit(ImageHandle, SystemTable); - if ( EFI_ERROR (Status) ) { + if ( EFI_ERROR(Status) ) { DBG("AppleKeyFeederEntrypoint: SimpleTextProxyInit failed, Status=%x\n", Status); } @@ -95,7 +95,7 @@ DBG("AppleKeyFeederEntrypoint\n"); NULL, &AppleKeyFeederSimpleTextExProxy.WaitForKeyEx ); - if ( EFI_ERROR (Status) ) { + if ( EFI_ERROR(Status) ) { DBG("SimpleTextProxyInit: CreateEvent AppleKeyFeederSimpleTextExProxy.WaitForKeyEx, Status=%x\n", Status); } Status = gBS->CreateEvent ( @@ -105,7 +105,7 @@ DBG("AppleKeyFeederEntrypoint\n"); NULL, &AppleKeyFeederSimpleTextProxy.WaitForKey ); - if ( EFI_ERROR (Status) ) { + if ( EFI_ERROR(Status) ) { DBG("SimpleTextProxyInit: CreateEvent AppleKeyFeederSimpleTextProxy.WaitForKey, Status=%x\n", Status); } @@ -129,7 +129,7 @@ DBG("AppleKeyFeederEntrypoint\n"); &eventReadKeystroke ); } - if ( EFI_ERROR (Status) ) { + if ( EFI_ERROR(Status) ) { DBG("SimpleTextProxyInit: CreateEvent2 failed, Status=%x\n", Status); } Status = gBS->SetTimer ( @@ -137,7 +137,7 @@ DBG("AppleKeyFeederEntrypoint\n"); TimerPeriodic, 10*1000*20 // 10*1000*1000 = 1s, so this 20ms ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("SimpleTextProxyInit: SetTimer2 failed, Status=%x\n", Status); } @@ -158,7 +158,7 @@ DBG("AppleKeyFeederEntrypoint\n"); NULL ); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("SimpleTextProxyInit: InstallMultipleProtocol failed, Status=%x\n", Status); } diff --git a/Protocols/AppleKeyFeeder/AppleKeyMapUtils.c b/Protocols/AppleKeyFeeder/AppleKeyMapUtils.c index a95c8e5d1..805607493 100644 --- a/Protocols/AppleKeyFeeder/AppleKeyMapUtils.c +++ b/Protocols/AppleKeyFeeder/AppleKeyMapUtils.c @@ -54,14 +54,14 @@ static EFI_STATUS getAppleKeyMapDb() NULL, (VOID **)&AppleKeyMapDb ); - if (!EFI_ERROR (Status)) + if (!EFI_ERROR(Status)) { Status = AppleKeyMapDb->CreateKeyStrokesBuffer ( AppleKeyMapDb, 6, &AppleKeyMapDbIndex ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("AppleKeyFeederEntrypoint: CreateKeyStrokesBuffer failed, Status=%x\n", Status); } }else{ @@ -92,7 +92,7 @@ SendKeyRelease ( 0, &appleKey ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("SendKeyRelease: SetKeyStrokeBufferKeys failed, Status=%x\n", Status); } @@ -101,7 +101,7 @@ SendKeyRelease ( TimerCancel, 10*1000 ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("SendKeyRelease: SetTimer failed, Status=%x\n", Status); } } @@ -310,7 +310,7 @@ SendDataToAppleMap(IN EFI_KEY_DATA *KeyData) if ( !AppleKeyMapDb ) { Status = getAppleKeyMapDb(); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("SendDataToAppleMap: getAppleKeyMapDb() failed, Status=%x\n", Status); } } @@ -328,7 +328,7 @@ SendDataToAppleMap(IN EFI_KEY_DATA *KeyData) NumberOfKeys, &appleKey ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("SendDataToAppleMap: SetKeyStrokeBufferKeys failed, Status=%x\n", Status); return Status; } @@ -339,7 +339,7 @@ SendDataToAppleMap(IN EFI_KEY_DATA *KeyData) TimerPeriodic, 10*1000*15 // 15 ms ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // if this fail, we end up having the key repeated. DBG("SendDataToAppleMap: SetTimer failed, Status=%x\n", Status); return Status; @@ -376,7 +376,7 @@ DBG("AppleKeyMapUtilsInit\n"); NULL, &eventKeyRelease ); - if ( EFI_ERROR (Status) ) { + if ( EFI_ERROR(Status) ) { DBG("AppleKeyMapUtilsInit: CreateEvent failed, Status=%x\n", Status); } diff --git a/Protocols/AppleKeyFeeder/SimpleTextExProxy.c b/Protocols/AppleKeyFeeder/SimpleTextExProxy.c index fb1c27416..c8321a040 100644 --- a/Protocols/AppleKeyFeeder/SimpleTextExProxy.c +++ b/Protocols/AppleKeyFeeder/SimpleTextExProxy.c @@ -273,7 +273,7 @@ DBG("SimpleTextExProxyInit\n"); OriginalConsoleInHandle = SystemTable->ConsoleInHandle; Status = gBS->HandleProtocol(gST->ConsoleInHandle, &gEfiSimpleTextInputExProtocolGuid, (VOID **)&OriginalSimpleTextEx); - if ( EFI_ERROR (Status) ) { + if ( EFI_ERROR(Status) ) { DBG("SimpleTextExProxyInit: CreateEvent2 failed, Status=%x\n", Status); goto bail; } @@ -296,7 +296,7 @@ DBG("SimpleTextExProxyInit: AppleKeyFeederSimpleTextExProxy=%x, AppleKeyFeederSi // NULL, // &AppleKeyFeederSimpleTextExProxy.WaitForKeyEx // ); -// if ( EFI_ERROR (Status) ) { +// if ( EFI_ERROR(Status) ) { // DBG("SimpleTextExProxyInit: CreateEvent2 failed, Status=%x\n", Status); // goto bail; // } diff --git a/Protocols/AppleKeyFeeder/SimpleTextProxy.c b/Protocols/AppleKeyFeeder/SimpleTextProxy.c index 75fdb8c42..b32e0a8a7 100644 --- a/Protocols/AppleKeyFeeder/SimpleTextProxy.c +++ b/Protocols/AppleKeyFeeder/SimpleTextProxy.c @@ -196,7 +196,7 @@ DBG("SimpleTextProxyInit\n"); AppleKeyFeederSimpleTextProxy.ReadKeyStroke = SimpleTextProxyReadKeyStroke; Status = SimpleTextExProxyInit(ImageHandle, SystemTable); - if ( EFI_ERROR (Status) ) { + if ( EFI_ERROR(Status) ) { DBG("SimpleTextProxyInit: CreateEvent2 failed, Status=%x\n", Status); } diff --git a/Protocols/AptioInputFix/Keycode/AIK.c b/Protocols/AptioInputFix/Keycode/AIK.c index c4e3219d5..470ad4c57 100644 --- a/Protocols/AptioInputFix/Keycode/AIK.c +++ b/Protocols/AptioInputFix/Keycode/AIK.c @@ -38,7 +38,7 @@ AIKProtocolArriveHandler ( } Status = AIKInstall (Keycode); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // We are successful, so can remove the protocol polling event if any // @@ -61,12 +61,12 @@ AIKProtocolArriveInstall ( if (Keycode->KeyMapDbArriveEvent == NULL) { Status = gBS->CreateEvent (EVT_NOTIFY_SIGNAL, TPL_NOTIFY, AIKProtocolArriveHandler, Keycode, &Keycode->KeyMapDbArriveEvent); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "KeyMapDbArriveEvent creation failed - %r\n", Status)); } else { Status = gBS->RegisterProtocolNotify (&gAppleKeyMapDatabaseProtocolGuid, Keycode->KeyMapDbArriveEvent, &Registration); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "KeyMapDbArriveEvent registration failed - %r\n", Status)); gBS->CloseEvent (Keycode->KeyMapDbArriveEvent); Keycode->KeyMapDbArriveEvent = NULL; @@ -126,7 +126,7 @@ AIKPollKeyboardHandler ( &Keycode->Source, &KeyData ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { (VOID) Counter; DEBUG ((DEBUG_VERBOSE, "Read key with scan 0x%X and unicode 0x%X at %Lu\n", KeyData.Key.ScanCode, KeyData.Key.UnicodeChar, Counter @@ -136,7 +136,7 @@ AIKPollKeyboardHandler ( } Index++; - } while (!EFI_ERROR (Status) && Index < AIK_KEY_POLL_LIMIT); + } while (!EFI_ERROR(Status) && Index < AIK_KEY_POLL_LIMIT); AIKTargetSubmit (&Keycode->Target); @@ -152,7 +152,7 @@ AIKInstall ( Status = AIKTargetInstall (&Keycode->Target); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Working AppleKeyMapAggregator is not here yet. // @@ -161,7 +161,7 @@ AIKInstall ( Status = AIKSourceInstall (&Keycode->Source); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Cannot work with these sources. // @@ -177,9 +177,9 @@ AIKInstall ( Keycode, &Keycode->PollKeyboardEvent ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gBS->SetTimer (Keycode->PollKeyboardEvent, TimerPeriodic, AIK_KEY_POLL_INTERVAL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AIKPollKeyboardHandler timer setting failed - %r\n", Status)); gBS->CloseEvent (Keycode->PollKeyboardEvent); Keycode->PollKeyboardEvent = NULL; @@ -188,7 +188,7 @@ AIKInstall ( DEBUG ((DEBUG_INFO, "AIKPollKeyboardHandler event creation failed - %r\n", Status)); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { AIKSourceUninstall (&Keycode->Source); AIKTargetUninstall (&Keycode->Target); } @@ -225,14 +225,14 @@ AIKInit ( AIKTranslateConfigure (); Status = AIKInstall (&gAikSelf); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AIKInstall failed - %r\n", Status)); // // No AppleKeyMapAggregator present, install on its availability. // Status = AIKProtocolArriveInstall (&gAikSelf); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AIK is NOT waiting for protocols - %r\n", Status)); } } diff --git a/Protocols/AptioInputFix/Keycode/AIKShim.c b/Protocols/AptioInputFix/Keycode/AIKShim.c index c541a5e83..f86855e0c 100644 --- a/Protocols/AptioInputFix/Keycode/AIKShim.c +++ b/Protocols/AptioInputFix/Keycode/AIKShim.c @@ -107,7 +107,7 @@ AIKShimTextInputReadKeyStroke ( // Do not touch any protocol but ours. // Status = AIKDataReadEntry (&gAikSelf.Data, &AmiKeyData); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // 'Partial' keys should not be returned by SimpleTextInput protocols. // @@ -168,7 +168,7 @@ AIKShimTextInputReadKeyStrokeEx ( // Do not touch any protocol but ours. // Status = AIKDataReadEntry (&gAikSelf.Data, &AmiKeyData); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { CopyMem (&KeyData->Key, &AmiKeyData.Key, sizeof (AmiKeyData.Key)); CopyMem (&KeyData->KeyState, &AmiKeyData.KeyState, sizeof (AmiKeyData.KeyState)); } diff --git a/Protocols/AptioInputFix/Keycode/AIKSource.c b/Protocols/AptioInputFix/Keycode/AIKSource.c index 1f2d935b3..390bd8554 100644 --- a/Protocols/AptioInputFix/Keycode/AIKSource.c +++ b/Protocols/AptioInputFix/Keycode/AIKSource.c @@ -69,19 +69,19 @@ AIKSourceInstall ( Status = gBS->HandleProtocol (Source->ConSplitHandler, &gAmiEfiKeycodeProtocolGuid, (VOID **) &Source->AmiKeycode); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AmiEfiKeycodeProtocol is unavailable on gST->ConsoleHandle - %r\n", Status)); } Status = gBS->HandleProtocol (Source->ConSplitHandler, &gEfiSimpleTextInProtocolGuid, (VOID **) &Source->TextInput); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "EfiSimpleTextInProtocol is unavailable on gST->ConsoleHandle - %r\n", Status)); } Status = gBS->HandleProtocol (Source->ConSplitHandler, &gEfiSimpleTextInputExProtocolGuid, (VOID **) &Source->TextInputEx); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "EfiSimpleTextInputExProtocol is unavailable on gST->ConsoleHandle - %r\n", Status)); } @@ -106,7 +106,7 @@ AIKSourceInstall ( EVT_NOTIFY_WAIT, TPL_NOTIFY, AIKShimWaitForKeyHandler, NULL, &Source->AmiKeycode->WaitForKeyEx ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AmiEfiKeycodeProtocol WaitForKey replace failed - %r", Status)); Source->AmiKeycode->WaitForKeyEx = Source->AmiWait; Source->AmiWait = NULL; @@ -124,7 +124,7 @@ AIKSourceInstall ( EVT_NOTIFY_WAIT, TPL_NOTIFY, AIKShimWaitForKeyHandler, NULL, &Source->TextInput->WaitForKey ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "EfiSimpleTextInProtocol WaitForKey replace failed - %r", Status)); Source->TextInput->WaitForKey = Source->TextWait; Source->TextWait = NULL; @@ -142,7 +142,7 @@ AIKSourceInstall ( EVT_NOTIFY_WAIT, TPL_NOTIFY, AIKShimWaitForKeyHandler, NULL, &Source->TextInputEx->WaitForKeyEx ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "EfiSimpleTextInputExProtocol WaitForKey replace failed - %r", Status)); Source->TextInputEx->WaitForKeyEx = Source->TextWaitEx; Source->TextWaitEx = NULL; diff --git a/Protocols/AptioInputFix/Keycode/AIKTarget.c b/Protocols/AptioInputFix/Keycode/AIKTarget.c index c4989f2bc..caa7d50cb 100644 --- a/Protocols/AptioInputFix/Keycode/AIKTarget.c +++ b/Protocols/AptioInputFix/Keycode/AIKTarget.c @@ -31,7 +31,7 @@ AIKTargetInstall ( if (Target->KeyMapDb == NULL) { Status = gBS->LocateProtocol (&gAppleKeyMapDatabaseProtocolGuid, NULL, (VOID **) &Target->KeyMapDb); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AppleKeyMapDatabaseProtocol is unavailable - %r\n", Status)); return EFI_NOT_FOUND; } @@ -40,7 +40,7 @@ AIKTargetInstall ( Target->KeyMapDb, AIK_TARGET_BUFFER_SIZE, &Target->KeyMapDbIndex ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "CreateKeyStrokesBuffer failed - %r\n", Status)); Target->KeyMapDb = NULL; } @@ -185,7 +185,7 @@ AIKTargetSubmit ( Status = EFI_NOT_FOUND; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "Failed to submit keys to AppleMapDb - %r", Status)); } } diff --git a/Protocols/AptioInputFix/Pointer/AIM.c b/Protocols/AptioInputFix/Pointer/AIM.c index c3082e063..2c50aa607 100644 --- a/Protocols/AptioInputFix/Pointer/AIM.c +++ b/Protocols/AptioInputFix/Pointer/AIM.c @@ -319,7 +319,7 @@ AmiShimPointerGetState ( if (Index != AIM_MAX_POINTERS) { Status = AmiShimPointerUpdateState (Pointer, State); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (State->RelativeMovementX != 0 || State->RelativeMovementY != 0 || State->RelativeMovementZ != 0) { @@ -351,14 +351,14 @@ AmiShimPointerTimerSetup ( Status = gBS->CreateEvent (EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_NOTIFY, AmiShimPointerPositionHandler, NULL, &mAmiShimPointer.PositionEvent); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AmiShimPointerPositionHandler event creation failed %d\n", Status)); return Status; } Status = gBS->SetTimer (mAmiShimPointer.PositionEvent, TimerPeriodic, AIM_POSITION_POLL_INTERVAL); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AmiShimPointerPositionHandler timer setting failed %d\n", Status)); gBS->CloseEvent (mAmiShimPointer.PositionEvent); return Status; @@ -383,7 +383,7 @@ AmiShimPointerTimerUninstall ( if (mAmiShimPointer.PositionEvent != NULL) { Status = gBS->SetTimer (mAmiShimPointer.PositionEvent, TimerCancel, 0); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { gBS->CloseEvent (mAmiShimPointer.PositionEvent); mAmiShimPointer.PositionEvent = NULL; } else { @@ -483,7 +483,7 @@ AmiShimPointerInstall ( Installed = TRUE; } - gBS->FreePool (Handles); + gBS->FreePool(Handles); if (!Installed) { return EFI_NOT_FOUND; @@ -539,7 +539,7 @@ AIMInit ( Status = gBS->CreateEvent (EVT_NOTIFY_SIGNAL, TPL_NOTIFY, AmiShimPointerArriveHandler, NULL, &mAmiShimPointer.ProtocolArriveEvent); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AmiShimPointerArriveHandler event creation failed %d\n", Status)); return Status; } @@ -547,7 +547,7 @@ AIMInit ( // EfiSimplePointer gets installed after AMI proprietary protocol Status = gBS->RegisterProtocolNotify (&gEfiSimplePointerProtocolGuid, mAmiShimPointer.ProtocolArriveEvent, &Registration); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AmiShimProtocolArriveHandler protocol registration failed %d\n", Status)); gBS->CloseEvent (mAmiShimPointer.ProtocolArriveEvent); return Status; diff --git a/Protocols/AptioInputFix/Timer/AIT.c b/Protocols/AptioInputFix/Timer/AIT.c index 8e1afd834..ea00fd8a0 100644 --- a/Protocols/AptioInputFix/Timer/AIT.c +++ b/Protocols/AptioInputFix/Timer/AIT.c @@ -31,13 +31,13 @@ AITInit ( // Refresh rate needs to be increased to poll mouse and keyboard frequently enough // Status = gBS->LocateProtocol (&gEfiTimerArchProtocolGuid, NULL, (VOID **)&mTimerProtocol); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = mTimerProtocol->GetTimerPeriod (mTimerProtocol, &mOriginalTimerPeriod); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AIFTimerBoostInit Current timer is %u\n", mOriginalTimerPeriod)); if (mOriginalTimerPeriod > AIT_TIMER_PERIOD) { Status = mTimerProtocol->SetTimerPeriod (mTimerProtocol, AIT_TIMER_PERIOD); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "AIFTimerBoostInit changed period %d to %d\n", mOriginalTimerPeriod, AIT_TIMER_PERIOD)); } else { @@ -73,7 +73,7 @@ AITExit ( // handler during XNU boot. // // Status = mTimerProtocol->SetTimerPeriod (mTimerProtocol, mOriginalTimerPeriod); - // if (!EFI_ERROR (Status)) { + // if (!EFI_ERROR(Status)) { // DEBUG ((DEBUG_INFO, "AmiShimTimerBoostExit changed period %d to %d\n", // AIT_TIMER_PERIOD, mOriginalTimerPeriod)); // } else { diff --git a/Protocols/DataHubDxe/DataHub.c b/Protocols/DataHubDxe/DataHub.c index 9a193d5ff..f37236148 100644 --- a/Protocols/DataHubDxe/DataHub.c +++ b/Protocols/DataHubDxe/DataHub.c @@ -83,7 +83,7 @@ DataHubLogData ( // atomic operation, so use the lock. // Status = EfiAcquireLockOrFail (&Private->DataLock); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // Reentrancy detected so exit! // @@ -458,7 +458,7 @@ DataHubRegisterFilterDriver ( // Search for duplicate entries // if (FindFilterDriverByEvent (&Private->FilterDriverListHead, FilterEvent) != NULL) { - FreePool (FilterDriver); + FreePool(FilterDriver); return EFI_ALREADY_STARTED; } // @@ -564,7 +564,7 @@ DataHubInstall ( // Make sure we get a bigger MTC number on every boot! // Status = gRT->GetNextHighMonotonicCount (&HighMontonicCount); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // // if system service fails pick a sane value. // diff --git a/Protocols/DataHubStdErrDxe/DataHubStdErr.c b/Protocols/DataHubStdErrDxe/DataHubStdErr.c index f64c5411d..19514763c 100644 --- a/Protocols/DataHubStdErrDxe/DataHubStdErr.c +++ b/Protocols/DataHubStdErrDxe/DataHubStdErr.c @@ -73,7 +73,7 @@ DataHubStdErrEventHandler ( Mtc = 0; do { Status = DataHub->GetNextRecord (DataHub, &Mtc, &mDataHubStdErrEvent, &Record); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (CompareGuid (&Record->DataRecordGuid, &gEfiDataHubStatusCodeRecordGuid)) { DataRecord = (DATA_HUB_STATUS_CODE_DATA_RECORD *) (((CHAR8 *) Record) + Record->HeaderSize); @@ -91,7 +91,7 @@ DataHubStdErrEventHandler ( } } } - } while ((Mtc != 0) && !EFI_ERROR (Status)); + } while ((Mtc != 0) && !EFI_ERROR(Status)); } /** @@ -130,7 +130,7 @@ DataHubStdErrInitialize ( mDataHub, &mDataHubStdErrEvent ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -142,7 +142,7 @@ DataHubStdErrInitialize ( DataClass, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { gBS->CloseEvent (mDataHubStdErrEvent); } diff --git a/Protocols/DumpUefiCalls/Lib.c b/Protocols/DumpUefiCalls/Lib.c index 1a82bc383..8d682fd03 100644 --- a/Protocols/DumpUefiCalls/Lib.c +++ b/Protocols/DumpUefiCalls/Lib.c @@ -1050,7 +1050,7 @@ PrintRTVariables( // no more vars break; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // no more vars or error PRINT("ERROR: GetNextVariableName: %r\n", Status); return; diff --git a/Protocols/EmuVariableUefi/EmuVariable.c b/Protocols/EmuVariableUefi/EmuVariable.c index 82a1a1eed..84d76a3b0 100644 --- a/Protocols/EmuVariableUefi/EmuVariable.c +++ b/Protocols/EmuVariableUefi/EmuVariable.c @@ -721,7 +721,7 @@ AutoUpdateLangVariable( // Therefore, in variable driver, only store the original value for other use. // if (mVariableModuleGlobal->PlatformLangCodes != NULL) { - FreePool (mVariableModuleGlobal->PlatformLangCodes); + FreePool(mVariableModuleGlobal->PlatformLangCodes); } mVariableModuleGlobal->PlatformLangCodes = AllocateRuntimeCopyPool (DataSize, Data); // ASSERT (mVariableModuleGlobal->PlatformLangCodes != NULL); @@ -731,7 +731,7 @@ AutoUpdateLangVariable( // so the size of PlatformLangCodes is enough for the PlatformLang. // if (mVariableModuleGlobal->PlatformLang != NULL) { - FreePool (mVariableModuleGlobal->PlatformLang); + FreePool(mVariableModuleGlobal->PlatformLang); } mVariableModuleGlobal->PlatformLang = AllocateRuntimePool (DataSize); // ASSERT (mVariableModuleGlobal->PlatformLang != NULL); @@ -751,7 +751,7 @@ AutoUpdateLangVariable( // Therefore, in variable driver, only store the original value for other use. // if (mVariableModuleGlobal->LangCodes != NULL) { - FreePool (mVariableModuleGlobal->LangCodes); + FreePool(mVariableModuleGlobal->LangCodes); } mVariableModuleGlobal->LangCodes = AllocateRuntimeCopyPool (DataSize, Data); // ASSERT (mVariableModuleGlobal->LangCodes != NULL); @@ -765,7 +765,7 @@ AutoUpdateLangVariable( // Update PlatformLang if Lang is already set // Status = FindVariable (L"PlatformLang", &gEfiGlobalVariableGuid, &Variable, (VARIABLE_GLOBAL *) mVariableModuleGlobal); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update Lang // @@ -774,7 +774,7 @@ AutoUpdateLangVariable( DataSize = Variable.CurrPtr->DataSize; } else { Status = FindVariable (L"Lang", &gEfiGlobalVariableGuid, &Variable, (VARIABLE_GLOBAL *) mVariableModuleGlobal); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Update PlatformLang // @@ -857,7 +857,7 @@ AutoUpdateLangVariable( AsciiStrSize (BestPlatformLang), Attributes, &Variable); DEBUG ((EFI_D_INFO, "Variable Driver Auto Update Lang, Lang:%a, PlatformLang:%a\n", BestLang, BestPlatformLang)); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); } } } @@ -1198,7 +1198,7 @@ EmuGetVariable ( // Status = FindVariable (VariableName, VendorGuid, &Variable, Global); - if (Variable.CurrPtr == NULL || EFI_ERROR (Status)) { + if (Variable.CurrPtr == NULL || EFI_ERROR(Status)) { goto Done; } // @@ -1272,7 +1272,7 @@ EmuGetNextVariableName ( Status = FindVariable (VariableName, VendorGuid, &Variable, Global); - if (Variable.CurrPtr == NULL || EFI_ERROR (Status)) { + if (Variable.CurrPtr == NULL || EFI_ERROR(Status)) { goto Done; } @@ -1741,7 +1741,7 @@ InitializeVariableStore ( &mVariableModuleGlobal->VolatileLastVariableOffset, &mVariableModuleGlobal->NonVolatileLastVariableOffset ); - // ASSERT_EFI_ERROR (Status); + // ASSERT_EFI_ERROR(Status); } } } @@ -1788,7 +1788,7 @@ VariableCommonInitialize ( // Intialize volatile variable store // Status = InitializeVariableStore (TRUE); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { FreePool(mVariableModuleGlobal); return Status; } diff --git a/Protocols/EmuVariableUefi/InitVariable.c b/Protocols/EmuVariableUefi/InitVariable.c index e4bc32b83..ef3528075 100644 --- a/Protocols/EmuVariableUefi/InitVariable.c +++ b/Protocols/EmuVariableUefi/InitVariable.c @@ -350,8 +350,8 @@ CopyRTVariables ( // print just the first time //CopyVarsDebugPrint = FALSE; - FreePool (Name); - FreePool (Data); + FreePool(Name); + FreePool(Data); } //////////////////////////////////////// @@ -410,7 +410,7 @@ EmuVariableControlProtocolInstallEmulation ( &mVirtualAddressChangeEvent ); DBG(", CreateEventEx VirtualAddressChange = %r\n", Status); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, @@ -421,7 +421,7 @@ EmuVariableControlProtocolInstallEmulation ( &mExitBootServicesEvent ); DBG(", CreateEventEx ExitBootServices = %r\n", Status); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); */ // old style CreateEvent @@ -438,7 +438,7 @@ EmuVariableControlProtocolInstallEmulation ( ); DBG(", CreateEvent VirtualAddressChange = %r", Status); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // Create an Exit Boot Services event. @@ -452,7 +452,7 @@ EmuVariableControlProtocolInstallEmulation ( ); DBG(", CreateEvent ExitBootServices = %r", Status); -// ASSERT_EFI_ERROR (Status); +// ASSERT_EFI_ERROR(Status); // // Add EmuVariableUefiPresent variable to allow /ect/rc* scripts to detect @@ -538,7 +538,7 @@ VariableServiceInitialize ( DBG("EmuVariableUefi Initialize:"); Status = VariableCommonInitialize (ImageHandle, SystemTable); DBG(" VariableCommonInitialize = %r", Status); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR(Status); // // Store orig RS var services diff --git a/Protocols/FirmwareVolume/FirmwareVolume.c b/Protocols/FirmwareVolume/FirmwareVolume.c index f12e70874..4d9121483 100644 --- a/Protocols/FirmwareVolume/FirmwareVolume.c +++ b/Protocols/FirmwareVolume/FirmwareVolume.c @@ -404,7 +404,7 @@ FVEntrypoint (IN EFI_HANDLE ImageHandle, Status = gBS->LocateProtocol (&gEfiFirmwareVolumeProtocolGuid, NULL, (VOID **)&ExistingFirmwareVolume); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { Status = gBS->InstallMultipleProtocolInterfaces ( &mHandle, &gEfiFirmwareVolumeProtocolGuid, diff --git a/Protocols/MsgLog/MsgLog.c b/Protocols/MsgLog/MsgLog.c index 376f02784..c028ce56e 100644 --- a/Protocols/MsgLog/MsgLog.c +++ b/Protocols/MsgLog/MsgLog.c @@ -88,7 +88,7 @@ MsgLogEntrypoint ( BOOTER_LOG_SIZE, (VOID**) &tmp ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // Print(L"MsgLogProtocol installed!\n"); diff --git a/rEFIt_UEFI/Platform/BdsConnect.cpp b/rEFIt_UEFI/Platform/BdsConnect.cpp index 8e1153b52..0e6031e0c 100644 --- a/rEFIt_UEFI/Platform/BdsConnect.cpp +++ b/rEFIt_UEFI/Platform/BdsConnect.cpp @@ -120,7 +120,7 @@ BdsLibConnectDevicePath ( // Instance = GetNextDevicePathInstance (&DevicePath, &Size); if (Instance == NULL) { - FreePool (CopyOfDevicePath); + FreePool(CopyOfDevicePath); return EFI_OUT_OF_RESOURCES; } @@ -144,7 +144,7 @@ BdsLibConnectDevicePath ( RemainingDevicePath = Instance; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (Handle == PreviousHandle) { // // If no forward progress is made try invoking the Dispatcher. @@ -156,7 +156,7 @@ BdsLibConnectDevicePath ( Status = gDS->Dispatch (); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PreviousHandle = Handle; // // Connect all drivers that apply to Handle and RemainingDevicePath, @@ -179,12 +179,12 @@ BdsLibConnectDevicePath ( // // Loop until RemainingDevicePath is an empty device path // - } while (!EFI_ERROR (Status) && !IsDevicePathEnd (RemainingDevicePath)); + } while (!EFI_ERROR(Status) && !IsDevicePathEnd (RemainingDevicePath)); } while (DevicePath != NULL); if (CopyOfDevicePath != NULL) { - FreePool (CopyOfDevicePath); + FreePool(CopyOfDevicePath); } // // All handle with DevicePath exists in the handle database @@ -222,7 +222,7 @@ BdsLibConnectAllEfi ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -232,7 +232,7 @@ BdsLibConnectAllEfi ( } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } return EFI_SUCCESS; @@ -270,7 +270,7 @@ BdsLibDisconnectAllEfi ( &HandleCount, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -280,7 +280,7 @@ BdsLibDisconnectAllEfi ( } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } return EFI_SUCCESS; @@ -309,7 +309,7 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, // Retrieve the list of all handles from the handle database // Status = gBS->LocateHandleBuffer (AllHandles, NULL, NULL, HandleCount, HandleBuffer); - if (EFI_ERROR (Status)) goto Error; + if (EFI_ERROR(Status)) goto Error; *HandleType = (__typeof_am__(*HandleType))AllocatePool (*HandleCount * sizeof (**HandleType)); if (*HandleType == NULL) goto Error; @@ -324,7 +324,7 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, &ProtocolGuidArray, &ArrayCount ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) { if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiLoadedImageProtocolGuid)) { @@ -364,7 +364,7 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, &OpenInfo, &OpenInfoCount ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { @@ -389,11 +389,11 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, } } - FreePool (OpenInfo); + FreePool(OpenInfo); } } - FreePool (ProtocolGuidArray); + FreePool(ProtocolGuidArray); } } @@ -401,11 +401,11 @@ EFI_STATUS ScanDeviceHandles(EFI_HANDLE ControllerHandle, Error: if (*HandleType != NULL) { - FreePool (*HandleType); + FreePool(*HandleType); } if (*HandleBuffer != NULL) { - FreePool (*HandleBuffer); + FreePool(*HandleBuffer); } *HandleCount = 0; @@ -434,13 +434,13 @@ EFI_STATUS BdsLibConnectMostlyAllEfi() Status = gBS->LocateHandleBuffer (AllHandles, NULL, NULL, &AllHandleCount, &AllHandleBuffer); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) return Status; for (Index = 0; Index < AllHandleCount; Index++) { Status = ScanDeviceHandles(AllHandleBuffer[Index], &HandleCount, &HandleBuffer, &HandleType); - if (EFI_ERROR (Status)) + if (EFI_ERROR(Status)) goto Done; Device = TRUE; @@ -460,9 +460,9 @@ EFI_STATUS BdsLibConnectMostlyAllEfi() if (!Parent) { if (HandleType[Index] & EFI_HANDLE_TYPE_DEVICE_HANDLE) { Status = gBS->HandleProtocol (AllHandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID**)&PciIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = PciIo->Pci.Read (PciIo,EfiPciIoWidthUint32, 0, sizeof (Pci) / sizeof (UINT32), &Pci); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if(IS_PCI_VGA(&Pci)==TRUE) { gBS->DisconnectController(AllHandleBuffer[Index], NULL, NULL); } @@ -473,12 +473,12 @@ EFI_STATUS BdsLibConnectMostlyAllEfi() } } - FreePool (HandleBuffer); - FreePool (HandleType); + FreePool(HandleBuffer); + FreePool(HandleType); } Done: - FreePool (AllHandleBuffer); + FreePool(AllHandleBuffer); return Status; } @@ -513,7 +513,7 @@ BdsLibConnectAllDriversToAllControllers ( // Status = gDS->Dispatch (); - } while (!EFI_ERROR (Status)); + } while (!EFI_ERROR(Status)); } @@ -583,19 +583,19 @@ BdsLibConnectUsbDevByShortFormDP( &HandleArrayCount, &HandleArray ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleArrayCount; Index++) { Status = gBS->HandleProtocol ( HandleArray[Index], &gEfiPciIoProtocolGuid, (VOID **)&PciIo ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Check whether the Pci device is the wanted usb host controller // Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((PCI_CLASS_SERIAL == Class[2]) && (PCI_CLASS_SERIAL_USB == Class[1])) { if (HostControllerPI == Class[0] || HostControllerPI == 0xFF) { @@ -615,7 +615,7 @@ BdsLibConnectUsbDevByShortFormDP( } if (HandleArray != NULL) { - FreePool (HandleArray); + FreePool(HandleArray); } if (AtLeastOneConnected) { diff --git a/rEFIt_UEFI/Platform/BootOptions.cpp b/rEFIt_UEFI/Platform/BootOptions.cpp index 523f7214a..929c8c2a7 100644 --- a/rEFIt_UEFI/Platform/BootOptions.cpp +++ b/rEFIt_UEFI/Platform/BootOptions.cpp @@ -204,12 +204,12 @@ CreateBootOptionDevicePath ( // TmpDevPath = DuplicateDevicePath (FindDevicePathNodeWithType (*DevicePath, MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP)); if (TmpDevPath != NULL) { - FreePool (*DevicePath); + FreePool(*DevicePath); *DevicePath = TmpDevPath; } /* else { TmpDevPath = DuplicateDevicePath (FindDevicePathNodeWithType (*DevicePath, HARDWARE_DEVICE_PATH, HW_VENDOR_DP)); if (TmpDevPath != NULL) { - FreePool (*DevicePath); + FreePool(*DevicePath); *DevicePath = TmpDevPath; } }*/ @@ -439,8 +439,8 @@ AddToBootOrder ( DBG("SetVariable: %ls = %s\n", BOOT_ORDER_VAR, strerror(Status)); PrintBootOrder(BootOrderNew, BootOrderLen); - FreePool (BootOrder); - FreePool (BootOrderNew); + FreePool(BootOrder); + FreePool(BootOrderNew); // Debug: Get and print new BootOrder value //GetBootOrder (&BootOrder, &BootOrderLen); @@ -508,7 +508,7 @@ DeleteFromBootOrder ( ); DBG("SetVariable: %ls = %s\n", BOOT_ORDER_VAR, strerror(Status)); - FreePool (BootOrder); + FreePool(BootOrder); // Debug: Get and print new BootOrder value //GetBootOrder (&BootOrder, &BootOrderLen); @@ -536,7 +536,7 @@ PrintBootOption ( Index, BootOption->BootNum, BootOption->Description, BootOption->Attributes); FPStr = FileDevicePathToStr(BootOption->FilePathList); DBG(" %ls\n", FPStr); - FreePool (FPStr); + FreePool(FPStr); VarSizeTmp = sizeof(BootOption->Attributes) + sizeof(BootOption->FilePathListLength) @@ -793,7 +793,7 @@ FindBootOptionForFile ( BootOption.Variable = NULL; for (Index = 0; Index < BootOrderLen; Index++) { if (BootOption.Variable != NULL) { - FreePool (BootOption.Variable); + FreePool(BootOption.Variable); BootOption.Variable = NULL; } // @@ -817,7 +817,7 @@ FindBootOptionForFile ( if (BootIndex != NULL) { *BootIndex = Index; } - FreePool (BootOption.Variable); + FreePool(BootOption.Variable); //WaitForKeyPress(L"press a key to continue\n\n"); return EFI_SUCCESS; } @@ -825,7 +825,7 @@ FindBootOptionForFile ( } if (BootOption.Variable != NULL) { - FreePool (BootOption.Variable); + FreePool(BootOption.Variable); } DBG("FindBootOptionForFile: Not found.\n"); @@ -872,7 +872,7 @@ PrintBootOptions ( } PrintBootOption (&BootOption, Index); - FreePool (BootOption.Variable); + FreePool(BootOption.Variable); } if (AllBootOptions) { @@ -905,7 +905,7 @@ PrintBootOptions ( } PrintBootOption (&BootOption, 0); - FreePool (BootOption.Variable); + FreePool(BootOption.Variable); FoundOthers = TRUE; } if (!FoundOthers) { @@ -979,7 +979,7 @@ AddBootOption ( // // Free allocated space // - FreePool (BootOption->Variable); + FreePool(BootOption->Variable); // // Update BootOrder - add our new boot option as BootIndex in the list @@ -1039,7 +1039,7 @@ AddBootOptionForFile ( Status = AddBootOption (&BootOption, BootIndex); if (EFI_ERROR(Status)) { - FreePool (BootOption.FilePathList); + FreePool(BootOption.FilePathList); DBG("AddBootOptionForFile: Error: %s\n", strerror(Status)); return Status; } @@ -1047,7 +1047,7 @@ AddBootOptionForFile ( // // Free allocated space // - FreePool (BootOption.FilePathList); + FreePool(BootOption.FilePathList); // // Output vars @@ -1162,7 +1162,7 @@ DeleteBootOptionsContainingFile ( BootOption.Variable = NULL; for (Index = 0; Index < BootOrderLen; Index++) { if (BootOption.Variable != NULL) { - FreePool (BootOption.Variable); + FreePool(BootOption.Variable); BootOption.Variable = NULL; } // @@ -1190,7 +1190,7 @@ DeleteBootOptionsContainingFile ( } if (BootOption.Variable != NULL) { - FreePool (BootOption.Variable); + FreePool(BootOption.Variable); } DBG("DeleteBootOptionContainingFile: %s\n", strerror(ReturnStatus)); diff --git a/rEFIt_UEFI/Platform/DevicePath.cpp b/rEFIt_UEFI/Platform/DevicePath.cpp index 2720dfcb8..dd400ba84 100644 --- a/rEFIt_UEFI/Platform/DevicePath.cpp +++ b/rEFIt_UEFI/Platform/DevicePath.cpp @@ -72,7 +72,7 @@ // Str->Len = StringSize - sizeof (UINT16); // } // -// FreePool (AppendStr); +// FreePool(AppendStr); // return Str->Str; //} // @@ -1557,7 +1557,7 @@ // NULL, // (VOID **) &DevPathToText // ); -// if (!EFI_ERROR (Status)) { +// if (!EFI_ERROR(Status)) { // ToText = DevPathToText->ConvertDevicePathToText ( // DevPath, // FALSE, diff --git a/rEFIt_UEFI/Platform/Edid.cpp b/rEFIt_UEFI/Platform/Edid.cpp index 69aa71c9f..24a4d1600 100644 --- a/rEFIt_UEFI/Platform/Edid.cpp +++ b/rEFIt_UEFI/Platform/Edid.cpp @@ -51,7 +51,7 @@ InitializeEdidOverride () EdidOverride, NULL ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG("Can't install EdidOverride on ImageHandle\n"); } return Status; @@ -67,7 +67,7 @@ UINT8* getCurrentEdid (VOID) DBG ("EdidActive:"); Edid = NULL; Status = gBS->LocateProtocol (&gEfiEdidActiveProtocolGuid, NULL, (VOID**)&EdidProtocol); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DBG(" size=%d", EdidProtocol->SizeOfEdid); if (EdidProtocol->SizeOfEdid > 0) { Edid = (__typeof__(Edid))AllocateCopyPool (EdidProtocol->SizeOfEdid, EdidProtocol->Edid); @@ -112,7 +112,7 @@ EFI_STATUS GetEdidDiscovered(VOID) DebugDumpEDID("--- Custom EDID Table", N); } else { Status = gBS->LocateProtocol (&gEfiEdidDiscoveredProtocolGuid, NULL, (VOID **)&EdidDiscovered); - if (!EFI_ERROR (Status)) { //discovered + if (!EFI_ERROR(Status)) { //discovered N = EdidDiscovered->SizeOfEdid; if (!GlobalConfig.DebugLog) { DBG("EdidDiscovered size=%llu\n", N); diff --git a/rEFIt_UEFI/Platform/Events.cpp b/rEFIt_UEFI/Platform/Events.cpp index ad85c3a55..89e577106 100644 --- a/rEFIt_UEFI/Platform/Events.cpp +++ b/rEFIt_UEFI/Platform/Events.cpp @@ -539,7 +539,7 @@ EFI_STATUS EjectVolume(IN REFIT_VOLUME *Volume) //TODO - DetectMedia will appear automatically. Do nothing? if (!Media->RemovableMedia) { //Status = UsbBootDetectMedia (UsbMass); - // if (EFI_ERROR (Status)) { + // if (EFI_ERROR(Status)) { Status = EFI_UNSUPPORTED; goto ON_EXIT; // } diff --git a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp index 68812f4fa..dc1eccbaa 100755 --- a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp +++ b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp @@ -629,7 +629,7 @@ VOID CheckHardware() &HandleCount, &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // DBG("PciIo handles count=%d\n", HandleCount); for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { Handle = HandleBuffer[HandleIndex]; @@ -638,7 +638,7 @@ VOID CheckHardware() &gEfiPciIoProtocolGuid, (VOID **)&PciIo ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { UINT32 deviceid; /* Read PCI BUS */ PciIo->GetLocation (PciIo, &Segment, &Bus, &Device, &Function); @@ -1952,7 +1952,7 @@ UINT32 AddPNLF (UINT8 *dsdt, UINT32 len) &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { Handle = HandleBuffer[HandleIndex]; Status = gBS->HandleProtocol ( @@ -1960,7 +1960,7 @@ UINT32 AddPNLF (UINT8 *dsdt, UINT32 len) &gEfiPciIoProtocolGuid, (VOID **)&PciIo ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { PciIo->GetLocation (PciIo, &Segment, &Bus, &Device, &Function); Status = PciIo->Pci.Read ( PciIo, diff --git a/rEFIt_UEFI/Platform/Hibernate.cpp b/rEFIt_UEFI/Platform/Hibernate.cpp index ba8b6e7f2..99dcbfdb5 100644 --- a/rEFIt_UEFI/Platform/Hibernate.cpp +++ b/rEFIt_UEFI/Platform/Hibernate.cpp @@ -1046,13 +1046,13 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) // If legacy boot-switch-vars exists (NVRAM working), then use it. // Status = GetVariable2 (L"boot-switch-vars", &gEfiAppleBootGuid, &Value, &Size); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Leave it as is. // DBG(" boot-switch-vars present\n"); ZeroMem (Value, Size); - gBS->FreePool (Value); + gBS->FreePool(Value); return TRUE; } @@ -1075,7 +1075,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) // Status = GetVariable2 (L"IOHibernateRTCVariables", &gEfiAppleBootGuid, &Value, &Size); DBG("get IOHR variable status=%s, size=%llu, RTC info=%d\n", strerror(Status), Size, HasHibernateInfoInRTC); - if (!HasHibernateInfo && !EFI_ERROR (Status) && Size == sizeof (RtcVars)) { + if (!HasHibernateInfo && !EFI_ERROR(Status) && Size == sizeof (RtcVars)) { CopyMem (RtcRawVars, Value, sizeof (RtcVars)); HasHibernateInfo = (RtcVars.signature[0] == 'A' && RtcVars.signature[1] == 'A' && RtcVars.signature[2] == 'P' && RtcVars.signature[3] == 'L'); @@ -1084,12 +1084,12 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) // // Erase RTC variables in NVRAM. // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = gRT->SetVariable (L"IOHibernateRTCVariables", &gEfiAppleBootGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, 0, NULL); ZeroMem (Value, Size); - gBS->FreePool (Value); + gBS->FreePool(Value); } // @@ -1133,7 +1133,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) // Value = NULL; Status = GetVariable2 (L"IOHibernateRTCVariables", &gEfiAppleBootGuid, &Value, &Size); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DBG(" IOHibernateRTCVariables found - will be used as boot-switch-vars\n"); // // Delete IOHibernateRTCVariables. @@ -1175,7 +1175,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) // ZeroMem (Value, Size); if (HasIORTCVariables) { - gBS->FreePool (Value); + gBS->FreePool(Value); } if (EFI_ERROR(Status)) { diff --git a/rEFIt_UEFI/Platform/Injectors.cpp b/rEFIt_UEFI/Platform/Injectors.cpp index e6fa0124b..557bf9df0 100644 --- a/rEFIt_UEFI/Platform/Injectors.cpp +++ b/rEFIt_UEFI/Platform/Injectors.cpp @@ -267,7 +267,7 @@ OSInfoOSVendorImpl ( if (!OSVendor) { return; } - Result = AsciiStrCmp (OSVendor, OS_INFO_VENDOR_NAME); + Result = AsciiStrCmp(OSVendor, OS_INFO_VENDOR_NAME); if (Result == 0) { // EfiLibNamedEventSignal (&gAppleOsLoadedNamedEventGuid); diff --git a/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp b/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp index 9564b55f2..79457ccc9 100644 --- a/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp +++ b/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp @@ -60,8 +60,8 @@ InitializeBiosIntCaller ( EFI_SIZE_TO_PAGES(LegacyRegionSize), &LegacyRegionBase ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -118,8 +118,8 @@ InitializeInterruptRedirection ( EFI_SIZE_TO_PAGES(LegacyRegionLength), &LegacyRegionBase ); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -132,8 +132,8 @@ InitializeInterruptRedirection ( // Get VectorBase, it should be 0x68 // Status = gLegacy8259->GetVector (gLegacy8259, Efi8259Irq0, &ProtectedModeBaseVector); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return Status; } @@ -171,7 +171,7 @@ DisconnectVga ( VOID ) continue; } Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, 0, sizeof (Pci) / sizeof (UINT32), &Pci); - if (!EFI_ERROR (Status)) + if (!EFI_ERROR(Status)) { if(IS_PCI_VGA(&Pci) == TRUE) { @@ -248,8 +248,8 @@ LegacyBiosInt86 ( // Set Legacy16 state. 0x08, 0x70 is legacy 8259 vector bases. // Status = gLegacy8259->SetMode (gLegacy8259, Efi8259LegacyMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return FALSE; } @@ -267,8 +267,8 @@ LegacyBiosInt86 ( // Restore protected mode interrupt state // Status = gLegacy8259->SetMode (gLegacy8259, Efi8259ProtectedMode, NULL, NULL); -// ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { +// ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { return FALSE; } @@ -381,7 +381,7 @@ LegacyBiosFarCall86 ( // Save current rate of DXE Timer and disable DXE timer Status = gBS->LocateProtocol (&gEfiTimerArchProtocolGuid, NULL, (VOID **) &Timer); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Timer->GetTimerPeriod (Timer, &TimerPeriod); Timer->SetTimerPeriod (Timer, 0); } diff --git a/rEFIt_UEFI/Platform/LegacyBoot.cpp b/rEFIt_UEFI/Platform/LegacyBoot.cpp index d493efe6a..305a01218 100644 --- a/rEFIt_UEFI/Platform/LegacyBoot.cpp +++ b/rEFIt_UEFI/Platform/LegacyBoot.cpp @@ -431,11 +431,11 @@ EFI_STATUS bootElTorito(REFIT_VOLUME* volume) */ Status = gBS->AllocatePool (EfiBootServicesData,sizeof(THUNK_CONTEXT),(VOID **)&mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = InitializeBiosIntCaller(); //mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } // InitializeInterruptRedirection(); //gLegacy8259); @@ -484,14 +484,14 @@ EFI_STATUS bootMBR(REFIT_VOLUME* volume) } Status = gBS->AllocatePool (EfiBootServicesData,sizeof(THUNK_CONTEXT),(VOID **)&mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DBG("boot from partition %ls\n", FileDevicePathToStr(volume->DevicePath)); Status = InitializeBiosIntCaller(); //mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } //InitializeInterruptRedirection(); //gLegacy8259); @@ -646,11 +646,11 @@ EFI_STATUS bootPBRtest(REFIT_VOLUME* volume) DBG("gEfiLegacy8259ProtocolGuid found\n"); Status = gBS->AllocatePool (EfiBootServicesData,sizeof(THUNK_CONTEXT),(VOID **)&mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } Status = InitializeBiosIntCaller(); //mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } @@ -891,12 +891,12 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset) // if (mThunkContext == NULL) { Status = gBS->AllocatePool (EfiBootServicesData, sizeof(THUNK_CONTEXT), (VOID **)&mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } DBG("Thunk allocated\n"); Status = InitializeBiosIntCaller(); //mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return Status; } } @@ -1113,11 +1113,11 @@ VOID DumpBiosMemoryMap() DBG("gEfiLegacy8259ProtocolGuid found\n"); Status = gBS->AllocatePool (EfiBootServicesData,sizeof(THUNK_CONTEXT),(VOID **)&mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } Status = InitializeBiosIntCaller(); //mThunkContext); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } diff --git a/rEFIt_UEFI/Platform/Net.cpp b/rEFIt_UEFI/Platform/Net.cpp index 4fcc48f88..12635cb01 100644 --- a/rEFIt_UEFI/Platform/Net.cpp +++ b/rEFIt_UEFI/Platform/Net.cpp @@ -98,7 +98,7 @@ GetMacAddress() &NumberOfHandles, &HandleBuffer ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { return; } @@ -112,7 +112,7 @@ GetMacAddress() &gEfiDevicePathProtocolGuid, (VOID **) &Node ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) Node; @@ -147,7 +147,7 @@ GetMacAddress() } } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } if (!Found && GetLegacyLanAddress) { //// diff --git a/rEFIt_UEFI/Platform/Nvram.cpp b/rEFIt_UEFI/Platform/Nvram.cpp index 5e535f535..6f83f262d 100644 --- a/rEFIt_UEFI/Platform/Nvram.cpp +++ b/rEFIt_UEFI/Platform/Nvram.cpp @@ -121,8 +121,8 @@ VOID *GetNvramVariable ( // Read variable into the allocated buffer. // Status = gRT->GetVariable (VariableName, VendorGuid, Attributes, &IntDataSize, Data); - if (EFI_ERROR (Status)) { - FreePool (Data); + if (EFI_ERROR(Status)) { + FreePool(Data); IntDataSize = 0; Data = NULL; } @@ -160,12 +160,12 @@ SetNvramVariable ( (CompareMem (OldData, Data, DataSize) == 0)) { // it's the same - do nothing //DBG (", equal -> not writing again.\n"); - FreePool (OldData); + FreePool(OldData); return EFI_SUCCESS; } //DBG (", not equal\n"); - FreePool (OldData); + FreePool(OldData); // not the same - delete previous one if attributes are different if (OldAttributes != Attributes) { @@ -201,7 +201,7 @@ AddNvramVariable ( return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data); // DBG (" -> writing new (%s)\n", strerror(Status)); } else { - FreePool (OldData); + FreePool(OldData); return EFI_ABORTED; } } @@ -312,15 +312,15 @@ ResetNativeNvram () NameSize = NewNameSize; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if (IsDeletableVariable (Name, &Guid)) { //DBG ("Deleting %s:%ls...", strguid(&Guid), Name); Status = DeleteNvramVariable(Name, &Guid); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { //DBG ("OK\n"); Restart = TRUE; } else { @@ -332,7 +332,7 @@ ResetNativeNvram () } if (Name) { - FreePool (Name); + FreePool(Name); } if (gFirmwareClover || gDriversFlags.EmuVariableLoaded) { @@ -443,7 +443,7 @@ GetSmcKeys (BOOLEAN WriteToSMC) NameSize = NewNameSize; } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { break; //no more variables } @@ -467,7 +467,7 @@ GetSmcKeys (BOOLEAN WriteToSMC) } NumKey++; } - FreePool (Data); + FreePool(Data); } } if (WriteToSMC && gAppleSmc && (gAppleSmc->Signature == NON_APPLE_SMC_SIGNATURE)) { @@ -492,7 +492,7 @@ GetSmcKeys (BOOLEAN WriteToSMC) Status = gAppleSmc->SmcWriteValue(gAppleSmc, FourCharKey("RMde"), 1, (SMC_DATA *)&Mode); } } - FreePool (Name); + FreePool(Name); } /* VOID DumpSmcKeys() @@ -851,7 +851,7 @@ LoadNvramPlist ( // DBG (" parsing error\n"); // } - FreePool (NvramPtr); + FreePool(NvramPtr); // we will leave nvram.plist loaded and parsed for later processing //FreeTag(gNvramDict); @@ -934,7 +934,7 @@ LoadLatestNvramPlist () FileInfo->ModificationTime.Year, FileInfo->ModificationTime.Month, FileInfo->ModificationTime.Day, FileInfo->ModificationTime.Hour, FileInfo->ModificationTime.Minute, FileInfo->ModificationTime.Second, ModifTimeMs); */ - FreePool (FileInfo); + FreePool(FileInfo); FileHandle->Close(FileHandle); // check if newer @@ -1001,16 +1001,16 @@ PutNvramPlistToRtVars () // DBG("tag: %s\n", Tag->string); // skip OsxAptioFixDrv-RelocBase - appears and causes trouble // in kernel and kext patcher when mixing UEFI and CloverEFI boot - if (AsciiStrCmp (Tag->string, "OsxAptioFixDrv-RelocBase") == 0) { + if (AsciiStrCmp(Tag->string, "OsxAptioFixDrv-RelocBase") == 0) { DBG (" Skipping OsxAptioFixDrv-RelocBase\n"); continue; - } else if (AsciiStrCmp (Tag->string, "OsxAptioFixDrv-ErrorExitingBootServices") == 0) { + } else if (AsciiStrCmp(Tag->string, "OsxAptioFixDrv-ErrorExitingBootServices") == 0) { DBG (" Skipping OsxAptioFixDrv-ErrorExitingBootServices\n"); continue; - } else if (AsciiStrCmp (Tag->string, "EmuVariableUefiPresent") == 0) { + } else if (AsciiStrCmp(Tag->string, "EmuVariableUefiPresent") == 0) { DBG (" Skipping EmuVariableUefiPresent\n"); continue; - } else if (AsciiStrCmp (Tag->string, "aapl,panic-info") == 0) { + } else if (AsciiStrCmp(Tag->string, "aapl,panic-info") == 0) { DBG (" Skipping aapl,panic-info\n"); continue; } @@ -1021,7 +1021,7 @@ PutNvramPlistToRtVars () continue; } - if (AsciiStrCmp (Tag->string, "Boot0082") == 0 || AsciiStrCmp (Tag->string, "BootNext") == 0) { + if (AsciiStrCmp(Tag->string, "Boot0082") == 0 || AsciiStrCmp(Tag->string, "BootNext") == 0) { VendorGuid = &gEfiGlobalVariableGuid; // it may happen only in this case GlobalConfig.HibernationFixup = TRUE; @@ -1382,7 +1382,7 @@ EFI_STATUS SetStartupDiskVolume ( // DBG (" * efi-boot-device: %s\n", EfiBootDevice); // // Status = SetNvramVariable (L"efi-boot-device", &gEfiAppleBootGuid, Attributes, Size, EfiBootDevice); -// FreePool (EfiBootDevice); +// FreePool(EfiBootDevice); XString EfiBootDevice; EfiBootDevice.SPrintf( diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index 5fe8d3f35..c79f25503 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -396,7 +396,7 @@ ParseLoadOptions ( *(AsciiConf + TailSize) = '\0'; *Conf = (__typeof_am__(*Conf))AllocateZeroPool ((TailSize + 1) * sizeof(**Conf)); AsciiStrToUnicodeStrS (AsciiConf, *Conf, TailSize); - FreePool (AsciiConf); + FreePool(AsciiConf); } } @@ -554,7 +554,7 @@ UINT8 UINT32 Len; //UINTN i; - Prop = GetProperty (Dict, PropName); + Prop = GetProperty(Dict, PropName); if (Prop != NULL) { if (Prop->data != NULL /*&& Prop->dataLen > 0*/) { //rehabman: allow zero length data // data property @@ -612,28 +612,28 @@ LoadUserSettings ( return EFI_NOT_FOUND; } - ConfigPlistPath = PoolPrint (L"EFI\\CLOVER\\%s.plist", ConfName); - ConfigOemPath = PoolPrint (L"%s\\%s.plist", OEMPath, ConfName); + ConfigPlistPath = PoolPrint(L"EFI\\CLOVER\\%s.plist", ConfName); + ConfigOemPath = PoolPrint(L"%s\\%s.plist", OEMPath, ConfName); if (FileExists (SelfRootDir, ConfigOemPath)) { Status = egLoadFile (SelfRootDir, ConfigOemPath, (UINT8**)&gConfigPtr, &Size); } - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if ((RootDir != NULL) && FileExists (RootDir, ConfigPlistPath)) { Status = egLoadFile (RootDir, ConfigPlistPath, (UINT8**)&gConfigPtr, &Size); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DBG ("Using %ls.plist at RootDir at path: %ls\n", ConfName, ConfigPlistPath); } else { Status = egLoadFile (SelfRootDir, ConfigPlistPath, (UINT8**)&gConfigPtr, &Size); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { DBG ("Using %ls.plist at SelfRootDir at path: %ls\n", ConfName, ConfigPlistPath); } } } - if (!EFI_ERROR (Status) && gConfigPtr != NULL) { + if (!EFI_ERROR(Status) && gConfigPtr != NULL) { Status = ParseXML ((const CHAR8*)gConfigPtr, Dict, (UINT32)Size); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // Dict = NULL; DBG ("config.plist parse error Status=%s\n", strerror(Status)); return Status; @@ -909,22 +909,22 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, Patches->KPAppleIntelCPUPM = TRUE; } - Prop = GetProperty (DictPointer, "Debug"); + Prop = GetProperty(DictPointer, "Debug"); if (Prop != NULL || gBootChanged) { Patches->KPDebug = IsPropertyTrue (Prop); } - Prop = GetProperty (DictPointer, "KernelCpu"); + Prop = GetProperty(DictPointer, "KernelCpu"); if (Prop != NULL || gBootChanged) { Patches->KPKernelCpu = IsPropertyTrue (Prop); } - Prop = GetProperty (DictPointer, "KernelLapic"); + Prop = GetProperty(DictPointer, "KernelLapic"); if (Prop != NULL || gBootChanged) { Patches->KPKernelLapic = IsPropertyTrue (Prop); } - Prop = GetProperty (DictPointer, "KernelXCPM"); + Prop = GetProperty(DictPointer, "KernelXCPM"); if (Prop != NULL || gBootChanged) { Patches->KPKernelXCPM = IsPropertyTrue (Prop); if (IsPropertyTrue(Prop)) { @@ -932,22 +932,22 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } } - Prop = GetProperty (DictPointer, "KernelPm"); + Prop = GetProperty(DictPointer, "KernelPm"); if (Prop != NULL || gBootChanged) { Patches->KPKernelPm = IsPropertyTrue (Prop); } - Prop = GetProperty (DictPointer, "PanicNoKextDump"); + Prop = GetProperty(DictPointer, "PanicNoKextDump"); if (Prop != NULL || gBootChanged) { Patches->KPPanicNoKextDump = IsPropertyTrue (Prop); } - Prop = GetProperty (DictPointer, "AppleIntelCPUPM"); + Prop = GetProperty(DictPointer, "AppleIntelCPUPM"); if (Prop != NULL || gBootChanged) { Patches->KPAppleIntelCPUPM = IsPropertyTrue (Prop); } - Prop = GetProperty (DictPointer, "AppleRTC"); + Prop = GetProperty(DictPointer, "AppleRTC"); if (Prop != NULL || gBootChanged) { Patches->KPAppleRTC = !IsPropertyFalse (Prop); //default = TRUE } @@ -962,13 +962,13 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, Patches->KPDELLSMBIOS = IsPropertyTrue (Prop); // default == FALSE gRemapSmBiosIsRequire = Patches->KPDELLSMBIOS; - Prop = GetProperty (DictPointer, "FakeCPUID"); + Prop = GetProperty(DictPointer, "FakeCPUID"); if (Prop != NULL || gBootChanged) { - Patches->FakeCPUID = (UINT32)GetPropertyInteger (Prop, 0); + Patches->FakeCPUID = (UINT32)GetPropertyInteger(Prop, 0); DBG ("FakeCPUID: %X\n", Patches->FakeCPUID); } - Prop = GetProperty (DictPointer, "ATIConnectorsController"); + Prop = GetProperty(DictPointer, "ATIConnectorsController"); if (Prop != NULL) { UINTN len = 0, i=0; @@ -988,15 +988,15 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, DBG ("ATIConnectors patch: invalid parameters!\n"); if (Patches->KPATIConnectorsController != NULL) { - FreePool (Patches->KPATIConnectorsController); + FreePool(Patches->KPATIConnectorsController); } if (Patches->KPATIConnectorsData != NULL) { - FreePool (Patches->KPATIConnectorsData); + FreePool(Patches->KPATIConnectorsData); } if (Patches->KPATIConnectorsPatch != NULL) { - FreePool (Patches->KPATIConnectorsPatch); + FreePool(Patches->KPATIConnectorsPatch); } Patches->KPATIConnectorsController = NULL; @@ -1006,7 +1006,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } } - Prop = GetProperty (DictPointer, "ForceKextsToLoad"); + Prop = GetProperty(DictPointer, "ForceKextsToLoad"); if (Prop != NULL) { INTN i, Count = GetTagCount (Prop); if (Count > 0) { @@ -1015,7 +1015,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, if (Patches->ForceKexts != NULL) { CopyMem (newForceKexts, Patches->ForceKexts, (Patches->NrForceKexts * sizeof(CHAR16 *))); - FreePool (Patches->ForceKexts); + FreePool(Patches->ForceKexts); } Patches->ForceKexts = newForceKexts; @@ -1023,7 +1023,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, for (i = 0; i < Count; i++) { EFI_STATUS Status = GetElement (Prop, i, &Prop2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG (" - [%02lld]: ForceKexts error %s getting next element\n", i, strerror(Status)); continue; } @@ -1048,7 +1048,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } } - Prop = GetProperty (DictPointer, "KextsToPatch"); //zzzz + Prop = GetProperty(DictPointer, "KextsToPatch"); //zzzz if (Prop != NULL) { INTN i, Count = GetTagCount (Prop); //delete old and create new @@ -1080,7 +1080,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } } Patches->NrKexts = 0; - FreePool (Patches->KextPatches); + FreePool(Patches->KextPatches); Patches->KextPatches = NULL; } if (Count > 0) { @@ -1094,7 +1094,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, UINTN FindLen = 0, ReplaceLen = 0, MaskLen = 0; UINT8 *TmpData, *TmpPatch; EFI_STATUS Status = GetElement (Prop, i, &Prop2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG (" - [%02lld]: Patches error %s getting next element\n", i, strerror(Status)); continue; } @@ -1104,7 +1104,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } DBG (" - [%02lld]:", i); - Dict = GetProperty (Prop2, "Name"); + Dict = GetProperty(Prop2, "Name"); if (Dict == NULL) { DBG(" patch without Name, skipped\n"); continue; @@ -1113,7 +1113,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, KextPatchesName = (__typeof__(KextPatchesName))AllocateCopyPool (255, Dict->string); KextPatchesLabel = (__typeof__(KextPatchesLabel))AllocateCopyPool (255, KextPatchesName); - Dict = GetProperty (Prop2, "Comment"); + Dict = GetProperty(Prop2, "Comment"); if (Dict != NULL) { //this is impossible because UnicodeStrToAsciiStr not extend output size // UnicodeStrToAsciiStr(PoolPrint(L"%a (%a)", KextPatchesLabel, Dict->string), KextPatchesLabel); @@ -1128,7 +1128,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, DBG (" %s", KextPatchesLabel); Patches->KextPatches[Patches->NrKexts].MenuItem.BValue = TRUE; - Dict = GetProperty (Prop2, "Disabled"); + Dict = GetProperty(Prop2, "Disabled"); if ((Dict != NULL) && IsPropertyTrue (Dict)) { Patches->KextPatches[Patches->NrKexts].MenuItem.BValue = FALSE; } @@ -1176,20 +1176,20 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, FreePool(KextPatchesLabel); // check enable/disabled patch (OS based) by Micky1979 - Dict = GetProperty (Prop2, "MatchOS"); + Dict = GetProperty(Prop2, "MatchOS"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->KextPatches[Patches->NrKexts].MatchOS = (__typeof__(Patches->KextPatches[Patches->NrKexts].MatchOS))AllocateCopyPool (AsciiStrSize(Dict->string), Dict->string); DBG(" :: MatchOS: %s", Patches->KextPatches[Patches->NrKexts].MatchOS); } - Dict = GetProperty (Prop2, "MatchBuild"); + Dict = GetProperty(Prop2, "MatchBuild"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->KextPatches[Patches->NrKexts].MatchBuild = (__typeof__(Patches->KextPatches[Patches->NrKexts].MatchBuild))AllocateCopyPool (AsciiStrSize(Dict->string), Dict->string); DBG(" :: MatchBuild: %s", Patches->KextPatches[Patches->NrKexts].MatchBuild); } // check if this is Info.plist patch or kext binary patch - Dict = GetProperty (Prop2, "InfoPlistPatch"); + Dict = GetProperty(Prop2, "InfoPlistPatch"); Patches->KextPatches[Patches->NrKexts].IsPlistPatch = IsPropertyTrue (Dict); if (Patches->KextPatches[Patches->NrKexts].IsPlistPatch) { @@ -1212,7 +1212,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } - Prop = GetProperty (DictPointer, "KernelToPatch"); + Prop = GetProperty(DictPointer, "KernelToPatch"); if (Prop != NULL) { INTN i, Count = GetTagCount (Prop); //delete old and create new @@ -1242,7 +1242,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } } Patches->NrKernels = 0; - FreePool (Patches->KernelPatches); + FreePool(Patches->KernelPatches); Patches->KernelPatches = NULL; } if (Count > 0) { @@ -1256,7 +1256,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, UINTN FindLen = 0, ReplaceLen = 0, MaskLen = 0; UINT8 *TmpData, *TmpPatch; EFI_STATUS Status = GetElement (Prop, i, &Prop2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG (" - [%02lld]: Patches error %s getting next element\n", i, strerror(Status)); continue; } @@ -1266,7 +1266,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } DBG (" - [%02lld]:", i); - Dict = GetProperty (Prop2, "Comment"); + Dict = GetProperty(Prop2, "Comment"); if (Dict != NULL) { KernelPatchesLabel = (__typeof__(KernelPatchesLabel))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); } else { @@ -1274,7 +1274,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } DBG (" %s", KernelPatchesLabel); - Dict = GetProperty (Prop2, "Disabled"); + Dict = GetProperty(Prop2, "Disabled"); Patches->KernelPatches[Patches->NrKernels].MenuItem.BValue = !IsPropertyTrue (Dict); TmpData = GetDataSetting (Prop2, "Find", &FindLen); @@ -1316,20 +1316,20 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, Patches->KernelPatches[Patches->NrKernels].MatchBuild = NULL; Patches->KernelPatches[Patches->NrKernels].Label = (__typeof__(Patches->KernelPatches[Patches->NrKernels].Label))AllocateCopyPool (AsciiStrSize (KernelPatchesLabel), KernelPatchesLabel); - Dict = GetProperty (Prop2, "Count"); + Dict = GetProperty(Prop2, "Count"); if (Dict != NULL) { - Patches->KernelPatches[Patches->NrKernels].Count = GetPropertyInteger (Dict, 0); + Patches->KernelPatches[Patches->NrKernels].Count = GetPropertyInteger(Dict, 0); } FreePool(KernelPatchesLabel); // check enable/disabled patch (OS based) by Micky1979 - Dict = GetProperty (Prop2, "MatchOS"); + Dict = GetProperty(Prop2, "MatchOS"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->KernelPatches[Patches->NrKernels].MatchOS = (__typeof__(Patches->KernelPatches[Patches->NrKernels].MatchOS))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); DBG(" :: MatchOS: %s", Patches->KernelPatches[Patches->NrKernels].MatchOS); } - Dict = GetProperty (Prop2, "MatchBuild"); + Dict = GetProperty(Prop2, "MatchBuild"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->KernelPatches[Patches->NrKernels].MatchBuild = (__typeof__(Patches->KernelPatches[Patches->NrKernels].MatchBuild))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); DBG(" :: MatchBuild: %s", Patches->KernelPatches[Patches->NrKernels].MatchBuild); @@ -1340,7 +1340,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } } - Prop = GetProperty (DictPointer, "BootPatches"); + Prop = GetProperty(DictPointer, "BootPatches"); if (Prop != NULL) { INTN i, Count = GetTagCount (Prop); //delete old and create new @@ -1370,7 +1370,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } } Patches->NrBoots = 0; - FreePool (Patches->BootPatches); + FreePool(Patches->BootPatches); } if (Count > 0) { TagPtr Prop2 = NULL, Dict = NULL; @@ -1383,7 +1383,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, UINTN FindLen = 0, ReplaceLen = 0, MaskLen = 0; UINT8 *TmpData, *TmpPatch; EFI_STATUS Status = GetElement (Prop, i, &Prop2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG (" - [%02lld]: error %s getting next element\n", i, strerror(Status)); continue; } @@ -1392,7 +1392,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } DBG (" - [%02lld]:", i); - Dict = GetProperty (Prop2, "Comment"); + Dict = GetProperty(Prop2, "Comment"); if (Dict != NULL) { BootPatchesLabel = (__typeof__(BootPatchesLabel))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); } else { @@ -1401,7 +1401,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, DBG (" %s", BootPatchesLabel); - Dict = GetProperty (Prop2, "Disabled"); + Dict = GetProperty(Prop2, "Disabled"); Patches->BootPatches[Patches->NrBoots].MenuItem.BValue = !IsPropertyTrue (Dict); Patches->BootPatches[Patches->NrBoots].MenuItem.ItemType = BoolValue; @@ -1441,19 +1441,19 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, Patches->BootPatches[Patches->NrBoots].MatchBuild = NULL; Patches->BootPatches[Patches->NrBoots].Label = (__typeof__(Patches->BootPatches[Patches->NrBoots].Label))AllocateCopyPool (AsciiStrSize (BootPatchesLabel), BootPatchesLabel); - Dict = GetProperty (Prop2, "Count"); + Dict = GetProperty(Prop2, "Count"); if (Dict != NULL) { - Patches->BootPatches[Patches->NrBoots].Count = GetPropertyInteger (Dict, 0); + Patches->BootPatches[Patches->NrBoots].Count = GetPropertyInteger(Dict, 0); } FreePool(BootPatchesLabel); - Dict = GetProperty (Prop2, "MatchOS"); + Dict = GetProperty(Prop2, "MatchOS"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->BootPatches[Patches->NrBoots].MatchOS = (__typeof__(Patches->BootPatches[Patches->NrBoots].MatchOS))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); DBG(" :: MatchOS: %s", Patches->BootPatches[Patches->NrBoots].MatchOS); } - Dict = GetProperty (Prop2, "MatchBuild"); + Dict = GetProperty(Prop2, "MatchBuild"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->BootPatches[Patches->NrBoots].MatchBuild = (__typeof__(Patches->BootPatches[Patches->NrBoots].MatchBuild))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); DBG(" :: MatchBuild: %s", Patches->BootPatches[Patches->NrBoots].MatchBuild); @@ -1715,7 +1715,7 @@ UINT8 GetVolumeType(TagPtr DictPointer) TagPtr Prop, Prop2; UINT8 VolumeType = 0; - Prop = GetProperty (DictPointer, "VolumeType"); + Prop = GetProperty(DictPointer, "VolumeType"); if (Prop != NULL) { if (Prop->type == kTagTypeString) { VolumeType = CheckVolumeType(0, Prop); @@ -1724,7 +1724,7 @@ UINT8 GetVolumeType(TagPtr DictPointer) if (Count > 0) { Prop2 = NULL; for (i = 0; i < Count; i++) { - if (EFI_ERROR (GetElement(Prop, i, &Prop2))) { + if (EFI_ERROR(GetElement(Prop, i, &Prop2))) { continue; } @@ -1758,43 +1758,43 @@ FillinCustomEntry ( return FALSE; } - Prop = GetProperty (DictPointer, "Disabled"); + Prop = GetProperty(DictPointer, "Disabled"); if (IsPropertyTrue (Prop)) { return FALSE; } - Prop = GetProperty (DictPointer, "Volume"); + Prop = GetProperty(DictPointer, "Volume"); if (Prop != NULL && (Prop->type == kTagTypeString)) { if (Entry->Volume) { - FreePool (Entry->Volume); + FreePool(Entry->Volume); } - Entry->Volume = PoolPrint (L"%a", Prop->string); + Entry->Volume = PoolPrint(L"%a", Prop->string); } - Prop = GetProperty (DictPointer, "Path"); + Prop = GetProperty(DictPointer, "Path"); if (Prop != NULL && (Prop->type == kTagTypeString)) { if (Entry->Path) { - FreePool (Entry->Path); + FreePool(Entry->Path); } - Entry->Path = PoolPrint (L"%a", Prop->string); + Entry->Path = PoolPrint(L"%a", Prop->string); } - Prop = GetProperty (DictPointer, "Settings"); + Prop = GetProperty(DictPointer, "Settings"); if (Prop != NULL && (Prop->type == kTagTypeString)) { if (Entry->Settings) { - FreePool (Entry->Settings); + FreePool(Entry->Settings); } - Entry->Settings = PoolPrint (L"%a", Prop->string); + Entry->Settings = PoolPrint(L"%a", Prop->string); } - Prop = GetProperty (DictPointer, "CommonSettings"); + Prop = GetProperty(DictPointer, "CommonSettings"); Entry->CommonSettings = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "AddArguments"); + Prop = GetProperty(DictPointer, "AddArguments"); if (Prop != NULL && (Prop->type == kTagTypeString)) { if (Entry->Options.notEmpty()) { Entry->Options.SPrintf("%s %s", Entry->Options.c_str(), Prop->string); @@ -1802,30 +1802,30 @@ FillinCustomEntry ( Entry->Options.SPrintf("%s", Prop->string); } } else { - Prop = GetProperty (DictPointer, "Arguments"); + Prop = GetProperty(DictPointer, "Arguments"); if (Prop != NULL && (Prop->type == kTagTypeString)) { Entry->Options.SPrintf("%s", Prop->string); Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_NODEFAULTARGS); } } - Prop = GetProperty (DictPointer, "Title"); + Prop = GetProperty(DictPointer, "Title"); if (Prop != NULL && (Prop->type == kTagTypeString)) { Entry->Title.takeValueFrom(Prop->string); } - Prop = GetProperty (DictPointer, "FullTitle"); + Prop = GetProperty(DictPointer, "FullTitle"); if (Prop != NULL && (Prop->type == kTagTypeString)) { Entry->FullTitle.takeValueFrom(Prop->string); } - Prop = GetProperty (DictPointer, "Image"); + Prop = GetProperty(DictPointer, "Image"); if (Prop != NULL) { if (Entry->ImagePath) { - FreePool (Entry->ImagePath); + FreePool(Entry->ImagePath); Entry->ImagePath = NULL; } Entry->Image.setEmpty(); if (Prop->type == kTagTypeString) { - Entry->ImagePath = PoolPrint (L"%a", Prop->string); + Entry->ImagePath = PoolPrint(L"%a", Prop->string); } // we can't load the file yet, as ThemeDir is not initialized } else { @@ -1837,15 +1837,15 @@ FillinCustomEntry ( } } - Prop = GetProperty (DictPointer, "DriveImage"); + Prop = GetProperty(DictPointer, "DriveImage"); if (Prop != NULL) { if (Entry->DriveImagePath != NULL) { - FreePool (Entry->DriveImagePath); + FreePool(Entry->DriveImagePath); Entry->DriveImagePath = NULL; } Entry->DriveImage.setEmpty(); if (Prop->type == kTagTypeString) { - Entry->DriveImagePath = PoolPrint (L"%a", Prop->string); + Entry->DriveImagePath = PoolPrint(L"%a", Prop->string); } // we can't load the file yet, as ThemeDir is not initialized } else { @@ -1857,13 +1857,13 @@ FillinCustomEntry ( } } - Prop = GetProperty (DictPointer, "Hotkey"); + Prop = GetProperty(DictPointer, "Hotkey"); if (Prop != NULL && (Prop->type == kTagTypeString) && Prop->string) { Entry->Hotkey = *(Prop->string); } // Whether or not to draw boot screen - Prop = GetProperty (DictPointer, "CustomLogo"); + Prop = GetProperty(DictPointer, "CustomLogo"); if (Prop != NULL) { if (IsPropertyTrue (Prop)) { Entry->CustomBoot = CUSTOM_BOOT_APPLE; @@ -1927,7 +1927,7 @@ FillinCustomEntry ( } } - Prop = GetProperty (DictPointer, "Type"); + Prop = GetProperty(DictPointer, "Type"); if (Prop != NULL && (Prop->type == kTagTypeString)) { if ((AsciiStriCmp(Prop->string, "OSX") == 0) || (AsciiStriCmp(Prop->string, "macOS") == 0)) { @@ -1982,7 +1982,7 @@ FillinCustomEntry ( Entry->Flags = OSFLAG_UNSET(Entry->Flags, OSFLAG_CHECKFAKESMC); // Entry->Flags = OSFLAG_UNSET(Entry->Flags, OSFLAG_WITHKEXTS); - Prop = GetProperty (DictPointer, "InjectKexts"); + Prop = GetProperty(DictPointer, "InjectKexts"); if (Prop != NULL) { if (Prop->type == kTagTypeTrue) { Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_WITHKEXTS); @@ -2039,7 +2039,7 @@ FillinCustomEntry ( } if (Entry->Type == OSTYPE_LINEFI) { - Prop = GetProperty (DictPointer, "Kernel"); + Prop = GetProperty(DictPointer, "Kernel"); if (Prop != NULL) { if ((Prop->type == kTagTypeString) && Prop->string) { if ((Prop->string[0] == 'N') || (Prop->string[0] == 'n')) { @@ -2060,7 +2060,7 @@ FillinCustomEntry ( } // Sub entries - Prop = GetProperty (DictPointer, "SubEntries"); + Prop = GetProperty(DictPointer, "SubEntries"); if (Prop != NULL) { if (Prop->type == kTagTypeFalse) { Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_NODEFAULTMENU); @@ -2071,7 +2071,7 @@ FillinCustomEntry ( Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_NODEFAULTMENU); if (Count > 0) { for (i = 0; i < Count; i++) { - if (EFI_ERROR (GetElement (Prop, i, &Dict))) { + if (EFI_ERROR(GetElement (Prop, i, &Dict))) { continue; } if (Dict == NULL) { @@ -2082,7 +2082,7 @@ FillinCustomEntry ( if (CustomSubEntry) { if (!FillinCustomEntry (CustomSubEntry, Dict, TRUE) || !AddCustomSubEntry (Entry, CustomSubEntry)) { if (CustomSubEntry) { - FreePool (CustomSubEntry); + FreePool(CustomSubEntry); } } } @@ -2104,29 +2104,29 @@ FillingCustomLegacy ( return FALSE; } - Prop = GetProperty (DictPointer, "Disabled"); + Prop = GetProperty(DictPointer, "Disabled"); if (IsPropertyTrue (Prop)) { return FALSE; } - Prop = GetProperty (DictPointer, "Volume"); + Prop = GetProperty(DictPointer, "Volume"); if (Prop != NULL && (Prop->type == kTagTypeString)) { if (Entry->Volume != NULL) { - FreePool (Entry->Volume); + FreePool(Entry->Volume); } - Entry->Volume = PoolPrint (L"%a", Prop->string); + Entry->Volume = PoolPrint(L"%a", Prop->string); } - Prop = GetProperty (DictPointer, "FullTitle"); + Prop = GetProperty(DictPointer, "FullTitle"); if (Prop != NULL && (Prop->type == kTagTypeString)) { Entry->FullTitle.takeValueFrom(Prop->string); } - Prop = GetProperty (DictPointer, "Title"); + Prop = GetProperty(DictPointer, "Title"); if (Prop != NULL && (Prop->type == kTagTypeString)) { Entry->Title.takeValueFrom(Prop->string); } - Prop = GetProperty (DictPointer, "Image"); + Prop = GetProperty(DictPointer, "Image"); if (Prop != NULL) { if (Prop->type == kTagTypeString) { Entry->Image.LoadXImage(ThemeX.ThemeDir, Prop->string); @@ -2140,7 +2140,7 @@ FillingCustomLegacy ( } } - Prop = GetProperty (DictPointer, "DriveImage"); + Prop = GetProperty(DictPointer, "DriveImage"); if (Prop != NULL) { if (Prop->type == kTagTypeString) { Entry->Image.LoadXImage(ThemeX.ThemeDir, Prop->string); @@ -2154,7 +2154,7 @@ FillingCustomLegacy ( } } - Prop = GetProperty (DictPointer, "Hotkey"); + Prop = GetProperty(DictPointer, "Hotkey"); if (Prop != NULL && (Prop->type == kTagTypeString) && Prop->string) { Entry->Hotkey = *(Prop->string); } @@ -2163,7 +2163,7 @@ FillingCustomLegacy ( // - No (show the entry) // - Yes (hide the entry but can be show with F3) // - Always (always hide the entry) - Prop = GetProperty (DictPointer, "Hidden"); + Prop = GetProperty(DictPointer, "Hidden"); if (Prop != NULL) { if ((Prop->type == kTagTypeString) && (AsciiStriCmp (Prop->string, "Always") == 0)) { @@ -2175,7 +2175,7 @@ FillingCustomLegacy ( } } - Prop = GetProperty (DictPointer, "Type"); + Prop = GetProperty(DictPointer, "Type"); if (Prop != NULL && (Prop->type == kTagTypeString)) { if (AsciiStriCmp (Prop->string, "Windows") == 0) { Entry->Type = OSTYPE_WIN; @@ -2198,28 +2198,28 @@ FillingCustomTool (IN OUT CUSTOM_TOOL_ENTRY *Entry, TagPtr DictPointer) return FALSE; } - Prop = GetProperty (DictPointer, "Disabled"); + Prop = GetProperty(DictPointer, "Disabled"); if (IsPropertyTrue (Prop)) { return FALSE; } - Prop = GetProperty (DictPointer, "Volume"); + Prop = GetProperty(DictPointer, "Volume"); if (Prop != NULL && (Prop->type == kTagTypeString)) { if (Entry->Volume) { - FreePool (Entry->Volume); + FreePool(Entry->Volume); } - Entry->Volume = PoolPrint (L"%a", Prop->string); + Entry->Volume = PoolPrint(L"%a", Prop->string); } - Prop = GetProperty (DictPointer, "Path"); + Prop = GetProperty(DictPointer, "Path"); if (Prop != NULL && (Prop->type == kTagTypeString)) { if (Entry->Path != NULL) { - FreePool (Entry->Path); + FreePool(Entry->Path); } - Entry->Path = PoolPrint (L"%a", Prop->string); + Entry->Path = PoolPrint(L"%a", Prop->string); } - Prop = GetProperty (DictPointer, "Arguments"); + Prop = GetProperty(DictPointer, "Arguments"); if (Prop != NULL && (Prop->type == kTagTypeString)) { // if (!Entry->Options.isEmpty()) { // Entry->Options.setEmpty(); @@ -2229,24 +2229,24 @@ FillingCustomTool (IN OUT CUSTOM_TOOL_ENTRY *Entry, TagPtr DictPointer) Entry->Options.SPrintf("%s", Prop->string); } - Prop = GetProperty (DictPointer, "FullTitle"); + Prop = GetProperty(DictPointer, "FullTitle"); if (Prop != NULL && (Prop->type == kTagTypeString)) { Entry->FullTitle.takeValueFrom(Prop->string); } - Prop = GetProperty (DictPointer, "Title"); + Prop = GetProperty(DictPointer, "Title"); if (Prop != NULL && (Prop->type == kTagTypeString)) { Entry->Title.takeValueFrom(Prop->string); } - Prop = GetProperty (DictPointer, "Image"); + Prop = GetProperty(DictPointer, "Image"); if (Prop != NULL) { if (Entry->ImagePath != NULL) { - FreePool (Entry->ImagePath); + FreePool(Entry->ImagePath); Entry->ImagePath = NULL; } if (Prop->type == kTagTypeString) { - Entry->ImagePath = PoolPrint (L"%a", Prop->string); + Entry->ImagePath = PoolPrint(L"%a", Prop->string); } Entry->Image.LoadXImage(ThemeX.ThemeDir, Entry->ImagePath); } else { @@ -2257,7 +2257,7 @@ FillingCustomTool (IN OUT CUSTOM_TOOL_ENTRY *Entry, TagPtr DictPointer) FreePool(TmpData); } } - Prop = GetProperty (DictPointer, "Hotkey"); + Prop = GetProperty(DictPointer, "Hotkey"); if (Prop != NULL && (Prop->type == kTagTypeString) && Prop->string) { Entry->Hotkey = *(Prop->string); } @@ -2266,7 +2266,7 @@ FillingCustomTool (IN OUT CUSTOM_TOOL_ENTRY *Entry, TagPtr DictPointer) // - No (show the entry) // - Yes (hide the entry but can be show with F3) // - Always (always hide the entry) - Prop = GetProperty (DictPointer, "Hidden"); + Prop = GetProperty(DictPointer, "Hidden"); if (Prop != NULL) { if ((Prop->type == kTagTypeString) && (AsciiStriCmp (Prop->string, "Always") == 0)) { @@ -2290,14 +2290,14 @@ GetEDIDSettings(TagPtr DictPointer) TagPtr Prop, Dict; UINTN j = 128; - Dict = GetProperty (DictPointer, "EDID"); + Dict = GetProperty(DictPointer, "EDID"); if (Dict != NULL) { - Prop = GetProperty (Dict, "Inject"); + Prop = GetProperty(Dict, "Inject"); gSettings.InjectEDID = IsPropertyTrue(Prop); // default = false! if (gSettings.InjectEDID){ //DBG ("Inject EDID\n"); - Prop = GetProperty (Dict, "Custom"); + Prop = GetProperty(Dict, "Custom"); if (Prop != NULL) { gSettings.CustomEDID = GetDataSetting(Dict, "Custom", &j); if ((j % 128) != 0) { @@ -2309,25 +2309,25 @@ GetEDIDSettings(TagPtr DictPointer) } } - Prop = GetProperty (Dict, "VendorID"); + Prop = GetProperty(Dict, "VendorID"); if (Prop) { gSettings.VendorEDID = (UINT16)GetPropertyInteger(Prop, gSettings.VendorEDID); //DBG(" VendorID = 0x%04lx\n", gSettings.VendorEDID); } - Prop = GetProperty (Dict, "ProductID"); + Prop = GetProperty(Dict, "ProductID"); if (Prop) { gSettings.ProductEDID = (UINT16)GetPropertyInteger(Prop, gSettings.ProductEDID); //DBG(" ProductID = 0x%04lx\n", gSettings.ProductEDID); } - Prop = GetProperty (Dict, "HorizontalSyncPulseWidth"); + Prop = GetProperty(Dict, "HorizontalSyncPulseWidth"); if (Prop) { gSettings.EdidFixHorizontalSyncPulseWidth = (UINT16)GetPropertyInteger(Prop, gSettings.EdidFixHorizontalSyncPulseWidth); //DBG(" EdidFixHorizontalSyncPulseWidth = 0x%02lx\n", gSettings.EdidFixHorizontalSyncPulseWidth); } - Prop = GetProperty (Dict, "VideoInputSignal"); + Prop = GetProperty(Dict, "VideoInputSignal"); if (Prop) { gSettings.EdidFixVideoInputSignal = (UINT8)GetPropertyInteger(Prop, gSettings.EdidFixVideoInputSignal); //DBG(" EdidFixVideoInputSignal = 0x%02lx\n", gSettings.EdidFixVideoInputSignal); @@ -2372,22 +2372,22 @@ GetEarlyUserSettings ( //DBG ("Loading early settings\n"); DbgHeader("GetEarlyUserSettings"); - DictPointer = GetProperty (Dict, "Boot"); + DictPointer = GetProperty(Dict, "Boot"); if (DictPointer != NULL) { - Prop = GetProperty (DictPointer, "Timeout"); + Prop = GetProperty(DictPointer, "Timeout"); if (Prop != NULL) { - GlobalConfig.Timeout = (INT32)GetPropertyInteger (Prop, GlobalConfig.Timeout); + GlobalConfig.Timeout = (INT32)GetPropertyInteger(Prop, GlobalConfig.Timeout); DBG ("timeout set to %lld\n", GlobalConfig.Timeout); } - Prop = GetProperty (DictPointer, "SkipHibernateTimeout"); + Prop = GetProperty(DictPointer, "SkipHibernateTimeout"); gSettings.SkipHibernateTimeout = IsPropertyTrue(Prop); //DisableCloverHotkeys - Prop = GetProperty (DictPointer, "DisableCloverHotkeys"); + Prop = GetProperty(DictPointer, "DisableCloverHotkeys"); gSettings.DisableCloverHotkeys = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "Arguments"); + Prop = GetProperty(DictPointer, "Arguments"); if (Prop != NULL && (Prop->type == kTagTypeString) && Prop->string != NULL) { AsciiStrnCpyS(gSettings.BootArgs, 256, Prop->string, 255); } @@ -2396,7 +2396,7 @@ GetEarlyUserSettings ( gSettings.LastBootedVolume = FALSE; // gSettings.DefaultVolume = NULL; - Prop = GetProperty (DictPointer, "DefaultVolume"); + Prop = GetProperty(DictPointer, "DefaultVolume"); if (Prop != NULL) { Size = AsciiStrSize (Prop->string); if (Size > 0) { @@ -2415,19 +2415,19 @@ GetEarlyUserSettings ( } } - Prop = GetProperty (DictPointer, "DefaultLoader"); + Prop = GetProperty(DictPointer, "DefaultLoader"); if (Prop != NULL) { gSettings.DefaultLoader = (__typeof__(gSettings.DefaultLoader))AllocateZeroPool (AsciiStrSize (Prop->string) * sizeof(CHAR16)); AsciiStrToUnicodeStrS (Prop->string, gSettings.DefaultLoader, AsciiStrSize (Prop->string)); } - Prop = GetProperty (DictPointer, "Debug"); + Prop = GetProperty(DictPointer, "Debug"); GlobalConfig.DebugLog = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "Fast"); + Prop = GetProperty(DictPointer, "Fast"); GlobalConfig.FastBoot = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "NoEarlyProgress"); + Prop = GetProperty(DictPointer, "NoEarlyProgress"); GlobalConfig.NoEarlyProgress = IsPropertyTrue (Prop); if (SpecialBootMode) { @@ -2435,28 +2435,28 @@ GetEarlyUserSettings ( DBG ("Fast option enabled\n"); } - Prop = GetProperty (DictPointer, "NeverHibernate"); + Prop = GetProperty(DictPointer, "NeverHibernate"); GlobalConfig.NeverHibernate = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "StrictHibernate"); + Prop = GetProperty(DictPointer, "StrictHibernate"); GlobalConfig.StrictHibernate = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "RtcHibernateAware"); + Prop = GetProperty(DictPointer, "RtcHibernateAware"); GlobalConfig.RtcHibernateAware = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "HibernationFixup"); + Prop = GetProperty(DictPointer, "HibernationFixup"); if (Prop) { GlobalConfig.HibernationFixup = IsPropertyTrue (Prop); //it will be set automatically } - Prop = GetProperty (DictPointer, "SignatureFixup"); + Prop = GetProperty(DictPointer, "SignatureFixup"); GlobalConfig.SignatureFixup = IsPropertyTrue (Prop); - // Prop = GetProperty (DictPointer, "GetLegacyLanAddress"); + // Prop = GetProperty(DictPointer, "GetLegacyLanAddress"); // GetLegacyLanAddress = IsPropertyTrue (Prop); // Secure boot - Prop = GetProperty (DictPointer, "Secure"); + Prop = GetProperty(DictPointer, "Secure"); if (Prop != NULL) { if (Prop->type == kTagTypeFalse) { // Only disable setup mode, we want always secure boot @@ -2468,7 +2468,7 @@ GetEarlyUserSettings ( } } // Secure boot policy - Prop = GetProperty (DictPointer, "Policy"); + Prop = GetProperty(DictPointer, "Policy"); if (Prop != NULL && (Prop->type == kTagTypeString) && Prop->string) { if ((Prop->string[0] == 'D') || (Prop->string[0] == 'd')) { // Deny all images @@ -2494,7 +2494,7 @@ GetEarlyUserSettings ( } } // Secure boot white list - Prop = GetProperty (DictPointer, "WhiteList"); + Prop = GetProperty(DictPointer, "WhiteList"); if (Prop != NULL && (Prop->type == kTagTypeArray)) { INTN i, Count = GetTagCount (Prop); if (Count > 0) { @@ -2502,7 +2502,7 @@ GetEarlyUserSettings ( gSettings.SecureBootWhiteList = (__typeof__(gSettings.SecureBootWhiteList))AllocateZeroPool (Count * sizeof(CHAR16 *)); if (gSettings.SecureBootWhiteList) { for (i = 0; i < Count; i++) { - if (EFI_ERROR (GetElement (Prop, i, &Dict2))) { + if (EFI_ERROR(GetElement (Prop, i, &Dict2))) { continue; } @@ -2511,14 +2511,14 @@ GetEarlyUserSettings ( } if ((Dict2->type == kTagTypeString) && Dict2->string) { - gSettings.SecureBootWhiteList[gSettings.SecureBootWhiteListCount++] = PoolPrint (L"%a", Dict2->string); + gSettings.SecureBootWhiteList[gSettings.SecureBootWhiteListCount++] = PoolPrint(L"%a", Dict2->string); } } } } } // Secure boot black list - Prop = GetProperty (DictPointer, "BlackList"); + Prop = GetProperty(DictPointer, "BlackList"); if (Prop != NULL && (Prop->type == kTagTypeArray)) { INTN i, Count = GetTagCount (Prop); if (Count > 0) { @@ -2526,7 +2526,7 @@ GetEarlyUserSettings ( gSettings.SecureBootBlackList = (__typeof__(gSettings.SecureBootBlackList))AllocateZeroPool (Count * sizeof(CHAR16 *)); if (gSettings.SecureBootBlackList) { for (i = 0; i < Count; i++) { - if (EFI_ERROR (GetElement (Prop, i, &Dict2))) { + if (EFI_ERROR(GetElement (Prop, i, &Dict2))) { continue; } @@ -2535,7 +2535,7 @@ GetEarlyUserSettings ( } if ((Dict2->type == kTagTypeString) && Dict2->string) { - gSettings.SecureBootBlackList[gSettings.SecureBootBlackListCount++] = PoolPrint (L"%a", Dict2->string); + gSettings.SecureBootBlackList[gSettings.SecureBootBlackListCount++] = PoolPrint(L"%a", Dict2->string); } } } @@ -2543,7 +2543,7 @@ GetEarlyUserSettings ( } // XMP memory profiles - Prop = GetProperty (DictPointer, "XMPDetection"); + Prop = GetProperty(DictPointer, "XMPDetection"); if (Prop != NULL) { gSettings.XMPDetection = 0; if (Prop->type == kTagTypeFalse) { @@ -2566,7 +2566,7 @@ GetEarlyUserSettings ( } // Legacy bios protocol - Prop = GetProperty (DictPointer, "Legacy"); + Prop = GetProperty(DictPointer, "Legacy"); if (Prop != NULL) { AsciiStrToUnicodeStrS (Prop->string, gSettings.LegacyBoot, 32); } else if (gFirmwareClover) { @@ -2578,13 +2578,13 @@ GetEarlyUserSettings ( } // Entry for LegacyBiosDefault - Prop = GetProperty (DictPointer, "LegacyBiosDefaultEntry"); + Prop = GetProperty(DictPointer, "LegacyBiosDefaultEntry"); if (Prop != NULL) { - gSettings.LegacyBiosDefaultEntry = (UINT16)GetPropertyInteger (Prop, 0); // disabled by default + gSettings.LegacyBiosDefaultEntry = (UINT16)GetPropertyInteger(Prop, 0); // disabled by default } // Whether or not to draw boot screen - Prop = GetProperty (DictPointer, "CustomLogo"); + Prop = GetProperty(DictPointer, "CustomLogo"); if (Prop != NULL) { if (IsPropertyTrue (Prop)) { gSettings.CustomBoot = CUSTOM_BOOT_APPLE; @@ -2596,7 +2596,7 @@ GetEarlyUserSettings ( } else if (AsciiStriCmp (Prop->string, "Theme") == 0) { gSettings.CustomBoot = CUSTOM_BOOT_THEME; } else { - // CHAR16 *customLogo = PoolPrint (L"%a", Prop->string); + // CHAR16 *customLogo = PoolPrint(L"%a", Prop->string); XStringW customLogo = XStringW().takeValueFrom(Prop->string); gSettings.CustomBoot = CUSTOM_BOOT_USER; if (gSettings.CustomLogo != NULL) { @@ -2632,10 +2632,10 @@ GetEarlyUserSettings ( //*** SYSTEM *** - DictPointer = GetProperty (Dict, "SystemParameters"); + DictPointer = GetProperty(Dict, "SystemParameters"); if (DictPointer != NULL) { // Inject kexts - Prop = GetProperty (DictPointer, "InjectKexts"); + Prop = GetProperty(DictPointer, "InjectKexts"); if (Prop != NULL) { if (IsPropertyTrue (Prop)) { gSettings.WithKexts = TRUE; @@ -2649,27 +2649,27 @@ GetEarlyUserSettings ( } // No caches - obsolete - Prop = GetProperty (DictPointer, "NoCaches"); + Prop = GetProperty(DictPointer, "NoCaches"); if (IsPropertyTrue (Prop)) { gSettings.NoCaches = TRUE; } //test float - Prop = GetProperty (DictPointer, "BlueValue"); + Prop = GetProperty(DictPointer, "BlueValue"); float tmpF = GetPropertyFloat(Prop, 1.2f); DBG(" get BlueValue=%f\n", tmpF); } // KernelAndKextPatches - DictPointer = GetProperty (Dict, "KernelAndKextPatches"); + DictPointer = GetProperty(Dict, "KernelAndKextPatches"); if (DictPointer != NULL) { FillinKextPatches ((KERNEL_AND_KEXT_PATCHES *)(((UINTN)&gSettings) + OFFSET_OF(SETTINGS_DATA, KernelAndKextPatches)), DictPointer); } - DictPointer = GetProperty (Dict, "GUI"); + DictPointer = GetProperty(Dict, "GUI"); if (DictPointer != NULL) { - Prop = GetProperty (DictPointer, "Timezone"); - GlobalConfig.Timezone = (INT32)GetPropertyInteger (Prop, GlobalConfig.Timezone); + Prop = GetProperty(DictPointer, "Timezone"); + GlobalConfig.Timezone = (INT32)GetPropertyInteger(Prop, GlobalConfig.Timezone); //initialize Daylight when we know timezone EFI_TIME Now; gRT->GetTime(&Now, NULL); @@ -2678,10 +2678,10 @@ GetEarlyUserSettings ( if (NowHour >= 24 ) NowHour -= 24; ThemeX.Daylight = (NowHour > 8) && (NowHour < 20); - Prop = GetProperty (DictPointer, "Theme"); + Prop = GetProperty(DictPointer, "Theme"); if (Prop != NULL && (Prop->type == kTagTypeString) && Prop->string) { ThemeX.Theme.takeValueFrom(Prop->string); - GlobalConfig.Theme = PoolPrint (L"%a", Prop->string); + GlobalConfig.Theme = PoolPrint(L"%a", Prop->string); DBG ("Default theme: %ls\n", GlobalConfig.Theme); OldChosenTheme = 0xFFFF; //default for embedded for (UINTN i = 0; i < ThemesNum; i++) { @@ -2693,7 +2693,7 @@ GetEarlyUserSettings ( } } // get embedded theme property even when starting with other themes, as they may be changed later - Prop = GetProperty (DictPointer, "EmbeddedThemeType"); + Prop = GetProperty(DictPointer, "EmbeddedThemeType"); if (Prop && (Prop->type == kTagTypeString) && Prop->string) { if (AsciiStriCmp (Prop->string, "Dark") == 0) { ThemeX.DarkEmbedded = TRUE; @@ -2706,25 +2706,25 @@ GetEarlyUserSettings ( //ThemeX.Font = ThemeX.Daylight?FONT_ALFA:FONT_GRAY; } } - Prop = GetProperty (DictPointer, "PlayAsync"); //PlayAsync + Prop = GetProperty(DictPointer, "PlayAsync"); //PlayAsync gSettings.PlayAsync = IsPropertyTrue (Prop); // CustomIcons - Prop = GetProperty (DictPointer, "CustomIcons"); + Prop = GetProperty(DictPointer, "CustomIcons"); GlobalConfig.CustomIcons = IsPropertyTrue(Prop); - Prop = GetProperty (DictPointer, "TextOnly"); + Prop = GetProperty(DictPointer, "TextOnly"); GlobalConfig.TextOnly = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "ShowOptimus"); + Prop = GetProperty(DictPointer, "ShowOptimus"); GlobalConfig.ShowOptimus = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "ScreenResolution"); + Prop = GetProperty(DictPointer, "ScreenResolution"); if (Prop != NULL) { if ((Prop->type == kTagTypeString) && Prop->string) { - GlobalConfig.ScreenResolution = PoolPrint (L"%a", Prop->string); + GlobalConfig.ScreenResolution = PoolPrint(L"%a", Prop->string); } } - Prop = GetProperty (DictPointer, "ConsoleMode"); + Prop = GetProperty(DictPointer, "ConsoleMode"); if (Prop != NULL) { if (Prop->type == kTagTypeInteger) { GlobalConfig.ConsoleMode = (INT32)(UINTN)Prop->string; @@ -2744,7 +2744,7 @@ GetEarlyUserSettings ( } } - Prop = GetProperty (DictPointer, "Language"); + Prop = GetProperty(DictPointer, "Language"); if (Prop != NULL) { AsciiStrCpyS (gSettings.Language, 16, Prop->string); if (AsciiStrStr (Prop->string, "en")) { @@ -2795,37 +2795,37 @@ GetEarlyUserSettings ( } // if (gSettings.Language != NULL) { // gSettings.Language != NULL cannot be false because gSettings.Language is dclared as CHAR8 Language[16]; Must we replace by gSettings.Language[0] != NULL - Prop = GetProperty (DictPointer, "KbdPrevLang"); + Prop = GetProperty(DictPointer, "KbdPrevLang"); if (Prop != NULL) { gSettings.KbdPrevLang = IsPropertyTrue (Prop); } // } - Prop = GetProperty (DictPointer, "Mouse"); + Prop = GetProperty(DictPointer, "Mouse"); if (Prop != NULL) { - Dict2 = GetProperty (Prop, "Speed"); + Dict2 = GetProperty(Prop, "Speed"); if (Dict2 != NULL) { - gSettings.PointerSpeed = (INT32)GetPropertyInteger (Dict2, 0); + gSettings.PointerSpeed = (INT32)GetPropertyInteger(Dict2, 0); gSettings.PointerEnabled = (gSettings.PointerSpeed != 0); } //but we can disable mouse even if there was positive speed - Dict2 = GetProperty (Prop, "Enabled"); + Dict2 = GetProperty(Prop, "Enabled"); if (IsPropertyFalse (Dict2)) { gSettings.PointerEnabled = FALSE; } - Dict2 = GetProperty (Prop, "Mirror"); + Dict2 = GetProperty(Prop, "Mirror"); if (IsPropertyTrue (Dict2)) { gSettings.PointerMirror = TRUE; } - Dict2 = GetProperty (Prop, "DoubleClickTime"); + Dict2 = GetProperty(Prop, "DoubleClickTime"); if (Dict2 != NULL) { - gSettings.DoubleClickTime = (UINT64)GetPropertyInteger (Dict2, 500); + gSettings.DoubleClickTime = (UINT64)GetPropertyInteger(Dict2, 500); } } // hide by name/uuid - Prop = GetProperty (DictPointer, "Hide"); + Prop = GetProperty(DictPointer, "Hide"); if (Prop != NULL) { INTN i, Count = GetTagCount (Prop); if (Count > 0) { @@ -2833,7 +2833,7 @@ GetEarlyUserSettings ( gSettings.HVHideStrings = (__typeof__(gSettings.HVHideStrings))AllocateZeroPool (Count * sizeof(CHAR16 *)); if (gSettings.HVHideStrings) { for (i = 0; i < Count; i++) { - if (EFI_ERROR (GetElement (Prop, i, &Dict2))) { + if (EFI_ERROR(GetElement (Prop, i, &Dict2))) { continue; } @@ -2842,7 +2842,7 @@ GetEarlyUserSettings ( } if ((Dict2->type == kTagTypeString) && Dict2->string) { - gSettings.HVHideStrings[gSettings.HVCount] = PoolPrint (L"%a", Dict2->string); + gSettings.HVHideStrings[gSettings.HVCount] = PoolPrint(L"%a", Dict2->string); if (gSettings.HVHideStrings[gSettings.HVCount]) { DBG ("Hiding entries with string %ls\n", gSettings.HVHideStrings[gSettings.HVCount]); gSettings.HVCount++; @@ -2854,27 +2854,27 @@ GetEarlyUserSettings ( } gSettings.LinuxScan = TRUE; // Disable loader scan - Prop = GetProperty (DictPointer, "Scan"); + Prop = GetProperty(DictPointer, "Scan"); if (Prop != NULL) { if (IsPropertyFalse (Prop)) { gSettings.DisableEntryScan = TRUE; gSettings.DisableToolScan = TRUE; GlobalConfig.NoLegacy = TRUE; } else if (Prop->type == kTagTypeDict) { - Dict2 = GetProperty (Prop, "Entries"); + Dict2 = GetProperty(Prop, "Entries"); if (IsPropertyFalse (Dict2)) { gSettings.DisableEntryScan = TRUE; } - Dict2 = GetProperty (Prop, "Tool"); + Dict2 = GetProperty(Prop, "Tool"); if (IsPropertyFalse (Dict2)) { gSettings.DisableToolScan = TRUE; } - Dict2 = GetProperty (Prop, "Linux"); + Dict2 = GetProperty(Prop, "Linux"); gSettings.LinuxScan = !IsPropertyFalse (Dict2); - Dict2 = GetProperty (Prop, "Legacy"); + Dict2 = GetProperty(Prop, "Legacy"); if (Dict2 != NULL) { if (Dict2->type == kTagTypeFalse) { GlobalConfig.NoLegacy = TRUE; @@ -2887,7 +2887,7 @@ GetEarlyUserSettings ( } } - Dict2 = GetProperty (Prop, "Kernel"); + Dict2 = GetProperty(Prop, "Kernel"); if (Dict2 != NULL) { if (Dict2->type == kTagTypeFalse) { gSettings.KernelScan = KERNEL_SCAN_NONE; @@ -2920,7 +2920,7 @@ GetEarlyUserSettings ( if (Count > 0) { for (i = 0; i < Count; i++) { - if (EFI_ERROR (GetElement(Prop, i, &Dict3))) { + if (EFI_ERROR(GetElement(Prop, i, &Dict3))) { continue; } @@ -2959,7 +2959,7 @@ GetEarlyUserSettings ( if (Entry) { // Fill it in if (!FillingCustomLegacy(Entry, Dict3) || !AddCustomLegacyEntry(Entry)) { - FreePool (Entry); + FreePool(Entry); } } } @@ -2973,7 +2973,7 @@ GetEarlyUserSettings ( TagPtr Dict3; if (Count > 0) { for (i = 0; i < Count; i++) { - if (EFI_ERROR (GetElement(Prop, i, &Dict3))) { + if (EFI_ERROR(GetElement(Prop, i, &Dict3))) { continue; } @@ -2986,7 +2986,7 @@ GetEarlyUserSettings ( if (Entry) { // Fill it in if (!FillingCustomTool(Entry, Dict3) || !AddCustomToolEntry(Entry)) { - FreePool (Entry); + FreePool(Entry); } } } @@ -3018,7 +3018,7 @@ GetEarlyUserSettings ( // get all entries for (i = 0; i < Count; i++) { // Get the next entry - if (EFI_ERROR (GetElement (Dict2, i, &Prop))) { + if (EFI_ERROR(GetElement (Dict2, i, &Prop))) { continue; } @@ -3054,19 +3054,19 @@ GetEarlyUserSettings ( } else { // error - release mem if (VBiosPatch->Find != NULL) { - FreePool (VBiosPatch->Find); + FreePool(VBiosPatch->Find); VBiosPatch->Find = NULL; } if (VBiosPatch->Replace != NULL) { - FreePool (VBiosPatch->Replace); + FreePool(VBiosPatch->Replace); VBiosPatch->Replace = NULL; } } } if (gSettings.PatchVBiosBytesCount == 0) { - FreePool (gSettings.PatchVBiosBytes); + FreePool(gSettings.PatchVBiosBytes); gSettings.PatchVBiosBytes = NULL; } } @@ -3075,7 +3075,7 @@ GetEarlyUserSettings ( GetEDIDSettings(DictPointer); } - DictPointer = GetProperty (Dict, "DisableDrivers"); + DictPointer = GetProperty(Dict, "DisableDrivers"); if (DictPointer != NULL) { INTN i, Count = GetTagCount (DictPointer); if (Count > 0) { @@ -3083,27 +3083,27 @@ GetEarlyUserSettings ( gSettings.BlackList = (__typeof__(gSettings.BlackList))AllocateZeroPool (Count * sizeof(CHAR16 *)); for (i = 0; i < Count; i++) { - if (!EFI_ERROR (GetElement (DictPointer, i, &Prop)) && + if (!EFI_ERROR(GetElement (DictPointer, i, &Prop)) && Prop != NULL && (Prop->type == kTagTypeString)) { - gSettings.BlackList[gSettings.BlackListCount++] = PoolPrint (L"%a", Prop->string); + gSettings.BlackList[gSettings.BlackListCount++] = PoolPrint(L"%a", Prop->string); } } } } - DictPointer = GetProperty (Dict, "Devices"); + DictPointer = GetProperty(Dict, "Devices"); if (DictPointer != NULL) { - Dict2 = GetProperty (DictPointer, "Audio"); + Dict2 = GetProperty(DictPointer, "Audio"); if (Dict2 != NULL) { // HDA - Prop = GetProperty (Dict2, "ResetHDA"); + Prop = GetProperty(Dict2, "ResetHDA"); gSettings.ResetHDA = IsPropertyTrue (Prop); } } - DictPointer = GetProperty (Dict, "RtVariables"); + DictPointer = GetProperty(Dict, "RtVariables"); if (DictPointer != NULL) { - Prop = GetProperty (DictPointer, "ROM"); + Prop = GetProperty(DictPointer, "ROM"); if (Prop != NULL) { if ((AsciiStriCmp (Prop->string, "UseMacAddr0") == 0) || (AsciiStriCmp (Prop->string, "UseMacAddr1") == 0)) { @@ -3251,7 +3251,7 @@ CHAR16* GetBundleVersion(CHAR16 *FullName) if(!EFI_ERROR(Status)) { Prop = GetProperty(InfoPlistDict, "CFBundleVersion"); if (Prop != NULL && Prop->string != NULL) { - CFBundleVersion = PoolPrint (L"%a", Prop->string); + CFBundleVersion = PoolPrint(L"%a", Prop->string); } } } @@ -3369,7 +3369,7 @@ GetListOfThemes () DbgHeader("GetListOfThemes"); ThemesNum = 0; - DirIterOpen (SelfRootDir, L"\\EFI\\CLOVER\\themes", &DirIter); + DirIterOpen(SelfRootDir, L"\\EFI\\CLOVER\\themes", &DirIter); while (DirIterNext(&DirIter, 1, L"*", &DirEntry)) { if (DirEntry->FileName[0] == '.') { //DBG("Skip theme: %ls\n", DirEntry->FileName); @@ -3377,40 +3377,40 @@ GetListOfThemes () } //DBG ("Found theme directory: %ls", DirEntry->FileName); DBG ("- [%02llu]: %ls", ThemesNum, DirEntry->FileName); - ThemeTestPath = PoolPrint (L"EFI\\CLOVER\\themes\\%s", DirEntry->FileName); + ThemeTestPath = PoolPrint(L"EFI\\CLOVER\\themes\\%s", DirEntry->FileName); if (ThemeTestPath != NULL) { - Status = SelfRootDir->Open (SelfRootDir, &ThemeTestDir, ThemeTestPath, EFI_FILE_MODE_READ, 0); - if (!EFI_ERROR (Status)) { - Status = egLoadFile (ThemeTestDir, CONFIG_THEME_FILENAME, (UINT8**)&ThemePtr, &Size); - if (EFI_ERROR (Status) || (ThemePtr == NULL) || (Size == 0)) { - Status = egLoadFile (ThemeTestDir, CONFIG_THEME_SVG, (UINT8**)&ThemePtr, &Size); - if (EFI_ERROR (Status)) { + Status = SelfRootDir->Open(SelfRootDir, &ThemeTestDir, ThemeTestPath, EFI_FILE_MODE_READ, 0); + if (!EFI_ERROR(Status)) { + Status = egLoadFile(ThemeTestDir, CONFIG_THEME_FILENAME, (UINT8**)&ThemePtr, &Size); + if (EFI_ERROR(Status) || (ThemePtr == NULL) || (Size == 0)) { + Status = egLoadFile(ThemeTestDir, CONFIG_THEME_SVG, (UINT8**)&ThemePtr, &Size); + if (EFI_ERROR(Status)) { Status = EFI_NOT_FOUND; DBG (" - bad theme because %ls nor %ls can't be load", CONFIG_THEME_FILENAME, CONFIG_THEME_SVG); } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { //we found a theme if ((StriCmp(DirEntry->FileName, L"embedded") == 0) || (StriCmp(DirEntry->FileName, L"random") == 0)) { ThemePtr = NULL; } else { - ThemesList[ThemesNum++] = (CHAR16*)AllocateCopyPool (StrSize (DirEntry->FileName), DirEntry->FileName); + ThemesList[ThemesNum++] = (CHAR16*)AllocateCopyPool(StrSize(DirEntry->FileName), DirEntry->FileName); } } } - FreePool (ThemeTestPath); + FreePool(ThemeTestPath); } DBG ("\n"); if (ThemePtr) { FreePool(ThemePtr); } } - DirIterClose (&DirIter); + DirIterClose(&DirIter); } EFI_STATUS -XTheme::GetThemeTagSettings (void* DictP) +XTheme::GetThemeTagSettings(void* DictP) { TagPtr Dict, Dict2, Dict3; TagPtr DictPointer = (TagPtr)DictP; @@ -3429,12 +3429,12 @@ XTheme::GetThemeTagSettings (void* DictP) return EFI_SUCCESS; } - Dict = GetProperty (DictPointer, "BootCampStyle"); + Dict = GetProperty(DictPointer, "BootCampStyle"); BootCampStyle = IsPropertyTrue(Dict); - Dict = GetProperty (DictPointer, "Background"); + Dict = GetProperty(DictPointer, "Background"); if (Dict != NULL) { - Dict2 = GetProperty (Dict, "Type"); + Dict2 = GetProperty(Dict, "Type"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { if ((Dict2->string[0] == 'S') || (Dict2->string[0] == 's')) { BackgroundScale = imScale; @@ -3443,225 +3443,225 @@ XTheme::GetThemeTagSettings (void* DictP) } } - Dict2 = GetProperty (Dict, "Path"); + Dict2 = GetProperty(Dict, "Path"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { BackgroundName.takeValueFrom(Dict2->string); } - Dict2 = GetProperty (Dict, "Sharp"); - BackgroundSharp = GetPropertyInteger (Dict2, BackgroundSharp); + Dict2 = GetProperty(Dict, "Sharp"); + BackgroundSharp = GetPropertyInteger(Dict2, BackgroundSharp); - Dict2 = GetProperty (Dict, "Dark"); + Dict2 = GetProperty(Dict, "Dark"); BackgroundDark = IsPropertyTrue(Dict2); } - Dict = GetProperty (DictPointer, "Banner"); + Dict = GetProperty(DictPointer, "Banner"); if (Dict != NULL) { // retain for legacy themes. if ((Dict->type == kTagTypeString) && Dict->string) { BannerFileName.takeValueFrom(Dict->string); } else { // for new placement settings - Dict2 = GetProperty (Dict, "Path"); + Dict2 = GetProperty(Dict, "Path"); if (Dict2 != NULL) { if ((Dict2->type == kTagTypeString) && Dict2->string) { BannerFileName.takeValueFrom(Dict2->string); } } - Dict2 = GetProperty (Dict, "ScreenEdgeX"); + Dict2 = GetProperty(Dict, "ScreenEdgeX"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { - if (AsciiStrCmp (Dict2->string, "left") == 0) { + if (AsciiStrCmp(Dict2->string, "left") == 0) { BannerEdgeHorizontal = SCREEN_EDGE_LEFT; - } else if (AsciiStrCmp (Dict2->string, "right") == 0) { + } else if (AsciiStrCmp(Dict2->string, "right") == 0) { BannerEdgeHorizontal = SCREEN_EDGE_RIGHT; } } - Dict2 = GetProperty (Dict, "ScreenEdgeY"); + Dict2 = GetProperty(Dict, "ScreenEdgeY"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { - if (AsciiStrCmp (Dict2->string, "top") == 0) { + if (AsciiStrCmp(Dict2->string, "top") == 0) { BannerEdgeVertical = SCREEN_EDGE_TOP; - } else if (AsciiStrCmp (Dict2->string, "bottom") == 0) { + } else if (AsciiStrCmp(Dict2->string, "bottom") == 0) { BannerEdgeVertical = SCREEN_EDGE_BOTTOM; } } - Dict2 = GetProperty (Dict, "DistanceFromScreenEdgeX%"); - BannerPosX = GetPropertyInteger (Dict2, 0); + Dict2 = GetProperty(Dict, "DistanceFromScreenEdgeX%"); + BannerPosX = GetPropertyInteger(Dict2, 0); - Dict2 = GetProperty (Dict, "DistanceFromScreenEdgeY%"); - BannerPosY = GetPropertyInteger (Dict2, 0); + Dict2 = GetProperty(Dict, "DistanceFromScreenEdgeY%"); + BannerPosY = GetPropertyInteger(Dict2, 0); - Dict2 = GetProperty (Dict, "NudgeX"); - BannerNudgeX = GetPropertyInteger (Dict2, 0); + Dict2 = GetProperty(Dict, "NudgeX"); + BannerNudgeX = GetPropertyInteger(Dict2, 0); - Dict2 = GetProperty (Dict, "NudgeY"); - BannerNudgeY = GetPropertyInteger (Dict2, 0); + Dict2 = GetProperty(Dict, "NudgeY"); + BannerNudgeY = GetPropertyInteger(Dict2, 0); } } - Dict = GetProperty (DictPointer, "Badges"); + Dict = GetProperty(DictPointer, "Badges"); if (Dict != NULL) { - Dict2 = GetProperty (Dict, "Swap"); + Dict2 = GetProperty(Dict, "Swap"); if (Dict2 != NULL && Dict2->type == kTagTypeTrue) { HideBadges |= HDBADGES_SWAP; DBG ("OS main and drive as badge\n"); } - Dict2 = GetProperty (Dict, "Show"); + Dict2 = GetProperty(Dict, "Show"); if (Dict2 != NULL && Dict2->type == kTagTypeTrue) { HideBadges |= HDBADGES_SHOW; } - Dict2 = GetProperty (Dict, "Inline"); + Dict2 = GetProperty(Dict, "Inline"); if (Dict2 != NULL && Dict2->type == kTagTypeTrue) { HideBadges |= HDBADGES_INLINE; } // blackosx added X and Y position for badge offset. - Dict2 = GetProperty (Dict, "OffsetX"); - BadgeOffsetX = GetPropertyInteger (Dict2, BadgeOffsetX); + Dict2 = GetProperty(Dict, "OffsetX"); + BadgeOffsetX = GetPropertyInteger(Dict2, BadgeOffsetX); - Dict2 = GetProperty (Dict, "OffsetY"); - BadgeOffsetY = GetPropertyInteger (Dict2, BadgeOffsetY); + Dict2 = GetProperty(Dict, "OffsetY"); + BadgeOffsetY = GetPropertyInteger(Dict2, BadgeOffsetY); - Dict2 = GetProperty (Dict, "Scale"); - ThemeX.BadgeScale = GetPropertyInteger (Dict2, BadgeScale); + Dict2 = GetProperty(Dict, "Scale"); + ThemeX.BadgeScale = GetPropertyInteger(Dict2, BadgeScale); } - Dict = GetProperty (DictPointer, "Origination"); + Dict = GetProperty(DictPointer, "Origination"); if (Dict != NULL) { - Dict2 = GetProperty (Dict, "DesignWidth"); - ThemeDesignWidth = GetPropertyInteger (Dict2, ThemeDesignWidth); + Dict2 = GetProperty(Dict, "DesignWidth"); + ThemeDesignWidth = GetPropertyInteger(Dict2, ThemeDesignWidth); - Dict2 = GetProperty (Dict, "DesignHeight"); - ThemeDesignHeight = GetPropertyInteger (Dict2, ThemeDesignHeight); + Dict2 = GetProperty(Dict, "DesignHeight"); + ThemeDesignHeight = GetPropertyInteger(Dict2, ThemeDesignHeight); } - Dict = GetProperty (DictPointer, "Layout"); + Dict = GetProperty(DictPointer, "Layout"); if (Dict != NULL) { - Dict2 = GetProperty (Dict, "BannerOffset"); - LayoutBannerOffset = GetPropertyInteger (Dict2, LayoutBannerOffset); + Dict2 = GetProperty(Dict, "BannerOffset"); + LayoutBannerOffset = GetPropertyInteger(Dict2, LayoutBannerOffset); - Dict2 = GetProperty (Dict, "ButtonOffset"); - LayoutButtonOffset = GetPropertyInteger (Dict2, LayoutButtonOffset); + Dict2 = GetProperty(Dict, "ButtonOffset"); + LayoutButtonOffset = GetPropertyInteger(Dict2, LayoutButtonOffset); - Dict2 = GetProperty (Dict, "TextOffset"); - LayoutTextOffset = GetPropertyInteger (Dict2, LayoutTextOffset); + Dict2 = GetProperty(Dict, "TextOffset"); + LayoutTextOffset = GetPropertyInteger(Dict2, LayoutTextOffset); - Dict2 = GetProperty (Dict, "AnimAdjustForMenuX"); - LayoutAnimMoveForMenuX = GetPropertyInteger (Dict2, LayoutAnimMoveForMenuX); + Dict2 = GetProperty(Dict, "AnimAdjustForMenuX"); + LayoutAnimMoveForMenuX = GetPropertyInteger(Dict2, LayoutAnimMoveForMenuX); - Dict2 = GetProperty (Dict, "Vertical"); + Dict2 = GetProperty(Dict, "Vertical"); VerticalLayout = IsPropertyTrue(Dict2); // GlobalConfig.MainEntriesSize - Dict2 = GetProperty (Dict, "MainEntriesSize"); - MainEntriesSize = GetPropertyInteger (Dict2, MainEntriesSize); + Dict2 = GetProperty(Dict, "MainEntriesSize"); + MainEntriesSize = GetPropertyInteger(Dict2, MainEntriesSize); - Dict2 = GetProperty (Dict, "TileXSpace"); - TileXSpace = GetPropertyInteger (Dict2, TileXSpace); + Dict2 = GetProperty(Dict, "TileXSpace"); + TileXSpace = GetPropertyInteger(Dict2, TileXSpace); - Dict2 = GetProperty (Dict, "TileYSpace"); - TileYSpace = GetPropertyInteger (Dict2, TileYSpace); + Dict2 = GetProperty(Dict, "TileYSpace"); + TileYSpace = GetPropertyInteger(Dict2, TileYSpace); - Dict2 = GetProperty (Dict, "SelectionBigWidth"); - row0TileSize = GetPropertyInteger (Dict2, row0TileSize); + Dict2 = GetProperty(Dict, "SelectionBigWidth"); + row0TileSize = GetPropertyInteger(Dict2, row0TileSize); - Dict2 = GetProperty (Dict, "SelectionSmallWidth"); - row1TileSize = (INTN)GetPropertyInteger (Dict2, row1TileSize); + Dict2 = GetProperty(Dict, "SelectionSmallWidth"); + row1TileSize = (INTN)GetPropertyInteger(Dict2, row1TileSize); } - Dict = GetProperty (DictPointer, "Components"); + Dict = GetProperty(DictPointer, "Components"); if (Dict != NULL) { - Dict2 = GetProperty (Dict, "Banner"); + Dict2 = GetProperty(Dict, "Banner"); if (Dict2 && Dict2->type == kTagTypeFalse) { HideUIFlags |= HIDEUI_FLAG_BANNER; } - Dict2 = GetProperty (Dict, "Functions"); + Dict2 = GetProperty(Dict, "Functions"); if (Dict2 && Dict2->type == kTagTypeFalse) { HideUIFlags |= HIDEUI_FLAG_FUNCS; } - Dict2 = GetProperty (Dict, "Tools"); + Dict2 = GetProperty(Dict, "Tools"); if (Dict2 && Dict2->type == kTagTypeFalse) { HideUIFlags |= HIDEUI_FLAG_TOOLS; } - Dict2 = GetProperty (Dict, "Label"); + Dict2 = GetProperty(Dict, "Label"); if (Dict2 && Dict2->type == kTagTypeFalse) { HideUIFlags |= HIDEUI_FLAG_LABEL; } - Dict2 = GetProperty (Dict, "Revision"); + Dict2 = GetProperty(Dict, "Revision"); if (Dict2 && Dict2->type == kTagTypeFalse) { HideUIFlags |= HIDEUI_FLAG_REVISION; } - Dict2 = GetProperty (Dict, "Help"); + Dict2 = GetProperty(Dict, "Help"); if (Dict2 && Dict2->type == kTagTypeFalse) { HideUIFlags |= HIDEUI_FLAG_HELP; } - Dict2 = GetProperty (Dict, "MenuTitle"); + Dict2 = GetProperty(Dict, "MenuTitle"); if (Dict2 && Dict2->type == kTagTypeFalse) { HideUIFlags |= HIDEUI_FLAG_MENU_TITLE; } - Dict2 = GetProperty (Dict, "MenuTitleImage"); + Dict2 = GetProperty(Dict, "MenuTitleImage"); if (Dict2 && Dict2->type == kTagTypeFalse) { HideUIFlags |= HIDEUI_FLAG_MENU_TITLE_IMAGE; } } - Dict = GetProperty (DictPointer, "Selection"); + Dict = GetProperty(DictPointer, "Selection"); if (Dict != NULL) { - Dict2 = GetProperty (Dict, "Color"); - SelectionColor = (UINTN)GetPropertyInteger (Dict2, SelectionColor); + Dict2 = GetProperty(Dict, "Color"); + SelectionColor = (UINTN)GetPropertyInteger(Dict2, SelectionColor); - Dict2 = GetProperty (Dict, "Small"); + Dict2 = GetProperty(Dict, "Small"); if ( Dict2 && (Dict2->type == kTagTypeString) && Dict2->string) { SelectionSmallFileName.takeValueFrom(Dict2->string); } - Dict2 = GetProperty (Dict, "Big"); + Dict2 = GetProperty(Dict, "Big"); if ( Dict2 && (Dict2->type == kTagTypeString) && Dict2->string) { SelectionBigFileName.takeValueFrom(Dict2->string); } - Dict2 = GetProperty (Dict, "Indicator"); + Dict2 = GetProperty(Dict, "Indicator"); if ( Dict2 && (Dict2->type == kTagTypeString) && Dict2->string) { SelectionIndicatorName.takeValueFrom(Dict2->string); } - Dict2 = GetProperty (Dict, "OnTop"); + Dict2 = GetProperty(Dict, "OnTop"); SelectionOnTop = IsPropertyTrue (Dict2); - Dict2 = GetProperty (Dict, "ChangeNonSelectedGrey"); + Dict2 = GetProperty(Dict, "ChangeNonSelectedGrey"); NonSelectedGrey = IsPropertyTrue (Dict2); } - Dict = GetProperty (DictPointer, "Scroll"); + Dict = GetProperty(DictPointer, "Scroll"); if (Dict != NULL) { - Dict2 = GetProperty (Dict, "Width"); - ScrollWidth = (UINTN)GetPropertyInteger (Dict2, ScrollWidth); + Dict2 = GetProperty(Dict, "Width"); + ScrollWidth = (UINTN)GetPropertyInteger(Dict2, ScrollWidth); - Dict2 = GetProperty (Dict, "Height"); - ScrollButtonsHeight = (UINTN)GetPropertyInteger (Dict2, ScrollButtonsHeight); + Dict2 = GetProperty(Dict, "Height"); + ScrollButtonsHeight = (UINTN)GetPropertyInteger(Dict2, ScrollButtonsHeight); - Dict2 = GetProperty (Dict, "BarHeight"); - ScrollBarDecorationsHeight = (UINTN)GetPropertyInteger (Dict2, ScrollBarDecorationsHeight); + Dict2 = GetProperty(Dict, "BarHeight"); + ScrollBarDecorationsHeight = (UINTN)GetPropertyInteger(Dict2, ScrollBarDecorationsHeight); - Dict2 = GetProperty (Dict, "ScrollHeight"); - ScrollScrollDecorationsHeight = (UINTN)GetPropertyInteger (Dict2,ScrollScrollDecorationsHeight); + Dict2 = GetProperty(Dict, "ScrollHeight"); + ScrollScrollDecorationsHeight = (UINTN)GetPropertyInteger(Dict2,ScrollScrollDecorationsHeight); } - Dict = GetProperty (DictPointer, "Font"); + Dict = GetProperty(DictPointer, "Font"); if (Dict != NULL) { - Dict2 = GetProperty (Dict, "Type"); + Dict2 = GetProperty(Dict, "Type"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { if ((Dict2->string[0] == 'A') || (Dict2->string[0] == 'B')) { Font = FONT_ALFA; @@ -3672,79 +3672,79 @@ XTheme::GetThemeTagSettings (void* DictP) } } if (Font == FONT_LOAD) { - Dict2 = GetProperty (Dict, "Path"); + Dict2 = GetProperty(Dict, "Path"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { FontFileName.takeValueFrom(Dict2->string); } } - Dict2 = GetProperty (Dict, "CharWidth"); - CharWidth = (UINTN)GetPropertyInteger (Dict2, CharWidth); + Dict2 = GetProperty(Dict, "CharWidth"); + CharWidth = (UINTN)GetPropertyInteger(Dict2, CharWidth); if (CharWidth & 1) { MsgLog("Warning! Character width %lld should be even!\n", CharWidth); } - Dict2 = GetProperty (Dict, "Proportional"); + Dict2 = GetProperty(Dict, "Proportional"); Proportional = IsPropertyTrue (Dict2); } - Dict = GetProperty (DictPointer, "Anime"); + Dict = GetProperty(DictPointer, "Anime"); if (Dict != NULL) { INTN Count = GetTagCount (Dict); for (INTN i = 0; i < Count; i++) { FILM *NewFilm = new FILM(); - if (EFI_ERROR (GetElement (Dict, i, &Dict3))) { + if (EFI_ERROR(GetElement (Dict, i, &Dict3))) { continue; } if (Dict3 == NULL) { break; } - Dict2 = GetProperty (Dict3, "ID"); - NewFilm->SetIndex((UINTN)GetPropertyInteger (Dict2, 1)); //default=main screen + Dict2 = GetProperty(Dict3, "ID"); + NewFilm->SetIndex((UINTN)GetPropertyInteger(Dict2, 1)); //default=main screen - Dict2 = GetProperty (Dict3, "Path"); + Dict2 = GetProperty(Dict3, "Path"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { NewFilm->Path.takeValueFrom(Dict2->string); } - Dict2 = GetProperty (Dict3, "Frames"); - NewFilm->NumFrames = (UINTN)GetPropertyInteger (Dict2, 0); + Dict2 = GetProperty(Dict3, "Frames"); + NewFilm->NumFrames = (UINTN)GetPropertyInteger(Dict2, 0); - Dict2 = GetProperty (Dict3, "FrameTime"); - NewFilm->FrameTime = (UINTN)GetPropertyInteger (Dict2, 50); //default will be 50ms + Dict2 = GetProperty(Dict3, "FrameTime"); + NewFilm->FrameTime = (UINTN)GetPropertyInteger(Dict2, 50); //default will be 50ms - Dict2 = GetProperty (Dict3, "ScreenEdgeX"); + Dict2 = GetProperty(Dict3, "ScreenEdgeX"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { - if (AsciiStrCmp (Dict2->string, "left") == 0) { + if (AsciiStrCmp(Dict2->string, "left") == 0) { NewFilm->ScreenEdgeHorizontal = SCREEN_EDGE_LEFT; - } else if (AsciiStrCmp (Dict2->string, "right") == 0) { + } else if (AsciiStrCmp(Dict2->string, "right") == 0) { NewFilm->ScreenEdgeHorizontal = SCREEN_EDGE_RIGHT; } } - Dict2 = GetProperty (Dict3, "ScreenEdgeY"); + Dict2 = GetProperty(Dict3, "ScreenEdgeY"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { - if (AsciiStrCmp (Dict2->string, "top") == 0) { + if (AsciiStrCmp(Dict2->string, "top") == 0) { NewFilm->ScreenEdgeVertical = SCREEN_EDGE_TOP; - } else if (AsciiStrCmp (Dict2->string, "bottom") == 0) { + } else if (AsciiStrCmp(Dict2->string, "bottom") == 0) { NewFilm->ScreenEdgeVertical = SCREEN_EDGE_BOTTOM; } } //default values are centre - Dict2 = GetProperty (Dict3, "DistanceFromScreenEdgeX%"); - NewFilm->FilmX = GetPropertyInteger (Dict2, INITVALUE); + Dict2 = GetProperty(Dict3, "DistanceFromScreenEdgeX%"); + NewFilm->FilmX = GetPropertyInteger(Dict2, INITVALUE); - Dict2 = GetProperty (Dict3, "DistanceFromScreenEdgeY%"); - NewFilm->FilmY = GetPropertyInteger (Dict2, INITVALUE); + Dict2 = GetProperty(Dict3, "DistanceFromScreenEdgeY%"); + NewFilm->FilmY = GetPropertyInteger(Dict2, INITVALUE); - Dict2 = GetProperty (Dict3, "NudgeX"); - NewFilm->NudgeX = GetPropertyInteger (Dict2, INITVALUE); + Dict2 = GetProperty(Dict3, "NudgeX"); + NewFilm->NudgeX = GetPropertyInteger(Dict2, INITVALUE); - Dict2 = GetProperty (Dict3, "NudgeY"); - NewFilm->NudgeY = GetPropertyInteger (Dict2, INITVALUE); + Dict2 = GetProperty(Dict3, "NudgeY"); + NewFilm->NudgeY = GetPropertyInteger(Dict2, INITVALUE); - Dict2 = GetProperty (Dict3, "Once"); + Dict2 = GetProperty(Dict3, "Once"); NewFilm->RunOnce = IsPropertyTrue (Dict2); NewFilm->GetFrames(ThemeX); //used properties: ID, Path, NumFrames @@ -3788,7 +3788,7 @@ void* XTheme::LoadTheme (const CHAR16 *TestTheme) return NULL; } if (ThemePath != NULL) { - FreePool (ThemePath); + FreePool(ThemePath); } if (UGAHeight > HEIGHT_2K) { ThemePath = PoolPrint(L"EFI\\CLOVER\\themes\\%s@2x", TestTheme); @@ -3796,17 +3796,17 @@ void* XTheme::LoadTheme (const CHAR16 *TestTheme) ThemePath = PoolPrint(L"EFI\\CLOVER\\themes\\%s", TestTheme); } Status = SelfRootDir->Open(SelfRootDir, &ThemeDir, ThemePath, EFI_FILE_MODE_READ, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { if (ThemeDir != NULL) { ThemeDir->Close (ThemeDir); ThemeDir = NULL; } - FreePool (ThemePath); + FreePool(ThemePath); ThemePath = PoolPrint(L"EFI\\CLOVER\\themes\\%s", TestTheme); Status = SelfRootDir->Open(SelfRootDir, &ThemeDir, ThemePath, EFI_FILE_MODE_READ, 0); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = egLoadFile(ThemeDir, CONFIG_THEME_SVG, (UINT8**)&ThemePtr, &Size); if (!EFI_ERROR(Status) && (ThemePtr != NULL) && (Size != 0)) { Status = ParseSVGXTheme((const CHAR8*)ThemePtr); @@ -3823,9 +3823,9 @@ void* XTheme::LoadTheme (const CHAR16 *TestTheme) } } else { Status = egLoadFile(ThemeDir, CONFIG_THEME_FILENAME, (UINT8**)&ThemePtr, &Size); - if (!EFI_ERROR (Status) && (ThemePtr != NULL) && (Size != 0)) { + if (!EFI_ERROR(Status) && (ThemePtr != NULL) && (Size != 0)) { Status = ParseXML((const CHAR8*)ThemePtr, &ThemeDict, 0); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { ThemeDict = NULL; } if (ThemeDict == NULL) { @@ -3837,7 +3837,7 @@ void* XTheme::LoadTheme (const CHAR16 *TestTheme) } } if (ThemePtr != NULL) { - FreePool (ThemePtr); + FreePool(ThemePtr); } return (void*)ThemeDict; } @@ -3912,9 +3912,9 @@ InitTheme(BOOLEAN UseThemeDefinedInNVRam, EFI_TIME *Time) // Try special theme first if (Time != NULL) { if ((Time->Month == 12) && ((Time->Day >= 25) && (Time->Day <= 31))) { - TestTheme = PoolPrint (L"christmas"); + TestTheme = PoolPrint(L"christmas"); } else if ((Time->Month == 1) && ((Time->Day >= 1) && (Time->Day <= 3))) { - TestTheme = PoolPrint (L"newyear"); + TestTheme = PoolPrint(L"newyear"); } if (TestTheme != NULL) { @@ -3923,13 +3923,13 @@ InitTheme(BOOLEAN UseThemeDefinedInNVRam, EFI_TIME *Time) DBG ("special theme %ls found and %ls parsed\n", TestTheme, CONFIG_THEME_FILENAME); // ThemeX.Theme.takeValueFrom(TestTheme); if (GlobalConfig.Theme) { - FreePool (GlobalConfig.Theme); + FreePool(GlobalConfig.Theme); } GlobalConfig.Theme = TestTheme; } else { // special theme not loaded DBG ("special theme %ls not found, skipping\n", TestTheme/*, CONFIG_THEME_FILENAME*/); - FreePool (TestTheme); + FreePool(TestTheme); } TestTheme = NULL; } @@ -3938,22 +3938,22 @@ InitTheme(BOOLEAN UseThemeDefinedInNVRam, EFI_TIME *Time) if (ThemeDict == NULL && UseThemeDefinedInNVRam) { ChosenTheme = (__typeof__(ChosenTheme))GetNvramVariable(L"Clover.Theme", &gEfiAppleBootGuid, NULL, &Size); if (ChosenTheme != NULL) { - if (AsciiStrCmp (ChosenTheme, "embedded") == 0) { + if (AsciiStrCmp(ChosenTheme, "embedded") == 0) { goto finish; } - if (AsciiStrCmp (ChosenTheme, "random") == 0) { + if (AsciiStrCmp(ChosenTheme, "random") == 0) { ThemeDict = (TagPtr)ThemeX.LoadTheme (ThemesList[Rnd]); goto finish; } - TestTheme = PoolPrint (L"%a", ChosenTheme); + TestTheme = PoolPrint(L"%a", ChosenTheme); if (TestTheme != NULL) { ThemeDict = (TagPtr)ThemeX.LoadTheme (TestTheme); if (ThemeDict != NULL) { DBG ("theme %s defined in NVRAM found and %ls parsed\n", ChosenTheme, CONFIG_THEME_FILENAME); // ThemeX.Theme.takeValueFrom(TestTheme); if (GlobalConfig.Theme) { - FreePool (GlobalConfig.Theme); + FreePool(GlobalConfig.Theme); } GlobalConfig.Theme = TestTheme; } else { // theme from nvram not loaded @@ -3962,11 +3962,11 @@ InitTheme(BOOLEAN UseThemeDefinedInNVRam, EFI_TIME *Time) } else { DBG ("theme %s chosen from nvram is absent, get first theme\n", ChosenTheme); } - FreePool (TestTheme); + FreePool(TestTheme); } TestTheme = NULL; } - FreePool (ChosenTheme); + FreePool(ChosenTheme); ChosenTheme = NULL; } } @@ -4007,7 +4007,7 @@ finish: ThemeX.FillByEmbedded(); OldChosenTheme = 0xFFFF; if (ThemePath != NULL) { - FreePool (ThemePath); + FreePool(ThemePath); ThemePath = NULL; } @@ -4029,7 +4029,7 @@ finish: TagPtr DictPointer = GetProperty(ThemeDict, "Theme"); if (DictPointer != NULL) { Status = ThemeX.GetThemeTagSettings((void*)DictPointer); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG ("Config theme error: %s\n", strerror(Status)); } else { ThemeX.FillByDir(); @@ -4055,7 +4055,7 @@ finish: } } if (ChosenTheme != NULL) { - FreePool (ChosenTheme); + FreePool(ChosenTheme); } if (!ThemeX.TypeSVG) { ThemeX.PrepareFont(); @@ -4078,7 +4078,7 @@ ParseSMBIOSSettings( BOOLEAN Default = FALSE; - Prop = GetProperty (DictPointer, "ProductName"); + Prop = GetProperty(DictPointer, "ProductName"); if (Prop != NULL) { MACHINE_TYPES Model; AsciiStrCpyS (gSettings.ProductName, 64, Prop->string); @@ -4102,7 +4102,7 @@ ParseSMBIOSSettings( gSettings.SmbiosVersion = (UINT16)GetPropertyInteger(Prop, 0x204); // Check for BiosVersion and BiosReleaseDate by Sherlocks - Prop = GetProperty (DictPointer, "BiosVersion"); + Prop = GetProperty(DictPointer, "BiosVersion"); if (Prop != NULL) { i = gSettings.RomVersion; j = Prop->string; @@ -4145,7 +4145,7 @@ ParseSMBIOSSettings( } DBG ("BiosVersion: %s\n", gSettings.RomVersion); - Prop1 = GetProperty (DictPointer, "BiosReleaseDate"); + Prop1 = GetProperty(DictPointer, "BiosReleaseDate"); if (Prop1 != NULL) { if (Prop != NULL) { i = gSettings.ReleaseDate; @@ -4318,7 +4318,7 @@ ParseSMBIOSSettings( } DBG ("BiosReleaseDate: %s\n", gSettings.ReleaseDate); - Prop = GetProperty (DictPointer, "EfiVersion"); + Prop = GetProperty(DictPointer, "EfiVersion"); if (Prop != NULL) { if (AsciiStrVersionToUint64(gSettings.EfiVersion, 4, 5) > AsciiStrVersionToUint64(Prop->string, 4, 5)) { DBG ("Using latest EfiVersion from clover: %s\n", gSettings.EfiVersion); @@ -4332,23 +4332,23 @@ ParseSMBIOSSettings( DBG ("Using EfiVersion from clover: %s\n", gSettings.EfiVersion); } - Prop = GetProperty (DictPointer, "FirmwareFeatures"); + Prop = GetProperty(DictPointer, "FirmwareFeatures"); if (Prop != NULL) { - gFwFeatures = (UINT32)GetPropertyInteger (Prop, gFwFeatures); + gFwFeatures = (UINT32)GetPropertyInteger(Prop, gFwFeatures); DBG ("Using FirmwareFeatures from config: 0x%08X\n", gFwFeatures); } else { DBG ("Using FirmwareFeatures from clover: 0x%08X\n", gFwFeatures); } - Prop = GetProperty (DictPointer, "FirmwareFeaturesMask"); + Prop = GetProperty(DictPointer, "FirmwareFeaturesMask"); if (Prop != NULL) { - gFwFeaturesMask = (UINT32)GetPropertyInteger (Prop, gFwFeaturesMask); + gFwFeaturesMask = (UINT32)GetPropertyInteger(Prop, gFwFeaturesMask); DBG ("Using FirmwareFeaturesMask from config: 0x%08X\n", gFwFeaturesMask); } else { DBG ("Using FirmwareFeaturesMask from clover: 0x%08X\n", gFwFeaturesMask); } - Prop = GetProperty (DictPointer, "PlatformFeature"); + Prop = GetProperty(DictPointer, "PlatformFeature"); if (Prop != NULL) { gPlatformFeature = (UINT64)GetPropertyInteger(Prop, (INTN)gPlatformFeature); } else { @@ -4359,33 +4359,33 @@ ParseSMBIOSSettings( } } - Prop = GetProperty (DictPointer, "BiosVendor"); + Prop = GetProperty(DictPointer, "BiosVendor"); if (Prop != NULL) { AsciiStrCpyS (gSettings.VendorName, 64, Prop->string); } - Prop = GetProperty (DictPointer, "Manufacturer"); + Prop = GetProperty(DictPointer, "Manufacturer"); if (Prop != NULL) { AsciiStrCpyS (gSettings.ManufactureName, 64, Prop->string); } - Prop = GetProperty (DictPointer, "Version"); + Prop = GetProperty(DictPointer, "Version"); if (Prop != NULL) { AsciiStrCpyS (gSettings.VersionNr, 64, Prop->string); } - Prop = GetProperty (DictPointer, "Family"); + Prop = GetProperty(DictPointer, "Family"); if (Prop != NULL) { AsciiStrCpyS (gSettings.FamilyName, 64, Prop->string); } - Prop = GetProperty (DictPointer, "SerialNumber"); + Prop = GetProperty(DictPointer, "SerialNumber"); if (Prop != NULL) { ZeroMem(gSettings.SerialNr, 64); AsciiStrCpyS (gSettings.SerialNr, 64, Prop->string); } - Prop = GetProperty (DictPointer, "SmUUID"); + Prop = GetProperty(DictPointer, "SmUUID"); if (Prop != NULL) { if (IsValidGuidAsciiString (Prop->string)) { AsciiStrToUnicodeStrS (Prop->string, (CHAR16*)&UStr[0], 64); @@ -4396,36 +4396,36 @@ ParseSMBIOSSettings( } } - Prop = GetProperty (DictPointer, "BoardManufacturer"); + Prop = GetProperty(DictPointer, "BoardManufacturer"); if (Prop != NULL) { AsciiStrCpyS (gSettings.BoardManufactureName, 64, Prop->string); } - Prop = GetProperty (DictPointer, "BoardSerialNumber"); + Prop = GetProperty(DictPointer, "BoardSerialNumber"); if (Prop != NULL && AsciiStrLen (Prop->string) > 0) { AsciiStrCpyS (gSettings.BoardSerialNumber, 64, Prop->string); } - Prop = GetProperty (DictPointer, "Board-ID"); + Prop = GetProperty(DictPointer, "Board-ID"); if (Prop != NULL) { AsciiStrCpyS (gSettings.BoardNumber, 64, Prop->string); DBG ("Board-ID set from config as %s\n", gSettings.BoardNumber); } - Prop = GetProperty (DictPointer, "BoardVersion"); + Prop = GetProperty(DictPointer, "BoardVersion"); if (Prop != NULL) { AsciiStrCpyS (gSettings.BoardVersion, 64, Prop->string); } else if (!Default) { AsciiStrCpyS (gSettings.BoardVersion, 64, gSettings.ProductName); } - Prop = GetProperty (DictPointer, "BoardType"); + Prop = GetProperty(DictPointer, "BoardType"); if (Prop != NULL) { - gSettings.BoardType = (UINT8)GetPropertyInteger (Prop, gSettings.BoardType); + gSettings.BoardType = (UINT8)GetPropertyInteger(Prop, gSettings.BoardType); DBG ("BoardType: 0x%hhX\n", gSettings.BoardType); } - Prop = GetProperty (DictPointer, "Mobile"); + Prop = GetProperty(DictPointer, "Mobile"); if (Prop != NULL) { if (IsPropertyFalse(Prop)) gSettings.Mobile = FALSE; @@ -4435,28 +4435,28 @@ ParseSMBIOSSettings( gSettings.Mobile = (AsciiStrStr(gSettings.ProductName, "MacBook") != NULL); } - Prop = GetProperty (DictPointer, "LocationInChassis"); + Prop = GetProperty(DictPointer, "LocationInChassis"); if (Prop != NULL) { AsciiStrCpyS (gSettings.LocationInChassis, 64, Prop->string); } - Prop = GetProperty (DictPointer, "ChassisManufacturer"); + Prop = GetProperty(DictPointer, "ChassisManufacturer"); if (Prop != NULL) { AsciiStrCpyS (gSettings.ChassisManufacturer, 64, Prop->string); } - Prop = GetProperty (DictPointer, "ChassisAssetTag"); + Prop = GetProperty(DictPointer, "ChassisAssetTag"); if (Prop != NULL) { AsciiStrCpyS (gSettings.ChassisAssetTag, 64, Prop->string); } - Prop = GetProperty (DictPointer, "ChassisType"); + Prop = GetProperty(DictPointer, "ChassisType"); if (Prop != NULL) { - gSettings.ChassisType = (UINT8)GetPropertyInteger (Prop, gSettings.ChassisType); + gSettings.ChassisType = (UINT8)GetPropertyInteger(Prop, gSettings.ChassisType); DBG ("ChassisType: 0x%hhX\n", gSettings.ChassisType); } - Prop = GetProperty (DictPointer, "NoRomInfo"); + Prop = GetProperty(DictPointer, "NoRomInfo"); if (Prop != NULL) { gSettings.NoRomInfo = IsPropertyTrue (Prop); } @@ -4487,10 +4487,10 @@ GetUserSettings( // Discussion. Why Arguments is here? It should be SystemParameters property! // we will read them again because of change in GUI menu. It is not only EarlySettings // - DictPointer = GetProperty (Dict, "Boot"); + DictPointer = GetProperty(Dict, "Boot"); if (DictPointer != NULL) { - Prop = GetProperty (DictPointer, "Arguments"); + Prop = GetProperty(DictPointer, "Arguments"); //if (Prop != NULL && (Prop->type == kTagTypeString) && Prop->string != NULL) { if ((Prop != NULL) && (Prop->type == kTagTypeString) && (Prop->string != NULL) && (AsciiStrStr(gSettings.BootArgs, Prop->string) == NULL)) { AsciiStrnCpyS(gSettings.BootArgs, 256, Prop->string, 255); @@ -4498,17 +4498,17 @@ GetUserSettings( //gBootChanged = TRUE; } - Prop = GetProperty (DictPointer, "NeverDoRecovery"); + Prop = GetProperty(DictPointer, "NeverDoRecovery"); gSettings.NeverDoRecovery = IsPropertyTrue (Prop); } //Graphics - DictPointer = GetProperty (Dict, "Graphics"); + DictPointer = GetProperty(Dict, "Graphics"); if (DictPointer != NULL) { INTN i; - Dict2 = GetProperty (DictPointer, "Inject"); + Dict2 = GetProperty(DictPointer, "Inject"); if (Dict2 != NULL) { if (IsPropertyTrue (Dict2)) { gSettings.GraphicsInjector = TRUE; @@ -4516,17 +4516,17 @@ GetUserSettings( gSettings.InjectATI = TRUE; gSettings.InjectNVidia = TRUE; } else if (Dict2->type == kTagTypeDict) { - Prop = GetProperty (Dict2, "Intel"); + Prop = GetProperty(Dict2, "Intel"); if (Prop != NULL) { gSettings.InjectIntel = IsPropertyTrue (Prop); } - Prop = GetProperty (Dict2, "ATI"); + Prop = GetProperty(Dict2, "ATI"); if (Prop != NULL) { gSettings.InjectATI = IsPropertyTrue (Prop); } - Prop = GetProperty (Dict2, "NVidia"); + Prop = GetProperty(Dict2, "NVidia"); if (Prop != NULL) { gSettings.InjectNVidia = IsPropertyTrue (Prop); } @@ -4538,34 +4538,34 @@ GetUserSettings( } } - Prop = GetProperty (DictPointer, "RadeonDeInit"); + Prop = GetProperty(DictPointer, "RadeonDeInit"); gSettings.DeInit = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "VRAM"); + Prop = GetProperty(DictPointer, "VRAM"); gSettings.VRAM = (UINTN)GetPropertyInteger(Prop, (INTN)gSettings.VRAM); //Mb // - Prop = GetProperty (DictPointer, "RefCLK"); - gSettings.RefCLK = (UINT16)GetPropertyInteger (Prop, 0); + Prop = GetProperty(DictPointer, "RefCLK"); + gSettings.RefCLK = (UINT16)GetPropertyInteger(Prop, 0); - Prop = GetProperty (DictPointer, "LoadVBios"); + Prop = GetProperty(DictPointer, "LoadVBios"); gSettings.LoadVBios = IsPropertyTrue (Prop); for (i = 0; i < (INTN)NGFX; i++) { gGraphics[i].LoadVBios = gSettings.LoadVBios; //default } - Prop = GetProperty (DictPointer, "VideoPorts"); - gSettings.VideoPorts = (UINT16)GetPropertyInteger (Prop, gSettings.VideoPorts); + Prop = GetProperty(DictPointer, "VideoPorts"); + gSettings.VideoPorts = (UINT16)GetPropertyInteger(Prop, gSettings.VideoPorts); - Prop = GetProperty (DictPointer, "BootDisplay"); - gSettings.BootDisplay = (INT8)GetPropertyInteger (Prop, -1); + Prop = GetProperty(DictPointer, "BootDisplay"); + gSettings.BootDisplay = (INT8)GetPropertyInteger(Prop, -1); - Prop = GetProperty (DictPointer, "FBName"); + Prop = GetProperty(DictPointer, "FBName"); if (Prop != NULL) { AsciiStrToUnicodeStrS(Prop->string, gSettings.FBName, 16); } - Prop = GetProperty (DictPointer, "NVCAP"); + Prop = GetProperty(DictPointer, "NVCAP"); if (Prop != NULL) { hex2bin (Prop->string, (UINT8*)&gSettings.NVCAP[0], 20); DBG ("Read NVCAP:"); @@ -4578,52 +4578,52 @@ GetUserSettings( //thus confirmed this procedure is working } - Prop = GetProperty (DictPointer, "display-cfg"); + Prop = GetProperty(DictPointer, "display-cfg"); if (Prop != NULL) { hex2bin (Prop->string, (UINT8*)&gSettings.Dcfg[0], 8); } - Prop = GetProperty (DictPointer, "DualLink"); - gSettings.DualLink = (UINT32)GetPropertyInteger (Prop, gSettings.DualLink); + Prop = GetProperty(DictPointer, "DualLink"); + gSettings.DualLink = (UINT32)GetPropertyInteger(Prop, gSettings.DualLink); //InjectEDID - already done in earlysettings //No! Take again GetEDIDSettings(DictPointer); // ErmaC: NvidiaGeneric - Prop = GetProperty (DictPointer, "NvidiaGeneric"); + Prop = GetProperty(DictPointer, "NvidiaGeneric"); gSettings.NvidiaGeneric = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "NvidiaNoEFI"); + Prop = GetProperty(DictPointer, "NvidiaNoEFI"); gSettings.NvidiaNoEFI = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "NvidiaSingle"); + Prop = GetProperty(DictPointer, "NvidiaSingle"); gSettings.NvidiaSingle = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "ig-platform-id"); - gSettings.IgPlatform = (UINT32)GetPropertyInteger (Prop, gSettings.IgPlatform); + Prop = GetProperty(DictPointer, "ig-platform-id"); + gSettings.IgPlatform = (UINT32)GetPropertyInteger(Prop, gSettings.IgPlatform); - Prop = GetProperty (DictPointer, "snb-platform-id"); - gSettings.IgPlatform = (UINT32)GetPropertyInteger (Prop, gSettings.IgPlatform); + Prop = GetProperty(DictPointer, "snb-platform-id"); + gSettings.IgPlatform = (UINT32)GetPropertyInteger(Prop, gSettings.IgPlatform); FillCardList(DictPointer); //#@ Getcardslist } - DictPointer = GetProperty (Dict, "Devices"); + DictPointer = GetProperty(Dict, "Devices"); if (DictPointer != NULL) { - Prop = GetProperty (DictPointer, "Inject"); + Prop = GetProperty(DictPointer, "Inject"); gSettings.StringInjector = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "SetIntelBacklight"); + Prop = GetProperty(DictPointer, "SetIntelBacklight"); gSettings.IntelBacklight = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "SetIntelMaxBacklight"); + Prop = GetProperty(DictPointer, "SetIntelMaxBacklight"); gSettings.IntelMaxBacklight = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "IntelMaxValue"); - gSettings.IntelMaxValue = (UINT16)GetPropertyInteger (Prop, gSettings.IntelMaxValue); + Prop = GetProperty(DictPointer, "IntelMaxValue"); + gSettings.IntelMaxValue = (UINT16)GetPropertyInteger(Prop, gSettings.IntelMaxValue); - Prop = GetProperty (DictPointer, "Properties"); + Prop = GetProperty(DictPointer, "Properties"); if (Prop != NULL) { if (Prop->type == kTagTypeString) { @@ -4761,16 +4761,16 @@ GetUserSettings( } } - Prop = GetProperty (DictPointer, "LANInjection"); + Prop = GetProperty(DictPointer, "LANInjection"); gSettings.LANInjection = !IsPropertyFalse (Prop); //default = TRUE - Prop = GetProperty (DictPointer, "HDMIInjection"); + Prop = GetProperty(DictPointer, "HDMIInjection"); gSettings.HDMIInjection = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "NoDefaultProperties"); + Prop = GetProperty(DictPointer, "NoDefaultProperties"); gSettings.NoDefaultProperties = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "Arbitrary"); //yyyy + Prop = GetProperty(DictPointer, "Arbitrary"); //yyyy if (Prop != NULL) { INTN Index, Count = GetTagCount (Prop); DEV_PROPERTY *DevProp; @@ -4781,11 +4781,11 @@ GetUserSettings( UINTN DeviceAddr = 0U; CHAR8 *Label; DBG (" - [%02lld]:", Index); - if (EFI_ERROR (GetElement (Prop, Index, &Prop2))) { + if (EFI_ERROR(GetElement (Prop, Index, &Prop2))) { DBG (" continue\n"/*, Index*/); continue; } - Dict2 = GetProperty (Prop2, "PciAddr"); + Dict2 = GetProperty(Prop2, "PciAddr"); if (Dict2 != NULL) { UINT8 Bus, Dev, Func; CHAR8 *Str = Dict2->string; @@ -4806,13 +4806,13 @@ GetUserSettings( continue; } - Dict2 = GetProperty (Prop2, "Comment"); + Dict2 = GetProperty(Prop2, "Comment"); if (Dict2 != NULL) { AsciiStrCatS(Label, 64, Dict2->string); DBG (" (%s)", Dict2->string); } DBG ("\n"); - Dict2 = GetProperty (Prop2, "CustomProperties"); + Dict2 = GetProperty(Prop2, "CustomProperties"); if (Dict2 != NULL) { TagPtr Dict3; INTN PropIndex, PropCount = GetTagCount (Dict2); @@ -4828,15 +4828,15 @@ GetUserSettings( gSettings.ArbProperties->Device = (UINT32)DeviceAddr; gSettings.ArbProperties->Label = (__typeof__(gSettings.ArbProperties->Label))AllocateCopyPool(AsciiStrSize(Label), Label); - Prop3 = GetProperty (Dict3, "Disabled"); + Prop3 = GetProperty(Dict3, "Disabled"); gSettings.ArbProperties->MenuItem.BValue = !IsPropertyTrue(Prop3); - Prop3 = GetProperty (Dict3, "Key"); + Prop3 = GetProperty(Dict3, "Key"); if (Prop3 && (Prop3->type == kTagTypeString) && Prop3->string) { gSettings.ArbProperties->Key = (__typeof__(gSettings.ArbProperties->Key))AllocateCopyPool(AsciiStrSize(Prop3->string), Prop3->string); } - Prop3 = GetProperty (Dict3, "Value"); + Prop3 = GetProperty(Dict3, "Value"); if (Prop3 && (Prop3->type == kTagTypeString) && Prop3->string) { //first suppose it is Ascii string gSettings.ArbProperties->Value = (__typeof__(gSettings.ArbProperties->Value))AllocateCopyPool(AsciiStrSize(Prop3->string), Prop3->string); @@ -4877,7 +4877,7 @@ GetUserSettings( // gSettings.NrAddProperties = 0xFFFE; } //can use AddProperties with ArbProperties - Prop = GetProperty (DictPointer, "AddProperties"); + Prop = GetProperty(DictPointer, "AddProperties"); if (Prop != NULL) { INTN i, Count = GetTagCount (Prop); INTN Index = 0; //begin from 0 if second enter @@ -4889,7 +4889,7 @@ GetUserSettings( for (i = 0; i < Count; i++) { UINTN Size = 0; DBG (" - [%02lld]:", i); - if (EFI_ERROR (GetElement (Prop, i, &Dict2))) { + if (EFI_ERROR(GetElement (Prop, i, &Dict2))) { DBG (" continue\n"); continue; } @@ -4899,7 +4899,7 @@ GetUserSettings( break; } - Prop2 = GetProperty (Dict2, "Device"); + Prop2 = GetProperty(Dict2, "Device"); if (Prop2 && (Prop2->type == kTagTypeString) && Prop2->string) { DEV_PROPERTY *Property = &gSettings.AddProperties[Index]; @@ -4937,15 +4937,15 @@ GetUserSettings( DBG (" %s ", Prop2->string); - Prop2 = GetProperty (Dict2, "Disabled"); + Prop2 = GetProperty(Dict2, "Disabled"); gSettings.AddProperties[Index].MenuItem.BValue = !IsPropertyTrue (Prop2); - Prop2 = GetProperty (Dict2, "Key"); + Prop2 = GetProperty(Dict2, "Key"); if (Prop2 && (Prop2->type == kTagTypeString) && Prop2->string) { gSettings.AddProperties[Index].Key = (__typeof__(gSettings.AddProperties[Index].Key))AllocateCopyPool (AsciiStrSize (Prop2->string), Prop2->string); } - Prop2 = GetProperty (Dict2, "Value"); + Prop2 = GetProperty(Dict2, "Value"); if (Prop2 && (Prop2->type == kTagTypeString) && Prop2->string) { //first suppose it is Ascii string gSettings.AddProperties[Index].Value = (__typeof__(gSettings.AddProperties[Index].Value))AllocateCopyPool (AsciiStrSize (Prop2->string), Prop2->string); @@ -4974,71 +4974,71 @@ GetUserSettings( } //end AddProperties - Prop = GetProperty (DictPointer, "FakeID"); + Prop = GetProperty(DictPointer, "FakeID"); if (Prop != NULL) { - Prop2 = GetProperty (Prop, "ATI"); + Prop2 = GetProperty(Prop, "ATI"); if (Prop2 && (Prop2->type == kTagTypeString)) { gSettings.FakeATI = (UINT32)AsciiStrHexToUint64(Prop2->string); } - Prop2 = GetProperty (Prop, "NVidia"); + Prop2 = GetProperty(Prop, "NVidia"); if (Prop2 && (Prop2->type == kTagTypeString)) { gSettings.FakeNVidia = (UINT32)AsciiStrHexToUint64(Prop2->string); } - Prop2 = GetProperty (Prop, "IntelGFX"); + Prop2 = GetProperty(Prop, "IntelGFX"); if (Prop2 && (Prop2->type == kTagTypeString)) { gSettings.FakeIntel = (UINT32)AsciiStrHexToUint64(Prop2->string); } - Prop2 = GetProperty (Prop, "LAN"); + Prop2 = GetProperty(Prop, "LAN"); if (Prop2 && (Prop2->type == kTagTypeString)) { gSettings.FakeLAN = (UINT32)AsciiStrHexToUint64(Prop2->string); } - Prop2 = GetProperty (Prop, "WIFI"); + Prop2 = GetProperty(Prop, "WIFI"); if (Prop2 && (Prop2->type == kTagTypeString)) { gSettings.FakeWIFI = (UINT32)AsciiStrHexToUint64(Prop2->string); } - Prop2 = GetProperty (Prop, "SATA"); + Prop2 = GetProperty(Prop, "SATA"); if (Prop2 && (Prop2->type == kTagTypeString)) { gSettings.FakeSATA = (UINT32)AsciiStrHexToUint64(Prop2->string); } - Prop2 = GetProperty (Prop, "XHCI"); + Prop2 = GetProperty(Prop, "XHCI"); if (Prop2 && (Prop2->type == kTagTypeString)) { gSettings.FakeXHCI = (UINT32)AsciiStrHexToUint64(Prop2->string); } - Prop2 = GetProperty (Prop, "IMEI"); + Prop2 = GetProperty(Prop, "IMEI"); if (Prop2 && (Prop2->type == kTagTypeString)) { gSettings.FakeIMEI = (UINT32)AsciiStrHexToUint64(Prop2->string); } } - Prop = GetProperty (DictPointer, "UseIntelHDMI"); + Prop = GetProperty(DictPointer, "UseIntelHDMI"); gSettings.UseIntelHDMI = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "ForceHPET"); + Prop = GetProperty(DictPointer, "ForceHPET"); gSettings.ForceHPET = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "DisableFunctions"); + Prop = GetProperty(DictPointer, "DisableFunctions"); if (Prop && (Prop->type == kTagTypeString)) { gSettings.DisableFunctions = (UINT32)AsciiStrHexToUint64(Prop->string); } - Prop = GetProperty (DictPointer, "AirportBridgeDeviceName"); + Prop = GetProperty(DictPointer, "AirportBridgeDeviceName"); if (Prop && (Prop->type == kTagTypeString)) { AsciiStrCpyS (gSettings.AirportBridgeDeviceName, sizeof(gSettings.AirportBridgeDeviceName), Prop->string); } - Prop2 = GetProperty (DictPointer, "Audio"); + Prop2 = GetProperty(DictPointer, "Audio"); if (Prop2 != NULL) { // HDA - // Prop = GetProperty (Prop2, "ResetHDA"); + // Prop = GetProperty(Prop2, "ResetHDA"); // gSettings.ResetHDA = IsPropertyTrue (Prop); - Prop = GetProperty (Prop2, "Inject"); + Prop = GetProperty(Prop2, "Inject"); if (Prop != NULL) { // enabled by default // syntax: @@ -5069,40 +5069,40 @@ GetUserSettings( } } - Prop = GetProperty (Prop2, "AFGLowPowerState"); + Prop = GetProperty(Prop2, "AFGLowPowerState"); gSettings.AFGLowPowerState = IsPropertyTrue (Prop); } - Prop2 = GetProperty (DictPointer, "USB"); + Prop2 = GetProperty(DictPointer, "USB"); if (Prop2 != NULL) { // USB - Prop = GetProperty (Prop2, "Inject"); + Prop = GetProperty(Prop2, "Inject"); gSettings.USBInjection = !IsPropertyFalse (Prop); // enabled by default - Prop = GetProperty (Prop2, "AddClockID"); + Prop = GetProperty(Prop2, "AddClockID"); gSettings.InjectClockID = IsPropertyTrue (Prop); // disabled by default // enabled by default for CloverEFI // disabled for others gSettings.USBFixOwnership = gFirmwareClover; - Prop = GetProperty (Prop2, "FixOwnership"); + Prop = GetProperty(Prop2, "FixOwnership"); if (Prop != NULL) { gSettings.USBFixOwnership = IsPropertyTrue (Prop); } DBG ("USB FixOwnership: %s\n", gSettings.USBFixOwnership?"yes":"no"); - Prop = GetProperty (Prop2, "HighCurrent"); + Prop = GetProperty(Prop2, "HighCurrent"); gSettings.HighCurrent = IsPropertyTrue (Prop); - Prop = GetProperty (Prop2, "NameEH00"); + Prop = GetProperty(Prop2, "NameEH00"); gSettings.NameEH00 = IsPropertyTrue (Prop); } } //*** ACPI ***// - DictPointer = GetProperty (Dict, "ACPI"); + DictPointer = GetProperty(Dict, "ACPI"); if (DictPointer) { - Prop = GetProperty (DictPointer, "DropTables"); + Prop = GetProperty(DictPointer, "DropTables"); if (Prop) { INTN i, Count = GetTagCount (Prop); BOOLEAN Dropped; @@ -5116,7 +5116,7 @@ GetUserSettings( UINT64 TableId = 0; BOOLEAN OtherOS = FALSE; - if (EFI_ERROR (GetElement (Prop, i, &Dict2))) { + if (EFI_ERROR(GetElement (Prop, i, &Dict2))) { DBG (" - [%02lld]: Drop table continue\n", i); continue; } @@ -5128,7 +5128,7 @@ GetUserSettings( DBG (" - [%02lld]: Drop table ", i); // Get the table signatures to drop - Prop2 = GetProperty (Dict2, "Signature"); + Prop2 = GetProperty(Dict2, "Signature"); if (Prop2 && (Prop2->type == kTagTypeString) && Prop2->string) { CHAR8 s1 = 0, s2 = 0, s3 = 0, s4 = 0; CHAR8 *str = Prop2->string; @@ -5155,7 +5155,7 @@ GetUserSettings( DBG ("\" (%8.8X)", Signature); } // Get the table ids to drop - Prop2 = GetProperty (Dict2, "TableId"); + Prop2 = GetProperty(Dict2, "TableId"); if (Prop2 != NULL) { UINTN IdIndex = 0; CHAR8 Id[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -5172,13 +5172,13 @@ GetUserSettings( DBG ("\" (%16.16llX)", TableId); } // Get the table len to drop - Prop2 = GetProperty (Dict2, "Length"); + Prop2 = GetProperty(Dict2, "Length"); if (Prop2 != NULL) { - TabLength = (UINT32)GetPropertyInteger (Prop2, 0); + TabLength = (UINT32)GetPropertyInteger(Prop2, 0); DBG (" length=%d(0x%X)", TabLength, TabLength); } // Check if to drop for other OS as well - Prop2 = GetProperty (Dict2, "DropForAllOS"); + Prop2 = GetProperty(Dict2, "DropForAllOS"); if (Prop2 != NULL) { OtherOS = IsPropertyTrue (Prop2); } @@ -5208,27 +5208,27 @@ GetUserSettings( } } - Dict2 = GetProperty (DictPointer, "DSDT"); + Dict2 = GetProperty(DictPointer, "DSDT"); if (Dict2) { //gSettings.DsdtName by default is "DSDT.aml", but name "BIOS" will mean autopatch - Prop = GetProperty (Dict2, "Name"); + Prop = GetProperty(Dict2, "Name"); if (Prop != NULL) { AsciiStrToUnicodeStrS (Prop->string, gSettings.DsdtName, 28); } - Prop = GetProperty (Dict2, "Debug"); + Prop = GetProperty(Dict2, "Debug"); gSettings.DebugDSDT = IsPropertyTrue (Prop); - Prop = GetProperty (Dict2, "Rtc8Allowed"); + Prop = GetProperty(Dict2, "Rtc8Allowed"); gSettings.Rtc8Allowed = IsPropertyTrue (Prop); - Prop = GetProperty (Dict2, "PNLF_UID"); - gSettings.PNLF_UID = (UINT8)GetPropertyInteger (Prop, 0x0A); + Prop = GetProperty(Dict2, "PNLF_UID"); + gSettings.PNLF_UID = (UINT8)GetPropertyInteger(Prop, 0x0A); - Prop = GetProperty (Dict2, "FixMask"); - gSettings.FixDsdt = (UINT32)GetPropertyInteger (Prop, gSettings.FixDsdt); + Prop = GetProperty(Dict2, "FixMask"); + gSettings.FixDsdt = (UINT32)GetPropertyInteger(Prop, gSettings.FixDsdt); - Prop = GetProperty (Dict2, "Fixes"); + Prop = GetProperty(Dict2, "Fixes"); if (Prop != NULL) { UINTN Index; // DBG ("Fixes will override DSDT fix mask %08X!\n", gSettings.FixDsdt); @@ -5247,7 +5247,7 @@ GetUserSettings( } DBG (" - final DSDT Fix mask=%08X\n", gSettings.FixDsdt); - Prop = GetProperty (Dict2, "Patches"); //yyyy + Prop = GetProperty(Dict2, "Patches"); //yyyy if (Prop != NULL) { INTN i, Count = GetTagCount (Prop); if (Count > 0) { @@ -5265,7 +5265,7 @@ GetUserSettings( UINTN Size = 0; CHAR8 *DSDTPatchesLabel; Status = GetElement (Prop, i, &Prop2); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { DBG ("error %s getting next element of PatchesDSDT at index %lld\n", strerror(Status), i); continue; } @@ -5277,7 +5277,7 @@ GetUserSettings( DBG(" - [%02lld]:", i); DSDTPatchesLabel = (__typeof__(DSDTPatchesLabel))AllocateZeroPool(256); - Prop3 = GetProperty (Prop2, "Comment"); + Prop3 = GetProperty(Prop2, "Comment"); if (Prop3 != NULL && (Prop3->type == kTagTypeString) && Prop3->string) { snprintf(DSDTPatchesLabel, 255, "%s", Prop3->string); } else { @@ -5289,7 +5289,7 @@ GetUserSettings( FreePool(DSDTPatchesLabel); - Prop3 = GetProperty (Prop2, "Disabled"); + Prop3 = GetProperty(Prop2, "Disabled"); gSettings.PatchDsdtMenuItem[i].BValue = !IsPropertyTrue (Prop3); //DBG (" DSDT bin patch #%d ", i); @@ -5308,17 +5308,17 @@ GetUserSettings( } //if count > 0 } //if prop PatchesDSDT - Prop = GetProperty (Dict2, "ReuseFFFF"); + Prop = GetProperty(Dict2, "ReuseFFFF"); if (IsPropertyTrue (Prop)) { gSettings.ReuseFFFF = TRUE; } - Prop = GetProperty (Dict2, "SuspendOverride"); + Prop = GetProperty(Dict2, "SuspendOverride"); if (IsPropertyTrue (Prop)) { gSettings.SuspendOverride = TRUE; } - Prop = GetProperty (Dict2, "DropOEM_DSM"); + Prop = GetProperty(Dict2, "DropOEM_DSM"); defDSM = FALSE; if (Prop != NULL) { @@ -5330,67 +5330,67 @@ GetUserSettings( } else if (Prop->type == kTagTypeInteger) { gSettings.DropOEM_DSM = (UINT16)(UINTN)Prop->string; } else if (Prop->type == kTagTypeDict) { - Prop2 = GetProperty (Prop, "ATI"); + Prop2 = GetProperty(Prop, "ATI"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_ATI; } - Prop2 = GetProperty (Prop, "NVidia"); + Prop2 = GetProperty(Prop, "NVidia"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_NVIDIA; } - Prop2 = GetProperty (Prop, "IntelGFX"); + Prop2 = GetProperty(Prop, "IntelGFX"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_INTEL; } - Prop2 = GetProperty (Prop, "HDA"); + Prop2 = GetProperty(Prop, "HDA"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_HDA; } - Prop2 = GetProperty (Prop, "HDMI"); + Prop2 = GetProperty(Prop, "HDMI"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_HDMI; } - Prop2 = GetProperty (Prop, "SATA"); + Prop2 = GetProperty(Prop, "SATA"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_SATA; } - Prop2 = GetProperty (Prop, "LAN"); + Prop2 = GetProperty(Prop, "LAN"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_LAN; } - Prop2 = GetProperty (Prop, "WIFI"); + Prop2 = GetProperty(Prop, "WIFI"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_WIFI; } - Prop2 = GetProperty (Prop, "USB"); + Prop2 = GetProperty(Prop, "USB"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_USB; } - Prop2 = GetProperty (Prop, "LPC"); + Prop2 = GetProperty(Prop, "LPC"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_LPC; } - Prop2 = GetProperty (Prop, "SmBUS"); + Prop2 = GetProperty(Prop, "SmBUS"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_SMBUS; } - Prop2 = GetProperty (Prop, "Firewire"); + Prop2 = GetProperty(Prop, "Firewire"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_FIREWIRE; } - Prop2 = GetProperty (Prop, "IDE"); + Prop2 = GetProperty(Prop, "IDE"); if (IsPropertyTrue (Prop2)) { gSettings.DropOEM_DSM |= DEV_IDE; } @@ -5398,9 +5398,9 @@ GetUserSettings( } } - Dict2 = GetProperty (DictPointer, "SSDT"); + Dict2 = GetProperty(DictPointer, "SSDT"); if (Dict2) { - Prop2 = GetProperty (Dict2, "Generate"); + Prop2 = GetProperty(Dict2, "Generate"); if (Prop2 != NULL) { if (IsPropertyTrue (Prop2)) { gSettings.GeneratePStates = TRUE; @@ -5417,104 +5417,104 @@ GetUserSettings( gSettings.GeneratePluginType = FALSE; } else if (Prop2->type == kTagTypeDict) { - Prop = GetProperty (Prop2, "PStates"); + Prop = GetProperty(Prop2, "PStates"); gSettings.GeneratePStates = IsPropertyTrue (Prop); gSettings.GenerateAPSN = gSettings.GeneratePStates; gSettings.GenerateAPLF = gSettings.GeneratePStates; gSettings.GeneratePluginType = gSettings.GeneratePStates; - Prop = GetProperty (Prop2, "CStates"); + Prop = GetProperty(Prop2, "CStates"); gSettings.GenerateCStates = IsPropertyTrue (Prop); - Prop = GetProperty (Prop2, "APSN"); + Prop = GetProperty(Prop2, "APSN"); if (Prop) { gSettings.GenerateAPSN = IsPropertyTrue (Prop); } - Prop = GetProperty (Prop2, "APLF"); + Prop = GetProperty(Prop2, "APLF"); if (Prop) { gSettings.GenerateAPLF = IsPropertyTrue (Prop); } - Prop = GetProperty (Prop2, "PluginType"); + Prop = GetProperty(Prop2, "PluginType"); if (Prop) { gSettings.GeneratePluginType = IsPropertyTrue (Prop); } } } - Prop = GetProperty (Dict2, "DropOem"); + Prop = GetProperty(Dict2, "DropOem"); gSettings.DropSSDT = IsPropertyTrue (Prop); - Prop = GetProperty (Dict2, "NoOemTableId"); // to disable OEM table ID on ACPI/orgin/SSDT file names + Prop = GetProperty(Dict2, "NoOemTableId"); // to disable OEM table ID on ACPI/orgin/SSDT file names gSettings.NoOemTableId = IsPropertyTrue (Prop); - Prop = GetProperty (Dict2, "NoDynamicExtract"); // to disable extracting child SSDTs + Prop = GetProperty(Dict2, "NoDynamicExtract"); // to disable extracting child SSDTs gSettings.NoDynamicExtract = IsPropertyTrue (Prop); - Prop = GetProperty (Dict2, "UseSystemIO"); + Prop = GetProperty(Dict2, "UseSystemIO"); gSettings.EnableISS = IsPropertyTrue (Prop); - Prop = GetProperty (Dict2, "EnableC7"); + Prop = GetProperty(Dict2, "EnableC7"); if (Prop != NULL) { gSettings.EnableC7 = IsPropertyTrue (Prop); DBG ("EnableC7: %s\n", gSettings.EnableC7 ? "yes" : "no"); } - Prop = GetProperty (Dict2, "EnableC6"); + Prop = GetProperty(Dict2, "EnableC6"); if (Prop != NULL) { gSettings.EnableC6 = IsPropertyTrue (Prop); DBG ("EnableC6: %s\n", gSettings.EnableC6 ? "yes" : "no"); } - Prop = GetProperty (Dict2, "EnableC4"); + Prop = GetProperty(Dict2, "EnableC4"); if (Prop != NULL) { gSettings.EnableC4 = IsPropertyTrue (Prop); DBG ("EnableC4: %s\n", gSettings.EnableC4 ? "yes" : "no"); } - Prop = GetProperty (Dict2, "EnableC2"); + Prop = GetProperty(Dict2, "EnableC2"); if (Prop != NULL) { gSettings.EnableC2 = IsPropertyTrue (Prop); DBG ("EnableC2: %s\n", gSettings.EnableC2 ? "yes" : "no"); } - Prop = GetProperty (Dict2, "C3Latency"); + Prop = GetProperty(Dict2, "C3Latency"); if (Prop != NULL) { - gSettings.C3Latency = (UINT16)GetPropertyInteger (Prop, gSettings.C3Latency); + gSettings.C3Latency = (UINT16)GetPropertyInteger(Prop, gSettings.C3Latency); DBG ("C3Latency: %d\n", gSettings.C3Latency); } - Prop = GetProperty (Dict2, "PLimitDict"); - gSettings.PLimitDict = (UINT8)GetPropertyInteger (Prop, 0); + Prop = GetProperty(Dict2, "PLimitDict"); + gSettings.PLimitDict = (UINT8)GetPropertyInteger(Prop, 0); - Prop = GetProperty (Dict2, "UnderVoltStep"); - gSettings.UnderVoltStep = (UINT8)GetPropertyInteger (Prop, 0); + Prop = GetProperty(Dict2, "UnderVoltStep"); + gSettings.UnderVoltStep = (UINT8)GetPropertyInteger(Prop, 0); - Prop = GetProperty (Dict2, "DoubleFirstState"); + Prop = GetProperty(Dict2, "DoubleFirstState"); gSettings.DoubleFirstState = IsPropertyTrue (Prop); - Prop = GetProperty (Dict2, "MinMultiplier"); + Prop = GetProperty(Dict2, "MinMultiplier"); if (Prop != NULL) { - gSettings.MinMultiplier = (UINT8)GetPropertyInteger (Prop, gSettings.MinMultiplier); + gSettings.MinMultiplier = (UINT8)GetPropertyInteger(Prop, gSettings.MinMultiplier); DBG ("MinMultiplier: %d\n", gSettings.MinMultiplier); } - Prop = GetProperty (Dict2, "MaxMultiplier"); + Prop = GetProperty(Dict2, "MaxMultiplier"); if (Prop != NULL) { - gSettings.MaxMultiplier = (UINT8)GetPropertyInteger (Prop, gSettings.MaxMultiplier); + gSettings.MaxMultiplier = (UINT8)GetPropertyInteger(Prop, gSettings.MaxMultiplier); DBG ("MaxMultiplier: %d\n", gSettings.MaxMultiplier); } - Prop = GetProperty (Dict2, "PluginType"); + Prop = GetProperty(Dict2, "PluginType"); if (Prop != NULL) { - gSettings.PluginType = (UINT8)GetPropertyInteger (Prop, gSettings.PluginType); + gSettings.PluginType = (UINT8)GetPropertyInteger(Prop, gSettings.PluginType); DBG ("PluginType: %d\n", gSettings.PluginType); } } - // Prop = GetProperty (DictPointer, "DropMCFG"); + // Prop = GetProperty(DictPointer, "DropMCFG"); // gSettings.DropMCFG = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "ResetAddress"); + Prop = GetProperty(DictPointer, "ResetAddress"); if (Prop) { - gSettings.ResetAddr = (UINT32)GetPropertyInteger (Prop, 0x64); + gSettings.ResetAddr = (UINT32)GetPropertyInteger(Prop, 0x64); DBG ("ResetAddr: 0x%llX\n", gSettings.ResetAddr); if (gSettings.ResetAddr == 0x64) { @@ -5526,37 +5526,37 @@ GetUserSettings( DBG ("Calc ResetVal: 0x%hhX\n", gSettings.ResetVal); } - Prop = GetProperty (DictPointer, "ResetValue"); + Prop = GetProperty(DictPointer, "ResetValue"); if (Prop) { - gSettings.ResetVal = (UINT8)GetPropertyInteger (Prop, gSettings.ResetVal); + gSettings.ResetVal = (UINT8)GetPropertyInteger(Prop, gSettings.ResetVal); DBG ("ResetVal: 0x%hhX\n", gSettings.ResetVal); } //other known pair is 0x0CF9/0x06. What about 0x92/0x01 ? - Prop = GetProperty (DictPointer, "HaltEnabler"); + Prop = GetProperty(DictPointer, "HaltEnabler"); gSettings.SlpSmiEnable = IsPropertyTrue (Prop); // - Prop = GetProperty (DictPointer, "FixHeaders"); + Prop = GetProperty(DictPointer, "FixHeaders"); gSettings.FixHeaders = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "FixMCFG"); + Prop = GetProperty(DictPointer, "FixMCFG"); gSettings.FixMCFG = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "DisableASPM"); + Prop = GetProperty(DictPointer, "DisableASPM"); gSettings.NoASPM = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "smartUPS"); + Prop = GetProperty(DictPointer, "smartUPS"); if (Prop) { gSettings.smartUPS = IsPropertyTrue (Prop); DBG ("smartUPS: present\n"); } - Prop = GetProperty (DictPointer, "PatchAPIC"); + Prop = GetProperty(DictPointer, "PatchAPIC"); gSettings.PatchNMI = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "SortedOrder"); + Prop = GetProperty(DictPointer, "SortedOrder"); if (Prop) { INTN i, Count = GetTagCount (Prop); Prop2 = NULL; @@ -5565,18 +5565,18 @@ GetUserSettings( gSettings.SortedACPI = (__typeof__(gSettings.SortedACPI))AllocateZeroPool (Count * sizeof(CHAR16 *)); for (i = 0; i < Count; i++) { - if (!EFI_ERROR (GetElement (Prop, i, &Prop2)) && + if (!EFI_ERROR(GetElement (Prop, i, &Prop2)) && (Prop2 != NULL) && (Prop2->type == kTagTypeString)) { - gSettings.SortedACPI[gSettings.SortedACPICount++] = PoolPrint (L"%a", Prop2->string); + gSettings.SortedACPI[gSettings.SortedACPICount++] = PoolPrint(L"%a", Prop2->string); } } } } - Prop = GetProperty (DictPointer, "AutoMerge"); + Prop = GetProperty(DictPointer, "AutoMerge"); gSettings.AutoMerge = IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "DisabledAML"); + Prop = GetProperty(DictPointer, "DisabledAML"); if (Prop) { INTN i, Count = GetTagCount (Prop); Prop2 = NULL; @@ -5586,11 +5586,11 @@ GetUserSettings( if (gSettings.DisabledAML) { for (i = 0; i < Count; i++) { - if (!EFI_ERROR (GetElement (Prop, i, &Prop2)) && + if (!EFI_ERROR(GetElement (Prop, i, &Prop2)) && (Prop2 != NULL) && (Prop2->type == kTagTypeString) ) { - gSettings.DisabledAML[gSettings.DisabledAMLCount++] = PoolPrint (L"%a", Prop2->string); + gSettings.DisabledAML[gSettings.DisabledAMLCount++] = PoolPrint(L"%a", Prop2->string); } } } @@ -5627,10 +5627,10 @@ GetUserSettings( } //*** SMBIOS ***// - DictPointer = GetProperty (Dict, "SMBIOS"); + DictPointer = GetProperty(Dict, "SMBIOS"); if (DictPointer != NULL) { ParseSMBIOSSettings(DictPointer); - Prop = GetProperty (DictPointer, "Trust"); + Prop = GetProperty(DictPointer, "Trust"); if (Prop != NULL) { if (IsPropertyFalse (Prop)) { gSettings.TrustSMBIOS = FALSE; @@ -5652,16 +5652,16 @@ GetUserSettings( gSettings.InjectMemoryTables = FALSE; // Inject memory tables into SMBIOS - Prop = GetProperty (DictPointer, "Memory"); + Prop = GetProperty(DictPointer, "Memory"); if (Prop != NULL){ // Get memory table count - Prop2 = GetProperty (Prop, "SlotCount"); - gRAM.UserInUse = (UINT8)GetPropertyInteger (Prop2, 0); + Prop2 = GetProperty(Prop, "SlotCount"); + gRAM.UserInUse = (UINT8)GetPropertyInteger(Prop2, 0); // Get memory channels - Prop2 = GetProperty (Prop, "Channels"); - gRAM.UserChannels = (UINT8)GetPropertyInteger (Prop2, 0); + Prop2 = GetProperty(Prop, "Channels"); + gRAM.UserChannels = (UINT8)GetPropertyInteger(Prop2, 0); // Get memory tables - Prop2 = GetProperty (Prop, "Modules"); + Prop2 = GetProperty(Prop, "Modules"); if (Prop2 != NULL) { INTN Count = GetTagCount (Prop2); Prop3 = NULL; @@ -5669,7 +5669,7 @@ GetUserSettings( for (i = 0; i < Count; i++) { UINT8 Slot = MAX_RAM_SLOTS; RAM_SLOT_INFO *SlotPtr; - if (EFI_ERROR (GetElement (Prop2, i, &Prop3))) { + if (EFI_ERROR(GetElement (Prop2, i, &Prop3))) { continue; } @@ -5677,7 +5677,7 @@ GetUserSettings( break; } // Get memory slot - Dict2 = GetProperty (Prop3, "Slot"); + Dict2 = GetProperty(Prop3, "Slot"); if (Dict2 == NULL) { continue; } @@ -5697,29 +5697,29 @@ GetUserSettings( SlotPtr = &gRAM.User[Slot]; // Get memory size - Dict2 = GetProperty (Prop3, "Size"); - SlotPtr->ModuleSize = (UINT32)GetPropertyInteger (Dict2, SlotPtr->ModuleSize); + Dict2 = GetProperty(Prop3, "Size"); + SlotPtr->ModuleSize = (UINT32)GetPropertyInteger(Dict2, SlotPtr->ModuleSize); // Get memory frequency - Dict2 = GetProperty (Prop3, "Frequency"); - SlotPtr->Frequency = (UINT32)GetPropertyInteger (Dict2, SlotPtr->Frequency); + Dict2 = GetProperty(Prop3, "Frequency"); + SlotPtr->Frequency = (UINT32)GetPropertyInteger(Dict2, SlotPtr->Frequency); // Get memory vendor - Dict2 = GetProperty (Prop3, "Vendor"); + Dict2 = GetProperty(Prop3, "Vendor"); if (Dict2 && Dict2->type == kTagTypeString && Dict2->string != NULL) { SlotPtr->Vendor = (__typeof__(SlotPtr->Vendor))AllocateCopyPool(AsciiStrSize(Dict2->string), Dict2->string); } // Get memory part number - Dict2 = GetProperty (Prop3, "Part"); + Dict2 = GetProperty(Prop3, "Part"); if (Dict2 && Dict2->type == kTagTypeString && Dict2->string != NULL) { SlotPtr->PartNo = (__typeof__(SlotPtr->PartNo))AllocateCopyPool(AsciiStrSize(Dict2->string), Dict2->string); } // Get memory serial number - Dict2 = GetProperty (Prop3, "Serial"); + Dict2 = GetProperty(Prop3, "Serial"); if (Dict2 && Dict2->type == kTagTypeString && Dict2->string != NULL) { SlotPtr->SerialNo = (__typeof__(SlotPtr->SerialNo))AllocateCopyPool(AsciiStrSize(Dict2->string), Dict2->string); } // Get memory type SlotPtr->Type = MemoryTypeDdr3; - Dict2 = GetProperty (Prop3, "Type"); + Dict2 = GetProperty(Prop3, "Type"); if (Dict2 && Dict2->type == kTagTypeString && Dict2->string != NULL) { if (AsciiStriCmp (Dict2->string, "DDR2") == 0) { SlotPtr->Type = MemoryTypeDdr2; @@ -5746,14 +5746,14 @@ GetUserSettings( } } - Prop = GetProperty (DictPointer, "Slots"); + Prop = GetProperty(DictPointer, "Slots"); if (Prop != NULL) { INTN DeviceN; INTN Count = GetTagCount (Prop); Prop3 = NULL; for (INTN Index = 0; Index < Count; ++Index) { - if (EFI_ERROR (GetElement (Prop, Index, &Prop3))) { + if (EFI_ERROR(GetElement (Prop, Index, &Prop3))) { continue; } if (Prop3 == NULL) { @@ -5764,7 +5764,7 @@ GetUserSettings( DBG ("Slots->Devices:\n"); } - Prop2 = GetProperty (Prop3, "Device"); + Prop2 = GetProperty(Prop3, "Device"); DeviceN = -1; if (Prop2 && (Prop2->type == kTagTypeString) && Prop2->string) { if (AsciiStriCmp (Prop2->string, "ATI") == 0) { @@ -5796,11 +5796,11 @@ GetUserSettings( if (DeviceN >= 0) { SLOT_DEVICE *SlotDevice = &SlotDevices[DeviceN]; - Prop2 = GetProperty (Prop3, "ID"); - SlotDevice->SlotID = (UINT8)GetPropertyInteger (Prop2, DeviceN); + Prop2 = GetProperty(Prop3, "ID"); + SlotDevice->SlotID = (UINT8)GetPropertyInteger(Prop2, DeviceN); SlotDevice->SlotType = SlotTypePci; - Prop2 = GetProperty (Prop3, "Type"); + Prop2 = GetProperty(Prop3, "Type"); if (Prop2 != NULL) { switch ((UINT8)GetPropertyInteger(Prop2, 0)) { case 0: @@ -5832,7 +5832,7 @@ GetUserSettings( break; } } - Prop2 = GetProperty (Prop3, "Name"); + Prop2 = GetProperty(Prop3, "Name"); if (Prop2 && (Prop2->type == kTagTypeString) && Prop2->string) { snprintf (SlotDevice->SlotName, 31, "%s", Prop2->string); } else { @@ -5846,81 +5846,81 @@ GetUserSettings( } //CPU - DictPointer = GetProperty (Dict, "CPU"); + DictPointer = GetProperty(Dict, "CPU"); if (DictPointer != NULL) { - Prop = GetProperty (DictPointer, "QPI"); + Prop = GetProperty(DictPointer, "QPI"); if (Prop != NULL) { - gSettings.QPI = (UINT16)GetPropertyInteger (Prop, gSettings.QPI); + gSettings.QPI = (UINT16)GetPropertyInteger(Prop, gSettings.QPI); DBG ("QPI: %dMHz\n", gSettings.QPI); } - Prop = GetProperty (DictPointer, "FrequencyMHz"); + Prop = GetProperty(DictPointer, "FrequencyMHz"); if (Prop != NULL) { - gSettings.CpuFreqMHz = (UINT32)GetPropertyInteger (Prop, gSettings.CpuFreqMHz); + gSettings.CpuFreqMHz = (UINT32)GetPropertyInteger(Prop, gSettings.CpuFreqMHz); DBG ("CpuFreq: %dMHz\n", gSettings.CpuFreqMHz); } - Prop = GetProperty (DictPointer, "Type"); + Prop = GetProperty(DictPointer, "Type"); gSettings.CpuType = GetAdvancedCpuType(); if (Prop != NULL) { - gSettings.CpuType = (UINT16)GetPropertyInteger (Prop, gSettings.CpuType); + gSettings.CpuType = (UINT16)GetPropertyInteger(Prop, gSettings.CpuType); DBG ("CpuType: %hX\n", gSettings.CpuType); } - Prop = GetProperty (DictPointer, "QEMU"); + Prop = GetProperty(DictPointer, "QEMU"); gSettings.QEMU = IsPropertyTrue (Prop); if (gSettings.QEMU) { DBG ("QEMU: true\n"); } - Prop = GetProperty (DictPointer, "UseARTFrequency"); + Prop = GetProperty(DictPointer, "UseARTFrequency"); gSettings.UseARTFreq = IsPropertyTrue (Prop); gSettings.UserChange = FALSE; - Prop = GetProperty (DictPointer, "BusSpeedkHz"); + Prop = GetProperty(DictPointer, "BusSpeedkHz"); if (Prop != NULL) { - gSettings.BusSpeed = (UINT32)GetPropertyInteger (Prop, gSettings.BusSpeed); + gSettings.BusSpeed = (UINT32)GetPropertyInteger(Prop, gSettings.BusSpeed); DBG ("BusSpeed: %dkHz\n", gSettings.BusSpeed); gSettings.UserChange = TRUE; } - Prop = GetProperty (DictPointer, "C6"); + Prop = GetProperty(DictPointer, "C6"); if (Prop != NULL) { gSettings.EnableC6 = IsPropertyTrue (Prop); } - Prop = GetProperty (DictPointer, "C4"); + Prop = GetProperty(DictPointer, "C4"); if (Prop != NULL) { gSettings.EnableC4 = IsPropertyTrue (Prop); } - Prop = GetProperty (DictPointer, "C2"); + Prop = GetProperty(DictPointer, "C2"); if (Prop != NULL) { gSettings.EnableC2 = IsPropertyTrue (Prop); } //Usually it is 0x03e9, but if you want Turbo, you may set 0x00FA - Prop = GetProperty (DictPointer, "Latency"); - gSettings.C3Latency = (UINT16)GetPropertyInteger (Prop, gSettings.C3Latency); + Prop = GetProperty(DictPointer, "Latency"); + gSettings.C3Latency = (UINT16)GetPropertyInteger(Prop, gSettings.C3Latency); - Prop = GetProperty (DictPointer, "SavingMode"); - gSettings.SavingMode = (UINT8)GetPropertyInteger (Prop, 0xFF); //the default value means not set + Prop = GetProperty(DictPointer, "SavingMode"); + gSettings.SavingMode = (UINT8)GetPropertyInteger(Prop, 0xFF); //the default value means not set - Prop = GetProperty (DictPointer, "HWPEnable"); + Prop = GetProperty(DictPointer, "HWPEnable"); if (Prop && IsPropertyTrue (Prop) && (gCPUStructure.Model >= CPU_MODEL_SKYLAKE_U)) { gSettings.HWP = TRUE; AsmWriteMsr64 (MSR_IA32_PM_ENABLE, 1); } - Prop = GetProperty (DictPointer, "HWPValue"); + Prop = GetProperty(DictPointer, "HWPValue"); if (Prop && gSettings.HWP) { gSettings.HWPValue = (UINT32)GetPropertyInteger(Prop, 0); AsmWriteMsr64 (MSR_IA32_HWP_REQUEST, gSettings.HWPValue); } - Prop = GetProperty (DictPointer, "TDP"); - gSettings.TDP = (UINT8)GetPropertyInteger (Prop, 0); + Prop = GetProperty(DictPointer, "TDP"); + gSettings.TDP = (UINT8)GetPropertyInteger(Prop, 0); - Prop = GetProperty (DictPointer, "TurboDisable"); + Prop = GetProperty(DictPointer, "TurboDisable"); if (Prop && IsPropertyTrue (Prop)) { UINT64 msr = AsmReadMsr64(MSR_IA32_MISC_ENABLE); gSettings.Turbo = 0; @@ -5930,10 +5930,10 @@ GetUserSettings( } // RtVariables - DictPointer = GetProperty (Dict, "RtVariables"); + DictPointer = GetProperty(Dict, "RtVariables"); if (DictPointer != NULL) { // ROM: bin data or base 64 encoded bin data - Prop = GetProperty (DictPointer, "ROM"); + Prop = GetProperty(DictPointer, "ROM"); if (Prop != NULL) { if (AsciiStriCmp (Prop->string, "UseMacAddr0") == 0) { gSettings.RtROM = &gLanMac[0][0]; @@ -5954,24 +5954,24 @@ GetUserSettings( } // MLB: some value - Prop = GetProperty (DictPointer, "MLB"); + Prop = GetProperty(DictPointer, "MLB"); if (Prop != NULL && AsciiStrLen (Prop->string) > 0) { gSettings.RtMLB = (__typeof__(gSettings.RtMLB))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } // CsrActiveConfig - Prop = GetProperty (DictPointer, "CsrActiveConfig"); - gSettings.CsrActiveConfig = (UINT32)GetPropertyInteger (Prop, 0x267); //the value 0xFFFF means not set + Prop = GetProperty(DictPointer, "CsrActiveConfig"); + gSettings.CsrActiveConfig = (UINT32)GetPropertyInteger(Prop, 0x267); //the value 0xFFFF means not set //BooterConfig - Prop = GetProperty (DictPointer, "BooterConfig"); - gSettings.BooterConfig = (UINT16)GetPropertyInteger (Prop, 0); //the value 0 means not set + Prop = GetProperty(DictPointer, "BooterConfig"); + gSettings.BooterConfig = (UINT16)GetPropertyInteger(Prop, 0); //the value 0 means not set //let it be string like "log=0" - Prop = GetProperty (DictPointer, "BooterCfg"); + Prop = GetProperty(DictPointer, "BooterCfg"); if (Prop != NULL && AsciiStrLen (Prop->string) > 0) { AsciiStrCpyS (gSettings.BooterCfgStr, 64, Prop->string); } //Block external variables - Prop = GetProperty (DictPointer, "Block"); + Prop = GetProperty(DictPointer, "Block"); if (Prop != NULL) { INTN i, Count = GetTagCount (Prop); CHAR16 UStr[64]; @@ -5980,7 +5980,7 @@ GetUserSettings( for (i = 0; i < Count; i++) { Status = GetElement (Prop, i, &Dict); if (!EFI_ERROR(Status)) { - Prop2 = GetProperty (Dict, "Comment"); + Prop2 = GetProperty(Dict, "Comment"); if (Prop2 && Prop2->string) { DBG(" %s\n", Prop2->string); } @@ -6030,22 +6030,22 @@ GetUserSettings( gSettings.InjectSystemID = TRUE; // SystemParameters again - values that can depend on previous params - DictPointer = GetProperty (Dict, "SystemParameters"); + DictPointer = GetProperty(Dict, "SystemParameters"); if (DictPointer != NULL) { //BacklightLevel - Prop = GetProperty (DictPointer, "BacklightLevel"); + Prop = GetProperty(DictPointer, "BacklightLevel"); if (Prop != NULL) { - gSettings.BacklightLevel = (UINT16)GetPropertyInteger (Prop, gSettings.BacklightLevel); + gSettings.BacklightLevel = (UINT16)GetPropertyInteger(Prop, gSettings.BacklightLevel); gSettings.BacklightLevelConfig = TRUE; } - Prop = GetProperty (DictPointer, "CustomUUID"); + Prop = GetProperty(DictPointer, "CustomUUID"); if (Prop != NULL) { if (IsValidGuidAsciiString (Prop->string)) { AsciiStrToUnicodeStrS(Prop->string, gSettings.CustomUuid, 40); DBG("Converted CustomUUID %ls\n", gSettings.CustomUuid); Status = StrToGuidLE (gSettings.CustomUuid, &gUuid); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { IsValidCustomUUID = TRUE; // if CustomUUID specified, then default for InjectSystemID=FALSE // to stay compatibile with previous Clover behaviour @@ -6061,28 +6061,28 @@ GetUserSettings( //else gUuid value from SMBIOS // DBG("Finally use %s\n", strguid(&gUuid)); - Prop = GetProperty (DictPointer, "InjectSystemID"); + Prop = GetProperty(DictPointer, "InjectSystemID"); gSettings.InjectSystemID = gSettings.InjectSystemID ? !IsPropertyFalse(Prop) : IsPropertyTrue (Prop); - Prop = GetProperty (DictPointer, "NvidiaWeb"); + Prop = GetProperty(DictPointer, "NvidiaWeb"); gSettings.NvidiaWeb = IsPropertyTrue (Prop); } - DictPointer = GetProperty (Dict, "BootGraphics"); + DictPointer = GetProperty(Dict, "BootGraphics"); if (DictPointer != NULL) { - Prop = GetProperty (DictPointer, "DefaultBackgroundColor"); - gSettings.DefaultBackgroundColor = (UINT32)GetPropertyInteger (Prop, 0x80000000); //the value 0x80000000 means not set + Prop = GetProperty(DictPointer, "DefaultBackgroundColor"); + gSettings.DefaultBackgroundColor = (UINT32)GetPropertyInteger(Prop, 0x80000000); //the value 0x80000000 means not set - Prop = GetProperty (DictPointer, "UIScale"); - gSettings.UIScale = (UINT32)GetPropertyInteger (Prop, 0x80000000); + Prop = GetProperty(DictPointer, "UIScale"); + gSettings.UIScale = (UINT32)GetPropertyInteger(Prop, 0x80000000); - Prop = GetProperty (DictPointer, "EFILoginHiDPI"); - gSettings.EFILoginHiDPI = (UINT32)GetPropertyInteger (Prop, 0x80000000); + Prop = GetProperty(DictPointer, "EFILoginHiDPI"); + gSettings.EFILoginHiDPI = (UINT32)GetPropertyInteger(Prop, 0x80000000); - Prop = GetProperty (DictPointer, "flagstate"); - *(UINT32*)&gSettings.flagstate[0] = (UINT32)GetPropertyInteger (Prop, 0x80000000); + Prop = GetProperty(DictPointer, "flagstate"); + *(UINT32*)&gSettings.flagstate[0] = (UINT32)GetPropertyInteger(Prop, 0x80000000); } /* @@ -6095,7 +6095,7 @@ GetUserSettings( - DictPointer = GetProperty (Dict, "SMCKeys"); + DictPointer = GetProperty(Dict, "SMCKeys"); if (DictPointer != NULL) { //sss TagPtr Key, ValArray; for (Key = DictPointer->tag; Key != NULL; Key = Key->tagNext) { @@ -6121,7 +6121,7 @@ GetUserSettings( */ if (gBootChanged) { - DictPointer = GetProperty (Dict, "KernelAndKextPatches"); + DictPointer = GetProperty(Dict, "KernelAndKextPatches"); if (DictPointer != NULL) { DBG("refill kernel patches bcoz gBootChanged\n"); FillinKextPatches ((KERNEL_AND_KEXT_PATCHES *)(((UINTN)&gSettings) + OFFSET_OF(SETTINGS_DATA, KernelAndKextPatches)), DictPointer); @@ -6133,9 +6133,9 @@ GetUserSettings( if (GlobalConfig.Theme) { FreePool(GlobalConfig.Theme); } - DictPointer = GetProperty (Dict, "GUI"); + DictPointer = GetProperty(Dict, "GUI"); if (DictPointer != NULL) { - Prop = GetProperty (DictPointer, "Theme"); + Prop = GetProperty(DictPointer, "Theme"); if ((Prop != NULL) && (Prop->type == kTagTypeString) && Prop->string) { // GlobalConfig.Theme = XStringW().takeValueFrom(Prop->string).forgetDataWithoutFreeing(); GlobalConfig.Theme = PoolPrint(L"%a", Prop->string); @@ -6193,12 +6193,12 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry) if (SystemPlists[i] != NULL) { // found macOS System Status = egLoadFile (Entry->Volume->RootDir, SystemPlists[i], (UINT8 **)&PlistBuffer, &PlistLen); - if (!EFI_ERROR (Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { - Prop = GetProperty (Dict, "ProductVersion"); + if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { + Prop = GetProperty(Dict, "ProductVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { OSVersion = (__typeof__(OSVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } - Prop = GetProperty (Dict, "ProductBuildVersion"); + Prop = GetProperty(Dict, "ProductBuildVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { Entry->BuildVersion = (__typeof__(Entry->BuildVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } @@ -6224,12 +6224,12 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry) } if (FileExists (Entry->Volume->RootDir, InstallerPlist)) { Status = egLoadFile (Entry->Volume->RootDir, InstallerPlist, (UINT8 **)&PlistBuffer, &PlistLen); - if (!EFI_ERROR (Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { - Prop = GetProperty (Dict, "ProductVersion"); + if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { + Prop = GetProperty(Dict, "ProductVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { OSVersion = (__typeof__(OSVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } - Prop = GetProperty (Dict, "ProductBuildVersion"); + Prop = GetProperty(Dict, "ProductBuildVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { Entry->BuildVersion = (__typeof__(Entry->BuildVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } @@ -6242,8 +6242,8 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry) InstallerPlist = L"\\.IABootFiles\\com.apple.Boot.plist"; // 10.9 - 10.13.3 if (FileExists (Entry->Volume->RootDir, InstallerPlist)) { Status = egLoadFile (Entry->Volume->RootDir, InstallerPlist, (UINT8 **)&PlistBuffer, &PlistLen); - if (!EFI_ERROR (Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { - Prop = GetProperty (Dict, "Kernel Flags"); + if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { + Prop = GetProperty(Dict, "Kernel Flags"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { if (AsciiStrStr (Prop->string, "Install%20OS%20hhX%20Mavericks.app")) { OSVersion = (__typeof__(OSVersion))AllocateCopyPool (5, "10.9"); @@ -6293,20 +6293,20 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry) } if (FileExists (Entry->Volume->RootDir, InstallerPlist)) { Status = egLoadFile (Entry->Volume->RootDir, InstallerPlist, (UINT8 **)&PlistBuffer, &PlistLen); - if (!EFI_ERROR (Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { - Prop = GetProperty (Dict, "ProductVersion"); + if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { + Prop = GetProperty(Dict, "ProductVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { OSVersion = (__typeof__(OSVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } - Prop = GetProperty (Dict, "ProductBuildVersion"); + Prop = GetProperty(Dict, "ProductBuildVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { Entry->BuildVersion = (__typeof__(Entry->BuildVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } // In InstallInfo.plist, there is no a version key only when updating from AppStore in 10.13+ // If use the startosinstall in 10.13+, this version key exists in InstallInfo.plist - DictPointer = GetProperty (Dict, "System Image Info"); // 10.12+ + DictPointer = GetProperty(Dict, "System Image Info"); // 10.12+ if (DictPointer != NULL) { - Prop = GetProperty (DictPointer, "version"); + Prop = GetProperty(DictPointer, "version"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { OSVersion = (__typeof__(OSVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } @@ -6334,7 +6334,7 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry) } if (FileExists (Entry->Volume->RootDir, InstallerLog)) { Status = egLoadFile(Entry->Volume->RootDir, InstallerLog, (UINT8 **)&fileBuffer, &fileLen); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { targetString = (CHAR8*) AllocateZeroPool(fileLen+1); CopyMem((VOID*)targetString, (VOID*)fileBuffer, fileLen); // s = SearchString(targetString, fileLen, "Running OS Build: Mac OS X ", 27); @@ -6402,12 +6402,12 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry) if (InstallPlists[i] != NULL) { Status = egLoadFile (Entry->Volume->RootDir, InstallPlists[i], (UINT8 **)&PlistBuffer, &PlistLen); - if (!EFI_ERROR (Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { - Prop = GetProperty (Dict, "ProductVersion"); + if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { + Prop = GetProperty(Dict, "ProductVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { OSVersion = (__typeof__(OSVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } - Prop = GetProperty (Dict, "ProductBuildVersion"); + Prop = GetProperty(Dict, "ProductBuildVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { Entry->BuildVersion = (__typeof__(Entry->BuildVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } @@ -6425,12 +6425,12 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry) if (RecoveryPlists[j] != NULL) { Status = egLoadFile (Entry->Volume->RootDir, RecoveryPlists[j], (UINT8 **)&PlistBuffer, &PlistLen); - if (!EFI_ERROR (Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { - Prop = GetProperty (Dict, "ProductVersion"); + if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) { + Prop = GetProperty(Dict, "ProductVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { OSVersion = (__typeof__(OSVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } - Prop = GetProperty (Dict, "ProductBuildVersion"); + Prop = GetProperty(Dict, "ProductBuildVersion"); if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') { Entry->BuildVersion = (__typeof__(Entry->BuildVersion))AllocateCopyPool (AsciiStrSize (Prop->string), Prop->string); } @@ -6442,7 +6442,7 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry) } if (PlistBuffer != NULL) { - FreePool (PlistBuffer); + FreePool(PlistBuffer); } return OSVersion; @@ -6572,20 +6572,20 @@ GetRootUUID (IN REFIT_VOLUME *Volume) Status = egLoadFile (Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen); } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Dict = NULL; if (ParseXML (PlistBuffer, &Dict, 0) != EFI_SUCCESS) { - FreePool (PlistBuffer); + FreePool(PlistBuffer); return EFI_NOT_FOUND; } - Prop = GetProperty (Dict, "Root UUID"); + Prop = GetProperty(Dict, "Root UUID"); if (Prop != NULL) { AsciiStrToUnicodeStrS(Prop->string, Uuid, 40); Status = StrToGuidLE (Uuid, &Volume->RootUUID); } - FreePool (PlistBuffer); + FreePool(PlistBuffer); } return Status; @@ -6636,10 +6636,10 @@ GetDevices () &HandleArray ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleCount; ++Index) { Status = gBS->HandleProtocol(HandleArray[Index], &gEfiPciIoProtocolGuid, (VOID **)&PciIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // Read PCI BUS PciIo->GetLocation (PciIo, &Segment, &Bus, &Device, &Function); Status = PciIo->Pci.Read ( @@ -6943,7 +6943,7 @@ GetDevices () UINT8 Value = 0; Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x44, 1, &Value); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -7038,13 +7038,13 @@ SetDevices (LOADER_ENTRY *Entry) &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (i = 0; i < HandleCount; i++) { Status = gBS->HandleProtocol (HandleBuffer[i], &gEfiPciIoProtocolGuid, (VOID **)&PciIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // Read PCI BUS Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, 0, sizeof (Pci) / sizeof (UINT32), &Pci); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { continue; } @@ -7746,7 +7746,7 @@ SetDevices (LOADER_ENTRY *Entry) Rcba = 0; /* Scan Port */ Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, 0xF0, 1, &Rcba); - if (EFI_ERROR (Status)) continue; + if (EFI_ERROR(Status)) continue; // Rcba &= 0xFFFFC000; if ((Rcba & 0xFFFFC000) == 0) { MsgLog (" RCBA disabled; cannot use it\n"); @@ -7803,7 +7803,7 @@ SetDevices (LOADER_ENTRY *Entry) &BufferPtr ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { mProperties = (UINT8*)(UINTN)BufferPtr; gDeviceProperties = devprop_generate_string (device_inject_string); gDeviceProperties[device_inject_stringlength] = 0; @@ -7943,12 +7943,12 @@ CHAR16 { CHAR16 *SrcDir = NULL; - SrcDir = PoolPrint (L"%s\\kexts\\%a", OEMPath, On?"Other":"Off"); + SrcDir = PoolPrint(L"%s\\kexts\\%a", OEMPath, On?"Other":"Off"); if (!FileExists (SelfVolume->RootDir, SrcDir)) { - FreePool (SrcDir); - SrcDir = PoolPrint (L"\\EFI\\CLOVER\\kexts\\%a", On?"Other":"Off"); + FreePool(SrcDir); + SrcDir = PoolPrint(L"\\EFI\\CLOVER\\kexts\\%a", On?"Other":"Off"); if (!FileExists (SelfVolume->RootDir, SrcDir)) { - FreePool (SrcDir); + FreePool(SrcDir); SrcDir = NULL; } } @@ -7985,12 +7985,12 @@ CHAR16 // find source injection folder with kexts // note: we are just checking for existance of particular folder, not checking if it is empty or not // check OEM subfolders: version specific or default to Other - SrcDir = PoolPrint (L"%s\\kexts\\%a", OEMPath, FixedVersion); + SrcDir = PoolPrint(L"%s\\kexts\\%a", OEMPath, FixedVersion); if (!FileExists (SelfVolume->RootDir, SrcDir)) { - FreePool (SrcDir); - SrcDir = PoolPrint (L"\\EFI\\CLOVER\\kexts\\%a", FixedVersion); + FreePool(SrcDir); + SrcDir = PoolPrint(L"\\EFI\\CLOVER\\kexts\\%a", FixedVersion); if (!FileExists (SelfVolume->RootDir, SrcDir)) { - FreePool (SrcDir); + FreePool(SrcDir); SrcDir = NULL; } } @@ -8004,7 +8004,7 @@ InjectKextsFromDir ( ) { - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { MsgLog (" - ERROR: Kext injection failed!\n"); return EFI_NOT_STARTED; } @@ -8043,7 +8043,7 @@ SetFSInjection ( // get FSINJECTION_PROTOCOL Status = gBS->LocateProtocol(&gFSInjectProtocolGuid, NULL, (void **)&FSInject); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { //Print (L"- No FSINJECTION_PROTOCOL, Status = %s\n", strerror(Status)); MsgLog (" - ERROR: gFSInjectProtocolGuid not found!\n"); return EFI_NOT_STARTED; @@ -8110,7 +8110,7 @@ SetFSInjection ( FSInject->AddStringToList(Blacklist, L"\\System\\Library\\Caches\\com.apple.kext.caches\\Startup\\kernelcache"); // 10.6/10.6 - 10.9 if (gSettings.BlockKexts[0] != L'\0') { - FSInject->AddStringToList(Blacklist, PoolPrint (L"\\System\\Library\\Extensions\\%s", gSettings.BlockKexts)); + FSInject->AddStringToList(Blacklist, PoolPrint(L"\\System\\Library\\Extensions\\%s", gSettings.BlockKexts)); } } @@ -8130,7 +8130,7 @@ SetFSInjection ( ); //InjectKextsFromDir(Status, GetOtherKextsDir()); InjectKextsFromDir(Status, SrcDir); - FreePool (SrcDir); + FreePool(SrcDir); SrcDir = GetOSVersionKextsDir (Entry->OSVersion); Status = FSInject->Install ( diff --git a/rEFIt_UEFI/Platform/card_vlist.cpp b/rEFIt_UEFI/Platform/card_vlist.cpp index 0ae8db5b7..c0c351dda 100644 --- a/rEFIt_UEFI/Platform/card_vlist.cpp +++ b/rEFIt_UEFI/Platform/card_vlist.cpp @@ -136,19 +136,19 @@ VOID FillCardList(TagPtr CfgDict) model_name = "VideoCard"; } - prop2 = GetProperty (element, "IOPCIPrimaryMatch"); - dev_id = (UINT32)GetPropertyInteger (prop2, 0); + prop2 = GetProperty(element, "IOPCIPrimaryMatch"); + dev_id = (UINT32)GetPropertyInteger(prop2, 0); - prop2 = GetProperty (element, "IOPCISubDevId"); - subdev_id = (UINT32)GetPropertyInteger (prop2, 0); + prop2 = GetProperty(element, "IOPCISubDevId"); + subdev_id = (UINT32)GetPropertyInteger(prop2, 0); - prop2 = GetProperty (element, "VRAM"); + prop2 = GetProperty(element, "VRAM"); VramSize = LShiftU64((UINTN)GetPropertyInteger(prop2, (INTN)VramSize), 20); //Mb -> bytes - prop2 = GetProperty (element, "VideoPorts"); - VideoPorts = (UINT16)GetPropertyInteger (prop2, VideoPorts); + prop2 = GetProperty(element, "VideoPorts"); + VideoPorts = (UINT16)GetPropertyInteger(prop2, VideoPorts); - prop2 = GetProperty (element, "LoadVBios"); + prop2 = GetProperty(element, "LoadVBios"); if (prop2 != NULL && IsPropertyTrue (prop2)) { LoadVBios = TRUE; } diff --git a/rEFIt_UEFI/Platform/platformdata.cpp b/rEFIt_UEFI/Platform/platformdata.cpp index 6a9369b3a..b99b6ea80 100644 --- a/rEFIt_UEFI/Platform/platformdata.cpp +++ b/rEFIt_UEFI/Platform/platformdata.cpp @@ -1315,7 +1315,7 @@ MACHINE_TYPES GetModelFromString(CHAR8 *ProductName) MACHINE_TYPES i; for (i = (MACHINE_TYPES)(0); i < MaxMachineType; i = (MACHINE_TYPES)(i + 1)) { - if (AsciiStrCmp (ApplePlatformData[i].productName, ProductName) == 0) { + if (AsciiStrCmp(ApplePlatformData[i].productName, ProductName) == 0) { return i; } } diff --git a/rEFIt_UEFI/Platform/plist.cpp b/rEFIt_UEFI/Platform/plist.cpp index d8149cc2e..81f16b05f 100755 --- a/rEFIt_UEFI/Platform/plist.cpp +++ b/rEFIt_UEFI/Platform/plist.cpp @@ -1132,7 +1132,7 @@ IsPropertyFalse ( 0x12abd */ INTN -GetPropertyInteger ( +GetPropertyInteger( TagPtr Prop, INTN Default ) diff --git a/rEFIt_UEFI/Platform/plist.h b/rEFIt_UEFI/Platform/plist.h index f25740f7a..d583f1876 100644 --- a/rEFIt_UEFI/Platform/plist.h +++ b/rEFIt_UEFI/Platform/plist.h @@ -71,7 +71,7 @@ ParseXML ( //VOID RenderSVGfont(NSVGfont *fontSVG); TagPtr -GetProperty ( +GetProperty( TagPtr dict, CONST CHAR8* key ); @@ -119,7 +119,7 @@ IsPropertyFalse ( ); INTN -GetPropertyInteger ( +GetPropertyInteger( TagPtr Prop, INTN Default ); diff --git a/rEFIt_UEFI/Platform/smbios.cpp b/rEFIt_UEFI/Platform/smbios.cpp index 2d98f17b0..8c99cca3a 100644 --- a/rEFIt_UEFI/Platform/smbios.cpp +++ b/rEFIt_UEFI/Platform/smbios.cpp @@ -2016,11 +2016,11 @@ EFI_STATUS PrepatchSmbios() BufferPtr = EFI_SYSTEM_TABLE_MAX_ADDRESS; Status = gBS->AllocatePages (AllocateMaxAddress, EfiACPIMemoryNVS, /*EfiACPIReclaimMemory, */ EFI_SIZE_TO_PAGES(BufferLen), &BufferPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG("There is error allocating pages in EfiACPIMemoryNVS!\n"); Status = gBS->AllocatePages (AllocateMaxAddress, /*EfiACPIMemoryNVS, */EfiACPIReclaimMemory, ROUND_PAGE(BufferLen)/EFI_PAGE_SIZE, &BufferPtr); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { // DBG("There is error allocating pages in EfiACPIReclaimMemory!\n"); } } diff --git a/rEFIt_UEFI/Platform/spd.cpp b/rEFIt_UEFI/Platform/spd.cpp index fd8b47fd0..96f31f752 100644 --- a/rEFIt_UEFI/Platform/spd.cpp +++ b/rEFIt_UEFI/Platform/spd.cpp @@ -882,10 +882,10 @@ VOID ScanSPD() &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleCount; ++Index) { Status = gBS->HandleProtocol(HandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID **)&PciIo); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // Read PCI BUS //PciIo->GetLocation (PciIo, &Segment, &Bus, &Device, &Function); Status = PciIo->Pci.Read ( diff --git a/rEFIt_UEFI/Platform/usbfix.cpp b/rEFIt_UEFI/Platform/usbfix.cpp index 62b7ff346..5e5739c5d 100644 --- a/rEFIt_UEFI/Platform/usbfix.cpp +++ b/rEFIt_UEFI/Platform/usbfix.cpp @@ -76,14 +76,14 @@ FixOwnership(VOID) &HandleArrayCount, &HandleArray ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleArrayCount; Index++) { Status = gBS->HandleProtocol ( HandleArray[Index], &gEfiPciIoProtocolGuid, (VOID **)&PciIo ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { // // Find the USB host controller // @@ -95,7 +95,7 @@ FixOwnership(VOID) &Pci ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if ((PCI_CLASS_SERIAL == Pci.Hdr.ClassCode[2]) && (PCI_CLASS_SERIAL_USB == Pci.Hdr.ClassCode[1])) { switch (Pci.Hdr.ClassCode[0]) { @@ -344,6 +344,6 @@ FixOwnership(VOID) } else { return Status; } - gBS->FreePool (HandleArray); + gBS->FreePool(HandleArray); return Status; } diff --git a/rEFIt_UEFI/cpp_foundation/XStringW.cpp b/rEFIt_UEFI/cpp_foundation/XStringW.cpp index ef9125204..61891ecbe 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringW.cpp +++ b/rEFIt_UEFI/cpp_foundation/XStringW.cpp @@ -424,37 +424,64 @@ bool XStringW::IsDigits(UINTN pos, UINTN count) const return true; } +void XStringW::ToLower(bool FirstCharIsCap) +{ + if ( size() > 0 ) + { + unsigned int ui; + + if ( FirstCharIsCap ) { + // data()[0] = Majuscule(data()[0]); //keep as is + ui = 1; + }else{ + ui = 0; + } + for ( ; ui < size() ; ui++ ) { + m_data[ui] = to_lower(m_data[ui]); + } + } +} + +#if __WCHAR_MIN__ < 0 void XStringW::RemoveLastEspCtrl() { wchar_t *p; if ( size() > 0 ) { p = _data(0) + size() - 1; - #if __WCHAR_MIN__ < 0 if ( *p >= 0 && *p <= ' ' ) { - #else - if ( *p <= ' ' ) { - #endif p -= 1; - #if __WCHAR_MIN__ < 0 while ( p>data() && *p >= 0 && *p <= ' ' ) p -= 1; - #else - while ( p>data() && *p <= ' ' ) p -= 1; - #endif if ( p>data() ) { SetLength( (UINTN)(p-data())+1); }else{ - #if __WCHAR_MIN__ < 0 if ( *p >= 0 && *p <= ' ' ) SetLength(0); - #else - if ( *p <= ' ' ) SetLength(0); - #endif else SetLength(1); } } } } +#else + void XStringW::RemoveLastEspCtrl() + { + wchar_t *p; + + if ( size() > 0 ) { + p = _data(0) + size() - 1; + if ( *p <= ' ' ) { + p -= 1; + while ( p>data() && *p <= ' ' ) p -= 1; + if ( p>data() ) { + SetLength( (UINTN)(p-data())+1); + }else{ + if ( *p <= ' ' ) SetLength(0); + else SetLength(1); + } + } + } + } +#endif //------------------------------------------------------------------------------------------------- // @@ -595,5 +622,4 @@ XStringW CleanCtrl(const XStringW &S) return ReturnValue; } - #endif diff --git a/rEFIt_UEFI/cpp_foundation/XStringW.h b/rEFIt_UEFI/cpp_foundation/XStringW.h index 2d612efc1..cb34b82d2 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringW.h +++ b/rEFIt_UEFI/cpp_foundation/XStringW.h @@ -201,6 +201,14 @@ public: friend bool operator >= (const XStringW& s1, const wchar_t* s2 ) { return s1.Compare(s2) >= 0; } friend bool operator >= (const wchar_t* s1, const XStringW& s2) { return s2.Compare(s1) <= 0; } + static wchar_t to_lower(wchar_t ch) { + if (ch <= L'Z') + return ((ch >= L'A') ? ((ch - L'A') + L'a') : ch); + else if (ch == L'Ё') return L'ё'; + else if (ch <= L'Я') + return ((ch >= L'А') ? ((ch - L'А') + L'а') : ch); //русские буквы + else return ch; + } }; extern const XStringW NullXStringW; diff --git a/rEFIt_UEFI/entry_scan/legacy.cpp b/rEFIt_UEFI/entry_scan/legacy.cpp index e1112aacb..6da4fac49 100644 --- a/rEFIt_UEFI/entry_scan/legacy.cpp +++ b/rEFIt_UEFI/entry_scan/legacy.cpp @@ -216,10 +216,11 @@ VOID ScanLegacy(VOID) #endif // skip volume if its kind is configured as disabled - if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || +/* if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || (Volume->DiskKind == DISK_KIND_EXTERNAL && (GlobalConfig.DisableFlags & VOLTYPE_EXTERNAL)) || (Volume->DiskKind == DISK_KIND_INTERNAL && (GlobalConfig.DisableFlags & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (GlobalConfig.DisableFlags & VOLTYPE_FIREWIRE))) + (Volume->DiskKind == DISK_KIND_FIREWIRE && (GlobalConfig.DisableFlags & VOLTYPE_FIREWIRE))) */ + if (((1ull<DiskKind) & GlobalConfig.DisableFlags) != 0) { // DBG(" hidden\n"); continue; @@ -302,27 +303,29 @@ VOID AddCustomLegacy(VOID) DBG(" Checking volume \"%ls\" (%ls) ... ", Volume->VolName, Volume->DevicePathString); // skip volume if its kind is configured as disabled - if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || + /* if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || (Volume->DiskKind == DISK_KIND_EXTERNAL && (GlobalConfig.DisableFlags & VOLTYPE_EXTERNAL)) || (Volume->DiskKind == DISK_KIND_INTERNAL && (GlobalConfig.DisableFlags & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (GlobalConfig.DisableFlags & VOLTYPE_FIREWIRE))) + (Volume->DiskKind == DISK_KIND_FIREWIRE && (GlobalConfig.DisableFlags & VOLTYPE_FIREWIRE))) */ + if (((1ull<DiskKind) & GlobalConfig.DisableFlags) != 0) { DBG("skipped because media is disabled\n"); continue; } if (Custom->VolumeType != 0) { - if ((Volume->DiskKind == DISK_KIND_OPTICAL && ((Custom->VolumeType & VOLTYPE_OPTICAL) == 0)) || + /* if ((Volume->DiskKind == DISK_KIND_OPTICAL && ((Custom->VolumeType & VOLTYPE_OPTICAL) == 0)) || (Volume->DiskKind == DISK_KIND_EXTERNAL && ((Custom->VolumeType & VOLTYPE_EXTERNAL) == 0)) || (Volume->DiskKind == DISK_KIND_INTERNAL && ((Custom->VolumeType & VOLTYPE_INTERNAL) == 0)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && ((Custom->VolumeType & VOLTYPE_FIREWIRE) == 0))) { + (Volume->DiskKind == DISK_KIND_FIREWIRE && ((Custom->VolumeType & VOLTYPE_FIREWIRE) == 0))) */ + if (((1ull<DiskKind) & Custom->VolumeType) == 0) { DBG("skipped because media is ignored\n"); continue; } } - if ((Volume->BootType != BOOTING_BY_PBR) && - (Volume->BootType != BOOTING_BY_MBR) && - (Volume->BootType != BOOTING_BY_CD)) { + if (/*(Volume->BootType != BOOTING_BY_PBR) && */ + (Volume->BootType >= BOOTING_BY_MBR) /*&& + (Volume->BootType != BOOTING_BY_CD)*/ ) { DBG("skipped because volume is not legacy bootable\n"); continue; } diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index 153890d06..b25dce223 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -87,34 +87,36 @@ typedef struct LINUX_PATH_DATA STATIC LINUX_PATH_DATA LinuxEntryData[] = { #if defined(MDE_CPU_X64) - { L"\\EFI\\grub\\grubx64.efi", L"Grub EFI boot menu", L"grub,linux" }, - { L"\\EFI\\Gentoo\\grubx64.efi", L"Gentoo EFI boot menu", L"gentoo,linux", "Gentoo" }, + //comment out all common names +// { L"\\EFI\\grub\\grubx64.efi", L"Grub EFI boot menu", L"grub,linux" }, +// { L"\\EFI\\Gentoo\\grubx64.efi", L"Gentoo EFI boot menu", L"gentoo,linux", "Gentoo" }, { L"\\EFI\\Gentoo\\kernelx64.efi", L"Gentoo EFI kernel", L"gentoo,linux" }, - { L"\\EFI\\RedHat\\grubx64.efi", L"RedHat EFI boot menu", L"redhat,linux", "Redhat" }, - { L"\\EFI\\debian\\grubx64.efi", L"Debian EFI boot menu", L"debian,linux", "Debian" }, - { L"\\EFI\\kali\\grubx64.efi", L"Kali EFI boot menu", L"kali,linux", "Kali" }, - { L"\\EFI\\ubuntu\\grubx64.efi", L"Ubuntu EFI boot menu", L"ubuntu,linux", "Ubuntu" }, - { L"\\EFI\\kubuntu\\grubx64.efi", L"kubuntu EFI boot menu", L"kubuntu,linux", "kubuntu" }, - { L"\\EFI\\LinuxMint\\grubx64.efi", L"Linux Mint EFI boot menu", L"mint,linux", "Linux Mint" }, - { L"\\EFI\\Fedora\\grubx64.efi", L"Fedora EFI boot menu", L"fedora,linux", "Fedora" }, - { L"\\EFI\\opensuse\\grubx64.efi", L"OpenSuse EFI boot menu", L"suse,linux", "openSUSE" }, - { L"\\EFI\\arch\\grubx64.efi", L"ArchLinux EFI boot menu", L"arch,linux" }, - { L"\\EFI\\arch_grub\\grubx64.efi", L"ArchLinux EFI boot menu", L"arch,linux" }, - { L"\\EFI\\ORACLE\\grubx64.efi", L"Oracle Solaris EFI boot menu", L"solaris,linux", "Solaris" }, - { L"\\EFI\\Endless\\grubx64.efi", L"EndlessOS EFI boot menu", L"endless,linux", "EndlessOS" }, - { L"\\EFI\\antergos_grub\\grubx64.efi", L"Antergos EFI boot menu", L"antergos,linux", "Antergos" }, - { L"\\EFI\\Deepin\\grubx64.efi", L"Deepin EFI boot menu", L"deepin,linux", "Deepin" }, - { L"\\EFI\\elementary\\grubx64.efi", L"Elementary EFI boot menu", L"eos,linux", "Elementary" }, - { L"\\EFI\\Manjaro\\grubx64.efi", L"Manjaro EFI boot menu", L"manjaro,linux", "Manjaro" }, - { L"\\EFI\\xubuntu\\grubx64.efi", L"Xubuntu EFI boot menu", L"xubuntu,linux", "Xubuntu" }, - { L"\\EFI\\zorin\\grubx64.efi", L"Zorin EFI boot menu", L"zorin,linux", "Zorin" }, +// { L"\\EFI\\RedHat\\grubx64.efi", L"RedHat EFI boot menu", L"redhat,linux", "Redhat" }, +// { L"\\EFI\\debian\\grubx64.efi", L"Debian EFI boot menu", L"debian,linux", "Debian" }, +// { L"\\EFI\\kali\\grubx64.efi", L"Kali EFI boot menu", L"kali,linux", "Kali" }, +// { L"\\EFI\\ubuntu\\grubx64.efi", L"Ubuntu EFI boot menu", L"ubuntu,linux", "Ubuntu" }, +// { L"\\EFI\\kubuntu\\grubx64.efi", L"kubuntu EFI boot menu", L"kubuntu,linux", "kubuntu" }, +// { L"\\EFI\\LinuxMint\\grubx64.efi", L"Linux Mint EFI boot menu", L"mint,linux", "Linux Mint" }, +// { L"\\EFI\\Fedora\\grubx64.efi", L"Fedora EFI boot menu", L"fedora,linux", "Fedora" }, +// { L"\\EFI\\opensuse\\grubx64.efi", L"OpenSuse EFI boot menu", L"suse,linux", "openSUSE" }, +// { L"\\EFI\\arch\\grubx64.efi", L"ArchLinux EFI boot menu", L"arch,linux" }, +// { L"\\EFI\\arch_grub\\grubx64.efi", L"ArchLinux EFI boot menu", L"arch,linux" }, +// { L"\\EFI\\ORACLE\\grubx64.efi", L"Oracle Solaris EFI boot menu", L"solaris,linux", "Solaris" }, +// { L"\\EFI\\Endless\\grubx64.efi", L"EndlessOS EFI boot menu", L"endless,linux", "EndlessOS" }, +// { L"\\EFI\\antergos_grub\\grubx64.efi", L"Antergos EFI boot menu", L"antergos,linux", "Antergos" }, +// { L"\\EFI\\Deepin\\grubx64.efi", L"Deepin EFI boot menu", L"deepin,linux", "Deepin" }, +// { L"\\EFI\\elementary\\grubx64.efi", L"Elementary EFI boot menu", L"eos,linux", "Elementary" }, +// { L"\\EFI\\Manjaro\\grubx64.efi", L"Manjaro EFI boot menu", L"manjaro,linux", "Manjaro" }, +// { L"\\EFI\\xubuntu\\grubx64.efi", L"Xubuntu EFI boot menu", L"xubuntu,linux", "Xubuntu" }, +// { L"\\EFI\\zorin\\grubx64.efi", L"Zorin EFI boot menu", L"zorin,linux", "Zorin" }, { L"\\EFI\\goofiboot\\goofibootx64.efi", L"Solus EFI boot menu", L"solus,linux", "Solus" }, - { L"\\EFI\\centos\\grubx64.efi", L"CentOS EFI boot menu", L"centos,linux", "CentOS" }, - { L"\\EFI\\pclinuxos\\grubx64.efi", L"PCLinuxOS EFI boot menu", L"pclinux,linux", "PCLinux" }, - { L"\\EFI\\neon\\grubx64.efi", L"KDE Neon EFI boot menu", L"neon,linux", "KDE Neon" }, - { L"\\EFI\\MX19\\grubx64.efi", L"MX Linux EFI boot menu", L"mx,linux", "MX Linux" }, - { L"\\EFI\\parrot\\grubx64.efi", L"Parrot OS EFI boot menu", L"parrot,linux", "Parrot OS" }, +// { L"\\EFI\\centos\\grubx64.efi", L"CentOS EFI boot menu", L"centos,linux", "CentOS" }, +// { L"\\EFI\\pclinuxos\\grubx64.efi", L"PCLinuxOS EFI boot menu", L"pclinux,linux", "PCLinux" }, +// { L"\\EFI\\neon\\grubx64.efi", L"KDE Neon EFI boot menu", L"neon,linux", "KDE Neon" }, +// { L"\\EFI\\MX19\\grubx64.efi", L"MX Linux EFI boot menu", L"mx,linux", "MX Linux" }, +// { L"\\EFI\\parrot\\grubx64.efi", L"Parrot OS EFI boot menu", L"parrot,linux", "Parrot OS" }, #else + //dont bother about 32bit compilation { L"\\EFI\\grub\\grub.efi", L"Grub EFI boot menu", L"grub,linux" }, { L"\\EFI\\Gentoo\\grub.efi", L"Gentoo EFI boot menu", L"gentoo,linux", "Gentoo" }, { L"\\EFI\\Gentoo\\kernel.efi", L"Gentoo EFI kernel", L"gentoo,linux" }, @@ -146,28 +148,7 @@ STATIC LINUX_PATH_DATA LinuxEntryData[] = { { L"\\EFI\\SuSe\\elilo.efi", L"OpenSuse EFI boot menu", L"suse,linux" }, }; -/* TODO - DirIterOpen (SelfRootDir, L"\\EFI", &DirIter); - while (DirIterNext(&DirIter, 1, L"*", &DirEntry)) { - if (DirEntry->FileName[0] == '.') { - //DBG("Skip folder: %ls\n", DirEntry->FileName); - continue; - } - XStringW OSName = SWPrintf(L"%s", DirEntry->FileName); - XStringW File = SWPrintf(L"EFI\\%s\\grubx64.efi", DirEntry->FileName); - // if exist the linux = DirEntry->FileName - OSIconName = OSName + L",linux" - } - DirIterClose (&DirIter); - - CONST CHAR16 *Path; -- File - CONST CHAR16 *Title; -- OSName + L" OS EFI boot menu" - CONST CHAR16 *Icon; -- OSName + L",linux" - CONST CHAR8 *Issue; -- OSName - - - */ STATIC CONST UINTN LinuxEntryDataCount = (sizeof(LinuxEntryData) / sizeof(LINUX_PATH_DATA)); #if defined(ANDX86) @@ -191,9 +172,7 @@ STATIC ANDX86_PATH_DATA AndroidEntryData[] = { { L"\\EFI\\PhoenixOS\\boot\\grubx64.efi", L"PhoenixOS", L"phoenix,grub,linux", { L"\\EFI\\PhoenixOS\\boot\\efi.img", L"\\EFI\\PhoenixOS\\initrd.img", L"\\EFI\\PhoenixOS\\kernel" } }, { L"\\EFI\\boot\\grubx64.efi", L"Phoenix", L"phoenix,grub,linux", { L"\\phoenix\\kernel", L"\\phoenix\\initrd.img", L"\\phoenix\\ramdisk.img" } }, { L"\\EFI\\boot\\bootx64.efi", L"Chrome", L"chrome,grub,linux", { L"\\syslinux\\vmlinuz.A", L"\\syslinux\\vmlinuz.B", L"\\syslinux\\ldlinux.sys"} }, -/* -#else -*/ + }; STATIC CONST UINTN AndroidEntryDataCount = (sizeof(AndroidEntryData) / sizeof(ANDX86_PATH_DATA)); #endif @@ -267,13 +246,15 @@ UINT8 GetOSTypeFromPath(IN CONST CHAR16 *Path) return OSTYPE_OSX_INSTALLER; } else if (StriCmp(Path, L"\\com.apple.recovery.boot\\boot.efi") == 0) { return OSTYPE_RECOVERY; - } else if ((StriCmp(Path, L"\\EFI\\Microsoft\\Boot\\bootmgfw.efi") == 0) || - (StriCmp(Path, L"\\EFI\\Microsoft\\Boot\\bootmgfw-orig.efi") == 0) || - (StriCmp(Path, L"\\bootmgr.efi") == 0) || + } else if ((StriCmp(Path, L"\\EFI\\Microsoft\\Boot\\bootmgfw-orig.efi") == 0) || //test first as orig + (StriCmp(Path, L"\\EFI\\Microsoft\\Boot\\bootmgfw.efi") == 0) || //it can be Clover + // (StriCmp(Path, L"\\bootmgr.efi") == 0) || //never worked, just extra icon in menu (StriCmp(Path, L"\\EFI\\MICROSOFT\\BOOT\\cdboot.efi") == 0)) { return OSTYPE_WINEFI; } else if (StrniCmp(Path, LINUX_FULL_LOADER_PATH.wc_str(), LINUX_FULL_LOADER_PATH.size()) == 0) { return OSTYPE_LINEFI; + } else if (StriStr(Path, L"grubx64.efi") != NULL) { + return OSTYPE_LINEFI; } else { UINTN Index; #if defined(ANDX86) @@ -309,6 +290,8 @@ STATIC CONST CHAR16 *LinuxIconNameFromPath(IN CONST CHAR16 *Path, ++Index; } #endif + + //check not common names Index = 0; while (Index < LinuxEntryDataCount) { if (StriCmp(Path, LinuxEntryData[Index].Path) == 0) { @@ -316,6 +299,7 @@ STATIC CONST CHAR16 *LinuxIconNameFromPath(IN CONST CHAR16 *Path, } ++Index; } + // Try to open the linux issue if ((RootDir != NULL) && (StrniCmp(Path, LINUX_FULL_LOADER_PATH.wc_str(), LINUX_FULL_LOADER_PATH.size()) == 0)) { CHAR8 *Issue = NULL; @@ -448,7 +432,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, EFI_DEVICE_PATH *LoaderDevicePath; CONST CHAR16 *LoaderDevicePathString; CONST CHAR16 *FilePathAsString; - CONST CHAR16 *OSIconName; + CONST CHAR16 *OSIconName = NULL; CHAR16 ShortcutLetter; LOADER_ENTRY *Entry; CONST CHAR8 *indent = " "; @@ -521,11 +505,11 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, // Check if the volume_type match if (Custom->VolumeType != 0) { - volume_type_match = - (((Volume->DiskKind == DISK_KIND_INTERNAL) && (Custom->VolumeType & VOLTYPE_INTERNAL)) || + volume_type_match = (((1ull<DiskKind) & Custom->VolumeType) != 0) ? 1 : -1; + /* (((Volume->DiskKind == DISK_KIND_INTERNAL) && (Custom->VolumeType & VOLTYPE_INTERNAL)) || ((Volume->DiskKind == DISK_KIND_EXTERNAL) && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || ((Volume->DiskKind == DISK_KIND_OPTICAL) && (Custom->VolumeType & VOLTYPE_OPTICAL)) || - ((Volume->DiskKind == DISK_KIND_FIREWIRE) && (Custom->VolumeType & VOLTYPE_FIREWIRE))) ? 1 : -1; + ((Volume->DiskKind == DISK_KIND_FIREWIRE) && (Custom->VolumeType & VOLTYPE_FIREWIRE))) ? 1 : -1; */ } // Check if the path match @@ -598,9 +582,6 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, } else if ((AsciiStrLen(gSettings.BootArgs) > 0) && OSFLAG_ISUNSET(Flags, OSFLAG_NODEFAULTARGS)) { Entry->LoadOptions = SPrintf("%s", gSettings.BootArgs); } -//DBG("locate a custom icon \n"); - // locate a custom icon for the loader - //StrCpy(IconFileName, Volume->OSIconName); Sothor - Unused? //actions Entry->AtClick = ActionSelect; Entry->AtDoubleClick = ActionEnter; @@ -654,7 +635,12 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, break; case OSTYPE_LIN: case OSTYPE_LINEFI: - OSIconName = LinuxIconNameFromPath(LoaderPath, Volume->RootDir); + // we already detected linux and have Path and Image + Entry->LoaderType = OSType; + OSIconName = L"linux"; + if (Image == nullptr) { + OSIconName = LinuxIconNameFromPath(LoaderPath, Volume->RootDir); //something named "issue" + } ShortcutLetter = 'L'; break; case OSTYPE_OTHER: @@ -725,7 +711,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, Entry->Image.LoadIcns(Volume->RootDir, L"\\.VolumeIcon.icns", 128); DBG("using VolumeIcon.icns image from Volume\n"); } else if (Image) { - Entry->Image = *Image; + Entry->Image = *Image; //copy image from temporary storage } else { Entry->Image = ThemeX.LoadOSIcon(OSIconName); } @@ -1026,7 +1012,7 @@ BOOLEAN AddLoaderEntry(IN CONST CHAR16 *LoaderPath, IN CONST XString& LoaderOpti } } } - Entry = CreateLoaderEntry(LoaderPath, LoaderOptions, L""_XSW, LoaderTitle, Volume, Image, NULL, OSType, Flags, 0, MenuBackgroundPixel, CUSTOM_BOOT_DISABLED, NULL, NULL, FALSE); + Entry = CreateLoaderEntry(LoaderPath, LoaderOptions, L""_XSW, LoaderTitle, Volume, Image, NULL, OSType, Flags, 0, MenuBackgroundPixel, CUSTOM_BOOT_DISABLED, NULL, NULL, FALSE); if (Entry != NULL) { if ((Entry->LoaderType == OSTYPE_OSX) || (Entry->LoaderType == OSTYPE_OSX_INSTALLER ) || @@ -1113,12 +1099,13 @@ VOID ScanLoader(VOID) } // skip volume if its kind is configured as disabled - if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || + /* if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || (Volume->DiskKind == DISK_KIND_EXTERNAL && (GlobalConfig.DisableFlags & VOLTYPE_EXTERNAL)) || (Volume->DiskKind == DISK_KIND_INTERNAL && (GlobalConfig.DisableFlags & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (GlobalConfig.DisableFlags & VOLTYPE_FIREWIRE))) + (Volume->DiskKind == DISK_KIND_FIREWIRE && (GlobalConfig.DisableFlags & VOLTYPE_FIREWIRE))) */ + if (((1ull<DiskKind) & GlobalConfig.DisableFlags) != 0) { - DBG(", hidden\n"); + DBG(", flagged disable\n"); continue; } @@ -1256,6 +1243,30 @@ VOID ScanLoader(VOID) if (gSettings.LinuxScan) { // check for linux loaders + // + //----- Test common linux name and path like /EFI/ubuntu/grubx64.efi + REFIT_DIR_ITER DirIter; + EFI_FILE_INFO *DirEntry = NULL; + DirIterOpen(SelfRootDir, L"\\EFI", &DirIter); + while (DirIterNext(&DirIter, 1, L"*", &DirEntry)) { + if (DirEntry->FileName[0] == '.') { + //DBG("Skip dot entries: %ls\n", DirEntry->FileName); + continue; + } + XStringW OSName = SWPrintf("%ls", DirEntry->FileName); //this is folder name "ubuntu" + XStringW File = SWPrintf("EFI\\%ls\\grubx64.efi", DirEntry->FileName); + if (FileExists(SelfRootDir, File.wc_str())) { + XStringW LoaderTitle = OSName + L" OS EFI boot menu"_XSW; + XStringW IconXSW = OSName + L",linux"; + IconXSW.ToLower(); //to avoid misconception + XImage ImageX; //will the image be destroyed or rewritten by next image after the cycle end? + ImageX.LoadXImage(ThemeX.ThemeDir, IconXSW); + AddLoaderEntry(File.wc_str(), ""_XS, LoaderTitle, Volume, + (ImageX.isEmpty() ? NULL : &ImageX), OSTYPE_LINEFI, OSFLAG_NODEFAULTARGS); + } //anyway continue search other entries + } + DirIterClose(&DirIter); + for (Index = 0; Index < LinuxEntryDataCount; ++Index) { if (FileExists(Volume->RootDir, LinuxEntryData[Index].Path)) { XImage ImageX; @@ -1870,10 +1881,11 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, // Better path match BetterMatch = ((Ptr->Path != NULL) && (StrCmp(CustomPath, Ptr->Path) == 0) && ((Custom->VolumeType == Ptr->VolumeType) || - (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || + ((1ull<DiskKind) & Custom->VolumeType) != 0)); + /* (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); + (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); */ } } else if ((StrStr(Volume->DevicePathString, Custom->Volume) == NULL) && ((Volume->VolName == NULL) || (StrStr(Volume->VolName, Custom->Volume) == NULL))) { @@ -1883,17 +1895,19 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, // Better path match BetterMatch = ((Ptr->Path != NULL) && (StrCmp(CustomPath, Ptr->Path) == 0) && ((Custom->VolumeType == Ptr->VolumeType) || - (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || - (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || - (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); + ((1ull<DiskKind) & Custom->VolumeType) != 0)); + /* (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || + (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || + (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || + (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); */ } else if (Custom->VolumeType != Ptr->VolumeType) { // More precise volume type match BetterMatch = ((Custom->VolumeType == 0) && - ((Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || - (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || - (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); + ((1ull<DiskKind) & Custom->VolumeType) != 0); + /* (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || + (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || + (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || + (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); */ } else { // Better match BetterMatch = TRUE; @@ -1903,18 +1917,20 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, // Better path match BetterMatch = ((Ptr->Path != NULL) && (StrCmp(CustomPath, Ptr->Path) == 0) && ((Custom->VolumeType == Ptr->VolumeType) || - (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || - (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || - (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); + ((1ull<DiskKind) & Custom->VolumeType) != 0)); + /* (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || + (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || + (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || + (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); */ // Duplicate path match } else if (Custom->VolumeType != Ptr->VolumeType) { // More precise volume type match BetterMatch = ((Custom->VolumeType == 0) && - ((Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || - (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || - (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); + ((1ull<DiskKind) & Custom->VolumeType) != 0); + /* (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || + (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || + (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || + (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); */ } else { // Duplicate entry BetterMatch = (i <= CustomIndex); @@ -1925,25 +1941,28 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, if (Ptr->Path == NULL) { // Less precise path match BetterMatch = ((Custom->VolumeType != Ptr->VolumeType) && - ((Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || - (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || - (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); + ((1ull<DiskKind) & Custom->VolumeType) != 0); + /* (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || + (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || + (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || + (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); */ } else if (StrCmp(CustomPath, Ptr->Path) == 0) { if (Custom->Path == NULL) { // More precise path and volume type match BetterMatch = ((Custom->VolumeType == Ptr->VolumeType) || - (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || - (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || - (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE))); + ((1ull<DiskKind) & Custom->VolumeType) != 0); + /* (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || + (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || + (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || + (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); */ } else if (Custom->VolumeType != Ptr->VolumeType) { // More precise volume type match BetterMatch = ((Custom->VolumeType == 0) && - ((Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || - (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || - (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); + ((1ull<DiskKind) & Custom->VolumeType) != 0); + /* (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || + (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || + (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || + (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); */ } else { // Duplicate entry BetterMatch = (i <= CustomIndex); @@ -1953,10 +1972,11 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, } else if (Custom->VolumeType != Ptr->VolumeType) { // More precise volume type match BetterMatch = ((Custom->VolumeType == 0) && - ((Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || - (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || - (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); + ((1ull<DiskKind) & Custom->VolumeType) != 0); + /* (Volume->DiskKind == DISK_KIND_OPTICAL && (Custom->VolumeType & VOLTYPE_OPTICAL)) || + (Volume->DiskKind == DISK_KIND_EXTERNAL && (Custom->VolumeType & VOLTYPE_EXTERNAL)) || + (Volume->DiskKind == DISK_KIND_INTERNAL && (Custom->VolumeType & VOLTYPE_INTERNAL)) || + (Volume->DiskKind == DISK_KIND_FIREWIRE && (Custom->VolumeType & VOLTYPE_FIREWIRE)))); */ } else { // Duplicate entry BetterMatch = (i <= CustomIndex); diff --git a/rEFIt_UEFI/entry_scan/tool.cpp b/rEFIt_UEFI/entry_scan/tool.cpp index 600fd18e0..40fa8124c 100644 --- a/rEFIt_UEFI/entry_scan/tool.cpp +++ b/rEFIt_UEFI/entry_scan/tool.cpp @@ -265,20 +265,22 @@ VOID AddCustomTool(VOID) } // skip volume if its kind is configured as disabled - if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || + /* if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || (Volume->DiskKind == DISK_KIND_EXTERNAL && (GlobalConfig.DisableFlags & VOLTYPE_EXTERNAL)) || (Volume->DiskKind == DISK_KIND_INTERNAL && (GlobalConfig.DisableFlags & VOLTYPE_INTERNAL)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && (GlobalConfig.DisableFlags & VOLTYPE_FIREWIRE))) + (Volume->DiskKind == DISK_KIND_FIREWIRE && (GlobalConfig.DisableFlags & VOLTYPE_FIREWIRE)))*/ + if (((1ull<DiskKind) & GlobalConfig.DisableFlags) != 0) { DBG("skipped because media is disabled\n"); continue; } if (Custom->VolumeType != 0) { - if ((Volume->DiskKind == DISK_KIND_OPTICAL && ((Custom->VolumeType & VOLTYPE_OPTICAL) == 0)) || + /* if ((Volume->DiskKind == DISK_KIND_OPTICAL && ((Custom->VolumeType & VOLTYPE_OPTICAL) == 0)) || (Volume->DiskKind == DISK_KIND_EXTERNAL && ((Custom->VolumeType & VOLTYPE_EXTERNAL) == 0)) || (Volume->DiskKind == DISK_KIND_INTERNAL && ((Custom->VolumeType & VOLTYPE_INTERNAL) == 0)) || - (Volume->DiskKind == DISK_KIND_FIREWIRE && ((Custom->VolumeType & VOLTYPE_FIREWIRE) == 0))) { + (Volume->DiskKind == DISK_KIND_FIREWIRE && ((Custom->VolumeType & VOLTYPE_FIREWIRE) == 0)))*/ + if (((1ull<DiskKind) & Custom->VolumeType) == 0) { DBG("skipped because media is ignored\n"); continue; } diff --git a/rEFIt_UEFI/libeg/BmLib.cpp b/rEFIt_UEFI/libeg/BmLib.cpp index 12e56b34c..9b69fd74b 100644 --- a/rEFIt_UEFI/libeg/BmLib.cpp +++ b/rEFIt_UEFI/libeg/BmLib.cpp @@ -77,7 +77,7 @@ EfiLibOpenRoot ( // // Open the root directory of the volume // - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { Status = Volume->OpenVolume ( Volume, &File @@ -86,7 +86,7 @@ EfiLibOpenRoot ( // // Done // - return EFI_ERROR (Status) ? NULL : File; + return EFI_ERROR(Status) ? NULL : File; } /** @@ -327,7 +327,7 @@ EfiReallocatePool ( CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize); } - FreePool (OldPool); + FreePool(OldPool); } return NewPool; diff --git a/rEFIt_UEFI/libeg/VectorGraphics.cpp b/rEFIt_UEFI/libeg/VectorGraphics.cpp index 766c05762..5efab144a 100755 --- a/rEFIt_UEFI/libeg/VectorGraphics.cpp +++ b/rEFIt_UEFI/libeg/VectorGraphics.cpp @@ -332,64 +332,64 @@ EFI_STATUS XTheme::ParseSVGXTheme(CONST CHAR8* buffer) //TODO parse anime like for PNG themes /* - Dict = GetProperty (DictPointer, "Anime"); + Dict = GetProperty(DictPointer, "Anime"); if (Dict != NULL) { INTN Count = GetTagCount (Dict); for (INTN i = 0; i < Count; i++) { FILM *NewFilm = new FILM(); - if (EFI_ERROR (GetElement (Dict, i, &Dict3))) { + if (EFI_ERROR(GetElement (Dict, i, &Dict3))) { continue; } if (Dict3 == NULL) { break; } - Dict2 = GetProperty (Dict3, "ID"); - NewFilm->SetIndex((UINTN)GetPropertyInteger (Dict2, 1)); //default=main screen + Dict2 = GetProperty(Dict3, "ID"); + NewFilm->SetIndex((UINTN)GetPropertyInteger(Dict2, 1)); //default=main screen - Dict2 = GetProperty (Dict3, "Path"); + Dict2 = GetProperty(Dict3, "Path"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { NewFilm->Path.takeValueFrom(Dict2->string); } - Dict2 = GetProperty (Dict3, "Frames"); - NewFilm->NumFrames = (UINTN)GetPropertyInteger (Dict2, 0); + Dict2 = GetProperty(Dict3, "Frames"); + NewFilm->NumFrames = (UINTN)GetPropertyInteger(Dict2, 0); - Dict2 = GetProperty (Dict3, "FrameTime"); - NewFilm->FrameTime = (UINTN)GetPropertyInteger (Dict2, 50); //default will be 50ms + Dict2 = GetProperty(Dict3, "FrameTime"); + NewFilm->FrameTime = (UINTN)GetPropertyInteger(Dict2, 50); //default will be 50ms - Dict2 = GetProperty (Dict3, "ScreenEdgeX"); + Dict2 = GetProperty(Dict3, "ScreenEdgeX"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { - if (AsciiStrCmp (Dict2->string, "left") == 0) { + if (AsciiStrCmp(Dict2->string, "left") == 0) { NewFilm->ScreenEdgeHorizontal = SCREEN_EDGE_LEFT; - } else if (AsciiStrCmp (Dict2->string, "right") == 0) { + } else if (AsciiStrCmp(Dict2->string, "right") == 0) { NewFilm->ScreenEdgeHorizontal = SCREEN_EDGE_RIGHT; } } - Dict2 = GetProperty (Dict3, "ScreenEdgeY"); + Dict2 = GetProperty(Dict3, "ScreenEdgeY"); if (Dict2 != NULL && (Dict2->type == kTagTypeString) && Dict2->string) { - if (AsciiStrCmp (Dict2->string, "top") == 0) { + if (AsciiStrCmp(Dict2->string, "top") == 0) { NewFilm->ScreenEdgeVertical = SCREEN_EDGE_TOP; - } else if (AsciiStrCmp (Dict2->string, "bottom") == 0) { + } else if (AsciiStrCmp(Dict2->string, "bottom") == 0) { NewFilm->ScreenEdgeVertical = SCREEN_EDGE_BOTTOM; } } //default values are centre - Dict2 = GetProperty (Dict3, "DistanceFromScreenEdgeX%"); - NewFilm->FilmX = GetPropertyInteger (Dict2, INITVALUE); + Dict2 = GetProperty(Dict3, "DistanceFromScreenEdgeX%"); + NewFilm->FilmX = GetPropertyInteger(Dict2, INITVALUE); - Dict2 = GetProperty (Dict3, "DistanceFromScreenEdgeY%"); - NewFilm->FilmY = GetPropertyInteger (Dict2, INITVALUE); + Dict2 = GetProperty(Dict3, "DistanceFromScreenEdgeY%"); + NewFilm->FilmY = GetPropertyInteger(Dict2, INITVALUE); - Dict2 = GetProperty (Dict3, "NudgeX"); - NewFilm->NudgeX = GetPropertyInteger (Dict2, INITVALUE); + Dict2 = GetProperty(Dict3, "NudgeX"); + NewFilm->NudgeX = GetPropertyInteger(Dict2, INITVALUE); - Dict2 = GetProperty (Dict3, "NudgeY"); - NewFilm->NudgeY = GetPropertyInteger (Dict2, INITVALUE); + Dict2 = GetProperty(Dict3, "NudgeY"); + NewFilm->NudgeY = GetPropertyInteger(Dict2, INITVALUE); - Dict2 = GetProperty (Dict3, "Once"); + Dict2 = GetProperty(Dict3, "Once"); NewFilm->RunOnce = IsPropertyTrue (Dict2); NewFilm->GetFrames(ThemeX); //used properties: ID, Path, NumFrames diff --git a/rEFIt_UEFI/libeg/libscreen.cpp b/rEFIt_UEFI/libeg/libscreen.cpp index 58b8aa38c..6a592e11d 100644 --- a/rEFIt_UEFI/libeg/libscreen.cpp +++ b/rEFIt_UEFI/libeg/libscreen.cpp @@ -589,7 +589,7 @@ static EFI_STATUS GopSetModeAndReconnectTextOut(IN UINT32 ModeNumber) Status = GraphicsOutput->SetMode(GraphicsOutput, ModeNumber); MsgLog("Video mode change to mode #%d: %s\n", ModeNumber, strerror(Status)); - if (gFirmwareClover && !EFI_ERROR (Status)) { + if (gFirmwareClover && !EFI_ERROR(Status)) { // When we change mode on GOP, we need to reconnect the drivers which produce simple text out // Otherwise, they won't produce text based on the new resolution Status = gBS->LocateHandleBuffer ( @@ -599,7 +599,7 @@ static EFI_STATUS GopSetModeAndReconnectTextOut(IN UINT32 ModeNumber) &HandleCount, &HandleBuffer ); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (UINTN Index = 0; Index < HandleCount; Index++) { gBS->DisconnectController (HandleBuffer[Index], NULL, NULL); } @@ -607,7 +607,7 @@ static EFI_STATUS GopSetModeAndReconnectTextOut(IN UINT32 ModeNumber) gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); } if (HandleBuffer != NULL) { - FreePool (HandleBuffer); + FreePool(HandleBuffer); } egDumpSetConsoleVideoModes(); } diff --git a/rEFIt_UEFI/refit/IO.cpp b/rEFIt_UEFI/refit/IO.cpp index 8e01a6b2e..c6211bba0 100644 --- a/rEFIt_UEFI/refit/IO.cpp +++ b/rEFIt_UEFI/refit/IO.cpp @@ -92,7 +92,7 @@ _PoolCatPrint ( EFI_STATUS EFIAPI -_PoolPrint ( +_PoolPrint( IN POOL_PRINT *Context, IN CHAR16 *Buffer ); @@ -253,7 +253,7 @@ Returns: CHAR16 * EFIAPI -PoolPrint ( +PoolPrint( IN CONST CHAR16 *fmt, ... ) @@ -485,7 +485,7 @@ PFLUSH ( if (mPrintMode.OutputPause) { Status = EFI_NOT_READY; - while (EFI_ERROR (Status)) { + while (EFI_ERROR(Status)) { Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); } @@ -728,7 +728,7 @@ Returns: Buffer = (__typeof__(Buffer))AllocateZeroPool (sizeof (CHAR16) * PRINT_STRING_LEN); if (NULL == Buffer) { - FreePool (Item.Scratch); + FreePool(Item.Scratch); return EFI_OUT_OF_RESOURCES; } @@ -962,8 +962,8 @@ Returns: // PFLUSH (ps); - FreePool (Item.Scratch); - FreePool (Buffer); + FreePool(Item.Scratch); + FreePool(Buffer); return ps->Len; } @@ -987,7 +987,7 @@ WaitForSingleEvent ( // Create a timer event // Status = gBS->CreateEvent(EVT_TIMER, 0, NULL, NULL, &TimerEvent); - if (!EFI_ERROR (Status)) + if (!EFI_ERROR(Status)) { // // Set the timer event @@ -1002,7 +1002,7 @@ WaitForSingleEvent ( Status = gBS->WaitForEvent(2, WaitList, &Index); gBS->CloseEvent (TimerEvent); - if (!EFI_ERROR (Status) && Index == 1) + if (!EFI_ERROR(Status) && Index == 1) { Status = EFI_TIMEOUT; } @@ -1252,7 +1252,7 @@ SetOutputPause ( EFI_STATUS EFIAPI -_PoolPrint ( +_PoolPrint( IN POOL_PRINT *Context, IN CHAR16 *Buffer ) diff --git a/rEFIt_UEFI/refit/IO.h b/rEFIt_UEFI/refit/IO.h index b08c3b119..2e8402351 100644 --- a/rEFIt_UEFI/refit/IO.h +++ b/rEFIt_UEFI/refit/IO.h @@ -111,7 +111,7 @@ typedef struct _pstate { extern EFI_STATUS EFIAPI -_PoolPrint ( +_PoolPrint( IN POOL_PRINT *Context, IN CHAR16 *Buffer ); @@ -199,7 +199,7 @@ VSPrint ( */ CHAR16 * EFIAPI -PoolPrint ( +PoolPrint( IN CONST CHAR16 *fmt, ... ); diff --git a/rEFIt_UEFI/refit/lib.cpp b/rEFIt_UEFI/refit/lib.cpp index 1dc292534..3ec01cd0e 100644 --- a/rEFIt_UEFI/refit/lib.cpp +++ b/rEFIt_UEFI/refit/lib.cpp @@ -988,7 +988,7 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume) ) { VOID *Instance; - if (!EFI_ERROR (gBS->HandleProtocol(Volume->DeviceHandle, &gEfiPartTypeSystemPartGuid, &Instance))) { + if (!EFI_ERROR(gBS->HandleProtocol(Volume->DeviceHandle, &gEfiPartTypeSystemPartGuid, &Instance))) { Volume->VolName = L"EFI"; \ } } diff --git a/rEFIt_UEFI/refit/list.cpp b/rEFIt_UEFI/refit/list.cpp index a5a92b76e..437d6da0a 100644 --- a/rEFIt_UEFI/refit/list.cpp +++ b/rEFIt_UEFI/refit/list.cpp @@ -121,7 +121,7 @@ // // Status = Constructor(&Element, ConstructorParameters); // -// if (EFI_ERROR (Status)) { +// if (EFI_ERROR(Status)) { // return EFI_ABORTED; // } //#ifdef DEBUG_LIST @@ -285,7 +285,7 @@ // // // Status = Entry->Destructor(&Element); // -// if (EFI_ERROR (Status)) { +// if (EFI_ERROR(Status)) { // return EFI_ABORTED; // } // @@ -343,7 +343,7 @@ // // // Status = Entry->Destructor(&Element); // -// if (EFI_ERROR (Status)) { +// if (EFI_ERROR(Status)) { // return EFI_ABORTED; // } // diff --git a/rEFIt_UEFI/refit/main.cpp b/rEFIt_UEFI/refit/main.cpp index 885c7971b..0543e331c 100644 --- a/rEFIt_UEFI/refit/main.cpp +++ b/rEFIt_UEFI/refit/main.cpp @@ -1260,7 +1260,7 @@ VOID DisconnectInvalidDiskIoChildDrivers(VOID) &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { //DBG(" BlockIo: %s - skipping\n", strerror(Status)); continue; } @@ -1300,7 +1300,7 @@ VOID DisconnectInvalidDiskIoChildDrivers(VOID) &OpenInfo, &OpenInfoCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR(Status)) { //DBG(" OpenInfo: no - skipping\n"); continue; } @@ -1316,7 +1316,7 @@ VOID DisconnectInvalidDiskIoChildDrivers(VOID) DBG(" - Handle %p with DiskIo, is Partition, no Fs, BY_DRIVER Agent: %p, Disconnect: %s\n", Handles[Index], OpenInfo[OpenInfoIndex].AgentHandle, strerror(Status)); } } - FreePool (OpenInfo); + FreePool(OpenInfo); } FreePool(Handles); @@ -1382,7 +1382,7 @@ VOID DisconnectSomeDevices(VOID) ControllerHandles = NULL; Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid, NULL, &ControllerHandleCount, &ControllerHandles); - /* if (!EFI_ERROR (Status)) { + /* if (!EFI_ERROR(Status)) { for (Index2 = 0; Index2 < ControllerHandleCount; Index2++) { Status = gBS->DisconnectController(ControllerHandles[Index2], NULL, NULL); @@ -1394,7 +1394,7 @@ VOID DisconnectSomeDevices(VOID) Handles = NULL; Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid, NULL, &HandleCount, &Handles); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { for (Index = 0; Index < HandleCount; Index++) { Status = gBS->OpenProtocol( Handles[Index], @@ -1440,7 +1440,7 @@ VOID DisconnectSomeDevices(VOID) continue; } Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, 0, sizeof (Pci) / sizeof (UINT32), &Pci); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR(Status)) { if(IS_PCI_VGA(&Pci) == TRUE) { // disconnect VGA Status = gBS->DisconnectController(Handles[Index], NULL, NULL); @@ -2017,7 +2017,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, } Status = gBS->HandleProtocol(ConsoleInHandle, &gEfiSimpleTextInputExProtocolGuid, (VOID **)&SimpleTextEx); - if ( EFI_ERROR (Status) ) { + if ( EFI_ERROR(Status) ) { SimpleTextEx = NULL; } DBG("SimpleTextEx Status=%s\n", strerror(Status));