yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-pc-bios-s390-ccw-bootmap-Silence-compiler-warning-fr.patch

a83cc2
From c00df86dd570d78767c5435f97bbe1d06407e470 Mon Sep 17 00:00:00 2001
a83cc2
From: Thomas Huth <thuth@redhat.com>
a83cc2
Date: Wed, 21 Apr 2021 17:48:48 +0200
a83cc2
Subject: [PATCH 28/39] pc-bios/s390-ccw/bootmap: Silence compiler warning from
a83cc2
 Clang
a83cc2
MIME-Version: 1.0
a83cc2
Content-Type: text/plain; charset=UTF-8
a83cc2
Content-Transfer-Encoding: 8bit
a83cc2
a83cc2
RH-Author: Jon Maloy <jmaloy@redhat.com>
a83cc2
RH-MergeRequest: 24: v7:  Add support for building qemu-kvm with clang and safe-stack
a83cc2
RH-Commit: [1/11] 85e41a04a0f47afe23e62f70397a5f79b2703499 (jmaloy/qemu-kvm-centos-jon)
a83cc2
RH-Bugzilla: 1939509 1940132
a83cc2
RH-Acked-by: Danilo Cesar Lemes de Paula <ddepaula@redhat.com>
a83cc2
RH-Acked-by: Thomas Huth <thuth@redhat.com>
a83cc2
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
a83cc2
a83cc2
When compiling the s390-ccw bios with Clang, the compiler complains:
a83cc2
a83cc2
 pc-bios/s390-ccw/bootmap.c:302:9: warning: logical not is only applied
a83cc2
  to the left hand side of this comparison [-Wlogical-not-parentheses]
a83cc2
    if (!mbr->dev_type == DEV_TYPE_ECKD) {
a83cc2
        ^              ~~
a83cc2
a83cc2
The code works (more or less by accident), since dev_type can only be
a83cc2
0 or 1, but it's better of course to use the intended != operator here
a83cc2
instead.
a83cc2
a83cc2
Fixes: 5dc739f343 ("Allow booting in case the first virtio-blk disk is bad")
a83cc2
Message-Id: <20210421163331.358178-1-thuth@redhat.com>
a83cc2
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
a83cc2
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
a83cc2
Signed-off-by: Thomas Huth <thuth@redhat.com>
a83cc2
(cherry picked from commit d08a64940452060ab7ad5eb49cd5801131c2b9ec)
a83cc2
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
a83cc2
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
---
a83cc2
 pc-bios/s390-ccw/bootmap.c | 2 +-
a83cc2
 1 file changed, 1 insertion(+), 1 deletion(-)
a83cc2
a83cc2
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
a83cc2
index b46997c0b7..56411ab3b6 100644
a83cc2
--- a/pc-bios/s390-ccw/bootmap.c
a83cc2
+++ b/pc-bios/s390-ccw/bootmap.c
a83cc2
@@ -299,7 +299,7 @@ static void ipl_eckd_cdl(void)
a83cc2
         sclp_print("Bad block size in zIPL section of IPL2 record.\n");
a83cc2
         return;
a83cc2
     }
a83cc2
-    if (!mbr->dev_type == DEV_TYPE_ECKD) {
a83cc2
+    if (mbr->dev_type != DEV_TYPE_ECKD) {
a83cc2
         sclp_print("Non-ECKD device type in zIPL section of IPL2 record.\n");
a83cc2
         return;
a83cc2
     }
a83cc2
-- 
a83cc2
2.27.0
a83cc2