[edk2] [PATCH 10/26] MdeModulePkg XhciPei: Remove redundant functions

shenglei posted 26 patches 6 years, 9 months ago
There is a newer version of this series
[edk2] [PATCH 10/26] MdeModulePkg XhciPei: Remove redundant functions
Posted by shenglei 6 years, 9 months ago
The functions that are never called have been removed.
They are XhcPeiReadDoorBellReg and UsbHcUnlinkMemBlock.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
---
 MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c | 24 ------------------------
 MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c  | 22 ----------------------
 MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h  | 14 --------------
 3 files changed, 60 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
index 5d0232ca56..442a613095 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
@@ -328,31 +328,7 @@ UsbHcIsMemBlockEmpty (
   return TRUE;
 }
 
-/**
-  Unlink the memory block from the pool's list.
-
-  @param  Head          The block list head of the memory's pool.
-  @param  BlockToUnlink The memory block to unlink.
 
-**/
-VOID
-UsbHcUnlinkMemBlock (
-  IN USBHC_MEM_BLOCK    *Head,
-  IN USBHC_MEM_BLOCK    *BlockToUnlink
-  )
-{
-  USBHC_MEM_BLOCK       *Block;
-
-  ASSERT ((Head != NULL) && (BlockToUnlink != NULL));
-
-  for (Block = Head; Block != NULL; Block = Block->Next) {
-    if (Block->Next == BlockToUnlink) {
-      Block->Next         = BlockToUnlink->Next;
-      BlockToUnlink->Next = NULL;
-      break;
-    }
-  }
-}
 
 /**
   Initialize the memory management pool for the host controller.
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
index c5631e87ca..ee4d1f97bd 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
@@ -211,29 +211,7 @@ XhcPeiReadCapRegister (
   return Data;
 }
 
-/**
-  Read XHCI door bell register.
-
-  @param  Xhc       The XHCI device.
-  @param  Offset    The offset of the door bell register.
-
-  @return The register content read
 
-**/
-UINT32
-XhcPeiReadDoorBellReg (
-  IN  PEI_XHC_DEV       *Xhc,
-  IN  UINT32            Offset
-  )
-{
-  UINT32                  Data;
-
-  ASSERT (Xhc->DBOff != 0);
-
-  Data = MmioRead32 (Xhc->UsbHostControllerBaseAddress + Xhc->DBOff + Offset);
-
-  return Data;
-}
 
 /**
   Write the data to the XHCI door bell register.
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h b/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
index 0297072ffd..3787aeccf5 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
@@ -302,20 +302,6 @@ XhcPeiWaitOpRegBit (
   IN UINT32             Timeout
   );
 
-/**
-  Read XHCI door bell register.
-
-  @param  Xhc           The XHCI device.
-  @param  Offset        The offset of the door bell register.
-
-  @return The register content read
-
-**/
-UINT32
-XhcPeiReadDoorBellReg (
-  IN  PEI_XHC_DEV       *Xhc,
-  IN  UINT32            Offset
-  );
 
 /**
   Write the data to the XHCI door bell register.
-- 
2.18.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 10/26] MdeModulePkg XhciPei: Remove redundant functions
Posted by Ni, Ruiyu 6 years, 9 months ago
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

Thanks/Ray

> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of shenglei
> Sent: Wednesday, August 8, 2018 4:47 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] [PATCH 10/26] MdeModulePkg XhciPei: Remove redundant
> functions
> 
> The functions that are never called have been removed.
> They are XhcPeiReadDoorBellReg and UsbHcUnlinkMemBlock.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1062
> 
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: shenglei <shenglei.zhang@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c | 24 ------------------------
> MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c  | 22 ----------------------
> MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h  | 14 --------------
>  3 files changed, 60 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
> b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
> index 5d0232ca56..442a613095 100644
> --- a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
> +++ b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
> @@ -328,31 +328,7 @@ UsbHcIsMemBlockEmpty (
>    return TRUE;
>  }
> 
> -/**
> -  Unlink the memory block from the pool's list.
> -
> -  @param  Head          The block list head of the memory's pool.
> -  @param  BlockToUnlink The memory block to unlink.
> 
> -**/
> -VOID
> -UsbHcUnlinkMemBlock (
> -  IN USBHC_MEM_BLOCK    *Head,
> -  IN USBHC_MEM_BLOCK    *BlockToUnlink
> -  )
> -{
> -  USBHC_MEM_BLOCK       *Block;
> -
> -  ASSERT ((Head != NULL) && (BlockToUnlink != NULL));
> -
> -  for (Block = Head; Block != NULL; Block = Block->Next) {
> -    if (Block->Next == BlockToUnlink) {
> -      Block->Next         = BlockToUnlink->Next;
> -      BlockToUnlink->Next = NULL;
> -      break;
> -    }
> -  }
> -}
> 
>  /**
>    Initialize the memory management pool for the host controller.
> diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
> b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
> index c5631e87ca..ee4d1f97bd 100644
> --- a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
> +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
> @@ -211,29 +211,7 @@ XhcPeiReadCapRegister (
>    return Data;
>  }
> 
> -/**
> -  Read XHCI door bell register.
> -
> -  @param  Xhc       The XHCI device.
> -  @param  Offset    The offset of the door bell register.
> -
> -  @return The register content read
> 
> -**/
> -UINT32
> -XhcPeiReadDoorBellReg (
> -  IN  PEI_XHC_DEV       *Xhc,
> -  IN  UINT32            Offset
> -  )
> -{
> -  UINT32                  Data;
> -
> -  ASSERT (Xhc->DBOff != 0);
> -
> -  Data = MmioRead32 (Xhc->UsbHostControllerBaseAddress + Xhc->DBOff +
> Offset);
> -
> -  return Data;
> -}
> 
>  /**
>    Write the data to the XHCI door bell register.
> diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
> b/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
> index 0297072ffd..3787aeccf5 100644
> --- a/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
> +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
> @@ -302,20 +302,6 @@ XhcPeiWaitOpRegBit (
>    IN UINT32             Timeout
>    );
> 
> -/**
> -  Read XHCI door bell register.
> -
> -  @param  Xhc           The XHCI device.
> -  @param  Offset        The offset of the door bell register.
> -
> -  @return The register content read
> -
> -**/
> -UINT32
> -XhcPeiReadDoorBellReg (
> -  IN  PEI_XHC_DEV       *Xhc,
> -  IN  UINT32            Offset
> -  );
> 
>  /**
>    Write the data to the XHCI door bell register.
> --
> 2.18.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 10/26] MdeModulePkg XhciPei: Remove redundant functions
Posted by Zeng, Star 6 years, 9 months ago
Reviewed-by: Star Zeng <star.zeng@intel.com>

-----Original Message-----
From: Zhang, Shenglei 
Sent: Wednesday, August 8, 2018 4:47 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>; Dong, Eric <eric.dong@intel.com>
Subject: [PATCH 10/26] MdeModulePkg XhciPei: Remove redundant functions

The functions that are never called have been removed.
They are XhcPeiReadDoorBellReg and UsbHcUnlinkMemBlock.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
---
 MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c | 24 ------------------------  MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c  | 22 ----------------------  MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h  | 14 --------------
 3 files changed, 60 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
index 5d0232ca56..442a613095 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c
@@ -328,31 +328,7 @@ UsbHcIsMemBlockEmpty (
   return TRUE;
 }
 
-/**
-  Unlink the memory block from the pool's list.
-
-  @param  Head          The block list head of the memory's pool.
-  @param  BlockToUnlink The memory block to unlink.
 
-**/
-VOID
-UsbHcUnlinkMemBlock (
-  IN USBHC_MEM_BLOCK    *Head,
-  IN USBHC_MEM_BLOCK    *BlockToUnlink
-  )
-{
-  USBHC_MEM_BLOCK       *Block;
-
-  ASSERT ((Head != NULL) && (BlockToUnlink != NULL));
-
-  for (Block = Head; Block != NULL; Block = Block->Next) {
-    if (Block->Next == BlockToUnlink) {
-      Block->Next         = BlockToUnlink->Next;
-      BlockToUnlink->Next = NULL;
-      break;
-    }
-  }
-}
 
 /**
   Initialize the memory management pool for the host controller.
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
index c5631e87ca..ee4d1f97bd 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
@@ -211,29 +211,7 @@ XhcPeiReadCapRegister (
   return Data;
 }
 
-/**
-  Read XHCI door bell register.
-
-  @param  Xhc       The XHCI device.
-  @param  Offset    The offset of the door bell register.
-
-  @return The register content read
 
-**/
-UINT32
-XhcPeiReadDoorBellReg (
-  IN  PEI_XHC_DEV       *Xhc,
-  IN  UINT32            Offset
-  )
-{
-  UINT32                  Data;
-
-  ASSERT (Xhc->DBOff != 0);
-
-  Data = MmioRead32 (Xhc->UsbHostControllerBaseAddress + Xhc->DBOff + Offset);
-
-  return Data;
-}
 
 /**
   Write the data to the XHCI door bell register.
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h b/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
index 0297072ffd..3787aeccf5 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h
@@ -302,20 +302,6 @@ XhcPeiWaitOpRegBit (
   IN UINT32             Timeout
   );
 
-/**
-  Read XHCI door bell register.
-
-  @param  Xhc           The XHCI device.
-  @param  Offset        The offset of the door bell register.
-
-  @return The register content read
-
-**/
-UINT32
-XhcPeiReadDoorBellReg (
-  IN  PEI_XHC_DEV       *Xhc,
-  IN  UINT32            Offset
-  );
 
 /**
   Write the data to the XHCI door bell register.
--
2.18.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel