public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/NonDiscoverablePciDev: Fix type mismatch in switch/case
@ 2016-12-12  1:26 Hao Wu
  2016-12-12  3:18 ` Ni, Ruiyu
  0 siblings, 1 reply; 2+ messages in thread
From: Hao Wu @ 2016-12-12  1:26 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao Wu, Ard Biesheuvel, Ruiyu Ni

Fix switch/case statement type mismatch in functions PciIoMemRead &
PciIoMemWrite.

Parameter 'Width' is of enum type EFI_PCI_IO_PROTOCOL_WIDTH, but the enum
type provided in 'switch (Width)' block is of type
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 .../NonDiscoverablePciDeviceIo.c                   | 48 +++++++++++-----------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
index 56482e3..82ee9d1 100644
--- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
+++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
@@ -189,22 +189,22 @@ PciIoMemRead (
   }
 
   switch (Width) {
-  case EfiPciWidthUint8:
-  case EfiPciWidthUint16:
-  case EfiPciWidthUint32:
-  case EfiPciWidthUint64:
+  case EfiPciIoWidthUint8:
+  case EfiPciIoWidthUint16:
+  case EfiPciIoWidthUint32:
+  case EfiPciIoWidthUint64:
     return PciIoMemRW (Width, Count, 1, Buffer, 1, Address);
 
-  case EfiPciWidthFifoUint8:
-  case EfiPciWidthFifoUint16:
-  case EfiPciWidthFifoUint32:
-  case EfiPciWidthFifoUint64:
+  case EfiPciIoWidthFifoUint8:
+  case EfiPciIoWidthFifoUint16:
+  case EfiPciIoWidthFifoUint32:
+  case EfiPciIoWidthFifoUint64:
     return PciIoMemRW (Width, Count, 1, Buffer, 0, Address);
 
-  case EfiPciWidthFillUint8:
-  case EfiPciWidthFillUint16:
-  case EfiPciWidthFillUint32:
-  case EfiPciWidthFillUint64:
+  case EfiPciIoWidthFillUint8:
+  case EfiPciIoWidthFillUint16:
+  case EfiPciIoWidthFillUint32:
+  case EfiPciIoWidthFillUint64:
     return PciIoMemRW (Width, Count, 0, Buffer, 1, Address);
 
   default:
@@ -256,22 +256,22 @@ PciIoMemWrite (
   }
 
   switch (Width) {
-  case EfiPciWidthUint8:
-  case EfiPciWidthUint16:
-  case EfiPciWidthUint32:
-  case EfiPciWidthUint64:
+  case EfiPciIoWidthUint8:
+  case EfiPciIoWidthUint16:
+  case EfiPciIoWidthUint32:
+  case EfiPciIoWidthUint64:
     return PciIoMemRW (Width, Count, 1, Address, 1, Buffer);
 
-  case EfiPciWidthFifoUint8:
-  case EfiPciWidthFifoUint16:
-  case EfiPciWidthFifoUint32:
-  case EfiPciWidthFifoUint64:
+  case EfiPciIoWidthFifoUint8:
+  case EfiPciIoWidthFifoUint16:
+  case EfiPciIoWidthFifoUint32:
+  case EfiPciIoWidthFifoUint64:
     return PciIoMemRW (Width, Count, 0, Address, 1, Buffer);
 
-  case EfiPciWidthFillUint8:
-  case EfiPciWidthFillUint16:
-  case EfiPciWidthFillUint32:
-  case EfiPciWidthFillUint64:
+  case EfiPciIoWidthFillUint8:
+  case EfiPciIoWidthFillUint16:
+  case EfiPciIoWidthFillUint32:
+  case EfiPciIoWidthFillUint64:
     return PciIoMemRW (Width, Count, 1, Address, 0, Buffer);
 
   default:
-- 
1.9.5.msysgit.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MdeModulePkg/NonDiscoverablePciDev: Fix type mismatch in switch/case
  2016-12-12  1:26 [PATCH] MdeModulePkg/NonDiscoverablePciDev: Fix type mismatch in switch/case Hao Wu
@ 2016-12-12  3:18 ` Ni, Ruiyu
  0 siblings, 0 replies; 2+ messages in thread
From: Ni, Ruiyu @ 2016-12-12  3:18 UTC (permalink / raw)
  To: Wu, Hao A, edk2-devel@lists.01.org; +Cc: Ard Biesheuvel

Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

Thanks/Ray

