Author: Steve Langasek <steve.langasek@ubuntu.com>
Description: use the right enums for an enum field
 This code tries to assign/compare values taken from one enum type to a
 variable which is of a different enum type.  Just because the numeric
 values happen to line up doesn't make it right.

Index: edk2-0~20121205.edae8d2d/Shell/mm/mm.c
===================================================================
--- edk2-0~20121205.edae8d2d.orig/Shell/mm/mm.c
+++ edk2-0~20121205.edae8d2d/Shell/mm/mm.c
@@ -271,7 +271,7 @@
     //
     // Parse arguments
     //
-    Width       = EfiPciWidthUint8;
+    Width       = IO_UINT8;
     Size        = 1;
     AccessType  = EfiMemory;
     AddressStr  = NULL;
@@ -364,22 +364,22 @@
 
       switch (ItemValue) {
       case 1:
-        Width = EfiPciWidthUint8;
+        Width = IO_UINT8;
         Size  = 1;
         break;
 
       case 2:
-        Width = EfiPciWidthUint16;
+        Width = IO_UINT16;
         Size  = 2;
         break;
 
       case 4:
-        Width = EfiPciWidthUint32;
+        Width = IO_UINT32;
         Size  = 4;
         break;
 
       case 8:
-        Width = EfiPciWidthUint64;
+        Width = IO_UINT64;
         Size  = 8;
         break;
 
@@ -669,16 +669,16 @@
   )
 {
   do {
-    if (Width == EfiPciWidthUint8) {
+    if (Width == IO_UINT8) {
       *(UINT8 *) Buffer = *(UINT8 *) (UINTN) Address;
       Address -= 1;
-    } else if (Width == EfiPciWidthUint16) {
+    } else if (Width == IO_UINT16) {
       *(UINT16 *) Buffer = *(UINT16 *) (UINTN) Address;
       Address -= 2;
-    } else if (Width == EfiPciWidthUint32) {
+    } else if (Width == IO_UINT32) {
       *(UINT32 *) Buffer = *(UINT32 *) (UINTN) Address;
       Address -= 4;
-    } else if (Width == EfiPciWidthUint64) {
+    } else if (Width == IO_UINT64) {
       *(UINT64 *) Buffer = *(UINT64 *) (UINTN) Address;
       Address -= 8;
     } else {
@@ -701,16 +701,16 @@
   )
 {
   do {
-    if (Width == EfiPciWidthUint8) {
+    if (Width == IO_UINT8) {
       *(UINT8 *) (UINTN) Address = *(UINT8 *) Buffer;
       Address += 1;
-    } else if (Width == EfiPciWidthUint16) {
+    } else if (Width == IO_UINT16) {
       *(UINT16 *) (UINTN) Address = *(UINT16 *) Buffer;
       Address += 2;
-    } else if (Width == EfiPciWidthUint32) {
+    } else if (Width == IO_UINT32) {
       *(UINT32 *) (UINTN) Address = *(UINT32 *) Buffer;
       Address += 4;
-    } else if (Width == EfiPciWidthUint64) {
+    } else if (Width == IO_UINT64) {
       *(UINT64 *) (UINTN) Address = *(UINT64 *) Buffer;
       Address += 8;
     } else {
@@ -804,7 +804,7 @@
   //
   // Parse arguments
   //
-  *Width                = EfiPciWidthUint8;
+  *Width                = IO_UINT8;
   *Size                 = 1;
   *AccessType           = EfiMemory;
   AddressStr            = WidthStr = NULL;
@@ -881,22 +881,22 @@
       WidthStr = Ptr;
       switch (Xtoi (WidthStr)) {
       case 1:
-        *Width  = EfiPciWidthUint8;
+        *Width  = IO_UINT8;
         *Size   = 1;
         continue;
 
       case 2:
-        *Width  = EfiPciWidthUint16;
+        *Width  = IO_UINT16;
         *Size   = 2;
         continue;
 
       case 4:
-        *Width  = EfiPciWidthUint32;
+        *Width  = IO_UINT32;
         *Size   = 4;
         continue;
 
       case 8:
-        *Width  = EfiPciWidthUint64;
+        *Width  = IO_UINT64;
         *Size   = 8;
         continue;
 
