MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
7c7184e201
commit
1436aea4d5
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "I2cDxe.h"
|
||||
|
||||
EFI_DRIVER_BINDING_PROTOCOL gI2cHostDriverBinding = {
|
||||
EFI_DRIVER_BINDING_PROTOCOL gI2cHostDriverBinding = {
|
||||
I2cHostDriverSupported,
|
||||
I2cHostDriverStart,
|
||||
I2cHostDriverStop,
|
||||
@@ -22,24 +22,24 @@ EFI_DRIVER_BINDING_PROTOCOL gI2cHostDriverBinding = {
|
||||
//
|
||||
// Driver name table
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mI2cHostDriverNameTable[] = {
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mI2cHostDriverNameTable[] = {
|
||||
{ "eng;en", L"I2c Host Driver" },
|
||||
{ NULL , NULL }
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// EFI Component Name Protocol
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gI2cHostComponentName = {
|
||||
(EFI_COMPONENT_NAME_GET_DRIVER_NAME) I2cHostComponentNameGetDriverName,
|
||||
(EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) I2cHostComponentNameGetControllerName,
|
||||
(EFI_COMPONENT_NAME_GET_DRIVER_NAME)I2cHostComponentNameGetDriverName,
|
||||
(EFI_COMPONENT_NAME_GET_CONTROLLER_NAME)I2cHostComponentNameGetControllerName,
|
||||
"eng"
|
||||
};
|
||||
|
||||
//
|
||||
// EFI Component Name 2 Protocol
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gI2cHostComponentName2 = {
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gI2cHostComponentName2 = {
|
||||
I2cHostComponentNameGetDriverName,
|
||||
I2cHostComponentNameGetControllerName,
|
||||
"en"
|
||||
@@ -88,8 +88,8 @@ EFI_STATUS
|
||||
EFIAPI
|
||||
I2cHostComponentNameGetDriverName (
|
||||
IN EFI_COMPONENT_NAME2_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
)
|
||||
{
|
||||
return LookupUnicodeString2 (
|
||||
@@ -172,11 +172,11 @@ I2cHostComponentNameGetDriverName (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
I2cHostComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME2_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
IN EFI_COMPONENT_NAME2_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
@@ -232,9 +232,9 @@ I2cHostDriverSupported (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
{
|
||||
EFI_I2C_MASTER_PROTOCOL *I2cMaster;
|
||||
EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL *I2cBusConfigurationManagement;
|
||||
EFI_STATUS Status;
|
||||
EFI_I2C_MASTER_PROTOCOL *I2cMaster;
|
||||
EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL *I2cBusConfigurationManagement;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Locate I2C Bus Configuration Management Protocol
|
||||
@@ -255,11 +255,11 @@ I2cHostDriverSupported (
|
||||
// Close the protocol because we don't use it here
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiI2cBusConfigurationManagementProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
Controller,
|
||||
&gEfiI2cBusConfigurationManagementProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
|
||||
//
|
||||
// Locate I2C Master Protocol
|
||||
@@ -317,15 +317,15 @@ I2cHostDriverSupported (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
I2cHostDriverStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_I2C_MASTER_PROTOCOL *I2cMaster;
|
||||
EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL *I2cBusConfigurationManagement;
|
||||
I2C_HOST_CONTEXT *I2cHostContext;
|
||||
EFI_STATUS Status;
|
||||
EFI_I2C_MASTER_PROTOCOL *I2cMaster;
|
||||
EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL *I2cBusConfigurationManagement;
|
||||
I2C_HOST_CONTEXT *I2cHostContext;
|
||||
|
||||
I2cMaster = NULL;
|
||||
I2cHostContext = NULL;
|
||||
@@ -379,8 +379,8 @@ I2cHostDriverStart (
|
||||
I2cHostContext->Signature = I2C_HOST_SIGNATURE;
|
||||
I2cHostContext->I2cMaster = I2cMaster;
|
||||
I2cHostContext->I2cBusConfigurationManagement = I2cBusConfigurationManagement;
|
||||
I2cHostContext->I2cBusConfiguration = (UINTN) -1;
|
||||
InitializeListHead(&I2cHostContext->RequestList);
|
||||
I2cHostContext->I2cBusConfiguration = (UINTN)-1;
|
||||
InitializeListHead (&I2cHostContext->RequestList);
|
||||
|
||||
//
|
||||
// Reset the controller
|
||||
@@ -441,11 +441,11 @@ Exit:
|
||||
DEBUG ((DEBUG_ERROR, "I2cHost: Start() function failed, Status = %r\n", Status));
|
||||
if (I2cBusConfigurationManagement != NULL) {
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiI2cBusConfigurationManagementProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
Controller,
|
||||
&gEfiI2cBusConfigurationManagementProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
}
|
||||
|
||||
if ((I2cHostContext != NULL) && (I2cHostContext->I2cEvent != NULL)) {
|
||||
@@ -501,16 +501,16 @@ Exit:
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
I2cHostDriverStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
I2C_HOST_CONTEXT *I2cHostContext;
|
||||
EFI_I2C_HOST_PROTOCOL *I2cHost;
|
||||
EFI_TPL TplPrevious;
|
||||
EFI_STATUS Status;
|
||||
I2C_HOST_CONTEXT *I2cHostContext;
|
||||
EFI_I2C_HOST_PROTOCOL *I2cHost;
|
||||
EFI_TPL TplPrevious;
|
||||
|
||||
TplPrevious = EfiGetCurrentTpl ();
|
||||
if (TplPrevious > TPL_I2C_SYNC) {
|
||||
@@ -521,7 +521,7 @@ I2cHostDriverStop (
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
&gEfiI2cHostProtocolGuid,
|
||||
(VOID **) &I2cHost,
|
||||
(VOID **)&I2cHost,
|
||||
This->DriverBindingHandle,
|
||||
Controller,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
@@ -542,9 +542,9 @@ I2cHostDriverStop (
|
||||
// If there is pending request or pending bus configuration, do not stop
|
||||
//
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
if (( !I2cHostContext->I2cBusConfigurationManagementPending )
|
||||
&& IsListEmpty (&I2cHostContext->RequestList)) {
|
||||
|
||||
if ( (!I2cHostContext->I2cBusConfigurationManagementPending)
|
||||
&& IsListEmpty (&I2cHostContext->RequestList))
|
||||
{
|
||||
//
|
||||
// Remove the I2C host protocol
|
||||
//
|
||||
@@ -602,16 +602,16 @@ I2cHostDriverStop (
|
||||
VOID
|
||||
EFIAPI
|
||||
I2cHostI2cBusConfigurationAvailable (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
I2C_HOST_CONTEXT *I2cHostContext;
|
||||
EFI_I2C_MASTER_PROTOCOL *I2cMaster;
|
||||
I2C_REQUEST *I2cRequest;
|
||||
LIST_ENTRY *EntryHeader;
|
||||
LIST_ENTRY *Entry;
|
||||
EFI_STATUS Status;
|
||||
I2C_HOST_CONTEXT *I2cHostContext;
|
||||
EFI_I2C_MASTER_PROTOCOL *I2cMaster;
|
||||
I2C_REQUEST *I2cRequest;
|
||||
LIST_ENTRY *EntryHeader;
|
||||
LIST_ENTRY *Entry;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Mark this I2C bus configuration management operation as complete
|
||||
@@ -637,7 +637,7 @@ I2cHostI2cBusConfigurationAvailable (
|
||||
// Unknown I2C bus configuration
|
||||
// Force next operation to enable the I2C bus configuration
|
||||
//
|
||||
I2cHostContext->I2cBusConfiguration = (UINTN) -1;
|
||||
I2cHostContext->I2cBusConfiguration = (UINTN)-1;
|
||||
|
||||
//
|
||||
// Do not continue current I2C request
|
||||
@@ -649,8 +649,8 @@ I2cHostI2cBusConfigurationAvailable (
|
||||
// Get the first request in the link with FIFO order
|
||||
//
|
||||
EntryHeader = &I2cHostContext->RequestList;
|
||||
Entry = GetFirstNode (EntryHeader);
|
||||
I2cRequest = I2C_REQUEST_FROM_ENTRY (Entry);
|
||||
Entry = GetFirstNode (EntryHeader);
|
||||
I2cRequest = I2C_REQUEST_FROM_ENTRY (Entry);
|
||||
|
||||
//
|
||||
// Update the I2C bus configuration of the current I2C request
|
||||
@@ -669,7 +669,7 @@ I2cHostI2cBusConfigurationAvailable (
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG((DEBUG_ERROR, "I2cHostI2cBusConfigurationAvailable: Error starting I2C operation, %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "I2cHostI2cBusConfigurationAvailable: Error starting I2C operation, %r\n", Status));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,20 +686,20 @@ I2cHostI2cBusConfigurationAvailable (
|
||||
**/
|
||||
EFI_STATUS
|
||||
I2cHostRequestComplete (
|
||||
I2C_HOST_CONTEXT *I2cHostContext,
|
||||
EFI_STATUS Status
|
||||
I2C_HOST_CONTEXT *I2cHostContext,
|
||||
EFI_STATUS Status
|
||||
)
|
||||
{
|
||||
I2C_REQUEST *I2cRequest;
|
||||
LIST_ENTRY *EntryHeader;
|
||||
LIST_ENTRY *Entry;
|
||||
I2C_REQUEST *I2cRequest;
|
||||
LIST_ENTRY *EntryHeader;
|
||||
LIST_ENTRY *Entry;
|
||||
|
||||
//
|
||||
// Remove the current I2C request from the list
|
||||
//
|
||||
EntryHeader = &I2cHostContext->RequestList;
|
||||
Entry = GetFirstNode (EntryHeader);
|
||||
I2cRequest = I2C_REQUEST_FROM_ENTRY (Entry);
|
||||
Entry = GetFirstNode (EntryHeader);
|
||||
I2cRequest = I2C_REQUEST_FROM_ENTRY (Entry);
|
||||
|
||||
//
|
||||
// Save the status for QueueRequest
|
||||
@@ -725,7 +725,7 @@ I2cHostRequestComplete (
|
||||
//
|
||||
// If there is more I2C request, start next one
|
||||
//
|
||||
if(!IsListEmpty (EntryHeader)) {
|
||||
if (!IsListEmpty (EntryHeader)) {
|
||||
I2cHostRequestEnable (I2cHostContext);
|
||||
}
|
||||
|
||||
@@ -744,11 +744,11 @@ I2cHostRequestComplete (
|
||||
VOID
|
||||
EFIAPI
|
||||
I2cHostRequestCompleteEvent (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
I2C_HOST_CONTEXT *I2cHostContext;
|
||||
I2C_HOST_CONTEXT *I2cHostContext;
|
||||
|
||||
//
|
||||
// Handle the completion event
|
||||
@@ -784,16 +784,16 @@ I2cHostRequestCompleteEvent (
|
||||
**/
|
||||
EFI_STATUS
|
||||
I2cHostRequestEnable (
|
||||
I2C_HOST_CONTEXT *I2cHostContext
|
||||
I2C_HOST_CONTEXT *I2cHostContext
|
||||
)
|
||||
{
|
||||
UINTN I2cBusConfiguration;
|
||||
CONST EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL *I2cBusConfigurationManagement;
|
||||
I2C_REQUEST *I2cRequest;
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL TplPrevious;
|
||||
LIST_ENTRY *EntryHeader;
|
||||
LIST_ENTRY *Entry;
|
||||
UINTN I2cBusConfiguration;
|
||||
CONST EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL *I2cBusConfigurationManagement;
|
||||
I2C_REQUEST *I2cRequest;
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL TplPrevious;
|
||||
LIST_ENTRY *EntryHeader;
|
||||
LIST_ENTRY *Entry;
|
||||
|
||||
//
|
||||
// Assume pending request
|
||||
@@ -807,7 +807,7 @@ I2cHostRequestEnable (
|
||||
//
|
||||
EntryHeader = &I2cHostContext->RequestList;
|
||||
Entry = GetFirstNode (EntryHeader);
|
||||
I2cRequest = I2C_REQUEST_FROM_ENTRY (Entry);
|
||||
I2cRequest = I2C_REQUEST_FROM_ENTRY (Entry);
|
||||
|
||||
I2cBusConfiguration = I2cRequest->I2cBusConfiguration;
|
||||
|
||||
@@ -820,16 +820,16 @@ I2cHostRequestEnable (
|
||||
// Update bus configuration for this device's requesting bus configuration
|
||||
//
|
||||
Status = I2cBusConfigurationManagement->EnableI2cBusConfiguration (
|
||||
I2cBusConfigurationManagement,
|
||||
I2cBusConfiguration,
|
||||
I2cHostContext->I2cBusConfigurationEvent,
|
||||
&I2cHostContext->Status
|
||||
);
|
||||
I2cBusConfigurationManagement,
|
||||
I2cBusConfiguration,
|
||||
I2cHostContext->I2cBusConfigurationEvent,
|
||||
&I2cHostContext->Status
|
||||
);
|
||||
} else {
|
||||
//
|
||||
// I2C bus configuration is same, no need change configuration and start I2c transaction directly
|
||||
//
|
||||
TplPrevious = gBS->RaiseTPL ( TPL_I2C_SYNC );
|
||||
TplPrevious = gBS->RaiseTPL (TPL_I2C_SYNC);
|
||||
|
||||
//
|
||||
// Same I2C bus configuration
|
||||
@@ -840,8 +840,9 @@ I2cHostRequestEnable (
|
||||
//
|
||||
// Release the thread synchronization
|
||||
//
|
||||
gBS->RestoreTPL ( TplPrevious );
|
||||
gBS->RestoreTPL (TplPrevious);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -965,12 +966,12 @@ I2cHostQueueRequest (
|
||||
// For synchronous transaction, register an event used to wait for finishing synchronous transaction
|
||||
//
|
||||
Status = gBS->CreateEvent (
|
||||
0,
|
||||
TPL_I2C_SYNC,
|
||||
NULL,
|
||||
NULL,
|
||||
&SyncEvent
|
||||
);
|
||||
0,
|
||||
TPL_I2C_SYNC,
|
||||
NULL,
|
||||
NULL,
|
||||
&SyncEvent
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
@@ -1007,7 +1008,7 @@ I2cHostQueueRequest (
|
||||
//
|
||||
// Copy request packet into private buffer, as RequestPacket may be freed during asynchronous transaction
|
||||
//
|
||||
RequestPacketSize = sizeof (UINTN) + RequestPacket->OperationCount * sizeof (EFI_I2C_OPERATION);
|
||||
RequestPacketSize = sizeof (UINTN) + RequestPacket->OperationCount * sizeof (EFI_I2C_OPERATION);
|
||||
I2cRequest->RequestPacket = AllocateZeroPool (RequestPacketSize);
|
||||
ASSERT (I2cRequest->RequestPacket != NULL);
|
||||
CopyMem (I2cRequest->RequestPacket, RequestPacket, RequestPacketSize);
|
||||
@@ -1015,7 +1016,7 @@ I2cHostQueueRequest (
|
||||
//
|
||||
// Synchronize with the other threads
|
||||
//
|
||||
gBS->RaiseTPL ( TPL_I2C_SYNC );
|
||||
gBS->RaiseTPL (TPL_I2C_SYNC);
|
||||
|
||||
FirstRequest = IsListEmpty (&I2cHostContext->RequestList);
|
||||
|
||||
@@ -1085,12 +1086,12 @@ I2cHostQueueRequest (
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeI2cHost(
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
InitializeI2cHost (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Install driver model protocol(s).
|
||||
@@ -1122,15 +1123,15 @@ InitializeI2cHost(
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
I2cHostUnload (
|
||||
IN EFI_HANDLE ImageHandle
|
||||
IN EFI_HANDLE ImageHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_HANDLE *DeviceHandleBuffer;
|
||||
UINTN DeviceHandleCount;
|
||||
UINTN Index;
|
||||
EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
|
||||
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
|
||||
EFI_STATUS Status;
|
||||
EFI_HANDLE *DeviceHandleBuffer;
|
||||
UINTN DeviceHandleCount;
|
||||
UINTN Index;
|
||||
EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
|
||||
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
|
||||
|
||||
//
|
||||
// Get the list of all I2C Controller handles in the handle database.
|
||||
@@ -1185,7 +1186,7 @@ I2cHostUnload (
|
||||
Status = gBS->HandleProtocol (
|
||||
gI2cHostDriverBinding.DriverBindingHandle,
|
||||
&gEfiComponentNameProtocolGuid,
|
||||
(VOID **) &ComponentName
|
||||
(VOID **)&ComponentName
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
gBS->UninstallProtocolInterface (
|
||||
@@ -1198,7 +1199,7 @@ I2cHostUnload (
|
||||
Status = gBS->HandleProtocol (
|
||||
gI2cHostDriverBinding.DriverBindingHandle,
|
||||
&gEfiComponentName2ProtocolGuid,
|
||||
(VOID **) &ComponentName2
|
||||
(VOID **)&ComponentName2
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
gBS->UninstallProtocolInterface (
|
||||
|
Reference in New Issue
Block a user