From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7236181EA2 for ; Thu, 19 Jan 2017 16:54:32 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 19 Jan 2017 16:54:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,256,1477983600"; d="scan'208";a="32949564" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga002.jf.intel.com with ESMTP; 19 Jan 2017 16:54:30 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Brijesh Singh , Leo Duran , Liming Gao Date: Fri, 20 Jan 2017 08:54:12 +0800 Message-Id: <1484873652-136780-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [patch] MdePkg: Avoid Non-Boolean type used as Boolean X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 00:54:32 -0000 Cc: Brijesh Singh Cc: Leo Duran Cc: Liming Gao Signed-off-by: Leo Duran Reviewed-by: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c | 12 ++++++------ MdePkg/Library/DxeIoLibCpuIo2/DxeCpuIo2LibInternal.h | 1 - MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c | 12 ++++++------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c index e388549..b84134b 100644 --- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c +++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c @@ -280,11 +280,11 @@ IoReadFifo8 ( ) { UINT8 *Buffer8; Buffer8 = (UINT8 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer8++ = IoRead8 (Port); } } /** @@ -313,11 +313,11 @@ IoReadFifo16 ( ) { UINT16 *Buffer16; Buffer16 = (UINT16 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer16++ = IoRead16 (Port); } } /** @@ -346,11 +346,11 @@ IoReadFifo32 ( ) { UINT32 *Buffer32; Buffer32 = (UINT32 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer32++ = IoRead32 (Port); } } /** @@ -379,11 +379,11 @@ IoWriteFifo8 ( ) { UINT8 *Buffer8; Buffer8 = (UINT8 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite8 (Port, *Buffer8++); } } /** @@ -412,11 +412,11 @@ IoWriteFifo16 ( ) { UINT16 *Buffer16; Buffer16 = (UINT16 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite16 (Port, *Buffer16++); } } /** @@ -445,11 +445,11 @@ 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 c84ce6b..8c289cb 100644 --- a/MdePkg/Library/DxeIoLibCpuIo2/DxeCpuIo2LibInternal.h +++ b/MdePkg/Library/DxeIoLibCpuIo2/DxeCpuIo2LibInternal.h @@ -133,11 +133,10 @@ IoWriteFifoWorker ( This function must guarantee that all MMIO read and write operations are serialized. @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. **/ UINT64 diff --git a/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c b/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c index 0279bde..69acb80 100644 --- a/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c +++ b/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c @@ -394,11 +394,11 @@ IoReadFifo8 ( ) { UINT8 *Buffer8; Buffer8 = (UINT8 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer8++ = IoRead8 (Port); } } /** @@ -427,11 +427,11 @@ IoWriteFifo8 ( ) { UINT8 *Buffer8; Buffer8 = (UINT8 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite8 (Port, *Buffer8++); } } /** @@ -464,11 +464,11 @@ IoReadFifo16 ( // // Make sure Port is aligned on a 16-bit boundary. // ASSERT ((Port & 1) == 0); Buffer16 = (UINT16 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer16++ = IoRead16 (Port); } } /** @@ -501,11 +501,11 @@ IoWriteFifo16 ( // // Make sure Port is aligned on a 16-bit boundary. // ASSERT ((Port & 1) == 0); Buffer16 = (UINT16 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite16 (Port, *Buffer16++); } } /** @@ -538,11 +538,11 @@ IoReadFifo32 ( // // Make sure Port is aligned on a 32-bit boundary. // ASSERT ((Port & 3) == 0); Buffer32 = (UINT32 *)Buffer; - while (Count--) { + while (Count-- > 0) { *Buffer32++ = IoRead32 (Port); } } /** @@ -575,11 +575,11 @@ IoWriteFifo32 ( // // Make sure Port is aligned on a 32-bit boundary. // ASSERT ((Port & 3) == 0); Buffer32 = (UINT32 *)Buffer; - while (Count--) { + while (Count-- > 0) { IoWrite32 (Port, *Buffer32++); } } /** -- 1.9.5.msysgit.1