qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
	qemu-s390x@nongnu.org, Cornelia Huck <cohuck@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] pc-bios/s390-ccw/bootmap: Silence compiler warning from Clang
Date: Wed, 21 Apr 2021 18:37:54 +0200	[thread overview]
Message-ID: <ea08454b-8eff-0f07-850b-1d0650bf47f8@de.ibm.com> (raw)
In-Reply-To: <20210421163331.358178-1-thuth@redhat.com>



On 21.04.21 18:33, Thomas Huth wrote:
> When compiling the s390-ccw bios with Clang, the compiler complains:
> 
>   pc-bios/s390-ccw/bootmap.c:302:9: warning: logical not is only applied
>    to the left hand side of this comparison [-Wlogical-not-parentheses]
>      if (!mbr->dev_type == DEV_TYPE_ECKD) {
>          ^              ~~
> 
> The code works (more or less by accident), since dev_type can only be
> 0 or 1, but it's better of course to use the intended != operator here
> instead.
> 
> Fixes: 5dc739f343 ("Allow booting in case the first virtio-blk disk is bad")
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>

> ---
>   pc-bios/s390-ccw/bootmap.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
> index 44df7d16af..e4b2e5a1b0 100644
> --- a/pc-bios/s390-ccw/bootmap.c
> +++ b/pc-bios/s390-ccw/bootmap.c
> @@ -299,7 +299,7 @@ static void ipl_eckd_cdl(void)
>           sclp_print("Bad block size in zIPL section of IPL2 record.\n");
>           return;
>       }
> -    if (!mbr->dev_type == DEV_TYPE_ECKD) {
> +    if (mbr->dev_type != DEV_TYPE_ECKD) {
>           sclp_print("Non-ECKD device type in zIPL section of IPL2 record.\n");
>           return;
>       }
> 


      parent reply	other threads:[~2021-04-21 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 16:33 [PATCH] pc-bios/s390-ccw/bootmap: Silence compiler warning from Clang Thomas Huth
2021-04-21 16:37 ` Philippe Mathieu-Daudé
2021-04-21 16:37 ` Christian Borntraeger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea08454b-8eff-0f07-850b-1d0650bf47f8@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).