hid_compare_device_paths(9)
π hid_compare_device_paths(9) π
okay bestie, so this one lives in the Kernel API Manual and it's literally called hid_compare_device_paths(9) β say that five times fast, iykyk. it's a tiny little helper in the HID corner of the kernel and honestly? it's giving "small but mighty." π¦
β¨ NAME β¨
hid_compare_device_paths β check if both devices share the same path ππ
πΈ SYNOPSIS πΈ
bool hid_compare_device_paths (struct hid_device *hdev_a , struct
hid_device *hdev_b , char separator );
π ARGUMENTS π
hdev_aβ hid device π (yes, the first one)hdev_bβ hid device π«Ά (and the second one, we love a duo)separatorβ char to use as separator β¨ like, the character that does the splitting, no cap
π₯ DESCRIPTION π₯
So here's the vibe: it checks if two devices share the same path up to the last occurrence of the separator char. that's the whole thing. that's the function. π
β οΈ Important caveat bestie, do NOT skip this: both paths must exist β meaning zero-length paths don't match. like, if there's nothing there, there's nothing to compare. periodt. π
π SEE ALSO π
these all live in the kernel file ./drivers/hid/hid-core.c and honestly the whole friend group is iconic π:
hid_parse_report(9)hid_validate_values(9)hid_open_report(9)hid_match_report(9)hid_match_usage(9)hid_input_report(9)hid_safe_input_report(9)hid_hw_start(9)hid_hw_stop(9)hid_hw_open(9)hid_hw_close(9)hid_hw_request(9)hid_hw_raw_request(9)hid_hw_output_report(9)new_id_store(9)hid_allocate_device(9)hid_destroy_device(9)
and that's the page, bestie!! π§ mwah π
this little cutie is filed under ./drivers/hid, and the version/date stamp on it is October 2026 β so yeah, she's from the future and she ate. πβ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms