summaryrefslogtreecommitdiff
path: root/libusb/os/haiku_usb_backend.cpp
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/os/haiku_usb_backend.cpp
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/os/haiku_usb_backend.cpp')
-rw-r--r--libusb/os/haiku_usb_backend.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libusb/os/haiku_usb_backend.cpp b/libusb/os/haiku_usb_backend.cpp
index 8bbf3e0..e1d7efe 100644
--- a/libusb/os/haiku_usb_backend.cpp
+++ b/libusb/os/haiku_usb_backend.cpp
@@ -296,7 +296,7 @@ USBDeviceHandle::SetAltSetting(uint8 inumber, uint8 alt)
return _errno_to_libusb(command.alternate.status);
}
if (command.alternate.alternate_info == (uint32)alt) {
- usbi_dbg("Setting alternate interface successful");
+ usbi_dbg(NULL, "Setting alternate interface successful");
return LIBUSB_SUCCESS;
}
command.alternate.alternate_info = alt;
@@ -305,7 +305,7 @@ USBDeviceHandle::SetAltSetting(uint8 inumber, uint8 alt)
usbi_err(NULL, "Error setting alternate interface");
return _errno_to_libusb(command.alternate.status);
}
- usbi_dbg("Setting alternate interface successful");
+ usbi_dbg(NULL, "Setting alternate interface successful");
return LIBUSB_SUCCESS;
}