public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms] [PATCH] Platform/ARM/SgiPkg: Fix constant-logical-operand clang error
@ 2020-02-19  8:20 Vijayenthiran Subramaniam
  2020-02-19  8:37 ` [edk2-platforms] [PATCH v2] " Vijayenthiran Subramaniam
  0 siblings, 1 reply; 5+ messages in thread
From: Vijayenthiran Subramaniam @ 2020-02-19  8:20 UTC (permalink / raw)
  To: devel, leif, michael.d.kinney, Ard.Biesheuvel; +Cc: thomas.abraham

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

Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
---

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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c
index 9e5f7e704e24..d8af525f52b1 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-15 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [edk2-devel] " Vijayenthiran Subramaniam
2020-03-16 14:40   ` Thomas Abraham
2020-05-15 15:38     ` Vijayenthiran Subramaniam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox