diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..ea71ad6
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,99 @@
+---
+Language:        Cpp
+# BasedOnStyle:  LLVM
+AccessModifierOffset: -2
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlinesLeft: false
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterClass:      true
+  AfterControlStatement: true
+  AfterEnum:       true
+  AfterFunction:   true
+  AfterNamespace:  true
+  AfterObjCDeclaration: true
+  AfterStruct:     true
+  AfterUnion:      true
+  BeforeCatch:     true
+  BeforeElse:      true
+  IndentBraces:    false
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Custom
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializers: AfterColon
+ColumnLimit:     80
+CommentPragmas:  '^ IWYU pragma:'
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+PointerAlignment: Left
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeBlocks: Regroup
+IncludeCategories:
+  - Regex:           '^[<"](gtest|gmock)'
+    Priority:        5
+  - Regex:           '^"config.h"'
+    Priority:        -1
+  - Regex:           '^".*\.hpp"'
+    Priority:        1
+  - Regex:           '^<.*\.h>'
+    Priority:        2
+  - Regex:           '^<.*'
+    Priority:        3
+  - Regex:           '.*'
+    Priority:        4
+IndentCaseLabels: true
+IndentWidth:     4
+IndentWrappedFunctionNames: true
+KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 60
+ReflowComments:  true
+SortIncludes:    true
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard:        Cpp11
+TabWidth:        4
+UseTab:          Never
+...
+
diff --git a/app.cpp b/app.cpp
index ee02949..260e27b 100644
--- a/app.cpp
+++ b/app.cpp
@@ -1,17 +1,19 @@
-#include <phosphor-logging/log.hpp>
-#include <phosphor-logging/elog.hpp>
-#include <xyz/openbmc_project/Common/error.hpp>
-#include <org/open_power/OCC/Device/error.hpp>
-#include "occ_manager.hpp"
-#include "occ_events.hpp"
-#include "elog-errors.hpp"
 #include "config.h"
 
+#include "elog-errors.hpp"
+#include "occ_events.hpp"
+#include "occ_manager.hpp"
+
+#include <org/open_power/OCC/Device/error.hpp>
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/log.hpp>
+#include <xyz/openbmc_project/Common/error.hpp>
+
 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;
 
 int main(int argc, char* argv[])
 {
diff --git a/elog-errors.hpp b/elog-errors.hpp
index 823ffdb..6f87a57 100644
--- a/elog-errors.hpp
+++ b/elog-errors.hpp
@@ -2,12 +2,12 @@
 // See elog-gen.py for more details
 #pragma once
 
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/log.hpp>
+#include <sdbusplus/exception.hpp>
 #include <string>
 #include <tuple>
 #include <type_traits>
-#include <sdbusplus/exception.hpp>
-#include <phosphor-logging/log.hpp>
-#include <phosphor-logging/elog.hpp>
 
 namespace sdbusplus
 {
@@ -19,7 +19,7 @@
 {
 namespace Error
 {
-    struct Timeout;
+struct Timeout;
 } // namespace Error
 } // namespace Common
 } // namespace openbmc_project
@@ -38,7 +38,7 @@
 {
 namespace Error
 {
-    struct GPIO;
+struct GPIO;
 } // namespace Error
 } // namespace Callout
 } // namespace Common
@@ -56,7 +56,7 @@
 {
 namespace Error
 {
-    struct InvalidArgument;
+struct InvalidArgument;
 } // namespace Error
 } // namespace Common
 } // namespace openbmc_project
@@ -75,7 +75,7 @@
 {
 namespace Error
 {
-    struct WriteFailure;
+struct WriteFailure;
 } // namespace Error
 } // namespace Device
 } // namespace OCC
@@ -95,7 +95,7 @@
 {
 namespace Error
 {
-    struct SoftOffTimeout;
+struct SoftOffTimeout;
 } // namespace Error
 } // namespace Host
 } // namespace State
@@ -115,7 +115,7 @@
 {
 namespace Error
 {
-    struct Inventory;
+struct Inventory;
 } // namespace Error
 } // namespace Callout
 } // namespace Common
@@ -135,7 +135,7 @@
 {
 namespace Error
 {
-    struct IIC;
+struct IIC;
 } // namespace Error
 } // namespace Callout
 } // namespace Common
@@ -155,7 +155,7 @@
 {
 namespace Error
 {
-    struct Open;
+struct Open;
 } // namespace Error
 } // namespace File
 } // namespace Common
@@ -173,7 +173,7 @@
 {
 namespace Error
 {
-    struct InternalFailure;
+struct InternalFailure;
 } // namespace Error
 } // namespace Common
 } // namespace openbmc_project
@@ -192,7 +192,7 @@
 {
 namespace Error
 {
-    struct Device;
+struct Device;
 } // namespace Error
 } // namespace Callout
 } // namespace Common
@@ -212,7 +212,7 @@
 {
 namespace Error
 {
-    struct WriteFailure;
+struct WriteFailure;
 } // namespace Error
 } // namespace Device
 } // namespace Control
@@ -232,7 +232,7 @@
 {
 namespace Error
 {
-    struct ReadFailure;
+struct ReadFailure;
 } // namespace Error
 } // namespace Device
 } // namespace Sensor
@@ -252,7 +252,7 @@
 {
 namespace Error
 {
-    struct Seek;
+struct Seek;
 } // namespace Error
 } // namespace File
 } // namespace Common
@@ -272,7 +272,7 @@
 {
 namespace Error
 {
-    struct ConfigFailure;
+struct ConfigFailure;
 } // namespace Error
 } // namespace Device
 } // namespace OCC
@@ -292,7 +292,7 @@
 {
 namespace Error
 {
-    struct OpenFailure;
+struct OpenFailure;
 } // namespace Error
 } // namespace Device
 } // namespace OCC
@@ -312,7 +312,7 @@
 {
 namespace Error
 {
-    struct IPMISensor;
+struct IPMISensor;
 } // namespace Error
 } // namespace Callout
 } // namespace Common
@@ -332,7 +332,7 @@
 {
 namespace Error
 {
-    struct ReadFailure;
+struct ReadFailure;
 } // namespace Error
 } // namespace Device
 } // namespace OCC
@@ -352,7 +352,7 @@
 {
 namespace Error
 {
-    struct CommandNotSupported;
+struct CommandNotSupported;
 } // namespace Error
 } // namespace Host
 } // namespace Control
@@ -360,7 +360,6 @@
 } // namespace xyz
 } // namespace sdbusplus
 
-
 namespace phosphor
 {
 
@@ -378,14 +377,12 @@
 namespace _CommandNotSupported
 {
 
-
-}  // namespace _CommandNotSupported
+} // namespace _CommandNotSupported
 
 struct CommandNotSupported
 {
     static constexpr auto L = level::ERR;
     using metadata_types = std::tuple<>;
-
 };
 
 } // namespace Host
