]> git.baikalelectronics.ru Git - kernel.git/commitdiff
selftests: KVM: Fix check for !POLLIN in demand_paging_test
authorOliver Upton <oupton@google.com>
Tue, 21 Sep 2021 17:11:20 +0000 (17:11 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Sep 2021 14:33:08 +0000 (10:33 -0400)
The logical not operator applies only to the left hand side of a bitwise
operator. As such, the check for POLLIN not being set in revents wrong.
Fix it by adding parentheses around the bitwise expression.

Fixes: e4ff92617a06 ("KVM: selftests: Add demand paging content to the demand paging test")
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Oliver Upton <oupton@google.com>
Message-Id: <20210921171121.2148982-2-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/demand_paging_test.c

index e79c1b64977f146465345020dad34424b69ba78a..10edae425ab3c140336cc227c3258f5076f348cb 100644 (file)
@@ -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));