From 7970a9c17aa0756bad63e89fccb6ee4f2ec83ccc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= <jose.exposito89@gmail.com>
Date: Sat, 25 May 2024 09:51:27 +0200
Subject: [PATCH] bpf: move the BIT() macro to hid_bpf_helpers.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
 src/bpf/hid_bpf_helpers.h               | 1 +
 src/bpf/stable/10-XPPen__Artist24.bpf.c | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/bpf/hid_bpf_helpers.h b/src/bpf/hid_bpf_helpers.h
index 8f226f6..3ba24d1 100644
--- a/src/bpf/hid_bpf_helpers.h
+++ b/src/bpf/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
diff --git a/src/bpf/stable/10-XPPen__Artist24.bpf.c b/src/bpf/stable/10-XPPen__Artist24.bpf.c
index 1664784..6836b60 100644
--- a/src/bpf/stable/10-XPPen__Artist24.bpf.c
+++ b/src/bpf/stable/10-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)
-- 
GitLab