Skip to content

ResourceManager: Minor logging and implementation refinements #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,11 +1197,13 @@ void ResourceManager::DetectDevicesCoroutine()

for(unsigned int i2c_detector_idx = 0; i2c_detector_idx < i2c_dimm_device_detectors.size() && detection_is_required.load(); i2c_detector_idx++)
{
if(i2c_dimm_device_detectors[i2c_detector_idx].dimm_type == dimm_type &&
is_jedec_in_slots(slots, i2c_dimm_device_detectors[i2c_detector_idx].jedec_id))
{
detection_string = i2c_dimm_device_detectors[i2c_detector_idx].name.c_str();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't seem harmful to lift this out of the if block.
But I'm new to the codebase, and since detection_string is visible elsewhere, thought I should call it out.

I2CDIMMDeviceDetectorBlock &detector = i2c_dimm_device_detectors[i2c_detector_idx];
detection_string = detector.name.c_str();

LOG_DEBUG("[%s] Detector %d Jedec ID: 0x%04x", detection_string, i2c_detector_idx, detector.jedec_id);

if(detector.dimm_type == dimm_type && is_jedec_in_slots(slots, detector.jedec_id))
{
/*-------------------------------------------------*\
| Check if this detector is enabled |
\*-------------------------------------------------*/
Expand All @@ -1216,8 +1218,8 @@ void ResourceManager::DetectDevicesCoroutine()
{
DetectionProgressChanged();

std::vector<SPDWrapper*> matching_slots = slots_with_jedec(slots, i2c_dimm_device_detectors[i2c_detector_idx].jedec_id);
i2c_dimm_device_detectors[i2c_detector_idx].function(busses[bus], matching_slots);
std::vector<SPDWrapper*> matching_slots = slots_with_jedec(slots, detector.jedec_id);
detector.function(busses[bus], matching_slots);
}

LOG_TRACE("[%s] detection end", detection_string);
Expand Down