diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2017-06-07 04:42:41 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2017-06-07 20:09:44 -0700 |
| commit | 9357cee2ef96fbe345a82ac2f6af7c715d1e6027 (patch) | |
| tree | badd7f8703424f269d1242b3964561ef0485c005 /Source/Core/InputCommon/GCAdapter.cpp | |
| parent | 50f34f8b05ea64c42f465d6bd384208e886ba88f (diff) | |
do not assign in conditional statements
Diffstat (limited to 'Source/Core/InputCommon/GCAdapter.cpp')
| -rw-r--r-- | Source/Core/InputCommon/GCAdapter.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp index 2cb7819d9d..a422e2635e 100644 --- a/Source/Core/InputCommon/GCAdapter.cpp +++ b/Source/Core/InputCommon/GCAdapter.cpp @@ -266,27 +266,26 @@ static bool CheckDeviceAccess(libusb_device* device) } return false; } - else if ((ret = libusb_kernel_driver_active(s_handle, 0)) == 1) + else { - if ((ret = libusb_detach_kernel_driver(s_handle, 0)) && ret != LIBUSB_ERROR_NOT_SUPPORTED) + ret = libusb_kernel_driver_active(s_handle, 0); + if (ret == 1) { - ERROR_LOG(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: %d", ret); + ret = libusb_detach_kernel_driver(s_handle, 0); + if (ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED) + ERROR_LOG(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: %d", ret); } } // this split is needed so that we don't avoid claiming the interface when // detaching the kernel driver is successful if (ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED) - { return false; - } - else if ((ret = libusb_claim_interface(s_handle, 0))) - { + + ret = libusb_claim_interface(s_handle, 0); + if (ret) ERROR_LOG(SERIALINTERFACE, "libusb_claim_interface failed with error: %d", ret); - } else - { return true; - } } return false; } |
