diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:02 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 1436aea4d5707e672672a11bda72be2c63c936c3 (patch) | |
tree | 370c9d5bd8823aa8ea7bce71a0f29bff71feff67 /MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c | |
parent | 7c7184e201a90a1d2376e615e55e3f4074731468 (diff) | |
download | edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.gz edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.bz2 edk2-1436aea4d5707e672672a11bda72be2c63c936c3.zip |
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>
Diffstat (limited to 'MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c')
-rw-r--r-- | MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c | 145 |
1 files changed, 74 insertions, 71 deletions
diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c index 4be90d7a80..5756ef0791 100644 --- a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c +++ b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c @@ -12,7 +12,7 @@ //
// NVM Express Driver Binding Protocol Instance
//
-EFI_DRIVER_BINDING_PROTOCOL gUfsHcDriverBinding = {
+EFI_DRIVER_BINDING_PROTOCOL gUfsHcDriverBinding = {
UfsHcDriverBindingSupported,
UfsHcDriverBindingStart,
UfsHcDriverBindingStop,
@@ -24,7 +24,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUfsHcDriverBinding = { //
// Template for Ufs host controller private data.
//
-UFS_HOST_CONTROLLER_PRIVATE_DATA gUfsHcTemplate = {
+UFS_HOST_CONTROLLER_PRIVATE_DATA gUfsHcTemplate = {
UFS_HC_PRIVATE_DATA_SIGNATURE, // Signature
{ // UfsHcProtocol
UfsHcGetMmioBar,
@@ -53,15 +53,15 @@ UFS_HOST_CONTROLLER_PRIVATE_DATA gUfsHcTemplate = { EFI_STATUS
EFIAPI
UfsHcGetMmioBar (
- IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,
- OUT UINTN *MmioBar
+ IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,
+ OUT UINTN *MmioBar
)
{
- UFS_HOST_CONTROLLER_PRIVATE_DATA *Private;
- EFI_PCI_IO_PROTOCOL *PciIo;
- EFI_STATUS Status;
- UINT8 BarIndex;
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *BarDesc;
+ UFS_HOST_CONTROLLER_PRIVATE_DATA *Private;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ EFI_STATUS Status;
+ UINT8 BarIndex;
+ EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *BarDesc;
if ((This == NULL) || (MmioBar == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -76,7 +76,7 @@ UfsHcGetMmioBar ( PciIo,
BarIndex,
NULL,
- (VOID**) &BarDesc
+ (VOID **)&BarDesc
);
if (EFI_ERROR (Status)) {
return Status;
@@ -115,8 +115,8 @@ UfsHcMap ( IN EDKII_UFS_HOST_CONTROLLER_OPERATION Operation,
IN VOID *HostAddress,
IN OUT UINTN *NumberOfBytes,
- OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
- OUT VOID **Mapping
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
+ OUT VOID **Mapping
)
{
UFS_HOST_CONTROLLER_PRIVATE_DATA *Private;
@@ -130,7 +130,7 @@ UfsHcMap ( Private = UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC (This);
PciIo = Private->PciIo;
- Status = PciIo->Map (PciIo, (EFI_PCI_IO_PROTOCOL_OPERATION)Operation, HostAddress, NumberOfBytes, DeviceAddress, Mapping);
+ Status = PciIo->Map (PciIo, (EFI_PCI_IO_PROTOCOL_OPERATION)Operation, HostAddress, NumberOfBytes, DeviceAddress, Mapping);
return Status;
}
@@ -147,8 +147,8 @@ UfsHcMap ( EFI_STATUS
EFIAPI
UfsHcUnmap (
- IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,
- IN VOID *Mapping
+ IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,
+ IN VOID *Mapping
)
{
UFS_HOST_CONTROLLER_PRIVATE_DATA *Private;
@@ -162,7 +162,7 @@ UfsHcUnmap ( Private = UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC (This);
PciIo = Private->PciIo;
- Status = PciIo->Unmap (PciIo, Mapping);
+ Status = PciIo->Unmap (PciIo, Mapping);
return Status;
}
@@ -189,12 +189,12 @@ UfsHcUnmap ( EFI_STATUS
EFIAPI
UfsHcAllocateBuffer (
- IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,
- IN EFI_ALLOCATE_TYPE Type,
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages,
- OUT VOID **HostAddress,
- IN UINT64 Attributes
+ IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,
+ IN EFI_ALLOCATE_TYPE Type,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ OUT VOID **HostAddress,
+ IN UINT64 Attributes
)
{
UFS_HOST_CONTROLLER_PRIVATE_DATA *Private;
@@ -208,7 +208,7 @@ UfsHcAllocateBuffer ( Private = UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC (This);
PciIo = Private->PciIo;
- Status = PciIo->AllocateBuffer (PciIo, Type, MemoryType, Pages, HostAddress, Attributes);
+ Status = PciIo->AllocateBuffer (PciIo, Type, MemoryType, Pages, HostAddress, Attributes);
return Status;
}
@@ -227,9 +227,9 @@ UfsHcAllocateBuffer ( EFI_STATUS
EFIAPI
UfsHcFreeBuffer (
- IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,
- IN UINTN Pages,
- IN VOID *HostAddress
+ IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This,
+ IN UINTN Pages,
+ IN VOID *HostAddress
)
{
UFS_HOST_CONTROLLER_PRIVATE_DATA *Private;
@@ -243,7 +243,7 @@ UfsHcFreeBuffer ( Private = UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC (This);
PciIo = Private->PciIo;
- Status = PciIo->FreeBuffer (PciIo, Pages, HostAddress);
+ Status = PciIo->FreeBuffer (PciIo, Pages, HostAddress);
return Status;
}
@@ -261,7 +261,7 @@ UfsHcFreeBuffer ( EFI_STATUS
EFIAPI
UfsHcFlush (
- IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This
+ IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This
)
{
UFS_HOST_CONTROLLER_PRIVATE_DATA *Private;
@@ -271,7 +271,7 @@ UfsHcFlush ( Private = UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC (This);
PciIo = Private->PciIo;
- Status = PciIo->Flush (PciIo);
+ Status = PciIo->Flush (PciIo);
return Status;
}
@@ -312,7 +312,7 @@ UfsHcMmioRead ( PciIo = Private->PciIo;
BarIndex = Private->BarIndex;
- Status = PciIo->Mem.Read (PciIo, (EFI_PCI_IO_PROTOCOL_WIDTH)Width, BarIndex, Offset, Count, Buffer);
+ Status = PciIo->Mem.Read (PciIo, (EFI_PCI_IO_PROTOCOL_WIDTH)Width, BarIndex, Offset, Count, Buffer);
return Status;
}
@@ -354,7 +354,7 @@ UfsHcMmioWrite ( PciIo = Private->PciIo;
BarIndex = Private->BarIndex;
- Status = PciIo->Mem.Write (PciIo, (EFI_PCI_IO_PROTOCOL_WIDTH)Width, BarIndex, Offset, Count, Buffer);
+ Status = PciIo->Mem.Write (PciIo, (EFI_PCI_IO_PROTOCOL_WIDTH)Width, BarIndex, Offset, Count, Buffer);
return Status;
}
@@ -426,7 +426,7 @@ UfsHcDriverBindingSupported ( Status = gBS->OpenProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
- (VOID *) &ParentDevicePath,
+ (VOID *)&ParentDevicePath,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -437,15 +437,16 @@ UfsHcDriverBindingSupported ( //
return Status;
}
+
//
// Close the protocol because we don't use it here
//
gBS->CloseProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
+ Controller,
+ &gEfiDevicePathProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
//
// Now test the EfiPciIoProtocol
@@ -453,7 +454,7 @@ UfsHcDriverBindingSupported ( Status = gBS->OpenProtocol (
Controller,
&gEfiPciIoProtocolGuid,
- (VOID **) &PciIo,
+ (VOID **)&PciIo,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -461,6 +462,7 @@ UfsHcDriverBindingSupported ( if (EFI_ERROR (Status)) {
return Status;
}
+
//
// Now further check the PCI header: Base class (offset 0x0B) and
// Sub Class (offset 0x0A). This controller should be an UFS controller
@@ -474,28 +476,30 @@ UfsHcDriverBindingSupported ( );
if (EFI_ERROR (Status)) {
gBS->CloseProtocol (
- Controller,
- &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
return EFI_UNSUPPORTED;
}
+
//
// Since we already got the PciData, we can close protocol to avoid to carry it on for multiple exit points.
//
gBS->CloseProtocol (
- Controller,
- &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
//
// Examine UFS Host Controller PCI Configuration table fields
//
if (PciData.Hdr.ClassCode[2] == PCI_CLASS_MASS_STORAGE) {
- if (PciData.Hdr.ClassCode[1] == 0x09 ) { //UFS Controller Subclass
+ if (PciData.Hdr.ClassCode[1] == 0x09 ) {
+ // UFS Controller Subclass
UfsHcFound = TRUE;
}
}
@@ -507,7 +511,6 @@ UfsHcDriverBindingSupported ( return Status;
}
-
/**
Starts a device controller or a bus controller.
@@ -551,12 +554,12 @@ UfsHcDriverBindingStart ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
- EFI_STATUS Status;
- EFI_PCI_IO_PROTOCOL *PciIo;
- UFS_HOST_CONTROLLER_PRIVATE_DATA *Private;
- UINT64 Supports;
- UINT8 BarIndex;
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *BarDesc;
+ EFI_STATUS Status;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ UFS_HOST_CONTROLLER_PRIVATE_DATA *Private;
+ UINT64 Supports;
+ UINT8 BarIndex;
+ EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *BarDesc;
PciIo = NULL;
Private = NULL;
@@ -569,7 +572,7 @@ UfsHcDriverBindingStart ( Status = gBS->OpenProtocol (
Controller,
&gEfiPciIoProtocolGuid,
- (VOID **) &PciIo,
+ (VOID **)&PciIo,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -602,7 +605,7 @@ UfsHcDriverBindingStart ( PciIo,
BarIndex,
NULL,
- (VOID**) &BarDesc
+ (VOID **)&BarDesc
);
if (Status == EFI_UNSUPPORTED) {
continue;
@@ -656,7 +659,7 @@ UfsHcDriverBindingStart ( &Controller,
&gEdkiiUfsHostControllerProtocolGuid,
EFI_NATIVE_INTERFACE,
- (VOID*)&(Private->UfsHc)
+ (VOID *)&(Private->UfsHc)
);
Done:
@@ -672,12 +675,13 @@ Done: NULL
);
}
+
gBS->CloseProtocol (
- Controller,
- &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
if (Private != NULL) {
FreePool (Private);
}
@@ -686,7 +690,6 @@ Done: return Status;
}
-
/**
Stops a device controller or a bus controller.
@@ -716,10 +719,10 @@ Done: EFI_STATUS
EFIAPI
UfsHcDriverBindingStop (
- 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;
@@ -732,7 +735,7 @@ UfsHcDriverBindingStop ( Status = gBS->OpenProtocol (
Controller,
&gEdkiiUfsHostControllerProtocolGuid,
- (VOID **) &UfsHc,
+ (VOID **)&UfsHc,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
@@ -794,7 +797,7 @@ UfsHcDriverEntry ( IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
Status = EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
|