hid_compare_device_paths(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 🌈:


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