All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: [kvm-unit-tests PULL 09/12] vmx_tests: Silence warning from Clang
Date: Tue, 16 Jun 2020 20:56:19 +0200	[thread overview]
Message-ID: <20200616185622.8644-10-thuth@redhat.com> (raw)
In-Reply-To: <20200616185622.8644-1-thuth@redhat.com>

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>
---
 x86/vmx_tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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();
 
-- 
2.18.1


  parent reply	other threads:[~2020-06-16 18:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 18:56 [kvm-unit-tests PULL 00/12] CI-related fixes and improvements Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 01/12] Fix out-of-tree builds Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 02/12] x86: avoid multiple defined symbol Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 03/12] Fixes for the umip test Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 04/12] Always compile the kvm-unit-tests with -fno-common Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 05/12] Fix powerpc issue with the linker from Fedora 32 Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 06/12] Update the gitlab-ci to " Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 07/12] x86: use a non-negative number in shift Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 08/12] x86: use inline asm to retrieve stack pointer Thomas Huth
2020-06-16 18:56 ` Thomas Huth [this message]
2020-06-16 18:56 ` [kvm-unit-tests PULL 10/12] Compile the kvm-unit-tests also with Clang Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 11/12] x86: disable SSE on 32-bit hosts Thomas Huth
2020-06-16 18:56 ` [kvm-unit-tests PULL 12/12] s390x: stsi: Make output tap13 compatible Thomas Huth
2020-06-23  7:30 ` [kvm-unit-tests PULL 00/12] CI-related fixes and improvements Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200616185622.8644-10-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.