From: Benjamin Tissoires <bentiss@kernel.org>
To: Jiri Kosina <jikos@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
bpf@vger.kernel.org, "Benjamin Tissoires" <bentiss@kernel.org>,
"José Expósito" <jose.exposito89@gmail.com>
Subject: [PATCH 3/6] HID: bpf: move the BIT() macro to hid_bpf_helpers.h
Date: Thu, 27 Jun 2024 11:54:19 +0200 [thread overview]
Message-ID: <20240627-import-bpf-v1-3-0dbcda4a5b1f@kernel.org> (raw)
In-Reply-To: <20240627-import-bpf-v1-0-0dbcda4a5b1f@kernel.org>
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>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
---
drivers/hid/bpf/progs/XPPen__Artist24.bpf.c | 2 --
drivers/hid/bpf/progs/hid_bpf_helpers.h | 1 +
2 files changed, 1 insertion(+), 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
--
2.44.0
next prev parent reply other threads:[~2024-06-27 9:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 9:54 [PATCH 0/6] HID: bpf: import some more fixes from udev-hid-bpf Benjamin Tissoires
2024-06-27 9:54 ` [PATCH 1/6] HID: bpf: Add a HID report composition helper macros Benjamin Tissoires
2024-06-27 9:54 ` [PATCH 2/6] HID: bpf: add a driver for the Huion Inspiroy 2S (H641P) Benjamin Tissoires
2024-06-28 0:22 ` Peter Hutterer
2024-06-27 9:54 ` Benjamin Tissoires [this message]
2024-06-27 9:54 ` [PATCH 4/6] HID: bpf: Add support for the XP-PEN Deco Mini 4 Benjamin Tissoires
2024-06-27 9:54 ` [PATCH 5/6] HID: bpf: Add Huion Dial 2 bpf fixup Benjamin Tissoires
2024-06-27 9:54 ` [PATCH 6/6] HID: bpf: Thrustmaster TCA Yoke Boeing joystick fix Benjamin Tissoires
2024-07-01 13:46 ` [PATCH 0/6] HID: bpf: import some more fixes from udev-hid-bpf Benjamin Tissoires
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240627-import-bpf-v1-3-0dbcda4a5b1f@kernel.org \
--to=bentiss@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=jikos@kernel.org \
--cc=jose.exposito89@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).