From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.9768.1583123072042654279 for ; Sun, 01 Mar 2020 20:24:32 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: vijayenthiran.subramaniam@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 59072113E for ; Sun, 1 Mar 2020 20:24:31 -0800 (PST) Received: from mail-lj1-f178.google.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2C7BC3F792 for ; Sun, 1 Mar 2020 20:24:31 -0800 (PST) Received: by mail-lj1-f178.google.com with SMTP id 143so10153242ljj.7 for ; Sun, 01 Mar 2020 20:24:31 -0800 (PST) X-Gm-Message-State: ANhLgQ3BlVAU/mJJ8WPJF82c9itZcJ0dPFG2lhlUQVmAWHpSY4/CAM6M gYJNy87QJuorRxZCbLFTnb55cXWjMAA4hArLED0= X-Google-Smtp-Source: ADFU+vvJFv0B0bCctSHHdZsJItBf+z/BJk227pl6JE1ecMbKgy0nsNwl5JJhV7zwHAFoLG6oE5ZTbk4Ph8sYmbijvzw= X-Received: by 2002:a2e:b530:: with SMTP id z16mr10146622ljm.216.1583123069578; Sun, 01 Mar 2020 20:24:29 -0800 (PST) MIME-Version: 1.0 References: <1582100458-13080-1-git-send-email-vijayenthiran.subramaniam@arm.com> <1582101467-14146-1-git-send-email-vijayenthiran.subramaniam@arm.com> In-Reply-To: <1582101467-14146-1-git-send-email-vijayenthiran.subramaniam@arm.com> From: "Vijayenthiran Subramaniam" Date: Mon, 2 Mar 2020 04:23:53 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [edk2-platforms] [PATCH v2] Platform/ARM/SgiPkg: Fix constant-logical-operand clang error To: devel@edk2.groups.io, leif@nuviainc.com, michael.d.kinney@intel.com, Ard.Biesheuvel@arm.com Cc: Thomas Abraham Content-Type: text/plain; charset="UTF-8" Hi, On Wed, Feb 19, 2020 at 8:37 AM Vijayenthiran Subramaniam wrote: > > Fix "use of logical '&&' with constant operand" error when built with > CLANG38 toolchain. > > Signed-off-by: Vijayenthiran Subramaniam > --- > > 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.
> + 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.