* [kvm-unit-tests PATCH] lib/x86/desc: Remove unused variable "exception"
@ 2026-11-11 8:18 Thomas Huth
2026-11-11 8:48 ` Thomas Huth
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2026-11-11 8:18 UTC (permalink / raw)
To: Paolo Bonzini, kvm
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [kvm-unit-tests PATCH] lib/x86/desc: Remove unused variable "exception"
2026-11-11 8:18 [kvm-unit-tests PATCH] lib/x86/desc: Remove unused variable "exception" Thomas Huth
@ 2026-11-11 8:48 ` Thomas Huth
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2026-11-11 8:48 UTC (permalink / raw)
To: Paolo Bonzini, kvm
Am 11.11.26 um 09:18 schrieb Thomas Huth:
> 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(-)
Never mind, I just saw that a patch for this has already been posted three
weeks ago:
https://lore.kernel.org/kvm/20261022204413.856786-3-yosry@kernel.org/
Thomas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-11 8:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-11 8:18 [kvm-unit-tests PATCH] lib/x86/desc: Remove unused variable "exception" Thomas Huth
2026-11-11 8:48 ` Thomas Huth
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.