fru_device: Remove unused systemBus parameter
The systemBus connection object was passed into several functions
but was never used within them. This change removes the unused
parameter to simplify the function signatures and improve clarity.
Modified Functions:
- updateFRUProperty
- addFruObjectToDbus
- rescanOneBus
- rescanBusses
- main
Change-Id: Ide90e794afd2a812e08f8d83a663caed53c1ab2b
Signed-off-by: Sora Su <baxiche@gmail.com>
diff --git a/src/fru_device/fru_device.cpp b/src/fru_device/fru_device.cpp
index 4bb9418..8a24b6c 100644
--- a/src/fru_device/fru_device.cpp
+++ b/src/fru_device/fru_device.cpp
@@ -82,8 +82,7 @@
std::pair<size_t, size_t>,
std::shared_ptr<sdbusplus::asio::dbus_interface>>& dbusInterfaceMap,
size_t& unknownBusObjectCount, const bool& powerIsOn,
- sdbusplus::asio::object_server& objServer,
- std::shared_ptr<sdbusplus::asio::connection>& systemBus);
+ sdbusplus::asio::object_server& objServer);
// Given a bus/address, produce the path in sysfs for an eeprom.
static std::string getEepromPath(size_t bus, size_t address)
@@ -793,8 +792,7 @@
std::pair<size_t, size_t>,
std::shared_ptr<sdbusplus::asio::dbus_interface>>& dbusInterfaceMap,
uint32_t bus, uint32_t address, size_t& unknownBusObjectCount,
- const bool& powerIsOn, sdbusplus::asio::object_server& objServer,
- std::shared_ptr<sdbusplus::asio::connection>& systemBus)
+ const bool& powerIsOn, sdbusplus::asio::object_server& objServer)
{
boost::container::flat_map<std::string, std::string> formattedFRU;
@@ -838,15 +836,15 @@
iface->register_property(
key, property.second + '\0',
[bus, address, propertyName, &dbusInterfaceMap,
- &unknownBusObjectCount, &powerIsOn, &objServer,
- &systemBus](const std::string& req, std::string& resp) {
+ &unknownBusObjectCount, &powerIsOn,
+ &objServer](const std::string& req, std::string& resp) {
if (strcmp(req.c_str(), resp.c_str()) != 0)
{
// call the method which will update
if (updateFRUProperty(req, bus, address, propertyName,
dbusInterfaceMap,
unknownBusObjectCount, powerIsOn,
- objServer, systemBus))
+ objServer))
{
resp = req;
}
@@ -1037,8 +1035,7 @@
std::pair<size_t, size_t>,
std::shared_ptr<sdbusplus::asio::dbus_interface>>& dbusInterfaceMap,
bool dbusCall, size_t& unknownBusObjectCount, const bool& powerIsOn,
- sdbusplus::asio::object_server& objServer,
- std::shared_ptr<sdbusplus::asio::connection>& systemBus)
+ sdbusplus::asio::object_server& objServer)
{
for (auto device = foundDevices.begin(); device != foundDevices.end();)
{
@@ -1071,7 +1068,7 @@
auto scan = std::make_shared<FindDevicesWithCallback>(
i2cBuses, busmap, powerIsOn, objServer,
[busNum, &busmap, &dbusInterfaceMap, &unknownBusObjectCount, &powerIsOn,
- &objServer, &systemBus]() {
+ &objServer]() {
for (auto busIface = dbusInterfaceMap.begin();
busIface != dbusInterfaceMap.end();)
{
@@ -1094,8 +1091,7 @@
{
addFruObjectToDbus(device.second, dbusInterfaceMap,
static_cast<uint32_t>(busNum), device.first,
- unknownBusObjectCount, powerIsOn, objServer,
- systemBus);
+ unknownBusObjectCount, powerIsOn, objServer);
}
});
scan->run();
@@ -1107,8 +1103,7 @@
std::pair<size_t, size_t>,
std::shared_ptr<sdbusplus::asio::dbus_interface>>& dbusInterfaceMap,
size_t& unknownBusObjectCount, const bool& powerIsOn,
- sdbusplus::asio::object_server& objServer,
- std::shared_ptr<sdbusplus::asio::connection>& systemBus)
+ sdbusplus::asio::object_server& objServer)
{
static boost::asio::steady_timer timer(io);
timer.expires_after(std::chrono::seconds(1));
@@ -1174,7 +1169,7 @@
addFruObjectToDbus(device.second, dbusInterfaceMap,
devicemap.first, device.first,
unknownBusObjectCount, powerIsOn,
- objServer, systemBus);
+ objServer);
}
}
});
@@ -1200,8 +1195,7 @@
std::pair<size_t, size_t>,
std::shared_ptr<sdbusplus::asio::dbus_interface>>& dbusInterfaceMap,
size_t& unknownBusObjectCount, const bool& powerIsOn,
- sdbusplus::asio::object_server& objServer,
- std::shared_ptr<sdbusplus::asio::connection>& systemBus)
+ sdbusplus::asio::object_server& objServer)
{
size_t updatePropertyReqLen = updatePropertyReq.length();
if (updatePropertyReqLen == 1 || updatePropertyReqLen > 63)
@@ -1357,7 +1351,7 @@
// Rescan the bus so that GetRawFru dbus-call fetches updated values
rescanBusses(busMap, dbusInterfaceMap, unknownBusObjectCount, powerIsOn,
- objServer, systemBus);
+ objServer);
return true;
}
@@ -1395,12 +1389,12 @@
iface->register_method("ReScan", [&]() {
rescanBusses(busMap, dbusInterfaceMap, unknownBusObjectCount, powerIsOn,
- objServer, systemBus);
+ objServer);
});
iface->register_method("ReScanBus", [&](uint16_t bus) {
rescanOneBus(busMap, bus, dbusInterfaceMap, true, unknownBusObjectCount,
- powerIsOn, objServer, systemBus);
+ powerIsOn, objServer);
});
iface->register_method("GetRawFru", getFRUInfo);
@@ -1415,7 +1409,7 @@
}
// schedule rescan on success
rescanBusses(busMap, dbusInterfaceMap, unknownBusObjectCount,
- powerIsOn, objServer, systemBus);
+ powerIsOn, objServer);
});
iface->initialize();
@@ -1440,7 +1434,7 @@
if (powerIsOn)
{
rescanBusses(busMap, dbusInterfaceMap, unknownBusObjectCount,
- powerIsOn, objServer, systemBus);
+ powerIsOn, objServer);
}
};
@@ -1493,12 +1487,12 @@
static_cast<uint16_t>(rootBus),
dbusInterfaceMap, false,
unknownBusObjectCount, powerIsOn,
- objServer, systemBus);
+ objServer);
}
rescanOneBus(busMap, static_cast<uint16_t>(bus),
dbusInterfaceMap, false,
unknownBusObjectCount, powerIsOn,
- objServer, systemBus);
+ objServer);
}
}
break;
@@ -1515,7 +1509,7 @@
dirWatch.async_read_some(boost::asio::buffer(readBuffer), watchI2cBusses);
// run the initial scan
rescanBusses(busMap, dbusInterfaceMap, unknownBusObjectCount, powerIsOn,
- objServer, systemBus);
+ objServer);
io.run();
return 0;