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.web09.20125.1606489363897935453 for ; Fri, 27 Nov 2020 07:02:44 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@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 8774E1516; Fri, 27 Nov 2020 07:02:43 -0800 (PST) Received: from [192.168.1.81] (unknown [10.37.8.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9B8213F70D; Fri, 27 Nov 2020 07:02:42 -0800 (PST) Subject: Re: [edk2-platforms] [PATCH v4] Platform/ARM/SgiPkg: Fix constant-logical-operand clang error To: Vijayenthiran Subramaniam , devel@edk2.groups.io, leif@nuviainc.com, thomas.abraham@arm.com References: <1606487941-10774-1-git-send-email-vijayenthiran.subramaniam@arm.com> From: "Ard Biesheuvel" Message-ID: Date: Fri, 27 Nov 2020 16:02:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1606487941-10774-1-git-send-email-vijayenthiran.subramaniam@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/27/20 3:39 PM, Vijayenthiran Subramaniam wrote: > Fix "use of logical '&&' with constant operand" error when built with > clang. > > Signed-off-by: Vijayenthiran Subramaniam > --- > > Changes since v3: > - Update commit message. > - Remove comparing boolean expression with TRUE. > - v3 discussion: https://edk2.groups.io/g/devel/topic/78500293 > > Changes since v2: > - Reviewed-by added from: > https://edk2.groups.io/g/devel/topic/71391950#55868 > - Rebased to latest master and repost. > > Changes since v1: > - Fix Copyright year > > Note: > Fix Clang build error reported by Leif in > https://edk2.groups.io/g/devel/message/54586 > > Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > Reviewed-by: Ard Biesheuvel Pushed as f182372f928f..3f71a8fb114a Thanks! > diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c > index 9e5f7e70..5cf8f6a7 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 > > @@ -82,7 +82,7 @@ InitVirtioDevices ( > > // Install protocol interface for storage device > if ((FeaturePcdGet (PcdVirtioBlkSupported)) && > - (FixedPcdGet32 (PcdVirtioBlkBaseAddress))) { > + (FixedPcdGet32 (PcdVirtioBlkBaseAddress) != 0)) { > Status = gBS->InstallProtocolInterface (&mVirtIoBlkController, > &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE, > &mVirtioBlockDevicePath); > @@ -111,7 +111,7 @@ InitVirtioDevices ( > > // Install protocol interface for network device > if ((FeaturePcdGet (PcdVirtioNetSupported)) && > - (FixedPcdGet32 (PcdVirtioNetBaseAddress))) { > + (FixedPcdGet32 (PcdVirtioNetBaseAddress) != 0)) { > Status = gBS->InstallProtocolInterface (&mVirtIoNetController, > &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE, > &mVirtioNetDevicePath); >