Update clang-format
refer: https://github.com/openbmc/docs/blob/master/style/cpp/.clang-format
`Don't break long string literals`
Tested: built bmcweb successfully and RedfishValidator Passed.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ib58f7c942fd3838592e043c57e0b6ffcdc3d963b
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index 59b7ff2..ec24735 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -591,8 +591,7 @@
},
service, dbusPath, "org.freedesktop.DBus.Properties",
"Get",
- "xyz.openbmc_project.Inventory.Item.Cpu."
- "OperatingConfig",
+ "xyz.openbmc_project.Inventory.Item.Cpu.OperatingConfig",
"BaseSpeedPrioritySettings");
}
else if (dbusPropName == "BaseSpeedPriorityEnabled")
@@ -778,8 +777,8 @@
{
getCpuAssetData(aResp, serviceName, objectPath);
}
- else if (interface == "xyz.openbmc_project.Inventory."
- "Decorator.Revision")
+ else if (interface ==
+ "xyz.openbmc_project.Inventory.Decorator.Revision")
{
getCpuRevisionData(aResp, serviceName, objectPath);
}
@@ -788,19 +787,20 @@
getCpuDataByService(aResp, processorId, serviceName,
objectPath);
}
- else if (interface == "xyz.openbmc_project.Inventory."
- "Item.Accelerator")
+ else if (interface ==
+ "xyz.openbmc_project.Inventory.Item.Accelerator")
{
getAcceleratorDataByService(aResp, processorId, serviceName,
objectPath);
}
- else if (interface == "xyz.openbmc_project.Control.Processor."
- "CurrentOperatingConfig")
+ else if (
+ interface ==
+ "xyz.openbmc_project.Control.Processor.CurrentOperatingConfig")
{
getCpuConfigData(aResp, processorId, serviceName, objectPath);
}
- else if (interface == "xyz.openbmc_project.Inventory."
- "Decorator.LocationCode")
+ else if (interface ==
+ "xyz.openbmc_project.Inventory.Decorator.LocationCode")
{
getCpuLocationCode(aResp, serviceName, objectPath);
}
@@ -808,8 +808,8 @@
{
getProcessorUUID(aResp, serviceName, objectPath);
}
- else if (interface == "xyz.openbmc_project.Inventory."
- "Decorator.UniqueIdentifier")
+ else if (interface ==
+ "xyz.openbmc_project.Inventory.Decorator.UniqueIdentifier")
{
getCpuUniqueId(aResp, serviceName, objectPath);
}
@@ -1068,61 +1068,58 @@
BMCWEB_ROUTE(
app, "/redfish/v1/Systems/system/Processors/<str>/OperatingConfigs/")
.privileges(redfish::privileges::getOperatingConfigCollection)
- .methods(boost::beast::http::verb::get)(
- [](const crow::Request& req,
- const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const std::string& cpuName) {
- asyncResp->res.jsonValue["@odata.type"] =
- "#OperatingConfigCollection.OperatingConfigCollection";
- asyncResp->res.jsonValue["@odata.id"] = req.url;
- asyncResp->res.jsonValue["Name"] =
- "Operating Config Collection";
+ .methods(
+ boost::beast::http::verb::get)([](const crow::Request& req,
+ const std::shared_ptr<
+ bmcweb::AsyncResp>& asyncResp,
+ const std::string& cpuName) {
+ asyncResp->res.jsonValue["@odata.type"] =
+ "#OperatingConfigCollection.OperatingConfigCollection";
+ asyncResp->res.jsonValue["@odata.id"] = req.url;
+ asyncResp->res.jsonValue["Name"] = "Operating Config Collection";
- // First find the matching CPU object so we know how to
- // constrain our search for related Config objects.
- crow::connections::systemBus->async_method_call(
- [asyncResp,
- cpuName](const boost::system::error_code ec,
- const std::vector<std::string>& objects) {
- if (ec)
+ // First find the matching CPU object so we know how to
+ // constrain our search for related Config objects.
+ crow::connections::systemBus->async_method_call(
+ [asyncResp, cpuName](const boost::system::error_code ec,
+ const std::vector<std::string>& objects) {
+ if (ec)
+ {
+ BMCWEB_LOG_WARNING << "D-Bus error: " << ec << ", "
+ << ec.message();
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
+ for (const std::string& object : objects)
+ {
+ if (!boost::ends_with(object, cpuName))
{
- BMCWEB_LOG_WARNING << "D-Bus error: " << ec << ", "
- << ec.message();
- messages::internalError(asyncResp->res);
- return;
+ continue;
}
- for (const std::string& object : objects)
- {
- if (!boost::ends_with(object, cpuName))
- {
- continue;
- }
+ // Not expected that there will be multiple matching
+ // CPU objects, but if there are just use the first
+ // one.
- // Not expected that there will be multiple matching
- // CPU objects, but if there are just use the first
- // one.
-
- // Use the common search routine to construct the
- // Collection of all Config objects under this CPU.
- collection_util::getCollectionMembers(
- asyncResp,
- "/redfish/v1/Systems/system/Processors/" +
- cpuName + "/OperatingConfigs",
- {"xyz.openbmc_project.Inventory.Item.Cpu."
- "OperatingConfig"},
- object.c_str());
- return;
- }
- },
- "xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths",
- "/xyz/openbmc_project/inventory", 0,
- std::array<const char*, 1>{
- "xyz.openbmc_project.Control.Processor."
- "CurrentOperatingConfig"});
- });
+ // Use the common search routine to construct the
+ // Collection of all Config objects under this CPU.
+ collection_util::getCollectionMembers(
+ asyncResp,
+ "/redfish/v1/Systems/system/Processors/" + cpuName +
+ "/OperatingConfigs",
+ {"xyz.openbmc_project.Inventory.Item.Cpu.OperatingConfig"},
+ object.c_str());
+ return;
+ }
+ },
+ "xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths",
+ "/xyz/openbmc_project/inventory", 0,
+ std::array<const char*, 1>{
+ "xyz.openbmc_project.Control.Processor.CurrentOperatingConfig"});
+ });
}
inline void requestRoutesOperatingConfig(App& app)