]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: pidff: Treat PID_REQUIRED_REPORTS as count, not max
authorTomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Wed, 13 Aug 2025 20:09:53 +0000 (22:09 +0200)
committerJiri Kosina <jkosina@suse.com>
Fri, 15 Aug 2025 13:58:02 +0000 (15:58 +0200)
It's naming suggests it's a count of the records required by the USB PID
standard and this driver.

Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Reviewed-by: Oleg Makarenko <oleg@makarenk.ooo>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/usbhid/hid-pidff.c

index 2f9fbe4c52d7c06635ad72c74d2747ebafe3b4de..cff79e76c2117530376a9906275fbaaa211d88a6 100644 (file)
@@ -33,7 +33,7 @@
 #define PID_DEVICE_CONTROL     6
 #define PID_CREATE_NEW_EFFECT  7
 
-#define PID_REQUIRED_REPORTS   7
+#define PID_REQUIRED_REPORTS   8
 
 #define PID_SET_ENVELOPE       8
 #define PID_SET_CONDITION      9
@@ -1056,7 +1056,7 @@ static int pidff_reports_ok(struct pidff_device *pidff)
 {
        int i;
 
-       for (i = 0; i <= PID_REQUIRED_REPORTS; i++) {
+       for (i = 0; i < PID_REQUIRED_REPORTS; i++) {
                if (!pidff->reports[i]) {
                        hid_dbg(pidff->hid, "%d missing\n", i);
                        return 0;