public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 0/2] MdeModulePkg/UfsPciHc: Code refinements
@ 2017-04-24  5:58 Hao Wu
  2017-04-24  5:58 ` [PATCH v2 1/2] MdeModulePkg/UfsPciHc: Remove unused field in UfsHc private struct Hao Wu
  2017-04-24  5:58 ` [PATCH v2 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart Hao Wu
  0 siblings, 2 replies; 4+ messages in thread
From: Hao Wu @ 2017-04-24  5:58 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao Wu

V2 changes:
Remove assigning the result of restoring original PCI attributes to
'Status'.

V1 history:
1. Remove unused field in UfsHc private struct
2. Avoid overriding return value in BindingStart

Hao Wu (2):
  MdeModulePkg/UfsPciHc: Remove unused field in UfsHc private struct
  MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart

 MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c | 16 +++++++---------
 MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.h |  5 ++---
 2 files changed, 9 insertions(+), 12 deletions(-)

-- 
2.12.0.windows.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] MdeModulePkg/UfsPciHc: Remove unused field in UfsHc private struct
  2017-04-24  5:58 [PATCH v2 0/2] MdeModulePkg/UfsPciHc: Code refinements Hao Wu
@ 2017-04-24  5:58 ` Hao Wu
  2017-04-24  5:58 ` [PATCH v2 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart Hao Wu
  1 sibling, 0 replies; 4+ messages in thread
From: Hao Wu @ 2017-04-24  5:58 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao Wu

The commit removes the unused field 'EFI_HANDLE  Handle' in Ufs host
controller private data structure 'UFS_HOST_CONTROLLER_PRIVATE_DATA'.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c | 3 +--
 MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.h | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c
index 23ebbf108f..373e55b4c2 100644
--- a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c
+++ b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c
@@ -2,7 +2,7 @@
   UfsHcDxe driver is used to provide platform-dependent info, mainly UFS host controller
   MMIO base, to upper layer UFS drivers.
 
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -32,7 +32,6 @@ EFI_DRIVER_BINDING_PROTOCOL gUfsHcDriverBinding = {
 //
 UFS_HOST_CONTROLLER_PRIVATE_DATA gUfsHcTemplate = {
   UFS_HC_PRIVATE_DATA_SIGNATURE,  // Signature
-  NULL,                           // Handle
   {                               // UfsHcProtocol
     UfsHcGetMmioBar,
     UfsHcAllocateBuffer,
diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.h b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.h
index 89f19feb7a..d9d977a5c9 100644
--- a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.h
+++ b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.h
@@ -2,7 +2,7 @@
   UfsHcDxe driver is used to provide platform-dependent info, mainly UFS host controller
   MMIO base, to upper layer UFS drivers.
 
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -49,11 +49,10 @@ extern EFI_COMPONENT_NAME2_PROTOCOL               gUfsHcComponentName2;
 typedef struct _UFS_HOST_CONTROLLER_PRIVATE_DATA  UFS_HOST_CONTROLLER_PRIVATE_DATA;
 
 //
-// Nvme private data structure.
+// Ufs host controller private data structure.
 //
 struct _UFS_HOST_CONTROLLER_PRIVATE_DATA {
   UINT32                             Signature;
-  EFI_HANDLE                         Handle;
 
   EDKII_UFS_HOST_CONTROLLER_PROTOCOL UfsHc;
   EFI_PCI_IO_PROTOCOL                *PciIo;  
-- 
2.12.0.windows.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart
  2017-04-24  5:58 [PATCH v2 0/2] MdeModulePkg/UfsPciHc: Code refinements Hao Wu
  2017-04-24  5:58 ` [PATCH v2 1/2] MdeModulePkg/UfsPciHc: Remove unused field in UfsHc private struct Hao Wu
@ 2017-04-24  5:58 ` Hao Wu
  2017-04-24  6:00   ` Zeng, Star
  1 sibling, 1 reply; 4+ messages in thread
From: Hao Wu @ 2017-04-24  5:58 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao Wu, Star Zeng

In function UfsHcDriverBindingStart(), the return value 'Status' may be
overridden during the original PCI attributes restore process.

This commit refines the logic to avoid such override.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c
index 373e55b4c2..96cf39adc1 100644
--- a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c
+++ b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c
@@ -671,13 +671,12 @@ Done:
       //
       // Restore original PCI attributes
       //
-      Status = PciIo->Attributes (
-                        PciIo,
-                        EfiPciIoAttributeOperationSet,
-                        Private->PciAttributes,
-                        NULL
-                        );
-      ASSERT_EFI_ERROR (Status);
+      PciIo->Attributes (
+               PciIo,
+               EfiPciIoAttributeOperationSet,
+               Private->PciAttributes,
+               NULL
+               );
     }
     gBS->CloseProtocol (
           Controller,
-- 
2.12.0.windows.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart
  2017-04-24  5:58 ` [PATCH v2 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart Hao Wu
@ 2017-04-24  6:00   ` Zeng, Star
  0 siblings, 0 replies; 4+ messages in thread
From: Zeng, Star @ 2017-04-24  6:00 UTC (permalink / raw)
  To: Wu, Hao A, edk2-devel@lists.01.org; +Cc: Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com>

Thanks,
Star
-----Original Message-----
From: Wu, Hao A 
Sent: Monday, April 24, 2017 1:59 PM
To: edk2-devel@lists.01.org
Cc: Wu, Hao A <hao.a.wu@intel.com>; Zeng, Star <star.zeng@intel.com>
Subject: [PATCH v2 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart

In function UfsHcDriverBindingStart(), the return value 'Status' may be overridden during the original PCI attributes restore process.

This commit refines the logic to avoid such override.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c
index 373e55b4c2..96cf39adc1 100644
--- a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c
+++ b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c
@@ -671,13 +671,12 @@ Done:
       //
       // Restore original PCI attributes
       //
-      Status = PciIo->Attributes (
-                        PciIo,
-                        EfiPciIoAttributeOperationSet,
-                        Private->PciAttributes,
-                        NULL
-                        );
-      ASSERT_EFI_ERROR (Status);
+      PciIo->Attributes (
+               PciIo,
+               EfiPciIoAttributeOperationSet,
+               Private->PciAttributes,
+               NULL
+               );
     }
     gBS->CloseProtocol (
           Controller,
--
2.12.0.windows.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-24  6:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-24  5:58 [PATCH v2 0/2] MdeModulePkg/UfsPciHc: Code refinements Hao Wu
2017-04-24  5:58 ` [PATCH v2 1/2] MdeModulePkg/UfsPciHc: Remove unused field in UfsHc private struct Hao Wu
2017-04-24  5:58 ` [PATCH v2 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart Hao Wu
2017-04-24  6:00   ` Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox