diff options
author | Benjamin Tissoires <bentiss@kernel.org> | 2024-06-27 11:54:19 +0200 |
---|---|---|
committer | Benjamin Tissoires <bentiss@kernel.org> | 2024-07-01 14:48:33 +0200 |
commit | c4015aa7d8faa43ca53608dccad681eafc22db09 (patch) | |
tree | 54026980e7bee0d86e4c3e252b0c51e6caa52a9b | |
parent | HID: bpf: add a driver for the Huion Inspiroy 2S (H641P) (diff) | |
download | linux-c4015aa7d8faa43ca53608dccad681eafc22db09.tar.xz linux-c4015aa7d8faa43ca53608dccad681eafc22db09.zip |
HID: bpf: move the BIT() macro to hid_bpf_helpers.h
This macro can be useful in mopre than one place
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/commit/7970a9c17aa0756bad63e89fccb6ee4f2ec83ccc
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patch.msgid.link/20240627-import-bpf-v1-3-0dbcda4a5b1f@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
-rw-r--r-- | drivers/hid/bpf/progs/XPPen__Artist24.bpf.c | 2 | ||||
-rw-r--r-- | drivers/hid/bpf/progs/hid_bpf_helpers.h | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hid/bpf/progs/XPPen__Artist24.bpf.c b/drivers/hid/bpf/progs/XPPen__Artist24.bpf.c index d4d062c3a653..c24fe905c50d 100644 --- a/drivers/hid/bpf/progs/XPPen__Artist24.bpf.c +++ b/drivers/hid/bpf/progs/XPPen__Artist24.bpf.c @@ -78,8 +78,6 @@ static const __u8 fixed_rdesc[] = { 0xc0, // End Collection 106 }; -#define BIT(n) (1UL << n) - #define TIP_SWITCH BIT(0) #define BARREL_SWITCH BIT(1) #define ERASER BIT(2) diff --git a/drivers/hid/bpf/progs/hid_bpf_helpers.h b/drivers/hid/bpf/progs/hid_bpf_helpers.h index 8f226f6e886b..3ba24d125a08 100644 --- a/drivers/hid/bpf/progs/hid_bpf_helpers.h +++ b/drivers/hid/bpf/progs/hid_bpf_helpers.h @@ -66,6 +66,7 @@ extern int hid_bpf_hw_request(struct hid_bpf_ctx *ctx, #define HID_VID_ANY 0x0000 #define HID_PID_ANY 0x0000 +#define BIT(n) (1UL << (n)) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) /* Helper macro to convert (foo, __LINE__) into foo134 so we can use __LINE__ for |