From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 F16AC81E9E for ; Thu, 19 Jan 2017 19:16:00 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 19 Jan 2017 19:16:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,257,1477983600"; d="scan'208";a="1115300385" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 19 Jan 2017 19:16:00 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 19 Jan 2017 19:16:00 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 19 Jan 2017 19:15:59 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Fri, 20 Jan 2017 11:15:57 +0800 From: "Gao, Liming" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: Brijesh Singh , Leo Duran Thread-Topic: [patch] MdePkg: Avoid Non-Boolean type used as Boolean Thread-Index: AQHScrfM1ubFWulfG066YhPt6l1MvaFAsZOg Date: Fri, 20 Jan 2017 03:15:56 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D6D1D30@shsmsx102.ccr.corp.intel.com> References: <1484873652-136780-1-git-send-email-dandan.bi@intel.com> In-Reply-To: <1484873652-136780-1-git-send-email-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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 03:16:01 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Bi, Dandan >Sent: Friday, January 20, 2017 8:54 AM >To: edk2-devel@lists.01.org >Cc: Brijesh Singh ; Leo Duran >; Gao, Liming >Subject: [patch] MdePkg: Avoid Non-Boolean type used as Boolean > >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 =3D (UINT8 *)Buffer; >- while (Count--) { >+ while (Count-- > 0) { > *Buffer8++ =3D IoRead8 (Port); > } > } > > /** >@@ -313,11 +313,11 @@ IoReadFifo16 ( > ) > { > UINT16 *Buffer16; > > Buffer16 =3D (UINT16 *)Buffer; >- while (Count--) { >+ while (Count-- > 0) { > *Buffer16++ =3D IoRead16 (Port); > } > } > > /** >@@ -346,11 +346,11 @@ IoReadFifo32 ( > ) > { > UINT32 *Buffer32; > > Buffer32 =3D (UINT32 *)Buffer; >- while (Count--) { >+ while (Count-- > 0) { > *Buffer32++ =3D IoRead32 (Port); > } > } > > /** >@@ -379,11 +379,11 @@ IoWriteFifo8 ( > ) > { > UINT8 *Buffer8; > > Buffer8 =3D (UINT8 *)Buffer; >- while (Count--) { >+ while (Count-- > 0) { > IoWrite8 (Port, *Buffer8++); > } > } > > /** >@@ -412,11 +412,11 @@ IoWriteFifo16 ( > ) > { > UINT16 *Buffer16; > > Buffer16 =3D (UINT16 *)Buffer; >- while (Count--) { >+ while (Count-- > 0) { > IoWrite16 (Port, *Buffer16++); > } > } > > /** >@@ -445,11 +445,11 @@ IoWriteFifo32 ( > ) > { > UINT32 *Buffer32; > > Buffer32 =3D (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 ar= e >serialized. > > @param Address The MMIO register to read. > The caller is responsible for aligning the Addres= s 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 =3D (UINT8 *)Buffer; >- while (Count--) { >+ while (Count-- > 0) { > *Buffer8++ =3D IoRead8 (Port); > } > } > > /** >@@ -427,11 +427,11 @@ IoWriteFifo8 ( > ) > { > UINT8 *Buffer8; > > Buffer8 =3D (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) =3D=3D 0); > Buffer16 =3D (UINT16 *)Buffer; >- while (Count--) { >+ while (Count-- > 0) { > *Buffer16++ =3D IoRead16 (Port); > } > } > > /** >@@ -501,11 +501,11 @@ IoWriteFifo16 ( > // > // Make sure Port is aligned on a 16-bit boundary. > // > ASSERT ((Port & 1) =3D=3D 0); > Buffer16 =3D (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) =3D=3D 0); > Buffer32 =3D (UINT32 *)Buffer; >- while (Count--) { >+ while (Count-- > 0) { > *Buffer32++ =3D IoRead32 (Port); > } > } > > /** >@@ -575,11 +575,11 @@ IoWriteFifo32 ( > // > // Make sure Port is aligned on a 32-bit boundary. > // > ASSERT ((Port & 3) =3D=3D 0); > Buffer32 =3D (UINT32 *)Buffer; >- while (Count--) { >+ while (Count-- > 0) { > IoWrite32 (Port, *Buffer32++); > } > } > > /** >-- >1.9.5.msysgit.1