@@ -393,17 +390,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Control::Host::Error::CommandNotSupported>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Control::Host::Error::CommandNotSupported>
 {
     using type = xyz::openbmc_project::Control::Host::CommandNotSupported;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -418,36 +415,35 @@
 {
     static constexpr auto str = "TIMEOUT_IN_MSEC=%llu";
     static constexpr auto str_short = "TIMEOUT_IN_MSEC";
-    using type = std::tuple<std::decay_t<decltype(str)>,uint64_t>;
-    explicit constexpr TIMEOUT_IN_MSEC(uint64_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, uint64_t>;
+    explicit constexpr TIMEOUT_IN_MSEC(uint64_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _Timeout
+} // namespace _Timeout
 
 struct Timeout
 {
     static constexpr auto L = level::ERR;
     using TIMEOUT_IN_MSEC = _Timeout::TIMEOUT_IN_MSEC;
     using metadata_types = std::tuple<TIMEOUT_IN_MSEC>;
-
 };
 
 } // namespace Common
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::Error::Timeout>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::Error::Timeout>
 {
     using type = xyz::openbmc_project::Common::Timeout;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -458,31 +454,29 @@
 namespace _InternalFailure
 {
 
-
-}  // namespace _InternalFailure
+} // namespace _InternalFailure
 
 struct InternalFailure
 {
     static constexpr auto L = level::ERR;
     using metadata_types = std::tuple<>;
-
 };
 
 } // namespace Common
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure>
 {
     using type = xyz::openbmc_project::Common::InternalFailure;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -497,20 +491,20 @@
 {
     static constexpr auto str = "ARGUMENT_NAME=%s";
     static constexpr auto str_short = "ARGUMENT_NAME";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr ARGUMENT_NAME(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr ARGUMENT_NAME(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct ARGUMENT_VALUE
 {
     static constexpr auto str = "ARGUMENT_VALUE=%s";
     static constexpr auto str_short = "ARGUMENT_VALUE";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr ARGUMENT_VALUE(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr ARGUMENT_VALUE(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _InvalidArgument
+} // namespace _InvalidArgument
 
 struct InvalidArgument
 {
@@ -518,24 +512,23 @@
     using ARGUMENT_NAME = _InvalidArgument::ARGUMENT_NAME;
     using ARGUMENT_VALUE = _InvalidArgument::ARGUMENT_VALUE;
     using metadata_types = std::tuple<ARGUMENT_NAME, ARGUMENT_VALUE>;
-
 };
 
 } // namespace Common
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::Error::InvalidArgument>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::Error::InvalidArgument>
 {
     using type = xyz::openbmc_project::Common::InvalidArgument;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -552,20 +545,20 @@
 {
     static constexpr auto str = "ERRNO=%d";
     static constexpr auto str_short = "ERRNO";
-    using type = std::tuple<std::decay_t<decltype(str)>,int32_t>;
-    explicit constexpr ERRNO(int32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, int32_t>;
+    explicit constexpr ERRNO(int32_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct PATH
 {
     static constexpr auto str = "PATH=%s";
     static constexpr auto str_short = "PATH";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr PATH(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr PATH(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _Open
+} // namespace _Open
 
 struct Open
 {
@@ -573,7 +566,6 @@
     using ERRNO = _Open::ERRNO;
     using PATH = _Open::PATH;
     using metadata_types = std::tuple<ERRNO, PATH>;
-
 };
 
 } // namespace File
@@ -581,17 +573,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::File::Error::Open>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::File::Error::Open>
 {
     using type = xyz::openbmc_project::Common::File::Open;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -608,36 +600,36 @@
 {
     static constexpr auto str = "OFFSET=%ll";
     static constexpr auto str_short = "OFFSET";
-    using type = std::tuple<std::decay_t<decltype(str)>,int64_t>;
-    explicit constexpr OFFSET(int64_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, int64_t>;
+    explicit constexpr OFFSET(int64_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct WHENCE
 {
     static constexpr auto str = "WHENCE=%d";
     static constexpr auto str_short = "WHENCE";
-    using type = std::tuple<std::decay_t<decltype(str)>,int32_t>;
-    explicit constexpr WHENCE(int32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, int32_t>;
+    explicit constexpr WHENCE(int32_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct ERRNO
 {
     static constexpr auto str = "ERRNO=%d";
     static constexpr auto str_short = "ERRNO";
-    using type = std::tuple<std::decay_t<decltype(str)>,int32_t>;
-    explicit constexpr ERRNO(int32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, int32_t>;
+    explicit constexpr ERRNO(int32_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct PATH
 {
     static constexpr auto str = "PATH=%s";
     static constexpr auto str_short = "PATH";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr PATH(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr PATH(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _Seek
+} // namespace _Seek
 
 struct Seek
 {
@@ -647,7 +639,6 @@
     using ERRNO = _Seek::ERRNO;
     using PATH = _Seek::PATH;
     using metadata_types = std::tuple<OFFSET, WHENCE, ERRNO, PATH>;
-
 };
 
 } // namespace File
@@ -655,17 +646,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::File::Error::Seek>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::File::Error::Seek>
 {
     using type = xyz::openbmc_project::Common::File::Seek;
 };
 
-}
+} // namespace details
 
 namespace example
 {
@@ -684,32 +675,33 @@
 {
     static constexpr auto str = "DEV_ADDR=0x%.8X";
     static constexpr auto str_short = "DEV_ADDR";
-    using type = std::tuple<std::decay_t<decltype(str)>,uint32_t>;
-    explicit constexpr DEV_ADDR(uint32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, uint32_t>;
+    explicit constexpr DEV_ADDR(uint32_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct DEV_ID
 {
     static constexpr auto str = "DEV_ID=%u";
     static constexpr auto str_short = "DEV_ID";
-    using type = std::tuple<std::decay_t<decltype(str)>,uint32_t>;
-    explicit constexpr DEV_ID(uint32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, uint32_t>;
+    explicit constexpr DEV_ID(uint32_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct DEV_NAME
 {
     static constexpr auto str = "DEV_NAME=%s";
     static constexpr auto str_short = "DEV_NAME";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr DEV_NAME(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr DEV_NAME(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _TestErrorTwo
+} // namespace _TestErrorTwo
 
 struct TestErrorTwo : public sdbusplus::exception_t
 {
-    static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.TestErrorTwo";
+    static constexpr auto errName =
+        "example.xyz.openbmc_project.Example.Elog.TestErrorTwo";
     static constexpr auto errDesc = "This is test error two";
     static constexpr auto L = level::ERR;
     using DEV_ADDR = _TestErrorTwo::DEV_ADDR;
@@ -739,8 +731,6 @@
 } // namespace xyz
 } // namespace example
 
-
-
 namespace example
 {
 namespace xyz
@@ -758,16 +748,17 @@
 {
     static constexpr auto str = "STRING=%s";
     static constexpr auto str_short = "STRING";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr STRING(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr STRING(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _AutoTestSimple
+} // namespace _AutoTestSimple
 
 struct AutoTestSimple : public sdbusplus::exception_t
 {
-    static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.AutoTestSimple";
+    static constexpr auto errName =
+        "example.xyz.openbmc_project.Example.Elog.AutoTestSimple";
     static constexpr auto errDesc = "This is a simple test error.";
     static constexpr auto L = level::ERR;
     using STRING = _AutoTestSimple::STRING;
@@ -795,8 +786,6 @@
 } // namespace xyz
 } // namespace example
 
-
-
 namespace example
 {
 namespace xyz
@@ -814,29 +803,32 @@
 {
     static constexpr auto str = "CALLOUT_ERRNO_TEST=%d";
     static constexpr auto str_short = "CALLOUT_ERRNO_TEST";
-    using type = std::tuple<std::decay_t<decltype(str)>,int32_t>;
-    explicit constexpr CALLOUT_ERRNO_TEST(int32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, int32_t>;
+    explicit constexpr CALLOUT_ERRNO_TEST(int32_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct CALLOUT_DEVICE_PATH_TEST
 {
     static constexpr auto str = "CALLOUT_DEVICE_PATH_TEST=%s";
     static constexpr auto str_short = "CALLOUT_DEVICE_PATH_TEST";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr CALLOUT_DEVICE_PATH_TEST(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr CALLOUT_DEVICE_PATH_TEST(const char* a) :
+        _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _Callout
+} // namespace _Callout
 
 struct Callout : public sdbusplus::exception_t
 {
-    static constexpr auto errName = "example.xyz.openbmc_project.Example.Device.Callout";
+    static constexpr auto errName =
+        "example.xyz.openbmc_project.Example.Device.Callout";
     static constexpr auto errDesc = "Generic device callout";
     static constexpr auto L = level::ERR;
     using CALLOUT_ERRNO_TEST = _Callout::CALLOUT_ERRNO_TEST;
     using CALLOUT_DEVICE_PATH_TEST = _Callout::CALLOUT_DEVICE_PATH_TEST;
-    using metadata_types = std::tuple<CALLOUT_ERRNO_TEST, CALLOUT_DEVICE_PATH_TEST>;
+    using metadata_types =
+        std::tuple<CALLOUT_ERRNO_TEST, CALLOUT_DEVICE_PATH_TEST>;
 
     const char* name() const noexcept
     {
@@ -860,8 +852,6 @@
 } // namespace xyz
 } // namespace example
 
-
-
 namespace xyz
 {
 namespace openbmc_project
@@ -877,20 +867,21 @@
 {
     static constexpr auto str = "CALLOUT_ERRNO=%d";
     static constexpr auto str_short = "CALLOUT_ERRNO";
-    using type = std::tuple<std::decay_t<decltype(str)>,int32_t>;
-    explicit constexpr CALLOUT_ERRNO(int32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, int32_t>;
+    explicit constexpr CALLOUT_ERRNO(int32_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct CALLOUT_DEVICE_PATH
 {
     static constexpr auto str = "CALLOUT_DEVICE_PATH=%s";
     static constexpr auto str_short = "CALLOUT_DEVICE_PATH";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr CALLOUT_DEVICE_PATH(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr CALLOUT_DEVICE_PATH(const char* a) :
+        _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _Device
+} // namespace _Device
 
 struct Device
 {
@@ -898,7 +889,6 @@
     using CALLOUT_ERRNO = _Device::CALLOUT_ERRNO;
     using CALLOUT_DEVICE_PATH = _Device::CALLOUT_DEVICE_PATH;
     using metadata_types = std::tuple<CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
-
 };
 
 } // namespace Callout
@@ -906,17 +896,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::Callout::Error::Device>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::Callout::Error::Device>
 {
     using type = xyz::openbmc_project::Common::Callout::Device;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -933,21 +923,23 @@
 {
     static constexpr auto str = "CALLOUT_GPIO_NUM=%u";
     static constexpr auto str_short = "CALLOUT_GPIO_NUM";
-    using type = std::tuple<std::decay_t<decltype(str)>,uint32_t>;
-    explicit constexpr CALLOUT_GPIO_NUM(uint32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, uint32_t>;
+    explicit constexpr CALLOUT_GPIO_NUM(uint32_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _GPIO
+} // namespace _GPIO
 
 struct GPIO
 {
     static constexpr auto L = level::ERR;
     using CALLOUT_GPIO_NUM = _GPIO::CALLOUT_GPIO_NUM;
-    using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
-    using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
-    using metadata_types = std::tuple<CALLOUT_GPIO_NUM, CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
-
+    using CALLOUT_ERRNO =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
+    using CALLOUT_DEVICE_PATH =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
+    using metadata_types =
+        std::tuple<CALLOUT_GPIO_NUM, CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
 };
 
 } // namespace Callout
@@ -955,17 +947,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::Callout::Error::GPIO>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::Callout::Error::GPIO>
 {
     using type = xyz::openbmc_project::Common::Callout::GPIO;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -982,30 +974,32 @@
 {
     static constexpr auto str = "CALLOUT_IIC_BUS=%s";
     static constexpr auto str_short = "CALLOUT_IIC_BUS";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr CALLOUT_IIC_BUS(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr CALLOUT_IIC_BUS(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct CALLOUT_IIC_ADDR
 {
     static constexpr auto str = "CALLOUT_IIC_ADDR=0x%hx";
     static constexpr auto str_short = "CALLOUT_IIC_ADDR";
-    using type = std::tuple<std::decay_t<decltype(str)>,uint16_t>;
-    explicit constexpr CALLOUT_IIC_ADDR(uint16_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, uint16_t>;
+    explicit constexpr CALLOUT_IIC_ADDR(uint16_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _IIC
+} // namespace _IIC
 
 struct IIC
 {
     static constexpr auto L = level::ERR;
     using CALLOUT_IIC_BUS = _IIC::CALLOUT_IIC_BUS;
     using CALLOUT_IIC_ADDR = _IIC::CALLOUT_IIC_ADDR;
-    using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
-    using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
-    using metadata_types = std::tuple<CALLOUT_IIC_BUS, CALLOUT_IIC_ADDR, CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
-
+    using CALLOUT_ERRNO =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
+    using CALLOUT_DEVICE_PATH =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
+    using metadata_types = std::tuple<CALLOUT_IIC_BUS, CALLOUT_IIC_ADDR,
+                                      CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
 };
 
 } // namespace Callout
@@ -1013,17 +1007,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::Callout::Error::IIC>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::Callout::Error::IIC>
 {
     using type = xyz::openbmc_project::Common::Callout::IIC;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -1040,19 +1034,19 @@
 {
     static constexpr auto str = "CALLOUT_INVENTORY_PATH=%s";
     static constexpr auto str_short = "CALLOUT_INVENTORY_PATH";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr CALLOUT_INVENTORY_PATH(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr CALLOUT_INVENTORY_PATH(const char* a) :
+        _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _Inventory
+} // namespace _Inventory
 
 struct Inventory
 {
     static constexpr auto L = level::ERR;
     using CALLOUT_INVENTORY_PATH = _Inventory::CALLOUT_INVENTORY_PATH;
     using metadata_types = std::tuple<CALLOUT_INVENTORY_PATH>;
-
 };
 
 } // namespace Callout
@@ -1060,17 +1054,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::Callout::Error::Inventory>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::Callout::Error::Inventory>
 {
     using type = xyz::openbmc_project::Common::Callout::Inventory;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -1087,19 +1081,19 @@
 {
     static constexpr auto str = "CALLOUT_IPMI_SENSOR_NUM=%u";
     static constexpr auto str_short = "CALLOUT_IPMI_SENSOR_NUM";
-    using type = std::tuple<std::decay_t<decltype(str)>,uint32_t>;
-    explicit constexpr CALLOUT_IPMI_SENSOR_NUM(uint32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, uint32_t>;
+    explicit constexpr CALLOUT_IPMI_SENSOR_NUM(uint32_t a) :
+        _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _IPMISensor
+} // namespace _IPMISensor
 
 struct IPMISensor
 {
     static constexpr auto L = level::ERR;
     using CALLOUT_IPMI_SENSOR_NUM = _IPMISensor::CALLOUT_IPMI_SENSOR_NUM;
     using metadata_types = std::tuple<CALLOUT_IPMI_SENSOR_NUM>;
-
 };
 
 } // namespace Callout
@@ -1107,17 +1101,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Common::Callout::Error::IPMISensor>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Common::Callout::Error::IPMISensor>
 {
     using type = xyz::openbmc_project::Common::Callout::IPMISensor;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -1130,15 +1124,14 @@
 namespace _SoftOffTimeout
 {
 
-
-}  // namespace _SoftOffTimeout
+} // namespace _SoftOffTimeout
 
 struct SoftOffTimeout
 {
     static constexpr auto L = level::ERR;
-    using TIMEOUT_IN_MSEC = xyz::openbmc_project::Common::Timeout::TIMEOUT_IN_MSEC;
+    using TIMEOUT_IN_MSEC =
+        xyz::openbmc_project::Common::Timeout::TIMEOUT_IN_MSEC;
     using metadata_types = std::tuple<TIMEOUT_IN_MSEC>;
-
 };
 
 } // namespace Host
@@ -1146,17 +1139,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::State::Host::Error::SoftOffTimeout>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::State::Host::Error::SoftOffTimeout>
 {
     using type = xyz::openbmc_project::State::Host::SoftOffTimeout;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -1169,16 +1162,16 @@
 namespace _WriteFailure
 {
 
-
-}  // namespace _WriteFailure
+} // namespace _WriteFailure
 
 struct WriteFailure
 {
     static constexpr auto L = level::ERR;
-    using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
-    using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
+    using CALLOUT_ERRNO =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
+    using CALLOUT_DEVICE_PATH =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
     using metadata_types = std::tuple<CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
-
 };
 
 } // namespace Device
@@ -1186,17 +1179,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Control::Device::Error::WriteFailure>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Control::Device::Error::WriteFailure>
 {
     using type = xyz::openbmc_project::Control::Device::WriteFailure;
 };
 
-}
+} // namespace details
 
 namespace org
 {
@@ -1209,16 +1202,16 @@
 namespace _OpenFailure
 {
 
-
-}  // namespace _OpenFailure
+} // namespace _OpenFailure
 
 struct OpenFailure
 {
     static constexpr auto L = level::ERR;
-    using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
-    using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
+    using CALLOUT_ERRNO =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
+    using CALLOUT_DEVICE_PATH =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
     using metadata_types = std::tuple<CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
-
 };
 
 } // namespace Device
@@ -1226,17 +1219,17 @@
 } // namespace open_power
 } // namespace org
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::org::open_power::OCC::Device::Error::OpenFailure>
+struct map_exception_type<
+    sdbusplus::org::open_power::OCC::Device::Error::OpenFailure>
 {
     using type = org::open_power::OCC::Device::OpenFailure;
 };
 
-}
+} // namespace details
 
 namespace org
 {
@@ -1249,16 +1242,16 @@
 namespace _ReadFailure
 {
 
-
-}  // namespace _ReadFailure
+} // namespace _ReadFailure
 
 struct ReadFailure
 {
     static constexpr auto L = level::ERR;
-    using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
-    using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
+    using CALLOUT_ERRNO =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
+    using CALLOUT_DEVICE_PATH =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
     using metadata_types = std::tuple<CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
-
 };
 
 } // namespace Device
@@ -1266,17 +1259,17 @@
 } // namespace open_power
 } // namespace org
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::org::open_power::OCC::Device::Error::ReadFailure>
+struct map_exception_type<
+    sdbusplus::org::open_power::OCC::Device::Error::ReadFailure>
 {
     using type = org::open_power::OCC::Device::ReadFailure;
 };
 
-}
+} // namespace details
 
 namespace org
 {
@@ -1289,16 +1282,16 @@
 namespace _WriteFailure
 {
 
-
-}  // namespace _WriteFailure
+} // namespace _WriteFailure
 
 struct WriteFailure
 {
     static constexpr auto L = level::ERR;
-    using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
-    using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
+    using CALLOUT_ERRNO =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
+    using CALLOUT_DEVICE_PATH =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
     using metadata_types = std::tuple<CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
-
 };
 
 } // namespace Device
@@ -1306,17 +1299,17 @@
 } // namespace open_power
 } // namespace org
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::org::open_power::OCC::Device::Error::WriteFailure>
+struct map_exception_type<
+    sdbusplus::org::open_power::OCC::Device::Error::WriteFailure>
 {
     using type = org::open_power::OCC::Device::WriteFailure;
 };
 
-}
+} // namespace details
 
 namespace org
 {
@@ -1329,16 +1322,16 @@
 namespace _ConfigFailure
 {
 
-
-}  // namespace _ConfigFailure
+} // namespace _ConfigFailure
 
 struct ConfigFailure
 {
     static constexpr auto L = level::ERR;
-    using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
-    using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
+    using CALLOUT_ERRNO =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
+    using CALLOUT_DEVICE_PATH =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
     using metadata_types = std::tuple<CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
-
 };
 
 } // namespace Device
@@ -1346,17 +1339,17 @@
 } // namespace open_power
 } // namespace org
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::org::open_power::OCC::Device::Error::ConfigFailure>
+struct map_exception_type<
+    sdbusplus::org::open_power::OCC::Device::Error::ConfigFailure>
 {
     using type = org::open_power::OCC::Device::ConfigFailure;
 };
 
-}
+} // namespace details
 
 namespace xyz
 {
@@ -1369,16 +1362,16 @@
 namespace _ReadFailure
 {
 
-
-}  // namespace _ReadFailure
+} // namespace _ReadFailure
 
 struct ReadFailure
 {
     static constexpr auto L = level::ERR;
-    using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
-    using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
+    using CALLOUT_ERRNO =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO;
+    using CALLOUT_DEVICE_PATH =
+        xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH;
     using metadata_types = std::tuple<CALLOUT_ERRNO, CALLOUT_DEVICE_PATH>;
-
 };
 
 } // namespace Device
@@ -1386,17 +1379,17 @@
 } // namespace openbmc_project
 } // namespace xyz
 
-
 namespace details
 {
 
 template <>
-struct map_exception_type<sdbusplus::xyz::openbmc_project::Sensor::Device::Error::ReadFailure>
+struct map_exception_type<
+    sdbusplus::xyz::openbmc_project::Sensor::Device::Error::ReadFailure>
 {
     using type = xyz::openbmc_project::Sensor::Device::ReadFailure;
 };
 
-}
+} // namespace details
 
 namespace example
 {
@@ -1415,41 +1408,46 @@
 {
     static constexpr auto str = "ERRNUM=0x%.4X";
     static constexpr auto str_short = "ERRNUM";
-    using type = std::tuple<std::decay_t<decltype(str)>,uint16_t>;
-    explicit constexpr ERRNUM(uint16_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, uint16_t>;
+    explicit constexpr ERRNUM(uint16_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct FILE_PATH
 {
     static constexpr auto str = "FILE_PATH=%s";
     static constexpr auto str_short = "FILE_PATH";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr FILE_PATH(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr FILE_PATH(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 struct FILE_NAME
 {
     static constexpr auto str = "FILE_NAME=%s";
     static constexpr auto str_short = "FILE_NAME";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr FILE_NAME(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr FILE_NAME(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _TestErrorOne
+} // namespace _TestErrorOne
 
 struct TestErrorOne : public sdbusplus::exception_t
 {
-    static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.TestErrorOne";
+    static constexpr auto errName =
+        "example.xyz.openbmc_project.Example.Elog.TestErrorOne";
     static constexpr auto errDesc = "this is test error one";
     static constexpr auto L = level::INFO;
     using ERRNUM = _TestErrorOne::ERRNUM;
     using FILE_PATH = _TestErrorOne::FILE_PATH;
     using FILE_NAME = _TestErrorOne::FILE_NAME;
-    using DEV_ADDR = example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ADDR;
-    using DEV_ID = example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ID;
-    using DEV_NAME = example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_NAME;
-    using metadata_types = std::tuple<ERRNUM, FILE_PATH, FILE_NAME, DEV_ADDR, DEV_ID, DEV_NAME>;
+    using DEV_ADDR =
+        example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ADDR;
+    using DEV_ID =
+        example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ID;
+    using DEV_NAME =
+        example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_NAME;
+    using metadata_types =
+        std::tuple<ERRNUM, FILE_PATH, FILE_NAME, DEV_ADDR, DEV_ID, DEV_NAME>;
 
     const char* name() const noexcept
     {
@@ -1473,8 +1471,6 @@
 } // namespace xyz
 } // namespace example
 
-
-
 namespace example
 {
 namespace xyz
@@ -1492,22 +1488,26 @@
 {
     static constexpr auto str = "DEV_ADDR=0x%.8X";
     static constexpr auto str_short = "DEV_ADDR";
-    using type = std::tuple<std::decay_t<decltype(str)>,uint32_t>;
-    explicit constexpr DEV_ADDR(uint32_t a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, uint32_t>;
+    explicit constexpr DEV_ADDR(uint32_t a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _TestCallout
+} // namespace _TestCallout
 
 struct TestCallout : public sdbusplus::exception_t
 {
-    static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.TestCallout";
+    static constexpr auto errName =
+        "example.xyz.openbmc_project.Example.Elog.TestCallout";
     static constexpr auto errDesc = "This is test error TestCallout";
     static constexpr auto L = level::ERR;
     using DEV_ADDR = _TestCallout::DEV_ADDR;
-    using CALLOUT_ERRNO_TEST = example::xyz::openbmc_project::Example::Device::Callout::CALLOUT_ERRNO_TEST;
-    using CALLOUT_DEVICE_PATH_TEST = example::xyz::openbmc_project::Example::Device::Callout::CALLOUT_DEVICE_PATH_TEST;
-    using metadata_types = std::tuple<DEV_ADDR, CALLOUT_ERRNO_TEST, CALLOUT_DEVICE_PATH_TEST>;
+    using CALLOUT_ERRNO_TEST = example::xyz::openbmc_project::Example::Device::
+        Callout::CALLOUT_ERRNO_TEST;
+    using CALLOUT_DEVICE_PATH_TEST = example::xyz::openbmc_project::Example::
+        Device::Callout::CALLOUT_DEVICE_PATH_TEST;
+    using metadata_types =
+        std::tuple<DEV_ADDR, CALLOUT_ERRNO_TEST, CALLOUT_DEVICE_PATH_TEST>;
 
     const char* name() const noexcept
     {
@@ -1531,8 +1531,6 @@
 } // namespace xyz
 } // namespace example
 
-
-
 namespace example
 {
 namespace xyz
@@ -1550,26 +1548,34 @@
 {
     static constexpr auto str = "FOO_DATA=%s";
     static constexpr auto str_short = "FOO_DATA";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr FOO_DATA(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr FOO_DATA(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _Foo
+} // namespace _Foo
 
 struct Foo : public sdbusplus::exception_t
 {
-    static constexpr auto errName = "example.xyz.openbmc_project.Example.Foo.Foo";
+    static constexpr auto errName =
+        "example.xyz.openbmc_project.Example.Foo.Foo";
     static constexpr auto errDesc = "this is test error Foo";
     static constexpr auto L = level::INFO;
     using FOO_DATA = _Foo::FOO_DATA;
-    using ERRNUM = example::xyz::openbmc_project::Example::Elog::TestErrorOne::ERRNUM;
-    using FILE_PATH = example::xyz::openbmc_project::Example::Elog::TestErrorOne::FILE_PATH;
-    using FILE_NAME = example::xyz::openbmc_project::Example::Elog::TestErrorOne::FILE_NAME;
-    using DEV_ADDR = example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ADDR;
-    using DEV_ID = example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ID;
-    using DEV_NAME = example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_NAME;
-    using metadata_types = std::tuple<FOO_DATA, ERRNUM, FILE_PATH, FILE_NAME, DEV_ADDR, DEV_ID, DEV_NAME>;
+    using ERRNUM =
+        example::xyz::openbmc_project::Example::Elog::TestErrorOne::ERRNUM;
+    using FILE_PATH =
+        example::xyz::openbmc_project::Example::Elog::TestErrorOne::FILE_PATH;
+    using FILE_NAME =
+        example::xyz::openbmc_project::Example::Elog::TestErrorOne::FILE_NAME;
+    using DEV_ADDR =
+        example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ADDR;
+    using DEV_ID =
+        example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ID;
+    using DEV_NAME =
+        example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_NAME;
+    using metadata_types = std::tuple<FOO_DATA, ERRNUM, FILE_PATH, FILE_NAME,
+                                      DEV_ADDR, DEV_ID, DEV_NAME>;
 
     const char* name() const noexcept
     {
@@ -1593,8 +1599,6 @@
 } // namespace xyz
 } // namespace example
 
-
-
 namespace example
 {
 namespace xyz
@@ -1612,27 +1616,35 @@
 {
     static constexpr auto str = "BAR_DATA=%s";
     static constexpr auto str_short = "BAR_DATA";
-    using type = std::tuple<std::decay_t<decltype(str)>,const char*>;
-    explicit constexpr BAR_DATA(const char* a) : _entry(entry(str, a)) {};
+    using type = std::tuple<std::decay_t<decltype(str)>, const char*>;
+    explicit constexpr BAR_DATA(const char* a) : _entry(entry(str, a)){};
     type _entry;
 };
 
-}  // namespace _Bar
+} // namespace _Bar
 
 struct Bar : public sdbusplus::exception_t
 {
-    static constexpr auto errName = "example.xyz.openbmc_project.Example.Bar.Bar";
+    static constexpr auto errName =
+        "example.xyz.openbmc_project.Example.Bar.Bar";
     static constexpr auto errDesc = "this is test error Bar";
     static constexpr auto L = level::INFO;
     using BAR_DATA = _Bar::BAR_DATA;
     using FOO_DATA = example::xyz::openbmc_project::Example::Foo::Foo::FOO_DATA;
-    using ERRNUM = example::xyz::openbmc_project::Example::Elog::TestErrorOne::ERRNUM;
-    using FILE_PATH = example::xyz::openbmc_project::Example::Elog::TestErrorOne::FILE_PATH;
-    using FILE_NAME = example::xyz::openbmc_project::Example::Elog::TestErrorOne::FILE_NAME;
-    using DEV_ADDR = example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ADDR;
-    using DEV_ID = example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ID;
-    using DEV_NAME = example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_NAME;
-    using metadata_types = std::tuple<BAR_DATA, FOO_DATA, ERRNUM, FILE_PATH, FILE_NAME, DEV_ADDR, DEV_ID, DEV_NAME>;
+    using ERRNUM =
+        example::xyz::openbmc_project::Example::Elog::TestErrorOne::ERRNUM;
+    using FILE_PATH =
+        example::xyz::openbmc_project::Example::Elog::TestErrorOne::FILE_PATH;
+    using FILE_NAME =
+        example::xyz::openbmc_project::Example::Elog::TestErrorOne::FILE_NAME;
+    using DEV_ADDR =
+        example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ADDR;
+    using DEV_ID =
+        example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_ID;
+    using DEV_NAME =
+        example::xyz::openbmc_project::Example::Elog::TestErrorTwo::DEV_NAME;
+    using metadata_types = std::tuple<BAR_DATA, FOO_DATA, ERRNUM, FILE_PATH,
+                                      FILE_NAME, DEV_ADDR, DEV_ID, DEV_NAME>;
 
     const char* name() const noexcept
     {
@@ -1656,9 +1668,6 @@
 } // namespace xyz
 } // namespace example
 
-
-
-
 } // namespace logging
 
 } // namespace phosphor
diff --git a/file.hpp b/file.hpp
index bc5450f..9ad5213 100644
--- a/file.hpp
+++ b/file.hpp
@@ -10,39 +10,39 @@
  */
 class FileDescriptor
 {
-    private:
-        /** @brief File descriptor for the gpio input device */
-        int fd = -1;
+  private:
+    /** @brief File descriptor for the gpio input device */
+    int fd = -1;
 
-    public:
-        FileDescriptor() = delete;
-        FileDescriptor(const FileDescriptor&) = delete;
-        FileDescriptor& operator=(const FileDescriptor&) = delete;
-        FileDescriptor(FileDescriptor&&) = delete;
-        FileDescriptor& operator=(FileDescriptor&&) = delete;
+  public:
+    FileDescriptor() = delete;
+    FileDescriptor(const FileDescriptor&) = delete;
+    FileDescriptor& operator=(const FileDescriptor&) = delete;
+    FileDescriptor(FileDescriptor&&) = delete;
+    FileDescriptor& operator=(FileDescriptor&&) = delete;
 
-        /** @brief Saves File descriptor and uses it to do file operation
-         *
-         *  @param[in] fd - File descriptor
-         */
-        FileDescriptor(int fd) : fd(fd)
+    /** @brief Saves File descriptor and uses it to do file operation
+     *
+     *  @param[in] fd - File descriptor
+     */
+    FileDescriptor(int fd) : fd(fd)
+    {
+        // Nothing
+    }
+
+    ~FileDescriptor()
+    {
+        if (fd >= 0)
         {
-            // Nothing
+            close(fd);
         }
+    }
 
-        ~FileDescriptor()
-        {
-            if (fd >=0)
-            {
-                close(fd);
-            }
-        }
-
-        int operator()()
-        {
-            return fd;
-        }
+    int operator()()
+    {
+        return fd;
+    }
 };
 
 } // namespace occ
-} // namespace open-power
+} // namespace open_power
diff --git a/i2c_occ.cpp b/i2c_occ.cpp
index 00e4187..1c1a9ff 100644
--- a/i2c_occ.cpp
+++ b/i2c_occ.cpp
@@ -1,10 +1,11 @@
+#include "config.h"
+
+#include "i2c_occ.hpp"
+
 #include <algorithm>
 #include <cassert>
 #include <fstream>
 
-#include "config.h"
-#include "i2c_occ.hpp"
-
 #ifdef I2C_OCC
 
 namespace i2c_occ
@@ -20,8 +21,8 @@
 constexpr auto OCC_NAME_LENGTH = 3;
 
 // static assert to make sure the i2c occ device name is expected
-static_assert(sizeof(I2C_OCC_DEVICE_NAME) -1 == DEVICE_NAME_LENGTH);
-static_assert(sizeof(OCC_NAME) -1 == OCC_NAME_LENGTH);
+static_assert(sizeof(I2C_OCC_DEVICE_NAME) - 1 == DEVICE_NAME_LENGTH);
+static_assert(sizeof(OCC_NAME) - 1 == OCC_NAME_LENGTH);
 
 static bool isMasterOcc(const fs::directory_entry& p)
 {
@@ -48,7 +49,7 @@
 
     if (fs::is_directory(path))
     {
-        for (auto & p : fs::directory_iterator(path))
+        for (auto& p : fs::directory_iterator(path))
         {
             // Check if a device's name is "p8-occ-hwmon"
             auto f = p / "name";
@@ -102,4 +103,3 @@
 } // namespace i2c_occ
 
 #endif
-
diff --git a/i2c_occ.hpp b/i2c_occ.hpp
index 66dc12c..3635ea1 100644
--- a/i2c_occ.hpp
+++ b/i2c_occ.hpp
@@ -67,4 +67,3 @@
 } // namespace i2c_occ
 
 #endif
-
diff --git a/occ_device.cpp b/occ_device.cpp
index b100d46..b05dc09 100644
--- a/occ_device.cpp
+++ b/occ_device.cpp
@@ -1,7 +1,9 @@
-#include <iostream>
 #include "occ_device.hpp"
+
 #include "occ_status.hpp"
 
+#include <iostream>
+
 namespace open_power
 {
 namespace occ
@@ -28,17 +30,17 @@
 
 void Device::throttleProcTempCallback(bool error)
 {
-        statusObject.throttleProcTemp(error);
+    statusObject.throttleProcTemp(error);
 }
 
 void Device::throttleProcPowerCallback(bool error)
 {
-        statusObject.throttleProcPower(error);
+    statusObject.throttleProcPower(error);
 }
 
 void Device::throttleMemTempCallback(bool error)
 {
-        statusObject.throttleMemTemp(error);
+    statusObject.throttleMemTemp(error);
 }
 
 } // namespace occ
diff --git a/occ_device.hpp b/occ_device.hpp
index efa46dc..448253a 100644
--- a/occ_device.hpp
+++ b/occ_device.hpp
@@ -1,12 +1,14 @@
 #pragma once
 
-#include <fstream>
-#include <experimental/filesystem>
-#include "occ_events.hpp"
-#include "occ_errors.hpp"
-#include "occ_presence.hpp"
 #include "config.h"
 
+#include "occ_errors.hpp"
+#include "occ_events.hpp"
+#include "occ_presence.hpp"
+
+#include <experimental/filesystem>
+#include <fstream>
+
 namespace open_power
 {
 namespace occ
@@ -21,180 +23,166 @@
  */
 class Device
 {
-    public:
-        Device() = delete;
-        ~Device() = default;
-        Device(const Device&) = delete;
-        Device& operator=(const Device&) = delete;
-        Device(Device&&) = default;
-        Device& operator=(Device&&) = default;
+  public:
+    Device() = delete;
+    ~Device() = default;
+    Device(const Device&) = delete;
+    Device& operator=(const Device&) = delete;
+    Device(Device&&) = default;
+    Device& operator=(Device&&) = default;
 
-        /** @brief Constructs the Device object
-         *
-         *  @param[in] event    - Unique ptr reference to sd_event
-         *  @param[in] name     - OCC instance name
-         *  @param[in] manager  - OCC manager instance
-         *  @param[in] callback - Optional callback on errors
-         */
-        Device(EventPtr& event,
-               const std::string& name,
-               const Manager& manager,
-               Status& status,
-               std::function<void(bool)> callBack = nullptr) :
-            config(name),
-            errorFile(fs::path(config) / "occ_error"),
-            statusObject(status),
-            error(event, errorFile, callBack),
-            presence(event,
-                     fs::path(config) / "occs_present",
-                     manager,
-                     callBack),
-            throttleProcTemp(
-                event,
-                fs::path(config) / "occ_dvfs_ot",
-                std::bind(std::mem_fn(&Device::throttleProcTempCallback),
-                          this,
-                          std::placeholders::_1)),
-            throttleProcPower(
-                event,
-                fs::path(config) / "occ_dvfs_power",
-                std::bind(std::mem_fn(&Device::throttleProcPowerCallback),
-                          this,
-                          std::placeholders::_1)),
-            throttleMemTemp(
-                event,
-                fs::path(config) / "occ_mem_throttle",
-                std::bind(std::mem_fn(&Device::throttleMemTempCallback),
-                          this,
-                          std::placeholders::_1))
+    /** @brief Constructs the Device object
+     *
+     *  @param[in] event    - Unique ptr reference to sd_event
+     *  @param[in] name     - OCC instance name
+     *  @param[in] manager  - OCC manager instance
+     *  @param[in] callback - Optional callback on errors
+     */
+    Device(EventPtr& event, const std::string& name, const Manager& manager,
+           Status& status, std::function<void(bool)> callBack = nullptr) :
+        config(name),
+        errorFile(fs::path(config) / "occ_error"), statusObject(status),
+        error(event, errorFile, callBack),
+        presence(event, fs::path(config) / "occs_present", manager, callBack),
+        throttleProcTemp(
+            event, fs::path(config) / "occ_dvfs_ot",
+            std::bind(std::mem_fn(&Device::throttleProcTempCallback), this,
+                      std::placeholders::_1)),
+        throttleProcPower(
+            event, fs::path(config) / "occ_dvfs_power",
+            std::bind(std::mem_fn(&Device::throttleProcPowerCallback), this,
+                      std::placeholders::_1)),
+        throttleMemTemp(event, fs::path(config) / "occ_mem_throttle",
+                        std::bind(std::mem_fn(&Device::throttleMemTempCallback),
+                                  this, std::placeholders::_1))
+    {
+        // Nothing to do here
+    }
+
+    /** @brief Binds device to the OCC driver */
+    inline void bind()
+    {
+        // Bind the device
+        return write(bindPath, config);
+    }
+
+    /** @brief Un-binds device from the OCC driver */
+    inline void unBind()
+    {
+        // Unbind the device
+        return write(unBindPath, config);
+    }
+
+    /** @brief Returns if device is already bound.
+     *
+     *  On device bind, a soft link by the name $config
+     *  gets created in OCC_HWMON_PATH and gets removed
+     *  on unbind
+     *
+     *  @return true if bound, else false
+     */
+    inline bool bound() const
+    {
+        return fs::exists(OCC_HWMON_PATH + config);
+    }
+
+    /** @brief Starts to monitor for errors */
+    inline void addErrorWatch()
+    {
+        throttleProcTemp.addWatch();
+        throttleProcPower.addWatch();
+        throttleMemTemp.addWatch();
+        error.addWatch();
+    }
+
+    /** @brief stops monitoring for errors */
+    inline void removeErrorWatch()
+    {
+        // we can always safely remove watch even if we don't add it
+        presence.removeWatch();
+        error.removeWatch();
+        error.removeWatch();
+        throttleMemTemp.removeWatch();
+        throttleProcPower.removeWatch();
+        throttleProcTemp.removeWatch();
+    }
+
+    /** @brief Starts to watch how many OCCs are present on the master */
+    inline void addPresenceWatchMaster()
+    {
+        if (master())
         {
-            // Nothing to do here
+            presence.addWatch();
         }
+    }
 
-        /** @brief Binds device to the OCC driver */
-        inline void bind()
-        {
-            // Bind the device
-            return write(bindPath, config);
-        }
+  private:
+    /** @brief Config value to be used to do bind and unbind */
+    const std::string config;
 
-        /** @brief Un-binds device from the OCC driver */
-        inline void unBind()
-        {
-           // Unbind the device
-           return write(unBindPath, config);
-        }
+    /** @brief This file contains 0 for success, non-zero for errors */
+    const fs::path errorFile;
 
-        /** @brief Returns if device is already bound.
-         *
-         *  On device bind, a soft link by the name $config
-         *  gets created in OCC_HWMON_PATH and gets removed
-         *  on unbind
-         *
-         *  @return true if bound, else false
-         */
-        inline bool bound() const
-        {
-            return fs::exists(OCC_HWMON_PATH + config);
-        }
+    /**  @brief To bind the device to the OCC driver, do:
+     *
+     *    Write occ<#>-dev0 to: /sys/bus/platform/drivers/occ-hwmon/bind
+     */
+    static fs::path bindPath;
 
-        /** @brief Starts to monitor for errors */
-        inline void addErrorWatch()
-        {
-            throttleProcTemp.addWatch();
-            throttleProcPower.addWatch();
-            throttleMemTemp.addWatch();
-            error.addWatch();
-        }
+    /**  @brief To un-bind the device from the OCC driver, do:
+     *    Write occ<#>-dev0 to: /sys/bus/platform/drivers/occ-hwmon/unbind
+     */
+    static fs::path unBindPath;
 
-        /** @brief stops monitoring for errors */
-        inline void removeErrorWatch()
-        {
-            // we can always safely remove watch even if we don't add it
-            presence.removeWatch();
-            error.removeWatch();
-            error.removeWatch();
-            throttleMemTemp.removeWatch();
-            throttleProcPower.removeWatch();
-            throttleProcTemp.removeWatch();
-        }
+    /**  Store the associated Status instance */
+    Status& statusObject;
 
-        /** @brief Starts to watch how many OCCs are present on the master */
-        inline void addPresenceWatchMaster()
-        {
-            if (master())
-            {
-                presence.addWatch();
-            }
-        }
+    /** Abstraction of error monitoring */
+    Error error;
 
-    private:
-        /** @brief Config value to be used to do bind and unbind */
-        const std::string config;
+    /** Abstraction of OCC presence monitoring */
+    Presence presence;
 
-        /** @brief This file contains 0 for success, non-zero for errors */
-        const fs::path errorFile;
+    /** Error instances for watching for throttling events */
+    Error throttleProcTemp;
+    Error throttleProcPower;
+    Error throttleMemTemp;
 
-        /**  @brief To bind the device to the OCC driver, do:
-         *
-         *    Write occ<#>-dev0 to: /sys/bus/platform/drivers/occ-hwmon/bind
-         */
-        static fs::path bindPath;
+    /** @brief file writer to achieve bind and unbind
+     *
+     *  @param[in] filename - Name of file to be written
+     *  @param[in] data     - Data to be written to
+     *  @return             - None
+     */
+    void write(const fs::path& fileName, const std::string& data)
+    {
+        // If there is an error, move the exception all the way up
+        std::ofstream file(fileName, std::ios::out);
+        file << data;
+        file.close();
+        return;
+    }
 
-        /**  @brief To un-bind the device from the OCC driver, do:
-         *    Write occ<#>-dev0 to: /sys/bus/platform/drivers/occ-hwmon/unbind
-         */
-        static fs::path unBindPath;
+    /** @brief Returns if device represents the master OCC */
+    bool master() const;
 
-        /**  Store the associated Status instance */
-        Status& statusObject;
+    /** @brief callback for the proc temp throttle event
+     *
+     *  @param[in] error - True if an error is reported, false otherwise
+     */
+    void throttleProcTempCallback(bool error);
 
-        /** Abstraction of error monitoring */
-        Error error;
+    /** @brief callback for the proc power throttle event
+     *
+     *  @param[in] error - True if an error is reported, false otherwise
+     */
+    void throttleProcPowerCallback(bool error);
 
-        /** Abstraction of OCC presence monitoring */
-        Presence presence;
-
-        /** Error instances for watching for throttling events */
-        Error throttleProcTemp;
-        Error throttleProcPower;
-        Error throttleMemTemp;
-
-        /** @brief file writer to achieve bind and unbind
-         *
-         *  @param[in] filename - Name of file to be written
-         *  @param[in] data     - Data to be written to
-         *  @return             - None
-         */
-        void write(const fs::path& fileName, const std::string& data)
-        {
-            // If there is an error, move the exception all the way up
-            std::ofstream file(fileName, std::ios::out);
-            file << data;
-            file.close();
-            return;
-        }
-
-        /** @brief Returns if device represents the master OCC */
-        bool master() const;
-
-        /** @brief callback for the proc temp throttle event
-         *
-         *  @param[in] error - True if an error is reported, false otherwise
-         */
-        void throttleProcTempCallback(bool error);
-
-        /** @brief callback for the proc power throttle event
-         *
-         *  @param[in] error - True if an error is reported, false otherwise
-         */
-        void throttleProcPowerCallback(bool error);
-
-        /** @brief callback for the proc temp throttle event
-         *
-         *  @param[in] error - True if an error is reported, false otherwise
-         */
-        void throttleMemTempCallback(bool error);
+    /** @brief callback for the proc temp throttle event
+     *
+     *  @param[in] error - True if an error is reported, false otherwise
+     */
+    void throttleMemTempCallback(bool error);
 };
 
 } // namespace occ
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 <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <phosphor-logging/log.hpp>
-#include <phosphor-logging/elog.hpp>
-#include <xyz/openbmc_project/Common/error.hpp>
-#include <org/open_power/OCC/Device/error.hpp>
 #include "occ_errors.hpp"
+
 #include "elog-errors.hpp"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+
+#include <org/open_power/OCC/Device/error.hpp>
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/log.hpp>
+#include <xyz/openbmc_project/Common/error.hpp>
 namespace open_power
 {
 namespace occ
@@ -18,8 +21,8 @@
 
 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 @@
     fd = open(file.c_str(), O_RDONLY | O_NONBLOCK);
     if (fd < 0)
     {
-        elog<OpenFailure>(
-            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<OpenFailure>(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::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<level::ERR>("Failed to register callback handler",
-                entry("ERROR=%s", strerror(-r)));
+                        entry("ERROR=%s", strerror(-r)));
         elog<InternalFailure>();
     }
 }
@@ -90,8 +92,8 @@
 }
 
 // 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<Error*>(userData);
 
@@ -108,10 +110,10 @@
     if (r < 0)
     {
         elog<ConfigFailure>(
-            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 @@
 // Reads so many bytes as passed in
 std::string Error::readFile(int len) const
 {
-    auto data = std::make_unique<char[]>(len+1);
+    auto data = std::make_unique<char[]>(len + 1);
     auto retries = 3;
     auto delay = std::chrono::milliseconds{100};
 
@@ -164,10 +166,10 @@
     {
         log<level::ERR>("Failure seeking error file to START");
         elog<ConfigFailure>(
-            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());
 }
diff --git a/occ_errors.hpp b/occ_errors.hpp
index 12ae925..ebacc8a 100644
--- a/occ_errors.hpp
+++ b/occ_errors.hpp
@@ -1,10 +1,13 @@
 #pragma once
 
-#include <unistd.h>
-#include <functional>
-#include <experimental/filesystem>
-#include "occ_events.hpp"
 #include "config.h"
+
+#include "occ_events.hpp"
+
+#include <unistd.h>
+
+#include <experimental/filesystem>
+#include <functional>
 namespace open_power
 {
 namespace occ
@@ -17,94 +20,92 @@
  */
 class Error
 {
-    public:
-        Error() = delete;
-        Error(const Error&) = delete;
-        Error& operator=(const Error&) = delete;
-        Error(Error&&) = default;
-        Error& operator=(Error&&) = default;
+  public:
+    Error() = delete;
+    Error(const Error&) = delete;
+    Error& operator=(const Error&) = delete;
+    Error(Error&&) = default;
+    Error& operator=(Error&&) = default;
 
-        /** @brief Constructs the Error object
-         *
-         *  @param[in] event    - reference to sd_event unique_ptr
-         *  @param[in] file     - File used by driver to communicate errors
-         *  @param[in] callBack - Optional function callback on error condition
-         */
-        Error(EventPtr& event,
-              const fs::path& file,
-              std::function<void(bool)> callBack = nullptr) :
-            event(event),
-            file(fs::path(DEV_PATH) / file),
-            callBack(callBack)
+    /** @brief Constructs the Error object
+     *
+     *  @param[in] event    - reference to sd_event unique_ptr
+     *  @param[in] file     - File used by driver to communicate errors
+     *  @param[in] callBack - Optional function callback on error condition
+     */
+    Error(EventPtr& event, const fs::path& file,
+          std::function<void(bool)> callBack = nullptr) :
+        event(event),
+        file(fs::path(DEV_PATH) / file), callBack(callBack)
+    {
+        // Nothing to do here.
+    }
+
+    ~Error()
+    {
+        if (fd >= 0)
         {
-            // Nothing to do here.
+            close(fd);
         }
+    }
 
-        ~Error()
-        {
-            if (fd>= 0)
-            {
-                close(fd);
-            }
-        }
+    /** @brief Starts to monitor for error conditions */
+    void addWatch();
 
-        /** @brief Starts to monitor for error conditions */
-        void addWatch();
+    /** @brief Removes error watch */
+    void removeWatch();
 
-        /** @brief Removes error watch */
-        void removeWatch();
+  private:
+    /** @brief sd_event wrapped in unique_ptr */
+    EventPtr& event;
 
-    private:
-        /** @brief sd_event wrapped in unique_ptr */
-        EventPtr& event;
+    /** @brief event source wrapped in unique_ptr */
+    EventSourcePtr eventSource;
 
-        /** @brief event source wrapped in unique_ptr */
-        EventSourcePtr eventSource;
+    /** @brief Current state of error watching */
+    bool watching = false;
 
-        /** @brief Current state of error watching */
-        bool watching = false;
+    /** @brief attaches FD to events and sets up callback handler */
+    void registerCallBack();
 
-        /** @brief attaches FD to events and sets up callback handler */
-        void registerCallBack();
+    /** @brief Opens the file and populates fd */
+    void openFile();
 
-        /** @brief Opens the file and populates fd */
-        void openFile();
+    /** @brief Callback handler when the FD has some activity on it
+     *
+     *  @param[in] es       - Populated event source
+     *  @param[in] fd       - Associated File descriptor
+     *  @param[in] revents  - Type of event
+     *  @param[in] userData - User data that was passed during registration
+     *
+     *  @return             - 0 or positive number on success and negative
+     *                        errno otherwise
+     */
+    static int processEvents(sd_event_source* es, int fd, uint32_t revents,
+                             void* userData);
 
-        /** @brief Callback handler when the FD has some activity on it
-         *
-         *  @param[in] es       - Populated event source
-         *  @param[in] fd       - Associated File descriptor
-         *  @param[in] revents  - Type of event
-         *  @param[in] userData - User data that was passed during registration
-         *
-         *  @return             - 0 or positive number on success and negative
-         *                        errno otherwise
-         */
-        static int processEvents(sd_event_source* es, int fd,
-                                 uint32_t revents, void* userData);
+    /** @brief When the error event is received, analyzes it
+     *         and makes a callback to error handler if the
+     *         content denotes an error condition
+     */
+    virtual void analyzeEvent();
 
-        /** @brief When the error event is received, analyzes it
-         *         and makes a callback to error handler if the
-         *         content denotes an error condition
-         */
-        virtual void analyzeEvent();
+  protected:
+    /** @brief File descriptor to watch for errors */
+    int fd = -1;
 
-    protected:
-        /** @brief File descriptor to watch for errors */
-        int fd = -1;
+    /** Error file */
+    const fs::path file;
 
-        /** Error file */
-        const fs::path file;
+    /** @brief Optional function to call on error scenario */
+    std::function<void(bool)> callBack;
 
-        /** @brief Optional function to call on error scenario */
-        std::function<void(bool)> callBack;
-
-        /** @brief Reads file data
-         *
-         *  @return data read. Since its a /sysfs entry,
-         *          it would be a string
-         */
-        std::string readFile(int) const;
+    /** @brief Reads file data
+     *
+     *  @return data read. Since its a /sysfs entry,
+     *          it would be a string
+     */
+    std::string readFile(int) const;
 };
 
 } // namespace occ
diff --git a/occ_finder.cpp b/occ_finder.cpp
index 0c02c35..a9f98d6 100644
--- a/occ_finder.cpp
+++ b/occ_finder.cpp
@@ -1,12 +1,14 @@
+#include "config.h"
+
+#include "occ_finder.hpp"
+
 #include <algorithm>
-#include <iterator>
 #include <experimental/filesystem>
-#include <sdbusplus/server.hpp>
+#include <iterator>
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/log.hpp>
+#include <sdbusplus/server.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
-#include "occ_finder.hpp"
-#include "config.h"
 namespace open_power
 {
 namespace occ
@@ -23,27 +25,22 @@
 }
 
 template <typename T>
-T getDbusProperty(sdbusplus::bus::bus& bus,
-                  const std::string& service,
-                  const std::string& objPath,
-                  const std::string& interface,
+T getDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
+                  const std::string& objPath, const std::string& interface,
                   const std::string& property)
 {
     using namespace sdbusplus::xyz::openbmc_project::Common::Error;
 
     constexpr auto PROPERTY_INTF = "org.freedesktop.DBus.Properties";
 
-    auto method = bus.new_method_call(
-                      service.c_str(),
-                      objPath.c_str(),
-                      PROPERTY_INTF,
-                      "Get");
+    auto method = bus.new_method_call(service.c_str(), objPath.c_str(),
+                                      PROPERTY_INTF, "Get");
     method.append(interface, property);
 
     auto reply = bus.call(method);
     if (reply.is_method_error())
     {
-         log<level::ERR>("Failed to get property",
+        log<level::ERR>("Failed to get property",
                         entry("PROPERTY=%s", property.c_str()),
                         entry("PATH=%s", objPath.c_str()),
                         entry("INTERFACE=%s", interface.c_str()));
@@ -65,19 +62,15 @@
     using Interfaces = std::vector<Interface>;
 
     auto mapper =
-        bus.new_method_call(
-            "xyz.openbmc_project.ObjectMapper",
-            "/xyz/openbmc_project/object_mapper",
-            "xyz.openbmc_project.ObjectMapper",
-            "GetSubTree");
+        bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+                            "/xyz/openbmc_project/object_mapper",
+                            "xyz.openbmc_project.ObjectMapper", "GetSubTree");
 
     auto depth = 0;
     Path path = CPU_SUBPATH;
-    Interfaces interfaces
-    {
+    Interfaces interfaces{
         "xyz.openbmc_project.Inventory.Item",
-        "xyz.openbmc_project.State.Decorator.OperationalStatus"
-    };
+        "xyz.openbmc_project.State.Decorator.OperationalStatus"};
 
     mapper.append(path);
     mapper.append(depth);
@@ -110,9 +103,7 @@
         {
             Criteria match{};
             match.emplace_back(std::make_tuple(
-                               "xyz.openbmc_project.Inventory.Item",
-                               "Present",
-                               true));
+                "xyz.openbmc_project.Inventory.Item", "Present", true));
 
             // Select only if the CPU is marked 'Present'.
             // Local variable to make it readable
@@ -120,8 +111,7 @@
             auto service = entry->second.begin()->first;
             if (matchCriteria(bus, path, service, match))
             {
-                occs.emplace_back(std::string(OCC_NAME) +
-                                  toChar(count));
+                occs.emplace_back(std::string(OCC_NAME) + toChar(count));
             }
         }
     }
@@ -129,16 +119,13 @@
     return occs;
 }
 
-bool matchCriteria(sdbusplus::bus::bus& bus,
-                   const std::string& path,
-                   const std::string& service,
-                   const Criteria& match)
+bool matchCriteria(sdbusplus::bus::bus& bus, const std::string& path,
+                   const std::string& service, const Criteria& match)
 {
-    for (const auto& iter: match)
+    for (const auto& iter : match)
     {
-        auto result = getDbusProperty<bool>(bus, service, path,
-                                            std::get<0>(iter),
-                                            std::get<1>(iter));
+        auto result = getDbusProperty<bool>(
+            bus, service, path, std::get<0>(iter), std::get<1>(iter));
         if (result != std::get<2>(iter))
         {
             return false;
diff --git a/occ_finder.hpp b/occ_finder.hpp
index 557d468..59b5984 100644
--- a/occ_finder.hpp
+++ b/occ_finder.hpp
@@ -1,8 +1,8 @@
 #pragma once
 
-#include <vector>
-#include <string>
 #include <sdbusplus/bus.hpp>
+#include <string>
+#include <vector>
 
 namespace open_power
 {
@@ -21,10 +21,10 @@
 using Criteria = std::vector<Match>;
 
 /** @brief Get OCC objects on the system by mapping them to CPU inventory
-  * @returns vector of occ objects, such as occ0, occ1, and so on.
-  *
-  * @param[in] bus - sdbusplus handler
-  */
+ * @returns vector of occ objects, such as occ0, occ1, and so on.
+ *
+ * @param[in] bus - sdbusplus handler
+ */
 std::vector<std::string> get(sdbusplus::bus::bus& bus);
 
 /** @brief Returns true if the inventory item matches the criteria
@@ -36,10 +36,8 @@
  *
  *  @return true on match, false otherwise
  */
-bool matchCriteria(sdbusplus::bus::bus& bus,
-                   const std::string& path,
-                   const std::string& service,
-                   const Criteria& match);
+bool matchCriteria(sdbusplus::bus::bus& bus, const std::string& path,
+                   const std::string& service, const Criteria& match);
 
 /** @brief Gets the value associated with the given object
  *         and the interface.
@@ -54,10 +52,8 @@
  */
 
 template <typename T>
-T getDbusProperty(sdbusplus::bus::bus& bus,
-                  const std::string& service,
-                  const std::string& objPath,
-                  const std::string& interface,
+T getDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
+                  const std::string& objPath, const std::string& interface,
                   const std::string& property);
 
 } // namespace finder
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 6fd0652..d420eea 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -1,13 +1,16 @@
-#include <experimental/filesystem>
-#include <phosphor-logging/log.hpp>
-#include <phosphor-logging/elog-errors.hpp>
-#include <xyz/openbmc_project/Common/error.hpp>
-#include "occ_finder.hpp"
-#include "occ_manager.hpp"
-#include "i2c_occ.hpp"
-#include "utils.hpp"
 #include "config.h"
 
+#include "occ_manager.hpp"
+
+#include "i2c_occ.hpp"
+#include "occ_finder.hpp"
+#include "utils.hpp"
+
+#include <experimental/filesystem>
+#include <phosphor-logging/elog-errors.hpp>
+#include <phosphor-logging/log.hpp>
+#include <xyz/openbmc_project/Common/error.hpp>
+
 namespace open_power
 {
 namespace occ
@@ -45,33 +48,26 @@
     auto path = fs::path(OCC_CONTROL_ROOT) / occ;
 
     passThroughObjects.emplace_back(
-            std::make_unique<PassThrough>(
-                bus,
-                path.c_str()));
+        std::make_unique<PassThrough>(bus, path.c_str()));
 
-    statusObjects.emplace_back(
-            std::make_unique<Status>(
-                bus,
-                event,
-                path.c_str(),
-                *this,
-                std::bind(std::mem_fn(&Manager::statusCallBack),
-                    this, std::placeholders::_1)));
+    statusObjects.emplace_back(std::make_unique<Status>(
+        bus, event, path.c_str(), *this,
+        std::bind(std::mem_fn(&Manager::statusCallBack), this,
+                  std::placeholders::_1)));
 
     // Create the power cap monitor object for master occ (0)
     if (!pcap)
     {
         pcap = std::make_unique<open_power::occ::powercap::PowerCap>(
-                bus,
-                *statusObjects.front());
+            bus, *statusObjects.front());
     }
 }
 
 void Manager::statusCallBack(bool status)
 {
     using namespace phosphor::logging;
-    using InternalFailure = sdbusplus::xyz::openbmc_project::Common::
-        Error::InternalFailure;
+    using InternalFailure =
+        sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
 
     // At this time, it won't happen but keeping it
     // here just in case something changes in the future
@@ -86,7 +82,7 @@
     // Only start presence detection if all the OCCs are bound
     if (activeCount == statusObjects.size())
     {
-        for (auto &obj : statusObjects)
+        for (auto& obj : statusObjects)
         {
             obj->addPresenceWatchMaster();
         }
@@ -107,17 +103,11 @@
         name = std::string(OCC_NAME) + '_' + name;
         auto path = fs::path(OCC_CONTROL_ROOT) / name;
         statusObjects.emplace_back(
-            std::make_unique<Status>(
-                bus,
-                event,
-                path.c_str(),
-                *this));
+            std::make_unique<Status>(bus, event, path.c_str(), *this));
     }
     // The first device is master occ
     pcap = std::make_unique<open_power::occ::powercap::PowerCap>(
-               bus,
-               *statusObjects.front(),
-               occMasterName);
+        bus, *statusObjects.front(), occMasterName);
 }
 #endif
 
diff --git a/occ_manager.hpp b/occ_manager.hpp
index 542c7d9..20002e4 100644
--- a/occ_manager.hpp
+++ b/occ_manager.hpp
@@ -1,13 +1,14 @@
 #pragma once
 
-#include <cstring>
-#include <vector>
-#include <functional>
-#include <sdbusplus/bus.hpp>
 #include "occ_pass_through.hpp"
 #include "occ_status.hpp"
 #include "powercap.hpp"
 
+#include <cstring>
+#include <functional>
+#include <sdbusplus/bus.hpp>
+#include <vector>
+
 namespace sdbusRule = sdbusplus::bus::match::rules;
 namespace open_power
 {
@@ -19,102 +20,99 @@
  */
 struct Manager
 {
-    public:
-        Manager() = delete;
-        Manager(const Manager&) = delete;
-        Manager& operator=(const Manager&) = delete;
-        Manager(Manager&&) = delete;
-        Manager& operator=(Manager&&) = delete;
-        ~Manager() = default;
+  public:
+    Manager() = delete;
+    Manager(const Manager&) = delete;
+    Manager& operator=(const Manager&) = delete;
+    Manager(Manager&&) = delete;
+    Manager& operator=(Manager&&) = delete;
+    ~Manager() = default;
 
-        /** @brief Adds OCC pass-through and status objects on the bus
-         *         when corresponding CPU inventory is created.
-         *
-         *  @param[in] bus   - handle to the bus
-         *  @param[in] event - Unique ptr reference to sd_event
-         */
-        Manager(sdbusplus::bus::bus& bus,
-                EventPtr& event) :
-            bus(bus),
-            event(event)
-        {
+    /** @brief Adds OCC pass-through and status objects on the bus
+     *         when corresponding CPU inventory is created.
+     *
+     *  @param[in] bus   - handle to the bus
+     *  @param[in] event - Unique ptr reference to sd_event
+     */
+    Manager(sdbusplus::bus::bus& bus, EventPtr& event) : bus(bus), event(event)
+    {
 #ifdef I2C_OCC
-            // I2C OCC status objects are initialized directly
-            initStatusObjects();
+        // I2C OCC status objects are initialized directly
+        initStatusObjects();
 #else
-            findAndCreateObjects();
+        findAndCreateObjects();
 #endif
-        }
+    }
 
-        inline auto getNumOCCs() const
-        {
-            return activeCount;
-        }
+    inline auto getNumOCCs() const
+    {
+        return activeCount;
+    }
 
-    private:
-        /** @brief Checks if the CPU inventory is present and if so, creates
-         *         the occ D-Bus objects. Else, registers a handler to be
-         *         called when inventory is created.
-         */
-        void findAndCreateObjects();
+  private:
+    /** @brief Checks if the CPU inventory is present and if so, creates
+     *         the occ D-Bus objects. Else, registers a handler to be
+     *         called when inventory is created.
+     */
+    void findAndCreateObjects();
 
-        /** @brief Callback that responds to cpu creation in the inventory -
-         *         by creating the needed objects.
-         *
-         *  @param[in] msg - bus message
-         *
-         *  @returns 0 to indicate success
-         */
-        int cpuCreated(sdbusplus::message::message& msg);
+    /** @brief Callback that responds to cpu creation in the inventory -
+     *         by creating the needed objects.
+     *
+     *  @param[in] msg - bus message
+     *
+     *  @returns 0 to indicate success
+     */
+    int cpuCreated(sdbusplus::message::message& msg);
 
-        /** @brief Create child OCC objects.
-         *
-         *  @param[in] occ - the occ name, such as occ0.
-         */
-        void createObjects(const std::string& occ);
+    /** @brief Create child OCC objects.
+     *
+     *  @param[in] occ - the occ name, such as occ0.
+     */
+    void createObjects(const std::string& occ);
 
-        /** @brief Callback handler invoked by Status object when the OccActive
-         *         property is changed. This is needed to make sure that the
-         *         error detection is started only after all the OCCs are bound.
-         *         Similarly, when one of the OCC gets its OccActive property
-         *         un-set, then the OCC error detection needs to be stopped on
-         *         all the OCCs
-         *
-         *  @param[in] status - OccActive status
-         */
-        void statusCallBack(bool status);
+    /** @brief Callback handler invoked by Status object when the OccActive
+     *         property is changed. This is needed to make sure that the
+     *         error detection is started only after all the OCCs are bound.
+     *         Similarly, when one of the OCC gets its OccActive property
+     *         un-set, then the OCC error detection needs to be stopped on
+     *         all the OCCs
+     *
+     *  @param[in] status - OccActive status
+     */
+    void statusCallBack(bool status);
 
-        /** @brief Sends a Heartbeat command to host control command handler */
-        void sendHeartBeat();
+    /** @brief Sends a Heartbeat command to host control command handler */
+    void sendHeartBeat();
 
-        /** @brief reference to the bus */
-        sdbusplus::bus::bus& bus;
+    /** @brief reference to the bus */
+    sdbusplus::bus::bus& bus;
 
-        /** @brief reference to sd_event wrapped in unique_ptr */
-        EventPtr& event;
+    /** @brief reference to sd_event wrapped in unique_ptr */
+    EventPtr& event;
 
-        /** @brief OCC pass-through objects */
-        std::vector<std::unique_ptr<PassThrough>> passThroughObjects;
+    /** @brief OCC pass-through objects */
+    std::vector<std::unique_ptr<PassThrough>> passThroughObjects;
 
-        /** @brief OCC Status objects */
-        std::vector<std::unique_ptr<Status>> statusObjects;
+    /** @brief OCC Status objects */
+    std::vector<std::unique_ptr<Status>> statusObjects;
 
-        /** @brief Power cap monitor and occ notification object */
-        std::unique_ptr<open_power::occ::powercap::PowerCap> pcap;
+    /** @brief Power cap monitor and occ notification object */
+    std::unique_ptr<open_power::occ::powercap::PowerCap> pcap;
 
-        /** @brief sbdbusplus match objects */
-        std::vector<sdbusplus::bus::match_t> cpuMatches;
+    /** @brief sbdbusplus match objects */
+    std::vector<sdbusplus::bus::match_t> cpuMatches;
 
-        /** @brief Number of OCCs that are bound */
-        uint8_t activeCount = 0;
+    /** @brief Number of OCCs that are bound */
+    uint8_t activeCount = 0;
 
 #ifdef I2C_OCC
-        /** @brief Init Status objects for I2C OCC devices
-         *
-         * It iterates in /sys/bus/i2c/devices, finds all occ hwmon devices
-         * and creates status objects.
-         */
-        void initStatusObjects();
+    /** @brief Init Status objects for I2C OCC devices
+     *
+     * It iterates in /sys/bus/i2c/devices, finds all occ hwmon devices
+     * and creates status objects.
+     */
+    void initStatusObjects();
 #endif
 };
 
diff --git a/occ_pass_through.cpp b/occ_pass_through.cpp
index 424cc22..a92d824 100644
--- a/occ_pass_through.cpp
+++ b/occ_pass_through.cpp
@@ -1,31 +1,31 @@
-#include <memory>
-#include <algorithm>
-#include <fcntl.h>
-#include <errno.h>
-#include <string>
-#include <unistd.h>
-#include <phosphor-logging/log.hpp>
-#include <phosphor-logging/elog.hpp>
-#include <org/open_power/OCC/Device/error.hpp>
-#include "occ_pass_through.hpp"
-#include "elog-errors.hpp"
 #include "config.h"
+
+#include "occ_pass_through.hpp"
+
+#include "elog-errors.hpp"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <algorithm>
+#include <memory>
+#include <org/open_power/OCC/Device/error.hpp>
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/log.hpp>
+#include <string>
 namespace open_power
 {
 namespace occ
 {
 
-PassThrough::PassThrough(
-    sdbusplus::bus::bus& bus,
-    const char* path) :
-    Iface(bus, path),
-    path(path),
+PassThrough::PassThrough(sdbusplus::bus::bus& bus, const char* path) :
+    Iface(bus, path), path(path),
     devicePath(OCC_DEV_PATH + std::to_string((this->path.back() - '0') + 1)),
     activeStatusSignal(
-            bus,
-            sdbusRule::propertiesChanged(path, "org.open_power.OCC.Status"),
-            std::bind(std::mem_fn(&PassThrough::activeStatusEvent),
-                this, std::placeholders::_1))
+        bus, sdbusRule::propertiesChanged(path, "org.open_power.OCC.Status"),
+        std::bind(std::mem_fn(&PassThrough::activeStatusEvent), this,
+                  std::placeholders::_1))
 {
     // Nothing to do.
 }
@@ -37,8 +37,8 @@
 
     if (!occActive)
     {
-         log<level::INFO>("OCC is inactive; cannot perform pass-through");
-         return;
+        log<level::INFO>("OCC is inactive; cannot perform pass-through");
+        return;
     }
 
     fd = open(devicePath.c_str(), O_RDWR | O_NONBLOCK);
@@ -46,10 +46,10 @@
     {
         // This would log and terminate since its not handled.
         elog<OpenFailure>(
-            phosphor::logging::org::open_power::OCC::Device::
-                OpenFailure::CALLOUT_ERRNO(errno),
-            phosphor::logging::org::open_power::OCC::Device::
-                OpenFailure::CALLOUT_DEVICE_PATH(devicePath.c_str()));
+            phosphor::logging::org::open_power::OCC::Device::OpenFailure::
+                CALLOUT_ERRNO(errno),
+            phosphor::logging::org::open_power::OCC::Device::OpenFailure::
+                CALLOUT_DEVICE_PATH(devicePath.c_str()));
     }
     return;
 }
@@ -68,7 +68,7 @@
     using namespace phosphor::logging;
     using namespace sdbusplus::org::open_power::OCC::Device::Error;
 
-    std::vector<int32_t> response {};
+    std::vector<int32_t> response{};
 
     openDevice();
 
@@ -85,7 +85,7 @@
 
     // Populate uint8_t version of vector.
     std::transform(command.begin(), command.end(), cmdInBytes.begin(),
-            [](decltype(cmdInBytes)::value_type x){return x;});
+                   [](decltype(cmdInBytes)::value_type x) { return x; });
 
     ssize_t size = cmdInBytes.size() * sizeof(decltype(cmdInBytes)::value_type);
     auto rc = write(fd, cmdInBytes.data(), size);
@@ -93,16 +93,16 @@
     {
         // This would log and terminate since its not handled.
         elog<WriteFailure>(
-            phosphor::logging::org::open_power::OCC::Device::
-                WriteFailure::CALLOUT_ERRNO(errno),
-            phosphor::logging::org::open_power::OCC::Device::
-                WriteFailure::CALLOUT_DEVICE_PATH(devicePath.c_str()));
+            phosphor::logging::org::open_power::OCC::Device::WriteFailure::
+                CALLOUT_ERRNO(errno),
+            phosphor::logging::org::open_power::OCC::Device::WriteFailure::
+                CALLOUT_DEVICE_PATH(devicePath.c_str()));
     }
 
     // Now read the response. This would be the content of occ-sram
-    while(1)
+    while (1)
     {
-        uint8_t data {};
+        uint8_t data{};
         auto len = read(fd, &data, sizeof(data));
         if (len > 0)
         {
@@ -123,10 +123,10 @@
         {
             // This would log and terminate since its not handled.
             elog<ReadFailure>(
-                phosphor::logging::org::open_power::OCC::Device::
-                    ReadFailure::CALLOUT_ERRNO(errno),
-                phosphor::logging::org::open_power::OCC::Device::
-                    ReadFailure::CALLOUT_DEVICE_PATH(devicePath.c_str()));
+                phosphor::logging::org::open_power::OCC::Device::ReadFailure::
+                    CALLOUT_ERRNO(errno),
+                phosphor::logging::org::open_power::OCC::Device::ReadFailure::
+                    CALLOUT_DEVICE_PATH(devicePath.c_str()));
         }
     }
 
diff --git a/occ_pass_through.hpp b/occ_pass_through.hpp
index 384a065..a28eb6a 100644
--- a/occ_pass_through.hpp
+++ b/occ_pass_through.hpp
@@ -1,9 +1,9 @@
 #pragma once
 
-#include <string>
+#include <org/open_power/OCC/PassThrough/server.hpp>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
-#include <org/open_power/OCC/PassThrough/server.hpp>
+#include <string>
 
 namespace open_power
 {
@@ -21,69 +21,67 @@
  */
 class PassThrough : public Iface
 {
-    public:
-        PassThrough() = delete;
-        PassThrough(const PassThrough&) = delete;
-        PassThrough& operator=(const PassThrough&) = delete;
-        PassThrough(PassThrough&&) = default;
-        PassThrough& operator=(PassThrough&&) = default;
+  public:
+    PassThrough() = delete;
+    PassThrough(const PassThrough&) = delete;
+    PassThrough& operator=(const PassThrough&) = delete;
+    PassThrough(PassThrough&&) = default;
+    PassThrough& operator=(PassThrough&&) = default;
 
-        /** @brief Ctor to put pass-through d-bus object on the bus
-         *  @param[in] bus - Bus to attach to
-         *  @param[in] path - Path to attach at
-         */
-        PassThrough(sdbusplus::bus::bus& bus,
-                    const char* path);
+    /** @brief Ctor to put pass-through d-bus object on the bus
+     *  @param[in] bus - Bus to attach to
+     *  @param[in] path - Path to attach at
+     */
+    PassThrough(sdbusplus::bus::bus& bus, const char* path);
 
-        ~PassThrough()
-        {
-            closeDevice();
-        }
+    ~PassThrough()
+    {
+        closeDevice();
+    }
 
-        /** @brief Pass through command to OCC
-         *  @param[in] command - command to pass-through
-         *  @returns OCC response as an array
-         */
-        std::vector<std::int32_t>
-            send(std::vector<std::int32_t> command) override;
+    /** @brief Pass through command to OCC
+     *  @param[in] command - command to pass-through
+     *  @returns OCC response as an array
+     */
+    std::vector<std::int32_t> send(std::vector<std::int32_t> command) override;
 
-    private:
-        /** @brief Pass-through occ path on the bus */
-        std::string path;
+  private:
+    /** @brief Pass-through occ path on the bus */
+    std::string path;
 
-        /** @brief OCC device path
-         *  For now, here is the hard-coded mapping until
-         *  the udev rule is in.
-         *  occ0 --> /dev/occ1
-         *  occ1 --> /dev/occ2
-         *  ...
-         */
-        std::string devicePath;
+    /** @brief OCC device path
+     *  For now, here is the hard-coded mapping until
+     *  the udev rule is in.
+     *  occ0 --> /dev/occ1
+     *  occ1 --> /dev/occ2
+     *  ...
+     */
+    std::string devicePath;
 
-        /** @brief Indicates whether or not the OCC is currently active */
-        bool occActive = false;
+    /** @brief Indicates whether or not the OCC is currently active */
+    bool occActive = false;
 
-        /** brief file descriptor associated with occ device */
-        int fd = -1;
+    /** brief file descriptor associated with occ device */
+    int fd = -1;
 
-        /** @brief Subscribe to OCC Status signal
-         *
-         *  Once the OCC status gets to active, only then we will get /dev/occ2
-         *  populated and hence need to wait on that before opening that
-         */
-        sdbusplus::bus::match_t activeStatusSignal;
+    /** @brief Subscribe to OCC Status signal
+     *
+     *  Once the OCC status gets to active, only then we will get /dev/occ2
+     *  populated and hence need to wait on that before opening that
+     */
+    sdbusplus::bus::match_t activeStatusSignal;
 
-        /** Opens devicePath and populates file descritor */
-        void openDevice();
+    /** Opens devicePath and populates file descritor */
+    void openDevice();
 
-        /** Closed the fd associated with opened device */
-        void closeDevice();
+    /** Closed the fd associated with opened device */
+    void closeDevice();
 
-        /** @brief Callback function on OCC Status change signals
-         *
-         *  @param[in]  msg - Data associated with subscribed signal
-         */
-        void activeStatusEvent(sdbusplus::message::message& msg);
+    /** @brief Callback function on OCC Status change signals
+     *
+     *  @param[in]  msg - Data associated with subscribed signal
+     */
+    void activeStatusEvent(sdbusplus::message::message& msg);
 };
 
 } // namespace occ
diff --git a/occ_presence.cpp b/occ_presence.cpp
index 59b886a..ab9b322 100644
--- a/occ_presence.cpp
+++ b/occ_presence.cpp
@@ -1,14 +1,17 @@
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <phosphor-logging/log.hpp>
-#include <phosphor-logging/elog.hpp>
-#include <xyz/openbmc_project/Common/error.hpp>
-#include <org/open_power/OCC/Device/error.hpp>
 #include "occ_presence.hpp"
-#include "occ_manager.hpp"
+
 #include "elog-errors.hpp"
+#include "occ_manager.hpp"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+
+#include <org/open_power/OCC/Device/error.hpp>
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/log.hpp>
+#include <xyz/openbmc_project/Common/error.hpp>
 
 namespace open_power
 {
@@ -27,10 +30,10 @@
     if (r < 0)
     {
         elog<ConfigFailure>(
-            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()));
     }
 
     auto data = readFile(len);
diff --git a/occ_presence.hpp b/occ_presence.hpp
index e0bd3ad..9e66acc 100644
--- a/occ_presence.hpp
+++ b/occ_presence.hpp
@@ -13,39 +13,37 @@
  */
 class Presence : public Error
 {
-    public:
-        Presence() = delete;
-        Presence(const Presence&) = delete;
-        Presence& operator=(const Presence&) = delete;
-        Presence(Presence&&) = default;
-        Presence& operator=(Presence&&) = default;
+  public:
+    Presence() = delete;
+    Presence(const Presence&) = delete;
+    Presence& operator=(const Presence&) = delete;
+    Presence(Presence&&) = default;
+    Presence& operator=(Presence&&) = default;
 
-        /** @brief Constructs the Presence object
-         *
-         *  @param[in] event    - Reference to sd_event unique_ptr
-         *  @param[in] file     - File used by driver to communicate errors
-         *  @param[in] mgr      - OCC manager instance
-         *  @param[in] callBack - Optional function callback on error condition
-         */
-        Presence(EventPtr& event,
-              const fs::path& file,
-              const Manager& mgr,
-              std::function<void(bool)> callBack = nullptr) :
-            Error(event, file, callBack),
-            manager(mgr)
-        {
-            // Nothing to do here.
-        }
+    /** @brief Constructs the Presence object
+     *
+     *  @param[in] event    - Reference to sd_event unique_ptr
+     *  @param[in] file     - File used by driver to communicate errors
+     *  @param[in] mgr      - OCC manager instance
+     *  @param[in] callBack - Optional function callback on error condition
+     */
+    Presence(EventPtr& event, const fs::path& file, const Manager& mgr,
+             std::function<void(bool)> callBack = nullptr) :
+        Error(event, file, callBack),
+        manager(mgr)
+    {
+        // Nothing to do here.
+    }
 
-    private:
-        /** Store the manager instance to enable getting number of OCCs */
-        const Manager& manager;
+  private:
+    /** Store the manager instance to enable getting number of OCCs */
+    const Manager& manager;
 
-        /** @brief When the error event is received, analyzes it
-         *         and makes a callback to error handler if the
-         *         content denotes an error condition
-         */
-        void analyzeEvent() override;
+    /** @brief When the error event is received, analyzes it
+     *         and makes a callback to error handler if the
+     *         content denotes an error condition
+     */
+    void analyzeEvent() override;
 };
 
 } // namespace occ
diff --git a/occ_status.cpp b/occ_status.cpp
index 26f2979..c2c4bae 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -1,7 +1,9 @@
-#include <phosphor-logging/log.hpp>
 #include "occ_status.hpp"
+
 #include "occ_sensor.hpp"
 #include "utils.hpp"
+
+#include <phosphor-logging/log.hpp>
 namespace open_power
 {
 namespace occ
@@ -87,17 +89,13 @@
     // This will throw exception on failure
     auto service = getService(bus, CONTROL_HOST_PATH, CONTROL_HOST_INTF);
 
-    auto method = bus.new_method_call(service.c_str(),
-                                      CONTROL_HOST_PATH,
-                                      CONTROL_HOST_INTF,
-                                      "Execute");
+    auto method = bus.new_method_call(service.c_str(), CONTROL_HOST_PATH,
+                                      CONTROL_HOST_INTF, "Execute");
     // OCC Reset control command
-    method.append(convertForMessage(
-                Control::Host::Command::OCCReset).c_str());
+    method.append(convertForMessage(Control::Host::Command::OCCReset).c_str());
 
     // OCC Sensor ID for callout reasons
-    method.append(sdbusplus::message::variant<uint8_t>(
-                        sensorMap.at(instance)));
+    method.append(sdbusplus::message::variant<uint8_t>(sensorMap.at(instance)));
     bus.call_noreply(method);
     return;
 }
@@ -114,19 +112,19 @@
     msg.read(cmdCompleted, cmdStatus);
 
     log<level::DEBUG>("Host control signal values",
-                      entry("COMMAND=%s",cmdCompleted.c_str()),
-                      entry("STATUS=%s",cmdStatus.c_str()));
+                      entry("COMMAND=%s", cmdCompleted.c_str()),
+                      entry("STATUS=%s", cmdStatus.c_str()));
 
-    if(Control::Host::convertResultFromString(cmdStatus) !=
-            Control::Host::Result::Success)
+    if (Control::Host::convertResultFromString(cmdStatus) !=
+        Control::Host::Result::Success)
     {
-        if(Control::Host::convertCommandFromString(cmdCompleted) ==
-                Control::Host::Command::OCCReset)
+        if (Control::Host::convertCommandFromString(cmdCompleted) ==
+            Control::Host::Command::OCCReset)
         {
             // Must be a Timeout. Log an Error trace
             log<level::ERR>("Error resetting the OCC.",
-                    entry("PATH=%s", path.c_str()),
-                    entry("SENSORID=0x%X",sensorMap.at(instance)));
+                            entry("PATH=%s", path.c_str()),
+                            entry("SENSORID=0x%X", sensorMap.at(instance)));
         }
     }
     return;
diff --git a/occ_status.hpp b/occ_status.hpp
index f14bd7d..9e6c687 100644
--- a/occ_status.hpp
+++ b/occ_status.hpp
@@ -1,13 +1,14 @@
 #pragma once
 
+#include "i2c_occ.hpp"
+#include "occ_device.hpp"
+#include "occ_events.hpp"
+
 #include <functional>
+#include <org/open_power/Control/Host/server.hpp>
+#include <org/open_power/OCC/Status/server.hpp>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
-#include <org/open_power/OCC/Status/server.hpp>
-#include <org/open_power/Control/Host/server.hpp>
-#include "occ_events.hpp"
-#include "occ_device.hpp"
-#include "i2c_occ.hpp"
 
 namespace open_power
 {
@@ -38,142 +39,135 @@
  */
 class Status : public Interface
 {
-    public:
-        Status() = delete;
-        ~Status() = default;
-        Status(const Status&) = delete;
-        Status& operator=(const Status&) = delete;
-        Status(Status&&) = default;
-        Status& operator=(Status&&) = default;
+  public:
+    Status() = delete;
+    ~Status() = default;
+    Status(const Status&) = delete;
+    Status& operator=(const Status&) = delete;
+    Status(Status&&) = default;
+    Status& operator=(Status&&) = default;
 
-        /** @brief Constructs the Status object and
-         *         the underlying device object
-         *
-         *  @param[in] bus      - DBus bus to attach to
-         *  @param[in] event    - sd_event unique pointer reference
-         *  @param[in] path     - DBus object path
-         *  @param[in] manager  - OCC manager instance
-         *  @param[in] callBack - Callback handler to invoke during
-         *                        property change
-         */
-        Status(sdbusplus::bus::bus& bus,
-               EventPtr& event,
-               const char* path,
-               const Manager& manager,
-               std::function<void(bool)> callBack = nullptr)
-            : Interface(bus, path, true),
-              bus(bus),
-              path(path),
-              callBack(callBack),
-              instance(((this->path.back() - '0'))),
-              device(event,
+    /** @brief Constructs the Status object and
+     *         the underlying device object
+     *
+     *  @param[in] bus      - DBus bus to attach to
+     *  @param[in] event    - sd_event unique pointer reference
+     *  @param[in] path     - DBus object path
+     *  @param[in] manager  - OCC manager instance
+     *  @param[in] callBack - Callback handler to invoke during
+     *                        property change
+     */
+    Status(sdbusplus::bus::bus& bus, EventPtr& event, const char* path,
+           const Manager& manager,
+           std::function<void(bool)> callBack = nullptr) :
+        Interface(bus, path, true),
+        bus(bus), path(path), callBack(callBack),
+        instance(((this->path.back() - '0'))),
+        device(event,
 #ifdef I2C_OCC
-                     i2c_occ::getI2cDeviceName(path),
+               i2c_occ::getI2cDeviceName(path),
 #else
-                     sysfsName + "." + std::to_string(instance + 1),
+               sysfsName + "." + std::to_string(instance + 1),
 #endif
-                     manager,
-                     *this,
-                     std::bind(std::mem_fn(&Status::deviceErrorHandler), this,
-                               std::placeholders::_1)),
-              hostControlSignal(
-                     bus,
-                     sdbusRule::type::signal() +
-                     sdbusRule::member("CommandComplete") +
-                     sdbusRule::path("/org/open_power/control/host0") +
-                     sdbusRule::interface("org.open_power.Control.Host") +
-                     sdbusRule::argN(0, Control::convertForMessage(
-                             Control::Host::Command::OCCReset)),
-                     std::bind(std::mem_fn(&Status::hostControlEvent),
-                            this, std::placeholders::_1))
+               manager, *this,
+               std::bind(std::mem_fn(&Status::deviceErrorHandler), this,
+                         std::placeholders::_1)),
+        hostControlSignal(
+            bus,
+            sdbusRule::type::signal() + sdbusRule::member("CommandComplete") +
+                sdbusRule::path("/org/open_power/control/host0") +
+                sdbusRule::interface("org.open_power.Control.Host") +
+                sdbusRule::argN(0, Control::convertForMessage(
+                                       Control::Host::Command::OCCReset)),
+            std::bind(std::mem_fn(&Status::hostControlEvent), this,
+                      std::placeholders::_1))
+    {
+        // Check to see if we have OCC already bound.  If so, just set it
+        if (device.bound())
         {
-            // Check to see if we have OCC already bound.  If so, just set it
-            if (device.bound())
-            {
-                this->occActive(true);
-            }
-
-            // Announce that we are ready
-            this->emit_object_added();
+            this->occActive(true);
         }
 
-        /** @brief Since we are overriding the setter-occActive but not the
-         *         getter-occActive, we need to have this using in order to
-         *         allow passthrough usage of the getter-occActive
-         */
-        using Base::Status::occActive;
+        // Announce that we are ready
+        this->emit_object_added();
+    }
 
-        /** @brief SET OccActive to True or False
-         *
-         *  @param[in] value - Intended value
-         *
-         *  @return          - Updated value of the property
-         */
-        bool occActive(bool value) override;
+    /** @brief Since we are overriding the setter-occActive but not the
+     *         getter-occActive, we need to have this using in order to
+     *         allow passthrough usage of the getter-occActive
+     */
+    using Base::Status::occActive;
 
-        /** @brief Starts OCC error detection */
-        inline void addErrorWatch()
-        {
-            return device.addErrorWatch();
-        }
+    /** @brief SET OccActive to True or False
+     *
+     *  @param[in] value - Intended value
+     *
+     *  @return          - Updated value of the property
+     */
+    bool occActive(bool value) override;
 
-        /** @brief Stops OCC error detection */
-        inline void removeErrorWatch()
-        {
-            return device.removeErrorWatch();
-        }
+    /** @brief Starts OCC error detection */
+    inline void addErrorWatch()
+    {
+        return device.addErrorWatch();
+    }
 
-        /** @brief Starts to watch how many OCCs are present on the master */
-        inline void addPresenceWatchMaster()
-        {
-            return device.addPresenceWatchMaster();
-        }
+    /** @brief Stops OCC error detection */
+    inline void removeErrorWatch()
+    {
+        return device.removeErrorWatch();
+    }
 
-    private:
+    /** @brief Starts to watch how many OCCs are present on the master */
+    inline void addPresenceWatchMaster()
+    {
+        return device.addPresenceWatchMaster();
+    }
 
-        /** @brief sdbus handle */
-        sdbusplus::bus::bus& bus;
+  private:
+    /** @brief sdbus handle */
+    sdbusplus::bus::bus& bus;
 
-        /** @brief OCC dbus object path */
-        std::string path;
+    /** @brief OCC dbus object path */
+    std::string path;
 
-        /** @brief Callback handler to be invoked during property change.
-         *         This is a handler in Manager class
-         */
-        std::function<void(bool)> callBack;
+    /** @brief Callback handler to be invoked during property change.
+     *         This is a handler in Manager class
+     */
+    std::function<void(bool)> callBack;
 
-        /** @brief OCC instance number. Ex, 0,1, etc */
-        int instance;
+    /** @brief OCC instance number. Ex, 0,1, etc */
+    int instance;
 
-        /** @brief OCC instance to Sensor ID mapping */
-        static const std::map<instanceID, sensorID> sensorMap;
+    /** @brief OCC instance to Sensor ID mapping */
+    static const std::map<instanceID, sensorID> sensorMap;
 
-        /** @brief OCC device object to do bind and unbind */
-        Device device;
+    /** @brief OCC device object to do bind and unbind */
+    Device device;
 
-        /** @brief Subscribe to host control signal
-         *
-         *  Once the OCC reset is requested, BMC sends that message to host.
-         *  If the host does not ack the message, then there would be a timeout
-         *  and we need to catch that to log an error
-         **/
-        sdbusplus::bus::match_t hostControlSignal;
+    /** @brief Subscribe to host control signal
+     *
+     *  Once the OCC reset is requested, BMC sends that message to host.
+     *  If the host does not ack the message, then there would be a timeout
+     *  and we need to catch that to log an error
+     **/
+    sdbusplus::bus::match_t hostControlSignal;
 
-        /** @brief Callback handler when device errors are detected
-         *
-         *  @param[in]  error - True if an error is reported, false otherwise
-         */
-        void deviceErrorHandler(bool error);
+    /** @brief Callback handler when device errors are detected
+     *
+     *  @param[in]  error - True if an error is reported, false otherwise
+     */
+    void deviceErrorHandler(bool error);
 
-        /** @brief Callback function on host control signals
-         *
-         *  @param[in]  msg - Data associated with subscribed signal
-         */
-        void hostControlEvent(sdbusplus::message::message& msg);
+    /** @brief Callback function on host control signals
+     *
+     *  @param[in]  msg - Data associated with subscribed signal
+     */
+    void hostControlEvent(sdbusplus::message::message& msg);
 
-        /** @brief Sends a message to host control command handler to reset OCC
-         */
-        void resetOCC();
+    /** @brief Sends a message to host control command handler to reset OCC
+     */
+    void resetOCC();
 };
 
 } // namespace occ
diff --git a/powercap.cpp b/powercap.cpp
index 4c0c330..bc4d3ca 100644
--- a/powercap.cpp
+++ b/powercap.cpp
@@ -1,5 +1,5 @@
-#include <powercap.hpp>
 #include <phosphor-logging/log.hpp>
+#include <powercap.hpp>
 
 namespace open_power
 {
@@ -8,7 +8,7 @@
 namespace powercap
 {
 
-constexpr auto PCAP_PATH    = "/xyz/openbmc_project/control/host0/power_cap";
+constexpr auto PCAP_PATH = "/xyz/openbmc_project/control/host0/power_cap";
 constexpr auto PCAP_INTERFACE = "xyz.openbmc_project.Control.Power.Cap";
 
 constexpr auto MAPPER_BUSNAME = "xyz.openbmc_project.ObjectMapper";
@@ -20,21 +20,17 @@
 
 using namespace phosphor::logging;
 
-std::string PowerCap::getService(std::string path,
-                                 std::string interface)
+std::string PowerCap::getService(std::string path, std::string interface)
 {
-    auto mapper = bus.new_method_call(MAPPER_BUSNAME,
-                                      MAPPER_PATH,
-                                      MAPPER_INTERFACE,
-                                      "GetObject");
+    auto mapper = bus.new_method_call(MAPPER_BUSNAME, MAPPER_PATH,
+                                      MAPPER_INTERFACE, "GetObject");
 
     mapper.append(path, std::vector<std::string>({interface}));
     auto mapperResponseMsg = bus.call(mapper);
 
     if (mapperResponseMsg.is_method_error())
     {
-        log<level::ERR>("Error in mapper call",
-                        entry("PATH=%s", path.c_str()),
+        log<level::ERR>("Error in mapper call", entry("PATH=%s", path.c_str()),
                         entry("INTERFACE=%s", interface.c_str()));
         // TODO openbmc/openbmc#851 - Once available, throw returned error
         throw std::runtime_error("Error in mapper call");
@@ -64,17 +60,16 @@
 
     // If pcap is not disabled then just return the pcap with the derating
     // factor applied.
-    return( (static_cast<uint64_t>(pcap) * PS_DERATING_FACTOR) /100);
+    return ((static_cast<uint64_t>(pcap) * PS_DERATING_FACTOR) / 100);
 }
 
 uint32_t PowerCap::getPcap()
 {
-    auto settingService = getService(PCAP_PATH,PCAP_INTERFACE);
+    auto settingService = getService(PCAP_PATH, PCAP_INTERFACE);
 
-    auto method = this->bus.new_method_call(settingService.c_str(),
-                                            PCAP_PATH,
-                                            "org.freedesktop.DBus.Properties",
-                                            "Get");
+    auto method =
+        this->bus.new_method_call(settingService.c_str(), PCAP_PATH,
+                                  "org.freedesktop.DBus.Properties", "Get");
 
     method.append(PCAP_INTERFACE, POWER_CAP_PROP);
     auto reply = this->bus.call(method);
@@ -92,12 +87,11 @@
 
 bool PowerCap::getPcapEnabled()
 {
-    auto settingService = getService(PCAP_PATH,PCAP_INTERFACE);
+    auto settingService = getService(PCAP_PATH, PCAP_INTERFACE);
 
-    auto method = this->bus.new_method_call(settingService.c_str(),
-                                            PCAP_PATH,
-                                            "org.freedesktop.DBus.Properties",
-                                            "Get");
+    auto method =
+        this->bus.new_method_call(settingService.c_str(), PCAP_PATH,
+                                  "org.freedesktop.DBus.Properties", "Get");
 
     method.append(PCAP_INTERFACE, POWER_CAP_ENABLE_PROP);
     auto reply = this->bus.call(method);
@@ -117,7 +111,7 @@
 {
     // Create path out to master occ hwmon entry
     std::unique_ptr<fs::path> fileName =
-            std::make_unique<fs::path>(OCC_HWMON_PATH);
+        std::make_unique<fs::path>(OCC_HWMON_PATH);
     *fileName /= occMasterName;
     *fileName /= "/hwmon/";
 
@@ -129,11 +123,11 @@
     // Append on the hwmon string where we write the user power cap
     *fileName /= "/caps1_user";
 
-    auto pcapString {std::to_string(pcapValue)};
+    auto pcapString{std::to_string(pcapValue)};
 
     log<level::INFO>("Writing pcap value to hwmon",
-                     entry("PCAP_PATH=%s",fileName->c_str()),
-                     entry("PCAP_VALUE=%s",pcapString.c_str()));
+                     entry("PCAP_PATH=%s", fileName->c_str()),
+                     entry("PCAP_VALUE=%s", pcapString.c_str()));
     // Open the hwmon file and write the power cap
     std::ofstream file(*fileName, std::ios::out);
     file << pcapString;
@@ -160,8 +154,8 @@
     auto valPropMap = msgData.find(POWER_CAP_PROP);
     if (valPropMap != msgData.end())
     {
-        pcap = sdbusplus::message::variant_ns::get<uint32_t>(
-            valPropMap->second);
+        pcap =
+            sdbusplus::message::variant_ns::get<uint32_t>(valPropMap->second);
         pcapEnabled = getPcapEnabled();
     }
     else
@@ -169,8 +163,8 @@
         valPropMap = msgData.find(POWER_CAP_ENABLE_PROP);
         if (valPropMap != msgData.end())
         {
-            pcapEnabled = sdbusplus::message::variant_ns::get<bool>(
-                valPropMap->second);
+            pcapEnabled =
+                sdbusplus::message::variant_ns::get<bool>(valPropMap->second);
             pcap = getPcap();
         }
         else
@@ -180,9 +174,8 @@
         }
     }
 
-    log<level::INFO>("Power Cap Property Change",
-                     entry("PCAP=%u",pcap),
-                     entry("PCAP_ENABLED=%u",pcapEnabled));
+    log<level::INFO>("Power Cap Property Change", entry("PCAP=%u", pcap),
+                     entry("PCAP_ENABLED=%u", pcapEnabled));
 
     // Determine desired action to write to occ
 
@@ -194,8 +187,8 @@
     return;
 }
 
-} // namespace open_power
+} // namespace powercap
 
 } // namespace occ
 
-}// namespace powercap
+} // namespace open_power
diff --git a/powercap.hpp b/powercap.hpp
index 6a5f0d1..b28be8c 100644
--- a/powercap.hpp
+++ b/powercap.hpp
@@ -1,9 +1,11 @@
 #pragma once
 
+#include "config.h"
+
+#include "occ_status.hpp"
+
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/bus/match.hpp>
-#include "occ_status.hpp"
-#include "config.h"
 
 namespace open_power
 {
@@ -24,7 +26,7 @@
 
 class PowerCap
 {
-public:
+  public:
     /** @brief PowerCap object to inform occ of changes to cap
      *
      * This object will monitor for changes to the power cap setting and
@@ -34,22 +36,19 @@
      * @param[in] bus       - The Dbus bus object
      * @param[in] occStatus - The occ status object
      */
-    PowerCap(sdbusplus::bus::bus &bus,
-             Status &occStatus,
+    PowerCap(sdbusplus::bus::bus& bus, Status& occStatus,
              const std::string& occMasterName = OCC_MASTER_NAME) :
         bus(bus),
-        occMasterName(occMasterName),
-        occStatus(occStatus),
+        occMasterName(occMasterName), occStatus(occStatus),
         pcapMatch(
-                bus,
-                sdbusRule::member("PropertiesChanged") +
+            bus,
+            sdbusRule::member("PropertiesChanged") +
                 sdbusRule::path(
                     "/xyz/openbmc_project/control/host0/power_cap") +
                 sdbusRule::argN(0, "xyz.openbmc_project.Control.Power.Cap") +
                 sdbusRule::interface("org.freedesktop.DBus.Properties"),
-                std::bind(std::mem_fn(&PowerCap::pcapChanged),
-                          this, std::placeholders::_1))
-    {};
+            std::bind(std::mem_fn(&PowerCap::pcapChanged), this,
+                      std::placeholders::_1)){};
 
     /** @brief Return the appropriate value to write to the OCC
      *
@@ -60,8 +59,7 @@
      */
     uint32_t getOccInput(uint32_t pcap, bool pcapEnabled);
 
-private:
-
+  private:
     /** @brief Callback for pcap setting changes
      *
      * Process change and inform OCC
@@ -78,8 +76,7 @@
      *
      * @return Distinct service name for input path/interface
      */
-    std::string getService(std::string path,
-                           std::string interface);
+    std::string getService(std::string path, std::string interface);
 
     /** @brief Get the power cap property
      *
@@ -106,15 +103,14 @@
     std::string occMasterName;
 
     /* @brief OCC Status object */
-    Status &occStatus;
+    Status& occStatus;
 
     /** @brief Used to subscribe to dbus pcap property changes **/
     sdbusplus::bus::match_t pcapMatch;
+};
 
- };
-
-} // namespace open_power
+} // namespace powercap
 
 } // namespace occ
 
-}// namespace powercap
+} // namespace open_power
diff --git a/test/TestI2cOcc.cpp b/test/TestI2cOcc.cpp
index bf976d7..92028fd 100644
--- a/test/TestI2cOcc.cpp
+++ b/test/TestI2cOcc.cpp
@@ -1,9 +1,10 @@
+#include "i2c_occ.hpp"
+
 #include <experimental/filesystem>
 #include <fstream>
-#include <gtest/gtest.h>
 #include <string>
 
-#include "i2c_occ.hpp"
+#include <gtest/gtest.h>
 
 #ifdef I2C_OCC
 namespace i2c_occ
@@ -33,10 +34,9 @@
 
 const auto OTHER_STRING = "SomeOtherString123"s;
 
-
 class TestUtilGetOccHwmonDevices : public testing::Test
 {
-public:
+  public:
     TestUtilGetOccHwmonDevices()
     {
         // Prepare env for test case
@@ -171,4 +171,3 @@
 } // namespace i2c_occ
 
 #endif // I2C_OCC
-
diff --git a/test/utest.cpp b/test/utest.cpp
index dc80cc2..eb9ca0b 100644
--- a/test/utest.cpp
+++ b/test/utest.cpp
@@ -1,43 +1,45 @@
-#include <gtest/gtest.h>
+#include "powercap.hpp"
+
 #include <occ_events.hpp>
 #include <occ_manager.hpp>
-#include "powercap.hpp"
+
+#include <gtest/gtest.h>
 
 using namespace open_power::occ;
 
 class VerifyOccInput : public ::testing::Test
 {
-    public:
-        VerifyOccInput() :
-            bus(sdbusplus::bus::new_default()),
-            rc(sd_event_default(&event)),
-            eventP(event),
-            manager(bus, eventP),
-            occStatus(bus, eventP, "/test/path/occ1", manager),
-            pcap(bus,occStatus)
-        {
-            EXPECT_GE(rc, 0);
-            event = nullptr;
-        }
-        ~VerifyOccInput()
-        {}
+  public:
+    VerifyOccInput() :
+        bus(sdbusplus::bus::new_default()), rc(sd_event_default(&event)),
+        eventP(event), manager(bus, eventP),
+        occStatus(bus, eventP, "/test/path/occ1", manager), pcap(bus, occStatus)
+    {
+        EXPECT_GE(rc, 0);
+        event = nullptr;
+    }
+    ~VerifyOccInput()
+    {
+    }
 
-        sdbusplus::bus::bus bus;
-        sd_event* event;
-        int rc;
-        open_power::occ::EventPtr eventP;
+    sdbusplus::bus::bus bus;
+    sd_event* event;
+    int rc;
+    open_power::occ::EventPtr eventP;
 
-        Manager manager;
-        Status occStatus;
-        powercap::PowerCap pcap;
+    Manager manager;
+    Status occStatus;
+    powercap::PowerCap pcap;
 };
 
-TEST_F(VerifyOccInput, PcapDisabled) {
-    uint32_t occInput = pcap.getOccInput(100,false);
+TEST_F(VerifyOccInput, PcapDisabled)
+{
+    uint32_t occInput = pcap.getOccInput(100, false);
     EXPECT_EQ(occInput, 0);
 }
 
-TEST_F(VerifyOccInput, PcapEnabled) {
-    uint32_t occInput = pcap.getOccInput(100,true);
+TEST_F(VerifyOccInput, PcapEnabled)
+{
+    uint32_t occInput = pcap.getOccInput(100, true);
     EXPECT_EQ(occInput, 90);
 }
diff --git a/utils.cpp b/utils.cpp
index d9a98ee..c68913d 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -1,6 +1,6 @@
-#include <string>
-#include <sdbusplus/bus.hpp>
 #include <phosphor-logging/elog-errors.hpp>
+#include <sdbusplus/bus.hpp>
+#include <string>
 #include <xyz/openbmc_project/Common/error.hpp>
 namespace open_power
 {
@@ -9,17 +9,16 @@
 
 // For throwing exceptions
 using namespace phosphor::logging;
-using InternalFailure = sdbusplus::xyz::openbmc_project::Common::
-                            Error::InternalFailure;
+using InternalFailure =
+    sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
 
-std::string getService(sdbusplus::bus::bus& bus,
-                       const std::string& path,
+std::string getService(sdbusplus::bus::bus& bus, const std::string& path,
                        const std::string& intf)
 {
-    auto mapperCall = bus.new_method_call("xyz.openbmc_project.ObjectMapper",
-                                          "/xyz/openbmc_project/object_mapper",
-                                          "xyz.openbmc_project.ObjectMapper",
-                                          "GetObject");
+    auto mapperCall =
+        bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+                            "/xyz/openbmc_project/object_mapper",
+                            "xyz.openbmc_project.ObjectMapper", "GetObject");
 
     mapperCall.append(path);
     mapperCall.append(std::vector<std::string>({intf}));
@@ -29,8 +28,8 @@
     if (mapperResponseMsg.is_method_error())
     {
         log<level::ERR>("ERROR in getting service",
-                entry("PATH=%s",path.c_str()),
-                entry("INTERFACE=%s",intf.c_str()));
+                        entry("PATH=%s", path.c_str()),
+                        entry("INTERFACE=%s", intf.c_str()));
 
         elog<InternalFailure>();
     }
@@ -41,8 +40,8 @@
     if (mapperResponse.begin() == mapperResponse.end())
     {
         log<level::ERR>("ERROR reading mapper response",
-                entry("PATH=%s",path.c_str()),
-                entry("INTERFACE=%s",intf.c_str()));
+                        entry("PATH=%s", path.c_str()),
+                        entry("INTERFACE=%s", intf.c_str()));
 
         elog<InternalFailure>();
     }
diff --git a/utils.hpp b/utils.hpp
index 33088df..7c8b871 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -16,8 +16,7 @@
  * @return            Service name
  * @error             InternalFailure exception thrown
  */
-std::string getService(sdbusplus::bus::bus& bus,
-                       const std::string& path,
+std::string getService(sdbusplus::bus::bus& bus, const std::string& path,
                        const std::string& intf);
 } // namespace occ
 } // namespace open_power
