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: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp
index 19eccba..cd051dc 100644
--- a/redfish-core/lib/telemetry_service.hpp
+++ b/redfish-core/lib/telemetry_service.hpp
@@ -42,54 +42,55 @@
"xyz.openbmc_project.Telemetry.ReportManager",
[asyncResp](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& ret) {
- if (ec == boost::system::errc::host_unreachable)
- {
+ if (ec == boost::system::errc::host_unreachable)
+ {
+ asyncResp->res.jsonValue["Status"]["State"] =
+ resource::State::Absent;
+ return;
+ }
+ if (ec)
+ {
+ BMCWEB_LOG_ERROR("respHandler DBus error {}", ec);
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
asyncResp->res.jsonValue["Status"]["State"] =
- resource::State::Absent;
- return;
- }
- if (ec)
- {
- BMCWEB_LOG_ERROR("respHandler DBus error {}", ec);
- messages::internalError(asyncResp->res);
- return;
- }
+ resource::State::Enabled;
- asyncResp->res.jsonValue["Status"]["State"] = resource::State::Enabled;
+ const size_t* maxReports = nullptr;
+ const uint64_t* minInterval = nullptr;
- const size_t* maxReports = nullptr;
- const uint64_t* minInterval = nullptr;
+ const bool success = sdbusplus::unpackPropertiesNoThrow(
+ dbus_utils::UnpackErrorPrinter(), ret, "MaxReports", maxReports,
+ "MinInterval", minInterval);
- const bool success = sdbusplus::unpackPropertiesNoThrow(
- dbus_utils::UnpackErrorPrinter(), ret, "MaxReports", maxReports,
- "MinInterval", minInterval);
+ if (!success)
+ {
+ messages::internalError(asyncResp->res);
+ return;
+ }
- if (!success)
- {
- messages::internalError(asyncResp->res);
- return;
- }
+ if (maxReports != nullptr)
+ {
+ asyncResp->res.jsonValue["MaxReports"] = *maxReports;
+ }
- if (maxReports != nullptr)
- {
- asyncResp->res.jsonValue["MaxReports"] = *maxReports;
- }
+ if (minInterval != nullptr)
+ {
+ asyncResp->res.jsonValue["MinCollectionInterval"] =
+ time_utils::toDurationString(std::chrono::milliseconds(
+ static_cast<time_t>(*minInterval)));
+ }
+ nlohmann::json::array_t supportedCollectionFunctions;
+ supportedCollectionFunctions.emplace_back("Maximum");
+ supportedCollectionFunctions.emplace_back("Minimum");
+ supportedCollectionFunctions.emplace_back("Average");
+ supportedCollectionFunctions.emplace_back("Summation");
- if (minInterval != nullptr)
- {
- asyncResp->res.jsonValue["MinCollectionInterval"] =
- time_utils::toDurationString(std::chrono::milliseconds(
- static_cast<time_t>(*minInterval)));
- }
- nlohmann::json::array_t supportedCollectionFunctions;
- supportedCollectionFunctions.emplace_back("Maximum");
- supportedCollectionFunctions.emplace_back("Minimum");
- supportedCollectionFunctions.emplace_back("Average");
- supportedCollectionFunctions.emplace_back("Summation");
-
- asyncResp->res.jsonValue["SupportedCollectionFunctions"] =
- std::move(supportedCollectionFunctions);
- });
+ asyncResp->res.jsonValue["SupportedCollectionFunctions"] =
+ std::move(supportedCollectionFunctions);
+ });
}
inline void requestRoutesTelemetryService(App& app)