Commit 7144acf918 for qemu.org
commit 7144acf9185894b024a68ee63fedd3b84cdf5571
Author: Cédric Le Goater <clg@redhat.com>
Date: Mon Nov 30 13:56:12 2026 +0100
qemu-keymap: Drop unused ctrl modifier
The ctrl modifier mask has been set but never read since the tool was
added in commit 6a021536e239 ("tools: add qemu-keymap"). This went
unnoticed until clang 23 extended -Wunused-but-set-variable to file
scope statics as -Wunused-but-set-global:
../qemu-keymap.c:28:23: error: variable 'ctrl' set but not used [-Werror,-Wunused-but-set-global]
28 | static xkb_mod_mask_t ctrl;
| ^
1 error generated.
Remove the dead variable.
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20261130125615.728947-3-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
diff --git a/qemu-keymap.c b/qemu-keymap.c
index d63b6be8ce..af3519fa05 100644
--- a/qemu-keymap.c
+++ b/qemu-keymap.c
@@ -25,7 +25,6 @@ struct xkb_rule_names names = {
};
static xkb_mod_mask_t shift;
-static xkb_mod_mask_t ctrl;
static xkb_mod_mask_t altgr;
static xkb_mod_mask_t numlock;
@@ -227,7 +226,6 @@ int main(int argc, char *argv[])
}
shift = get_mod(map, "Shift");
- ctrl = get_mod(map, "Control");
altgr = get_mod(map, "AltGr");
if (!altgr) {
altgr = get_mod(map, "Mod5");