clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I8c84201cb2343a8c8a5507a49de0721a1bee7063
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/oem/ibm/libpldmresponder/inband_code_update.cpp b/oem/ibm/libpldmresponder/inband_code_update.cpp
index 71b6ec3..d3ea1a8 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.cpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.cpp
@@ -172,8 +172,8 @@
runningVersion = std::get<std::vector<std::string>>(paths)[0];
- auto method1 = bus.new_method_call(mapperService, activeObjPath,
- propIntf, "Get");
+ auto method1 =
+ bus.new_method_call(mapperService, activeObjPath, propIntf, "Get");
method1.append("xyz.openbmc_project.Association", "endpoints");
auto reply1 = bus.call(method1, dbusTimeout);
@@ -201,117 +201,127 @@
pldm::utils::DBusHandler::getBus(),
propertiesChanged(runningVersion, redundancyIntf),
[this](sdbusplus::message_t& msg) {
- DbusChangedProps props;
- std::string iface;
- msg.read(iface, props);
- processPriorityChangeNotification(props);
- }));
+ DbusChangedProps props;
+ std::string iface;
+ msg.read(iface, props);
+ processPriorityChangeNotification(props);
+ }));
fwUpdateMatcher.push_back(std::make_unique<sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
"interface='org.freedesktop.DBus.ObjectManager',type='signal',"
"member='InterfacesAdded',path='/xyz/openbmc_project/software'",
[this](sdbusplus::message_t& msg) {
- DBusInterfaceAdded interfaces;
- sdbusplus::message::object_path path;
- msg.read(path, interfaces);
+ DBusInterfaceAdded interfaces;
+ sdbusplus::message::object_path path;
+ msg.read(path, interfaces);
- for (auto& interface : interfaces)
- {
- if (interface.first == "xyz.openbmc_project.Software.Activation")
+ for (auto& interface : interfaces)
{
- auto imageInterface = "xyz.openbmc_project.Software.Activation";
- auto imageObjPath = path.str.c_str();
-
- try
+ if (interface.first ==
+ "xyz.openbmc_project.Software.Activation")
{
- auto propVal = dBusIntf->getDbusPropertyVariant(
- imageObjPath, "Activation", imageInterface);
- const auto& imageProp = std::get<std::string>(propVal);
- if (imageProp == "xyz.openbmc_project.Software."
- "Activation.Activations.Ready" &&
- isCodeUpdateInProgress())
+ auto imageInterface =
+ "xyz.openbmc_project.Software.Activation";
+ auto imageObjPath = path.str.c_str();
+
+ try
{
- newImageId = path.str;
- if (!imageActivationMatch)
+ auto propVal = dBusIntf->getDbusPropertyVariant(
+ imageObjPath, "Activation", imageInterface);
+ const auto& imageProp = std::get<std::string>(propVal);
+ if (imageProp == "xyz.openbmc_project.Software."
+ "Activation.Activations.Ready" &&
+ isCodeUpdateInProgress())
{
- imageActivationMatch =
- std::make_unique<sdbusplus::bus::match_t>(
+ newImageId = path.str;
+ if (!imageActivationMatch)
+ {
+ imageActivationMatch = std::make_unique<
+ sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
propertiesChanged(newImageId,
"xyz.openbmc_project."
"Software.Activation"),
[this](sdbusplus::message_t& msg) {
- DbusChangedProps props;
- std::string iface;
- msg.read(iface, props);
- const auto itr = props.find("Activation");
- if (itr != props.end())
- {
- PropertyValue value = itr->second;
- auto propVal = std::get<std::string>(value);
- if (propVal ==
- "xyz.openbmc_project.Software."
- "Activation.Activations.Active")
- {
- CodeUpdateState state =
- CodeUpdateState::END;
- setCodeUpdateProgress(false);
- auto sensorId =
- getFirmwareUpdateSensor();
- sendStateSensorEvent(
- sensorId, PLDM_STATE_SENSOR_STATE,
- 0, uint8_t(state),
- uint8_t(CodeUpdateState::START));
- newImageId.clear();
- }
- else if (propVal == "xyz.openbmc_project."
- "Software.Activation."
- "Activations.Failed" ||
- propVal == "xyz.openbmc_"
- "project.Software."
- "Activation."
- "Activations."
- "Invalid")
- {
- CodeUpdateState state =
- CodeUpdateState::FAIL;
- setCodeUpdateProgress(false);
- auto sensorId =
- getFirmwareUpdateSensor();
- sendStateSensorEvent(
- sensorId, PLDM_STATE_SENSOR_STATE,
- 0, uint8_t(state),
- uint8_t(CodeUpdateState::START));
- newImageId.clear();
- }
- }
- });
+ DbusChangedProps props;
+ std::string iface;
+ msg.read(iface, props);
+ const auto itr =
+ props.find("Activation");
+ if (itr != props.end())
+ {
+ PropertyValue value = itr->second;
+ auto propVal =
+ std::get<std::string>(value);
+ if (propVal ==
+ "xyz.openbmc_project.Software."
+ "Activation.Activations.Active")
+ {
+ CodeUpdateState state =
+ CodeUpdateState::END;
+ setCodeUpdateProgress(false);
+ auto sensorId =
+ getFirmwareUpdateSensor();
+ sendStateSensorEvent(
+ sensorId,
+ PLDM_STATE_SENSOR_STATE, 0,
+ uint8_t(state),
+ uint8_t(CodeUpdateState::
+ START));
+ newImageId.clear();
+ }
+ else if (propVal ==
+ "xyz.openbmc_project."
+ "Software.Activation."
+ "Activations.Failed" ||
+ propVal ==
+ "xyz.openbmc_"
+ "project.Software."
+ "Activation."
+ "Activations."
+ "Invalid")
+ {
+ CodeUpdateState state =
+ CodeUpdateState::FAIL;
+ setCodeUpdateProgress(false);
+ auto sensorId =
+ getFirmwareUpdateSensor();
+ sendStateSensorEvent(
+ sensorId,
+ PLDM_STATE_SENSOR_STATE, 0,
+ uint8_t(state),
+ uint8_t(CodeUpdateState::
+ START));
+ newImageId.clear();
+ }
+ }
+ });
+ }
+ auto rc = setRequestedActivation();
+ if (rc != PLDM_SUCCESS)
+ {
+ error("Could not set Requested Activation");
+ CodeUpdateState state = CodeUpdateState::FAIL;
+ setCodeUpdateProgress(false);
+ auto sensorId = getFirmwareUpdateSensor();
+ sendStateSensorEvent(
+ sensorId, PLDM_STATE_SENSOR_STATE, 0,
+ uint8_t(state),
+ uint8_t(CodeUpdateState::START));
+ }
+ break;
}
- auto rc = setRequestedActivation();
- if (rc != PLDM_SUCCESS)
- {
- error("Could not set Requested Activation");
- CodeUpdateState state = CodeUpdateState::FAIL;
- setCodeUpdateProgress(false);
- auto sensorId = getFirmwareUpdateSensor();
- sendStateSensorEvent(
- sensorId, PLDM_STATE_SENSOR_STATE, 0,
- uint8_t(state),
- uint8_t(CodeUpdateState::START));
- }
- break;
+ }
+ catch (const sdbusplus::exception_t& e)
+ {
+ error(
+ "Failed to get activation status for interface '{INTERFACE}' and object path '{PATH}', error - {ERROR}",
+ "ERROR", e, "INTERFACE", imageInterface, "PATH",
+ imageObjPath);
}
}
- catch (const sdbusplus::exception_t& e)
- {
- error(
- "Failed to get activation status for interface '{INTERFACE}' and object path '{PATH}', error - {ERROR}",
- "ERROR", e, "INTERFACE", imageInterface, "PATH",
- imageObjPath);
- }
}
- }
- }));
+ }));
}
void CodeUpdate::processPriorityChangeNotification(