From 94df8c9015798764d40665bb363bdbf27510f285 Mon Sep 17 00:00:00 2001 From: Gunnar Mills Date: Fri, 14 Sep 2018 14:50:03 -0500 Subject: clang-format: Update to match docs repo Update the .clang-format file and run clang-format-6.0. This .clang-format matches the example one in https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting Change-Id: Id6760866dedbaeafd83ea8ef2e0303e30b8955aa Signed-off-by: Gunnar Mills Signed-off-by: Brad Bishop --- occ_errors.cpp | 56 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 27 deletions(-) (limited to 'occ_errors.cpp') diff --git a/occ_errors.cpp b/occ_errors.cpp index f4a5f69..ae66a62 100644 --- a/occ_errors.cpp +++ b/occ_errors.cpp @@ -1,13 +1,16 @@ +#include "occ_errors.hpp" + +#include "elog-errors.hpp" + +#include #include -#include #include -#include -#include +#include + +#include #include +#include #include -#include -#include "occ_errors.hpp" -#include "elog-errors.hpp" namespace open_power { namespace occ @@ -18,8 +21,8 @@ constexpr auto NO_ERROR = '0'; using namespace phosphor::logging; using namespace sdbusplus::org::open_power::OCC::Device::Error; -using InternalFailure = sdbusplus::xyz::openbmc_project::Common:: - Error::InternalFailure; +using InternalFailure = + sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; // Populate the file descriptor on the error file void Error::openFile() @@ -29,11 +32,10 @@ void Error::openFile() fd = open(file.c_str(), O_RDONLY | O_NONBLOCK); if (fd < 0) { - elog( - phosphor::logging::org::open_power::OCC::Device:: - OpenFailure::CALLOUT_ERRNO(errno), - phosphor::logging::org::open_power::OCC::Device:: - OpenFailure::CALLOUT_DEVICE_PATH(file.c_str())); + elog(phosphor::logging::org::open_power::OCC::Device:: + OpenFailure::CALLOUT_ERRNO(errno), + phosphor::logging::org::open_power::OCC::Device:: + OpenFailure::CALLOUT_DEVICE_PATH(file.c_str())); } } @@ -41,14 +43,14 @@ void Error::openFile() void Error::registerCallBack() { decltype(eventSource.get()) sourcePtr = nullptr; - auto r = sd_event_add_io(event.get(), &sourcePtr, fd, - EPOLLPRI | EPOLLERR, processEvents, this); + auto r = sd_event_add_io(event.get(), &sourcePtr, fd, EPOLLPRI | EPOLLERR, + processEvents, this); eventSource.reset(sourcePtr); if (r < 0) { log("Failed to register callback handler", - entry("ERROR=%s", strerror(-r))); + entry("ERROR=%s", strerror(-r))); elog(); } } @@ -90,8 +92,8 @@ void Error::removeWatch() } // Callback handler when there is an activity on the FD -int Error::processEvents(sd_event_source* es, int fd, - uint32_t revents, void* userData) +int Error::processEvents(sd_event_source* es, int fd, uint32_t revents, + void* userData) { auto error = static_cast(userData); @@ -108,10 +110,10 @@ void Error::analyzeEvent() if (r < 0) { elog( - phosphor::logging::org::open_power::OCC::Device:: - ConfigFailure::CALLOUT_ERRNO(errno), - phosphor::logging::org::open_power::OCC::Device:: - ConfigFailure::CALLOUT_DEVICE_PATH(file.c_str())); + phosphor::logging::org::open_power::OCC::Device::ConfigFailure:: + CALLOUT_ERRNO(errno), + phosphor::logging::org::open_power::OCC::Device::ConfigFailure:: + CALLOUT_DEVICE_PATH(file.c_str())); } // A non-zero data indicates an error condition @@ -128,7 +130,7 @@ void Error::analyzeEvent() // Reads so many bytes as passed in std::string Error::readFile(int len) const { - auto data = std::make_unique(len+1); + auto data = std::make_unique(len + 1); auto retries = 3; auto delay = std::chrono::milliseconds{100}; @@ -164,10 +166,10 @@ std::string Error::readFile(int len) const { log("Failure seeking error file to START"); elog( - phosphor::logging::org::open_power::OCC::Device:: - ConfigFailure::CALLOUT_ERRNO(errno), - phosphor::logging::org::open_power::OCC::Device:: - ConfigFailure::CALLOUT_DEVICE_PATH(file.c_str())); + phosphor::logging::org::open_power::OCC::Device::ConfigFailure:: + CALLOUT_ERRNO(errno), + phosphor::logging::org::open_power::OCC::Device::ConfigFailure:: + CALLOUT_DEVICE_PATH(file.c_str())); } return std::string(data.get()); } -- cgit v1.2.1