Skip to content

Commit c4015aa

Browse files
author
Benjamin Tissoires
committed
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent 09c555f commit c4015aa

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

drivers/hid/bpf/progs/XPPen__Artist24.bpf.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ static const __u8 fixed_rdesc[] = {
7878
0xc0, // End Collection 106
7979
};
8080

81-
#define BIT(n) (1UL << n)
82-
8381
#define TIP_SWITCH BIT(0)
8482
#define BARREL_SWITCH BIT(1)
8583
#define ERASER BIT(2)

drivers/hid/bpf/progs/hid_bpf_helpers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ extern int hid_bpf_hw_request(struct hid_bpf_ctx *ctx,
6666
#define HID_VID_ANY 0x0000
6767
#define HID_PID_ANY 0x0000
6868

69+
#define BIT(n) (1UL << (n))
6970
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
7071

7172
/* Helper macro to convert (foo, __LINE__) into foo134 so we can use __LINE__ for

0 commit comments

Comments
 (0)