diff options
author | Patrick Venture <venture@google.com> | 2018-11-01 16:29:18 -0700 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2018-11-08 02:00:20 +0000 |
commit | c83c4dc327447a6aee8ddebcd98963ac411169fb (patch) | |
tree | 20cadc16abe7c69e5046bff5460bb5760749b608 /utils.cpp | |
parent | 6c830e9dfa89a6fce124762d1f162e7efc5291dd (diff) | |
download | openpower-vpd-parser-c83c4dc327447a6aee8ddebcd98963ac411169fb.tar.gz openpower-vpd-parser-c83c4dc327447a6aee8ddebcd98963ac411169fb.zip |
Add .clang-format to repo for automated style
Add .clang-format to repo for automated style. A consistent style
across Openbmc makes the code easier to read and edit.
Change-Id: I7c09792d2482f0be3e01776804347700f3e3e651
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'utils.cpp')
-rw-r--r-- | utils.cpp | 30 |
1 files changed, 13 insertions, 17 deletions
@@ -1,7 +1,8 @@ #include "utils.hpp" -#include <sdbusplus/server.hpp> -#include <phosphor-logging/log.hpp> + #include <iostream> +#include <phosphor-logging/log.hpp> +#include <sdbusplus/server.hpp> namespace openpower { @@ -15,24 +16,22 @@ auto getPIMService() { auto bus = sdbusplus::bus::new_default(); auto mapper = - bus.new_method_call( - "xyz.openbmc_project.ObjectMapper", - "/xyz/openbmc_project/object_mapper", - "xyz.openbmc_project.ObjectMapper", - "GetObject"); + bus.new_method_call("xyz.openbmc_project.ObjectMapper", + "/xyz/openbmc_project/object_mapper", + "xyz.openbmc_project.ObjectMapper", "GetObject"); mapper.append(pimPath); mapper.append(std::vector<std::string>({pimIntf})); auto result = bus.call(mapper); - if(result.is_method_error()) + if (result.is_method_error()) { throw std::runtime_error("ObjectMapper GetObject failed"); } std::map<std::string, std::vector<std::string>> response; result.read(response); - if(response.empty()) + if (response.empty()) { throw std::runtime_error("ObjectMapper GetObject bad response"); } @@ -48,14 +47,11 @@ void callPIM(ObjectMap&& objects) { service = getPIMService(); auto bus = sdbusplus::bus::new_default(); - auto pimMsg = bus.new_method_call( - service.c_str(), - pimPath, - pimIntf, - "Notify"); + auto pimMsg = + bus.new_method_call(service.c_str(), pimPath, pimIntf, "Notify"); pimMsg.append(std::move(objects)); auto result = bus.call(pimMsg); - if(result.is_method_error()) + if (result.is_method_error()) { std::cerr << "PIM Notify() failed\n"; } @@ -69,5 +65,5 @@ void callPIM(ObjectMap&& objects) } // namespace inventory -} //namespace vpd -} //namespace openpower +} // namespace vpd +} // namespace openpower |