linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: selftests: Delete superfluous, unused "stage" variable in AMX test
@ 2024-01-09 22:03 Sean Christopherson
  2024-01-09 22:33 ` Jim Mattson
  2024-01-31  0:59 ` Sean Christopherson
  0 siblings, 2 replies; 3+ messages in thread
From: Sean Christopherson @ 2024-01-09 22:03 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini; +Cc: kvm, linux-kernel

Delete the AMX's tests "stage" counter, as the counter is no longer used,
which makes clang unhappy:

  x86_64/amx_test.c:224:6: error: variable 'stage' set but not used
          int stage, ret;
              ^
  1 error generated.

Note, "stage" was never really used, it just happened to be dumped out by
a (failed) assertion on run->exit_reason, i.e. the AMX test has no concept
of stages, the code was likely copy+pasted from a different test.

Fixes: c96f57b08012 ("KVM: selftests: Make vCPU exit reason test assertion common")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 tools/testing/selftests/kvm/x86_64/amx_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/kvm/x86_64/amx_test.c b/tools/testing/selftests/kvm/x86_64/amx_test.c
index 11329e5ff945..309ee5c72b46 100644
--- a/tools/testing/selftests/kvm/x86_64/amx_test.c
+++ b/tools/testing/selftests/kvm/x86_64/amx_test.c
@@ -221,7 +221,7 @@ int main(int argc, char *argv[])
 	vm_vaddr_t amx_cfg, tiledata, xstate;
 	struct ucall uc;
 	u32 amx_offset;
-	int stage, ret;
+	int ret;
 
 	/*
 	 * Note, all off-by-default features must be enabled before anything
@@ -263,7 +263,7 @@ int main(int argc, char *argv[])
 	memset(addr_gva2hva(vm, xstate), 0, PAGE_SIZE * DIV_ROUND_UP(XSAVE_SIZE, PAGE_SIZE));
 	vcpu_args_set(vcpu, 3, amx_cfg, tiledata, xstate);
 
-	for (stage = 1; ; stage++) {
+	for (;;) {
 		vcpu_run(vcpu);
 		TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
 

base-commit: 1c6d984f523f67ecfad1083bb04c55d91977bb15
-- 
2.43.0.472.g3155946c3a-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: selftests: Delete superfluous, unused "stage" variable in AMX test
  2024-01-09 22:03 [PATCH] KVM: selftests: Delete superfluous, unused "stage" variable in AMX test Sean Christopherson
@ 2024-01-09 22:33 ` Jim Mattson
  2024-01-31  0:59 ` Sean Christopherson
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Mattson @ 2024-01-09 22:33 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Paolo Bonzini, kvm, linux-kernel

On Tue, Jan 9, 2024 at 2:03 PM Sean Christopherson <seanjc@google.com> wrote:
>
> Delete the AMX's tests "stage" counter, as the counter is no longer used,
> which makes clang unhappy:
>
>   x86_64/amx_test.c:224:6: error: variable 'stage' set but not used
>           int stage, ret;
>               ^
>   1 error generated.
>
> Note, "stage" was never really used, it just happened to be dumped out by
> a (failed) assertion on run->exit_reason, i.e. the AMX test has no concept
> of stages, the code was likely copy+pasted from a different test.
>
> Fixes: c96f57b08012 ("KVM: selftests: Make vCPU exit reason test assertion common")
> Signed-off-by: Sean Christopherson <seanjc@google.com>

Reviewed-by: Jim Mattson <jmattson@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: selftests: Delete superfluous, unused "stage" variable in AMX test
  2024-01-09 22:03 [PATCH] KVM: selftests: Delete superfluous, unused "stage" variable in AMX test Sean Christopherson
  2024-01-09 22:33 ` Jim Mattson
@ 2024-01-31  0:59 ` Sean Christopherson
  1 sibling, 0 replies; 3+ messages in thread
From: Sean Christopherson @ 2024-01-31  0:59 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini; +Cc: kvm, linux-kernel

On Tue, 09 Jan 2024 14:03:02 -0800, Sean Christopherson wrote:
> Delete the AMX's tests "stage" counter, as the counter is no longer used,
> which makes clang unhappy:
> 
>   x86_64/amx_test.c:224:6: error: variable 'stage' set but not used
>           int stage, ret;
>               ^
>   1 error generated.
> 
> [...]

Applied to kvm-x86 selftests, thanks!

[1/1] KVM: selftests: Delete superfluous, unused "stage" variable in AMX test
      https://github.com/kvm-x86/linux/commit/46fee9e38995

--
https://github.com/kvm-x86/linux/tree/next

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-31  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 22:03 [PATCH] KVM: selftests: Delete superfluous, unused "stage" variable in AMX test Sean Christopherson
2024-01-09 22:33 ` Jim Mattson
2024-01-31  0:59 ` Sean Christopherson

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).