From: Dandan Bi Date: Thu, 19 Jan 2017 08:53:41 +0000 (+0800) Subject: MdePkg: Avoid Non-Boolean type used as Boolean X-Git-Tag: edk2-stable201903~4722 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=058cd03b5857e917a8a6d77ec4707ff77a441ca8;p=mirror_edk2.git MdePkg: Avoid Non-Boolean type used as Boolean Cc: Brijesh Singh Cc: Leo Duran Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Liming Gao --- diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c index e388549b3c..b84134b757 100644 --- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c +++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c @@ -282,7 +282,7 @@ IoReadFifo8 ( UINT8 *Buffer8; Buffer8 = (UINT8 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer8++ = IoRead8 (Port); } } @@ -315,7 +315,7 @@ IoReadFifo16 ( UINT16 *Buffer16; Buffer16 = (UINT16 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer16++ = IoRead16 (Port); } } @@ -348,7 +348,7 @@ IoReadFifo32 ( UINT32 *Buffer32; Buffer32 = (UINT32 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer32++ = IoRead32 (Port); } } @@ -381,7 +381,7 @@ IoWriteFifo8 ( UINT8 *Buffer8; Buffer8 = (UINT8 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite8 (Port, *Buffer8++); } } @@ -414,7 +414,7 @@ IoWriteFifo16 ( UINT16 *Buffer16; Buffer16 = (UINT16 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite16 (Port, *Buffer16++); } } @@ -447,7 +447,7 @@ IoWriteFifo32 ( UINT32 *Buffer32; Buffer32 = (UINT32 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite32 (Port, *Buffer32++); } } diff --git a/MdePkg/Library/DxeIoLibCpuIo2/DxeCpuIo2LibInternal.h b/MdePkg/Library/DxeIoLibCpuIo2/DxeCpuIo2LibInternal.h index c84ce6bf9e..8c289cb20d 100644 --- a/MdePkg/Library/DxeIoLibCpuIo2/DxeCpuIo2LibInternal.h +++ b/MdePkg/Library/DxeIoLibCpuIo2/DxeCpuIo2LibInternal.h @@ -135,7 +135,6 @@ IoWriteFifoWorker ( @param Address The MMIO register to read. The caller is responsible for aligning the Address if required. @param Width The width of the I/O operation. - @param Count The number of times to write I/O port. @return Data read from registers in the EFI system memory space. diff --git a/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c b/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c index 0279bde27e..69acb80f2d 100644 --- a/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c +++ b/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c @@ -396,7 +396,7 @@ IoReadFifo8 ( UINT8 *Buffer8; Buffer8 = (UINT8 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer8++ = IoRead8 (Port); } } @@ -429,7 +429,7 @@ IoWriteFifo8 ( UINT8 *Buffer8; Buffer8 = (UINT8 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite8 (Port, *Buffer8++); } } @@ -466,7 +466,7 @@ IoReadFifo16 ( // ASSERT ((Port & 1) == 0); Buffer16 = (UINT16 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer16++ = IoRead16 (Port); } } @@ -503,7 +503,7 @@ IoWriteFifo16 ( // ASSERT ((Port & 1) == 0); Buffer16 = (UINT16 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite16 (Port, *Buffer16++); } } @@ -540,7 +540,7 @@ IoReadFifo32 ( // ASSERT ((Port & 3) == 0); Buffer32 = (UINT32 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer32++ = IoRead32 (Port); } } @@ -577,7 +577,7 @@ IoWriteFifo32 ( // ASSERT ((Port & 3) == 0); Buffer32 = (UINT32 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite32 (Port, *Buffer32++); } }