HID: fix semantic patch and improve its performanceReplace "expression" with "identifier" in the declaration of hdev.This is necessary because hdev is used as the name of a functionparameter.Mo
HID: fix semantic patch and improve its performanceReplace "expression" with "identifier" in the declaration of hdev.This is necessary because hdev is used as the name of a functionparameter.Move the two uses of @p2 to the relevant function names.Convert <... ...>, meaning that the contained pattern is optional,to use ..., when any, and exists. This requires that the functioncontain calls to hid_hw_start, etc, which reduces the set of filesthat are considered for matching against this pattern.Reported-by: Ricardo Ribalda <ribalda@chromium.org>Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
HID: add documentation and Coccinelle script for FF registration raceHID drivers that rely on the HID core to register input devices mustensure that all private data and capabilities (like force-f
HID: add documentation and Coccinelle script for FF registration raceHID drivers that rely on the HID core to register input devices mustensure that all private data and capabilities (like force-feedback) arefully initialized before registration.When hid_hw_start() is called with HID_CONNECT_HIDINPUT, the inputdevice is registered immediately. This is racy if the driver attempts toaugment the input device in probe() after starting the hardware.The correct way to handle this is to use the .input_configured()callback.Add documentation and a Coccinelle script to detect and prevent thisanti-pattern.Assisted-by: Gemini:gemini-3.1-proSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>Signed-off-by: Jiri Kosina <jkosina@suse.com>