summaryrefslogtreecommitdiff
path: root/libusb/sync.c
diff options
context:
space:
mode:
authorNathan Hjelm <hjelmn@google.com>2021-07-20 09:31:06 -0600
committerNathan Hjelm <hjelmn@cs.unm.edu>2021-07-21 10:03:59 -0600
commit6cae9c6dbd74c0840848f343dd605c5ddcef1ad1 (patch)
tree05ab9c50bbafcf66d00f866f99a31126aa2866a3 /libusb/sync.c
parentb0fd4d873e224bbb1985971834d31d956080c7a4 (diff)
downloadlibusb-6cae9c6dbd74c0840848f343dd605c5ddcef1ad1.tar.gz
core: update usbi_dbg to take the context as an argument
This commit fixes a performance issue caused by the disconnection of the first context allocated from the default context. usbi_dbg now takes the explicit context instead of relying on the default context (which may not exist) in most cases. All call sites have been updated to pass the context or explicitly pass NULL if the context is not available. We should actively discourage using NULL as the context in the future and patch all call sites to always pass the context. Fixes #951 Signed-off-by: Nathan Hjelm <hjelmn@google.com>
Diffstat (limited to 'libusb/sync.c')
-rw-r--r--libusb/sync.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libusb/sync.c b/libusb/sync.c
index adc95b4..1fa1f0b 100644
--- a/libusb/sync.c
+++ b/libusb/sync.c
@@ -36,7 +36,7 @@ static void LIBUSB_CALL sync_transfer_cb(struct libusb_transfer *transfer)
{
int *completed = transfer->user_data;
*completed = 1;
- usbi_dbg("actual_length=%d", transfer->actual_length);
+ usbi_dbg(TRANSFER_CTX(transfer), "actual_length=%d", transfer->actual_length);
/* caller interprets result and frees transfer */
}