diff mbox

[edk2,20/47] MdeModulePkg/UsbBusDxe: rebase to ARRAY_SIZE()

Message ID 20161026190504.9888-21-lersek@redhat.com
State Accepted
Commit 60a2d24822b5029644edc80dd767f405a74f35ee
Headers show

Commit Message

Laszlo Ersek Oct. 26, 2016, 7:04 p.m. UTC
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.9.2


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

Patch

diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
index f51a51f191ad..fabb44157037 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
@@ -884,7 +884,7 @@  UsbHubClearPortChange (
   // It may lead to extra port state report. USB bus should
   // be able to handle this.
   //
-  for (Index = 0; Index < sizeof (mHubFeatureMap) / sizeof (mHubFeatureMap[0]); Index++) {
+  for (Index = 0; Index < ARRAY_SIZE (mHubFeatureMap); Index++) {
     Map = &mHubFeatureMap[Index];
 
     if (USB_BIT_IS_SET (PortState.PortChangeStatus, Map->ChangedBit)) {
@@ -1180,7 +1180,7 @@  UsbRootHubClearPortChange (
   // It may lead to extra port state report. USB bus should
   // be able to handle this.
   //
-  for (Index = 0; Index < sizeof (mRootHubFeatureMap) / sizeof (mRootHubFeatureMap[0]); Index++) {
+  for (Index = 0; Index < ARRAY_SIZE (mRootHubFeatureMap); Index++) {
     Map = &mRootHubFeatureMap[Index];
 
     if (USB_BIT_IS_SET (PortState.PortChangeStatus, Map->ChangedBit)) {