Re: [PATCH 1/2] selftests: KVM: Fix compiler warning in demand_paging_test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/09/21 03:01, 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@xxxxxxxxxx>
---
  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))
  			continue;
r = read(uffd, &msg, sizeof(msg));


Queued (with small adjustments to the commit message and Cc: stable), thanks.

Paolo




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux