Skip to content

Commit

Permalink
Merge pull request #661 from dlopr/fix-device-detection
Browse files Browse the repository at this point in the history
Fix logic to query the number of available devices
  • Loading branch information
coldav authored Jan 28, 2025
2 parents bd1a3d6 + e5fc676 commit 4042dda
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions modules/mux/targets/riscv/source/device_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,11 @@ static mux_result_t GetDeviceInfos(uint32_t device_types,
}

// copy out the device info pointer
if (out_device_infos) {
if (out_device_infos && (num_infos_out < device_infos_length)) {
out_device_infos[num_infos_out] = static_cast<mux_device_info_t>(&info);
}
// advance to next device info
++num_infos_out;
if (num_infos_out >= device_infos_length) {
// no more space so terminate
break;
}
}
// return the number of infos that we have
if (out_device_infos_length) {
Expand Down

0 comments on commit 4042dda

Please sign in to comment.