[edk2-devel] [edk2-platforms] [PATCH v3] Platform/ARM/SgiPkg: Fix constant-logical-operand clang error

Vijayenthiran Subramaniam vijayenthiran.subramaniam at arm.com
Wed Nov 25 14:30:30 UTC 2020


Fix "use of logical '&&' with constant operand" error when built with
CLANG38 toolchain.

Reviewed-by: Thomas Abraham <thomas.abraham at arm.com>
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam at arm.com>
---

Changes since v2:
  - Reviewed-bys 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 Clan error reported by Leif in
    https://edk2.groups.io/g/devel/message/54586

 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 9e5f7e70..f91724b9 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.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#67978): https://edk2.groups.io/g/devel/message/67978
Mute This Topic: https://groups.io/mt/78500293/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list