]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
Check Library usage and fix some typo.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / UsbHub.c
index fdcde5d90f76231b8203de9c084d506f26016e73..ac893e4e2a4d021425dd2b3b0263e3d67dac03f6 100644 (file)
@@ -252,7 +252,7 @@ UsbHubCtrlGetHubStatus (
   @param  State                 Variable to return the hub port state.\r
 \r
   @retval EFI_SUCCESS           The port state is returned in State.\r
-  @retval Others                Failed to retrive the port state.\r
+  @retval Others                Failed to retrieve the port state.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -627,6 +627,7 @@ UsbHubInit (
   USB_DEVICE              *HubDev;\r
   EFI_STATUS              Status;\r
   UINT8                   Index;\r
+  UINT8                   NumEndpoints;\r
 \r
   //\r
   // Locate the interrupt endpoint for port change map\r
@@ -635,8 +636,9 @@ UsbHubInit (
   Setting       = HubIf->IfSetting;\r
   HubDev        = HubIf->Device;\r
   EpDesc        = NULL;\r
+  NumEndpoints  = Setting->Desc.NumEndpoints;\r
 \r
-  for (Index = 0; Index < Setting->Desc.NumEndpoints; Index++) {\r
+  for (Index = 0; Index < NumEndpoints; Index++) {\r
     ASSERT ((Setting->Endpoints != NULL) && (Setting->Endpoints[Index] != NULL));\r
 \r
     EpDesc = Setting->Endpoints[Index];\r
@@ -647,7 +649,7 @@ UsbHubInit (
     }\r
   }\r
 \r
-  if (Index == Setting->Desc.NumEndpoints) {\r
+  if (Index == NumEndpoints) {\r
     DEBUG (( EFI_D_ERROR, "UsbHubInit: no interrupt endpoint found for hub %d\n", HubDev->Address));\r
     return EFI_DEVICE_ERROR;\r
   }\r
@@ -862,7 +864,7 @@ UsbHubClearPortFeature (
 \r
 \r
 /**\r
-  Interface funtion to reset the port.\r
+  Interface function to reset the port.\r
 \r
   @param  HubIf                 The hub interface.\r
   @param  Port                  The port to reset.\r
@@ -964,7 +966,7 @@ UsbHubRelease (
 \r
   @param  HubIf                 The root hub interface.\r
 \r
-  @retval EFI_SUCCESS           The interface is initialied for root hub.\r
+  @retval EFI_SUCCESS           The interface is initialized for root hub.\r
   @retval Others                Failed to initialize the hub.\r
 \r
 **/\r
@@ -1155,7 +1157,7 @@ UsbRootHubClearPortFeature (
 \r
 \r
 /**\r
-  Interface funtion to reset the root hub port.\r
+  Interface function to reset the root hub port.\r
 \r
   @param  RootIf                The root hub interface.\r
   @param  Port                  The port to reset.\r