public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Liming Gao <liming.gao@intel.com>
Cc: edk2-devel@lists.01.org
Subject: Re: [Patch] OvmfPkg BasePciCapLib: Fix VS build failure
Date: Tue, 29 May 2018 10:39:39 +0200	[thread overview]
Message-ID: <1fffb671-4ad2-8e40-872f-fdc8af94c1ad@redhat.com> (raw)
In-Reply-To: <1527570256-16140-1-git-send-email-liming.gao@intel.com>

On 05/29/18 07:04, Liming Gao wrote:
> Fix VS warning C4244: 'function': conversion from 'UINT32' to 'UINT16',
> possible loss of data.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> ---
>  OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
> index c059264..54e7409 100644
> --- a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
> +++ b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
> @@ -613,8 +613,8 @@ PciCapListInit (
>        }
>  
>        Status = InsertPciCap (OutCapList, CapHdrOffsets, PciCapExtended,
> -                 ExtendedCapHdr.CapabilityId, ExtendedCapHdrOffset,
> -                 ExtendedCapHdr.CapabilityVersion);
> +                 (UINT16) ExtendedCapHdr.CapabilityId, ExtendedCapHdrOffset,
> +                 (UINT8) ExtendedCapHdr.CapabilityVersion);
>        if (RETURN_ERROR (Status)) {
>          goto FreeCapHdrOffsets;
>        }
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Before pushing, I removed the whitespace right after the casts -- in the
past, we've had problems due to such whitespace; it caused confusion
about operator binding strength. Typecast is one of the most strongly
binding operators, so I find the space after it counter-intuitive.

I also ran some basic regression-tests before pushing the patch.

Commit 2d0c6692eee4.

Thanks for the patch!
Laszlo


      reply	other threads:[~2018-05-29  8:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29  5:04 [Patch] OvmfPkg BasePciCapLib: Fix VS build failure Liming Gao
2018-05-29  8:39 ` Laszlo Ersek [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=1fffb671-4ad2-8e40-872f-fdc8af94c1ad@redhat.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