kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Oliver Upton <oupton@google.com>
Cc: kvm@vger.kernel.org, Marc Zyngier <maz@kernel.org>,
	Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kvmarm@lists.cs.columbia.edu, Jim Mattson <jmattson@google.com>
Subject: Re: [PATCH 1/2] selftests: KVM: Fix compiler warning in demand_paging_test
Date: Tue, 21 Sep 2021 09:09:15 +0200	[thread overview]
Message-ID: <20210921070915.mmubmdqqkf2qsit6@gator.home> (raw)
In-Reply-To: <20210921010120.1256762-2-oupton@google.com>

On Tue, Sep 21, 2021 at 01:01:19AM +0000, Oliver Upton wrote:
> Building demand_paging_test.c with clang throws the following warning:
> 
> >> demand_paging_test.c:182:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses]
>                   if (!pollfd[0].revents & POLLIN)
> 
> Silence the warning by placing the bitwise operation within parentheses.
> 
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
>  tools/testing/selftests/kvm/demand_paging_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/demand_paging_test.c b/tools/testing/selftests/kvm/demand_paging_test.c
> index e79c1b64977f..10edae425ab3 100644
> --- a/tools/testing/selftests/kvm/demand_paging_test.c
> +++ b/tools/testing/selftests/kvm/demand_paging_test.c
> @@ -179,7 +179,7 @@ static void *uffd_handler_thread_fn(void *arg)
>  			return NULL;
>  		}
>  
> -		if (!pollfd[0].revents & POLLIN)
> +		if (!(pollfd[0].revents & POLLIN))

That's a bug fix. If revents was e.g. POLLPRI then this logic
wouldn't have done what it's supposed to do. Maybe we should
better call out that this is a fix in the summary and add a
fixes tag?

Anyway,

Reviewed-by: Andrew Jones <drjones@redhat.com>

Thanks,
drew

>  			continue;
>  
>  		r = read(uffd, &msg, sizeof(msg));
> -- 
> 2.33.0.464.g1972c5931b-goog
> 

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  reply	other threads:[~2021-09-21  7:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21  1:01 [PATCH 0/2] selftests: KVM: Fix some compiler warnings Oliver Upton
2021-09-21  1:01 ` [PATCH 1/2] selftests: KVM: Fix compiler warning in demand_paging_test Oliver Upton
2021-09-21  7:09   ` Andrew Jones [this message]
2021-09-21 17:38   ` Paolo Bonzini
2021-09-21 17:42     ` Oliver Upton
2021-09-21  1:01 ` [PATCH 2/2] selftests: KVM: Fix 'asm-operand-width' warnings in steal_time.c Oliver Upton
2021-09-21  7:19   ` Andrew Jones
2021-09-21 17:38     ` Paolo Bonzini

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=20210921070915.mmubmdqqkf2qsit6@gator.home \
    --to=drjones@redhat.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=maz@kernel.org \
    --cc=oupton@google.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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).