]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: bpf: fix some signed vs unsigned compiler warnings
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 3 Apr 2026 16:12:19 +0000 (18:12 +0200)
committerJiri Kosina <jkosina@suse.com>
Wed, 8 Apr 2026 19:46:00 +0000 (21:46 +0200)
On udev-hid-bpf, we are now getting warnings here, shut them off.

Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/227
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/bpf/progs/Huion__KeydialK20.bpf.c
drivers/hid/bpf/progs/IOGEAR__Kaliber-MMOmentum.bpf.c
drivers/hid/bpf/progs/Wacom__ArtPen.bpf.c
drivers/hid/bpf/progs/XPPen__DecoMini4.bpf.c

index ec360d71130f7edee7faf5d64f0e81ddf65291c9..c562c2d684fe33c95b651ce6b0eeb06b31df6caf 100644 (file)
@@ -462,7 +462,8 @@ int BPF_PROG(k20_fix_events, struct hid_bpf_ctx *hctx)
                        __u32 buttons;
                        __u8 wheel;
                } __attribute__((packed)) *pad_report;
-               int i, b;
+               int i;
+               size_t b;
                __u8 modifiers = data[1];
                __u32 buttons = 0;
 
index 82f1950445ddec52668e171bf9ff86dfc7063074..253b96458c5886102971df5dbd116587bc1d2311 100644 (file)
@@ -34,7 +34,7 @@ int BPF_PROG(hid_fix_rdesc, struct hid_bpf_ctx *hctx)
        if (data[3] != 0x06)
                return 0;
 
-       for (int idx = 0; idx < ARRAY_SIZE(offsets); idx++) {
+       for (size_t idx = 0; idx < ARRAY_SIZE(offsets); idx++) {
                u8 offset = offsets[idx];
 
                /* if Input (Cnst,Var,Abs) , make it Input (Data,Var,Abs) */
index 2da680bc4e111cf8b63167a768d8cbad241f3506..ed60a660cc1a8d394e5ff5a3ef4d1a0c890ef8d6 100644 (file)
@@ -148,7 +148,7 @@ int probe(struct hid_bpf_probe_args *ctx)
 {
        struct hid_bpf_ctx *hid_ctx;
        __u16 pid;
-       int i;
+       size_t i;
 
        /* get a struct hid_device to access the actual pid of the device */
        hid_ctx = hid_bpf_allocate_context(ctx->hid);
index 46d5c459d0c949204c3a8bc1dcd7a0d94ba02e2b..ac07216f5b67bb036f11802f9174b1e6d257bf95 100644 (file)
@@ -173,7 +173,7 @@ int BPF_PROG(hid_device_event_xppen_deco_mini_4, struct hid_bpf_ctx *hctx)
 {
        __u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 8 /* size */);
        __u8 button_mask = 0;
-       int d, b;
+       size_t d, b;
 
        if (!data)
                return 0; /* EPERM check */