KVM: selftests: simplify setup_demand_paging error handling
authorAxel Rasmussen <axelrasmussen@google.com>
Wed, 19 May 2021 20:03:31 +0000 (13:03 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 May 2021 11:45:55 +0000 (07:45 -0400)
commit25408e5a0246048e3e36d2cd513565ebcc481f51
treef6a0d6f20e94b548b4f5c38316f0dedf231e3b49
parent2aab4b355cbbe1deacfd9349729c43509042b557
KVM: selftests: simplify setup_demand_paging error handling

A small cleanup. Our caller writes:

  r = setup_demand_paging(...);
  if (r < 0) exit(-r);

Since we're just going to exit anyway, instead of returning an error we
can just re-use TEST_ASSERT. This makes the caller simpler, as well as
the function itself - no need to write our branches, etc.

Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Message-Id: <20210519200339.829146-3-axelrasmussen@google.com>
Reviewed-by: Ben Gardon <bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/demand_paging_test.c