]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
selftests/hid: tablets: reduce the number of pen state
authorBenjamin Tissoires <bentiss@kernel.org>
Wed, 10 Apr 2024 17:19:32 +0000 (19:19 +0200)
committerBenjamin Tissoires <bentiss@kernel.org>
Tue, 7 May 2024 13:39:30 +0000 (15:39 +0200)
commite14d88d9b8dae40c6f612c6fc74b7d03d12f3c94
tree4b1aee3772a51e4c922b1deb3f7176f48472c199
parente906463087cec0a179ddcafe08aeef5899af6b00
selftests/hid: tablets: reduce the number of pen state

All the *_WITH*BUTTON states were almost identical except for the
button itself.

I need to add a new device with a third button, and adding a bunch of
states is going to be quite cumbersome.

So convert the `button` parameter of PenState as a boolean, and store
which button is the target as an argument to all functions that need it.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-12-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
tools/testing/selftests/hid/tests/test_tablet.py