aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2020-05-13 13:05:06 +0200
committerThomas Huth <thuth@redhat.com>2020-06-16 15:00:07 +0200
commit951f9b82e24cac87374179cbb13016609ecd6ff0 (patch)
treea12d01baeb0b8d8e4ce7077dd5c972c2f71e898c
parent2d9e3a376b9adcc93f9b9874f7bc5408a1269a22 (diff)
downloadkvm-unit-tests-951f9b82e24cac87374179cbb13016609ecd6ff0.tar.gz
vmx_tests: Silence warning from Clang
Clang complains: x86/vmx_tests.c:8429:40: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare] vmx_preemption_timer_zero_inject_db(1 << DB_VECTOR); ^ Looking at the code, the "1 << DB_VECTOR" is done within the function vmx_preemption_timer_zero_inject_db() indeed: vmcs_write(EXC_BITMAP, intercept_db ? 1 << DB_VECTOR : 0); ... so using "true" as parameter for the function should be appropriate here. Message-Id: <20200514192626.9950-11-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--x86/vmx_tests.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index fcd97a1..36e94fa 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -8544,7 +8544,7 @@ static void vmx_preemption_timer_zero_test(void)
* an event that you injected.
*/
vmx_set_test_stage(1);
- vmx_preemption_timer_zero_inject_db(1 << DB_VECTOR);
+ vmx_preemption_timer_zero_inject_db(true);
vmx_preemption_timer_zero_expect_preempt_at_rip(db_fault_address);
vmx_preemption_timer_zero_advance_past_vmcall();