public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Vijayenthiran Subramaniam" <vijayenthiran.subramaniam@arm.com>
To: devel@edk2.groups.io, leif@nuviainc.com,
	michael.d.kinney@intel.com,  Ard.Biesheuvel@arm.com
Cc: Thomas Abraham <thomas.abraham@arm.com>
Subject: Re: [edk2-devel] [edk2-platforms] [PATCH v2] Platform/ARM/SgiPkg: Fix constant-logical-operand clang error
Date: Mon, 2 Mar 2020 04:23:53 +0000	[thread overview]
Message-ID: <CA+FsMCNoKfryz8h+QvguoKDGwy2gYDf4A9iBEfsMFjyLagjv8A@mail.gmail.com> (raw)
In-Reply-To: <1582101467-14146-1-git-send-email-vijayenthiran.subramaniam@arm.com>

Hi,

On Wed, Feb 19, 2020 at 8:37 AM Vijayenthiran Subramaniam
<vijayenthiran.subramaniam@arm.com> wrote:
>
> Fix "use of logical '&&' with constant operand" error when built with
> CLANG38 toolchain.
>
> Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
> ---
>
> Changes since v1:
>   - Fix Copyright year
>
> Notes:
>     Fix Clan error reported by Leif in https://edk2.groups.io/g/devel/message/54586.
>     Build tested with clang 9:
>     CLANG38_AARCH64_PREFIX=aarch64-linux-gnu- build -n $NUM_CPUS -a AARCH64 \
>     -t CLANG38 -p Platform/ARM/SgiPkg/SgiPlatform.dsc
>
>  Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c
> index 9e5f7e704e24..f91724b95a42 100644
> --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c
> +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c
> @@ -1,6 +1,6 @@
>  /** @file
>
> -  Copyright (c) 2018, ARM Ltd. All rights reserved.<BR>
> +  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -81,8 +81,8 @@ InitVirtioDevices (
>    STATIC EFI_HANDLE mVirtIoNetController = NULL;
>
>    // Install protocol interface for storage device
> -  if ((FeaturePcdGet (PcdVirtioBlkSupported)) &&
> -      (FixedPcdGet32 (PcdVirtioBlkBaseAddress))) {
> +  if ((FeaturePcdGet (PcdVirtioBlkSupported) == TRUE) &&
> +      (FixedPcdGet32 (PcdVirtioBlkBaseAddress) != 0)) {
>      Status = gBS->InstallProtocolInterface (&mVirtIoBlkController,
>                      &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,
>                      &mVirtioBlockDevicePath);
> @@ -110,8 +110,8 @@ InitVirtioDevices (
>    }
>
>    // Install protocol interface for network device
> -  if ((FeaturePcdGet (PcdVirtioNetSupported)) &&
> -      (FixedPcdGet32 (PcdVirtioNetBaseAddress))) {
> +  if ((FeaturePcdGet (PcdVirtioNetSupported) == TRUE) &&
> +      (FixedPcdGet32 (PcdVirtioNetBaseAddress) != 0)) {
>      Status = gBS->InstallProtocolInterface (&mVirtIoNetController,
>                      &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,
>                      &mVirtioNetDevicePath);
> --
> 2.7.4
>

Any feedback on this patch?

Regards,
Vijay.

  reply	other threads:[~2020-03-02  4:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19  8:20 [edk2-platforms] [PATCH] Platform/ARM/SgiPkg: Fix constant-logical-operand clang error Vijayenthiran Subramaniam
2020-02-19  8:37 ` [edk2-platforms] [PATCH v2] " Vijayenthiran Subramaniam
2020-03-02  4:23   ` Vijayenthiran Subramaniam [this message]
2020-03-16 14:40   ` [edk2-devel] " Thomas Abraham
2020-05-15 15:38     ` Vijayenthiran Subramaniam

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=CA+FsMCNoKfryz8h+QvguoKDGwy2gYDf4A9iBEfsMFjyLagjv8A@mail.gmail.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