> -----Original Message-----
> From: Wu, Hao A
> Sent: Monday, December 12, 2016 9:27 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Ard Biesheuvel
> <ard.biesheuvel@linaro.org>; Ni, Ruiyu <ruiyu.ni@intel.com>
> Subject: [PATCH] MdeModulePkg/NonDiscoverablePciDev: Fix type
> mismatch in switch/case
> 
> Fix switch/case statement type mismatch in functions PciIoMemRead &
> PciIoMemWrite.
> 
> Parameter 'Width' is of enum type EFI_PCI_IO_PROTOCOL_WIDTH, but the
> enum type provided in 'switch (Width)' block is of type
> EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH.
> 
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Hao Wu <hao.a.wu@intel.com>
> ---
>  .../NonDiscoverablePciDeviceIo.c                   | 48 +++++++++++-----------
>  1 file changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> PciDeviceIo.c
> b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> PciDeviceIo.c
> index 56482e3..82ee9d1 100644
> ---
> a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> PciDeviceIo.c
> +++
> b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> Pc
> +++ iDeviceIo.c
> @@ -189,22 +189,22 @@ PciIoMemRead (
>    }
> 
>    switch (Width) {
> -  case EfiPciWidthUint8:
> -  case EfiPciWidthUint16:
> -  case EfiPciWidthUint32:
> -  case EfiPciWidthUint64:
> +  case EfiPciIoWidthUint8:
> +  case EfiPciIoWidthUint16:
> +  case EfiPciIoWidthUint32:
> +  case EfiPciIoWidthUint64:
>      return PciIoMemRW (Width, Count, 1, Buffer, 1, Address);
> 
> -  case EfiPciWidthFifoUint8:
> -  case EfiPciWidthFifoUint16:
> -  case EfiPciWidthFifoUint32:
> -  case EfiPciWidthFifoUint64:
> +  case EfiPciIoWidthFifoUint8:
> +  case EfiPciIoWidthFifoUint16:
> +  case EfiPciIoWidthFifoUint32:
> +  case EfiPciIoWidthFifoUint64:
>      return PciIoMemRW (Width, Count, 1, Buffer, 0, Address);
> 
> -  case EfiPciWidthFillUint8:
> -  case EfiPciWidthFillUint16:
> -  case EfiPciWidthFillUint32:
> -  case EfiPciWidthFillUint64:
> +  case EfiPciIoWidthFillUint8:
> +  case EfiPciIoWidthFillUint16:
> +  case EfiPciIoWidthFillUint32:
> +  case EfiPciIoWidthFillUint64:
>      return PciIoMemRW (Width, Count, 0, Buffer, 1, Address);
> 
>    default:
> @@ -256,22 +256,22 @@ PciIoMemWrite (
>    }
> 
>    switch (Width) {
> -  case EfiPciWidthUint8:
> -  case EfiPciWidthUint16:
> -  case EfiPciWidthUint32:
> -  case EfiPciWidthUint64:
> +  case EfiPciIoWidthUint8:
> +  case EfiPciIoWidthUint16:
> +  case EfiPciIoWidthUint32:
> +  case EfiPciIoWidthUint64:
>      return PciIoMemRW (Width, Count, 1, Address, 1, Buffer);
> 
> -  case EfiPciWidthFifoUint8:
> -  case EfiPciWidthFifoUint16:
> -  case EfiPciWidthFifoUint32:
> -  case EfiPciWidthFifoUint64:
> +  case EfiPciIoWidthFifoUint8:
> +  case EfiPciIoWidthFifoUint16:
> +  case EfiPciIoWidthFifoUint32:
> +  case EfiPciIoWidthFifoUint64:
>      return PciIoMemRW (Width, Count, 0, Address, 1, Buffer);
> 
> -  case EfiPciWidthFillUint8:
> -  case EfiPciWidthFillUint16:
> -  case EfiPciWidthFillUint32:
> -  case EfiPciWidthFillUint64:
> +  case EfiPciIoWidthFillUint8:
> +  case EfiPciIoWidthFillUint16:
> +  case EfiPciIoWidthFillUint32:
> +  case EfiPciIoWidthFillUint64:
>      return PciIoMemRW (Width, Count, 1, Address, 0, Buffer);
> 
>    default:
> --
> 1.9.5.msysgit.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-12  3:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12  1:26 [PATCH] MdeModulePkg/NonDiscoverablePciDev: Fix type mismatch in switch/case Hao Wu
2016-12-12  3:18 ` Ni, Ruiyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox