Page MenuHomeFreeBSD

libusb: implement libusb_hotplug_get_user_data
ClosedPublic

Authored by aokblast on Jul 9 2025, 8:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 3:45 AM
Unknown Object (File)
Sat, Oct 11, 1:21 PM
Unknown Object (File)
Sat, Oct 11, 5:06 AM
Unknown Object (File)
Sat, Oct 11, 5:06 AM
Unknown Object (File)
Sat, Oct 11, 5:06 AM
Unknown Object (File)
Sat, Oct 11, 5:06 AM
Unknown Object (File)
Sat, Oct 11, 5:06 AM
Unknown Object (File)
Fri, Oct 10, 9:53 PM

Details

Summary

libusb provides a function to get the callback userdata for a given
callback sincwe this structure is opaque to libusb user.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 65293
Build 62176: arc lint + arc unit

Event Timeline

markj added inline comments.
lib/libusb/libusb.3
767
768
lib/libusb/libusb10_hotplug.c
429

Presumably you need to release the lock before returning?

Or, just break; here, and return (handle) below. It is guaranteed that TAILQ_FOREACH will set the iterator variable to NULL after the loop reaches the end of the queue and terminates.

lib/libusb/libusb.3
767

returns?

lib/libusb/libusb.3
767

Yes, sorry.

hi! please address the concerns in the diff (including that lock handling, heh) and then i'll approve! thanks!

lib/libusb/libusb10_hotplug.c
433

Don't you want to return handle here?

Fix false return after drunk too much

This revision is now accepted and ready to land.Jul 15 2025, 1:55 PM
lwhsu added a subscriber: lwhsu.
lwhsu added inline comments.
lib/libusb/libusb.h
601

don't forget to align the style with other functions.