public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Duran, Leo" <leo.duran@amd.com>
To: 'Dandan Bi' <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Singh, Brijesh" <brijesh.singh@amd.com>,
	Liming Gao <liming.gao@intel.com>
Subject: Re: [patch] MdePkg: Avoid Non-Boolean type used as Boolean
Date: Fri, 20 Jan 2017 15:52:28 +0000	[thread overview]
Message-ID: <CY4PR12MB1237DE4E5A8AA0F55F077A6FF9710@CY4PR12MB1237.namprd12.prod.outlook.com> (raw)
In-Reply-To: <1484873652-136780-1-git-send-email-dandan.bi@intel.com>

Acked-By: Leo Duran <leo.duran@amd.com>

> -----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 <brijesh.singh@amd.com>; Duran, Leo
> <leo.duran@amd.com>; Liming Gao <liming.gao@intel.com>
> Subject: [patch] MdePkg: Avoid Non-Boolean type used as Boolean
> 
> Cc: Brijesh Singh <brijesh.singh@amd.com>
> Cc: Leo Duran  <leo.duran@amd.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Leo Duran  <leo.duran@amd.com>
> Reviewed-by: Liming Gao <liming.gao@intel.com>
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  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



      parent reply	other threads:[~2017-01-20 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20  0:54 [patch] MdePkg: Avoid Non-Boolean type used as Boolean Dandan Bi
2017-01-20  3:15 ` Gao, Liming
2017-01-20 15:52 ` Duran, Leo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR12MB1237DE4E5A8AA0F55F077A6FF9710@CY4PR12MB1237.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox