From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on061d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe49::61d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8496D81E9E for ; Fri, 20 Jan 2017 07:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BhQqf0ziIwXLVEhYpWQj5+EV9UbRTIODKTmcYm5eaDE=; b=k094kzZ3HFoiDEsZNtUXNR2D48jdNku668Vm6VE13P/x/Bl1xfCM4J+o5gaAiKDLWgIokN/Xn/vvbssReiURwXq1N1a9tFWtW7+U+W22Y2fSgnL3ileYFJ8bCb+ZglThrFfM8IUtlHPjlIcaK2LcJjo/84RhV0URc//tXXZjAgI= Received: from CY4PR12MB1237.namprd12.prod.outlook.com (10.168.167.12) by SN1PR12MB0670.namprd12.prod.outlook.com (10.163.208.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Fri, 20 Jan 2017 15:52:29 +0000 Received: from CY4PR12MB1237.namprd12.prod.outlook.com ([10.168.167.12]) by CY4PR12MB1237.namprd12.prod.outlook.com ([10.168.167.12]) with mapi id 15.01.0845.021; Fri, 20 Jan 2017 15:52:28 +0000 From: "Duran, Leo" To: 'Dandan Bi' , "edk2-devel@lists.01.org" CC: "Singh, Brijesh" , Liming Gao Thread-Topic: [patch] MdePkg: Avoid Non-Boolean type used as Boolean Thread-Index: AQHScrfOLIxZHTg72E23SHz4orxlHKFBg+VQ Date: Fri, 20 Jan 2017 15:52:28 +0000 Message-ID: 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: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; x-originating-ip: [165.204.77.1] x-microsoft-exchange-diagnostics: 1; SN1PR12MB0670; 7:8vNs1O5Tn8SYs5U5TJ/rPw7Rp2F5szKoLdAE/p7vuvKEH6q9tKJ8Be1pNhiukSDDfDNjMLkz1AjsZ7bz+GRIX2s0GQCnSs7LFGGRtZ/ra+Glndo3hB04gxN7zmjQKhyfv2BL+OatlDMhuDq0SfqBbUGHb0FjPXhXmkCR34h4LlZEpW3gforalburVAywAuq2A6eBbWs60n6FmEMv8p+KspQ+1pIltHR+c9UEvwTO19Qg8W2S0Zgz0Gzm+0EdEiIa5pHr2fO+SguCWpJMPphQehEO+o6lZjKC0pEW8czeYYbM8c60E6g3yToGgjrzHL74rjXicB0c+8Ai9SXpAhasrq0FFXl++Ob9Tz8ulNeJTwZYRVAIW0GXC5iPVVSW3InsfslakjpzPkBcQ6yIF8Apj4yqe4rwcXSMkGMswelfO+wfV/cHiLHsLnv7/YaLPVOLb/Cf7+jdLaMiomoOX7JEMQ==; 20:y9giTqHPP/y3DT57auqUUv1OtDSikcWDg2SAafFbdaIjbv6Bujw5Y/0uaJBE6pJTsnGil0rltpOEbdiCtLlwqxExrrp1yys+Zsmi/wucJsBSmGvHT/JHtZMLzy7qewmQFA/QLpAuYtxcZ8w3YVkTNHpVAy/UMpSDab3fnEO/0qc+RITjz/uHH70glsj/QftXMFEE+ICYm76cCY9tA5G3REZiG9meTvPzX9SOxhg5cX/eP7ayPHxg/kfStTpmKLPE x-forefront-antispam-report: SFV:SKI; SCL:-1SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39850400002)(39840400002)(39860400002)(39450400003)(189002)(199003)(377454003)(13464003)(9686003)(3660700001)(99286003)(54906002)(2950100002)(55016002)(86362001)(5001770100001)(77096006)(7736002)(5660300001)(229853002)(81156014)(8676002)(81166006)(122556002)(8936002)(189998001)(2900100001)(74316002)(53936002)(25786008)(50986999)(38730400001)(76176999)(54356999)(6436002)(33656002)(66066001)(7696004)(97736004)(3846002)(92566002)(6506006)(6116002)(102836003)(2906002)(4326007)(2501003)(105586002)(305945005)(68736007)(106116001)(106356001)(3280700002)(101416001)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0670; H:CY4PR12MB1237.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-ms-office365-filtering-correlation-id: 37ebdca8-faed-4f56-be7f-08d4414c562e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR12MB0670; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123558021)(20161123560025)(6072148); SRVR:SN1PR12MB0670; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0670; x-forefront-prvs: 01930B2BA8 received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2017 15:52:28.3174 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0670 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 15:52:31 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Acked-By: Leo Duran > -----Original Message----- > From: Dandan Bi [mailto:dandan.bi@intel.com] > Sent: Thursday, January 19, 2017 6:54 PM > To: edk2-devel@lists.01.org > Cc: Singh, Brijesh ; Duran, Leo > ; Liming Gao > Subject: [patch] MdePkg: Avoid Non-Boolean type used as Boolean >=20 > Cc: Brijesh Singh > Cc: Leo Duran > Cc: Liming Gao > Signed-off-by: Leo Duran > Reviewed-by: Liming Gao >=20 > 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(-) >=20 > 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; >=20 > Buffer8 =3D (UINT8 *)Buffer; > - while (Count--) { > + while (Count-- > 0) { > *Buffer8++ =3D IoRead8 (Port); > } > } >=20 > /** > @@ -313,11 +313,11 @@ IoReadFifo16 ( > ) > { > UINT16 *Buffer16; >=20 > Buffer16 =3D (UINT16 *)Buffer; > - while (Count--) { > + while (Count-- > 0) { > *Buffer16++ =3D IoRead16 (Port); > } > } >=20 > /** > @@ -346,11 +346,11 @@ IoReadFifo32 ( > ) > { > UINT32 *Buffer32; >=20 > Buffer32 =3D (UINT32 *)Buffer; > - while (Count--) { > + while (Count-- > 0) { > *Buffer32++ =3D IoRead32 (Port); > } > } >=20 > /** > @@ -379,11 +379,11 @@ IoWriteFifo8 ( > ) > { > UINT8 *Buffer8; >=20 > Buffer8 =3D (UINT8 *)Buffer; > - while (Count--) { > + while (Count-- > 0) { > IoWrite8 (Port, *Buffer8++); > } > } >=20 > /** > @@ -412,11 +412,11 @@ IoWriteFifo16 ( > ) > { > UINT16 *Buffer16; >=20 > Buffer16 =3D (UINT16 *)Buffer; > - while (Count--) { > + while (Count-- > 0) { > IoWrite16 (Port, *Buffer16++); > } > } >=20 > /** > @@ -445,11 +445,11 @@ IoWriteFifo32 ( > ) > { > UINT32 *Buffer32; >=20 > Buffer32 =3D (UINT32 *)Buffer; > - while (Count--) { > + while (Count-- > 0) { > IoWrite32 (Port, *Buffer32++); > } > } >=20 > /** > 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 a= re > serialized. >=20 > @param Address The MMIO register to read. > The caller is responsible for aligning the Addre= ss if required. > @param Width The width of the I/O operation. > - @param Count The number of times to write I/O port. >=20 > @return Data read from registers in the EFI system memory space. >=20 > **/ > 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; >=20 > Buffer8 =3D (UINT8 *)Buffer; > - while (Count--) { > + while (Count-- > 0) { > *Buffer8++ =3D IoRead8 (Port); > } > } >=20 > /** > @@ -427,11 +427,11 @@ IoWriteFifo8 ( > ) > { > UINT8 *Buffer8; >=20 > Buffer8 =3D (UINT8 *)Buffer; > - while (Count--) { > + while (Count-- > 0) { > IoWrite8 (Port, *Buffer8++); > } > } >=20 > /** > @@ -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); > } > } >=20 > /** > @@ -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++); > } > } >=20 > /** > @@ -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); > } > } >=20 > /** > @@ -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++); > } > } >=20 > /** > -- > 1.9.5.msysgit.1