Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Subject: [kvm-unit-tests PATCH] lib/x86/desc: Remove unused variable "exception"
Date: Wed, 11 Nov 2026 09:18:33 +0100	[thread overview]
Message-ID: <20261111081833.69641-1-thuth@redhat.com> (raw)

The variable used to be the return value for test_for_exception(), but
commit 932ba2d2f530 ("x86: simplify test_for_exception trigger functions"),
changed the logic of that function, so that it is now unused. Clang from
Fedora 45 started to complain about this:

 lib/x86/desc.c:483:13: error: variable 'exception' set but not used
  [-Werror,-Wunused-but-set-global]
   483 | static bool exception;
       |             ^
 1 error generated.

Remove it to fix the problem.

Fixes: 932ba2d2f530 ("x86: simplify test_for_exception trigger functions")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 lib/x86/desc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/x86/desc.c b/lib/x86/desc.c
index f4cdfbc9..b5d40562 100644
--- a/lib/x86/desc.c
+++ b/lib/x86/desc.c
@@ -480,7 +480,6 @@ void setup_alt_stack(void)
 }
 #endif
 
-static bool exception;
 static jmp_buf *exception_jmpbuf;
 
 static void exception_handler_longjmp(void)
@@ -491,7 +490,6 @@ static void exception_handler_longjmp(void)
 static void exception_handler(struct ex_regs *regs)
 {
 	/* longjmp must happen after iret, so do not do it now.  */
-	exception = true;
 	regs->rip = (unsigned long)&exception_handler_longjmp;
 	regs->cs = read_cs();
 }
-- 
2.56.0


             reply	other threads:[~2026-11-11  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  8:18 Thomas Huth [this message]
2026-11-11  8:48 ` [kvm-unit-tests PATCH] lib/x86/desc: Remove unused variable "exception" Thomas Huth

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=20261111081833.69641-1-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox