Skip to contentSkip to conversation

KVM: selftests: Remove duplicated TEST_ASSERT in hyperv_cpuid.c

PATCH Applied Thomas Huth 2 participants 2 messages May 20, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: selftests: Remove duplicated TEST_ASSERT in hyperv_cpuid.c

The check for entry->index == 0 is done twice. One time should be sufficient.

Suggested-by Vitaly Kuznetsov <vkuznets at redhat.com>
Signed-off-by Thomas Huth <thuth at redhat.com>

---
Vitaly already noticed this in his review to the "Fix a condition in test_hv_cpuid()" patch a couple of days ago, but so far I haven't seen any patch yet on the list that fixes this ... if I missed it instead, please simply ignore this patch.

 tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c | 3 ---
 1 file changed, 3 deletions(-)
tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c +0 -3
index 9a21e912097c..8bdf1e7da6cc 100644
@@ -52,9 +52,6 @@ static void test_hv_cpuid(struct kvm_cpuid2 *hv_cpuid_entries,
 		TEST_ASSERT(entry->index == 0,
 			    ".index field should be zero");
 
-		TEST_ASSERT(entry->index == 0,
-			    ".index field should be zero");
-
 		TEST_ASSERT(entry->flags == 0,
 			    ".flags field should be zero");
 
Signature · 1 line
2.21.0
maintainer Applied
#1 lore raw
Quoted 20 lines · Thomas Huth

The check for entry->index == 0 is done twice. One time should be sufficient.

Suggested-by Vitaly Kuznetsov <vkuznets at redhat.com>
Signed-off-by Thomas Huth <thuth at redhat.com>

---
Vitaly already noticed this in his review to the "Fix a condition in test_hv_cpuid()" patch a couple of days ago, but so far I haven't seen any patch yet on the list that fixes this ... if I missed it instead, please simply ignore this patch.

 tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c | 3 ---
 1 file changed, 3 deletions(-)
tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c +0 -0
index 9a21e912097c..8bdf1e7da6cc 100644

tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c static void test_hv_cpuid(struct kvm_cpuid2 *hv_cpuid_entries, · line 57

Quoted 9 lines
tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c +0 -3
@@ -52,9 +52,6 @@ static void test_hv_cpuid(struct kvm_cpuid2 *hv_cpuid_entries,
 		TEST_ASSERT(entry->index == 0,
 			    ".index field should be zero");
 
-		TEST_ASSERT(entry->index == 0,
-			    ".index field should be zero");
-
 		TEST_ASSERT(entry->flags == 0,
 			    ".flags field should be zero");
 

Queued, thanks.

Paolo