]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c
1. Add the GLOBAL_REMOVE_IF_UNREFERENCED to globe variables which are used only in...
[mirror_edk2.git] / EdkModulePkg / Bus / Usb / UsbBus / Dxe / usbbus.c
index 1d1f44d63874e30f8cba948cb31ad857be97f808..d9387a60b1171f0dc578c540068da7fa1bfd9e00 100644 (file)
@@ -23,8 +23,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "usbbus.h"\r
 \r
-UINTN                       gUSBDebugLevel  = EFI_D_INFO;\r
-UINTN                       gUSBErrorLevel  = EFI_D_ERROR;\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED    UINTN    gUSBDebugLevel  = EFI_D_INFO;\r
+GLOBAL_REMOVE_IF_UNREFERENCED    UINTN    gUSBErrorLevel  = EFI_D_ERROR;\r
 \r
 //\r
 // The UsbBusProtocol is just used to locate USB_BUS_CONTROLLER\r
@@ -2328,17 +2329,18 @@ UsbPortReset (
 --*/\r
 {\r
   USB_IO_CONTROLLER_DEVICE  *UsbIoController;\r
-  EFI_STATUS                Status;\r
 \r
   UsbIoController = USB_IO_CONTROLLER_DEVICE_FROM_USB_IO_THIS (This);\r
 \r
+  if (IsHub (UsbIoController)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+  \r
   //\r
   // Since at this time, this device has already been configured,\r
   // it needs to be re-configured.\r
   //\r
-  Status = ParentPortReset (UsbIoController, TRUE, 0);\r
-\r
-  return Status;\r
+  return ParentPortReset (UsbIoController, TRUE, 0);\r
 }\r
 \r
 EFI_STATUS\r