HID: logitech-dj: stop G602 mouse dmesg flooding
Subsystems (2)
PATCH 1/1 HID: logitech-dj: stop G602 mouse dmesg flooding
The Logitech G602 mouse seems to send a 128 report on every button press, which is undefined behavior and results in a dmesg log entry each time any button on the mouse is clicked (left/right/scroll click or any other macro/function buttons). This causes dmesg to be flooded with repeated entries of the following content pretty much constantly:
Unexpected input report number 128
This commit checks for this exact scenario, and quietly ignores it instead of logging the error. Actual mouse functionality is not affected.
Signed-off-by thomas <[email protected]>
--- drivers/hid/hid-logitech-dj.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/hid/hid-logitech-dj.c +10 -0
@@ -1160,6 +1160,16 @@ static void logi_dj_recv_forward_input_report(struct hid_device *hdev,int i;if (report >REPORT_TYPE_RFREPORT_LAST ) { +/* +* G602 mouse may send a 128 report on every click, which is undefined +* behavior and spams the log. Ignore it. +*/ +if (report ==128 && + hdev->vendor ==USB_VENDOR_ID_LOGITECH && + hdev->product ==0xc537 ) { +return ; + } +hid_err (hdev,"Unexpected input report number %d\n" , report);return ; }
Signature · 1 line
2.43.0