Commit d8ba3f14 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini
Browse files

KVM: selftests: Return an 'unsigned int' from kvm_check_cap()



Return an 'unsigned int' instead of a signed 'int' from kvm_check_cap(),
to make it more obvious that kvm_check_cap() can never return a negative
value due to its assertion that the return is ">= 0".

Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 03260452
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ extern const struct vm_guest_mode_params vm_guest_mode_params[];

int open_path_or_exit(const char *path, int flags);
int open_kvm_dev_path_or_exit(void);
int kvm_check_cap(long cap);
unsigned int kvm_check_cap(long cap);

#define __KVM_SYSCALL_ERROR(_name, _ret) \
	"%s failed, rc: %i errno: %i (%s)", (_name), (_ret), errno, strerror(errno)
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ int main(int argc, char *argv[])
	}

	/* Check the extension for binary stats */
	if (kvm_check_cap(KVM_CAP_BINARY_STATS_FD) <= 0) {
	if (!kvm_check_cap(KVM_CAP_BINARY_STATS_FD)) {
		print_skip("Binary form statistics interface is not supported");
		exit(KSFT_SKIP);
	}
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ int open_kvm_dev_path_or_exit(void)
 * Looks up and returns the value corresponding to the capability
 * (KVM_CAP_*) given by cap.
 */
int kvm_check_cap(long cap)
unsigned int kvm_check_cap(long cap)
{
	int ret;
	int kvm_fd;