diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -87,7 +87,7 @@
 IndentWrappedFunctionNames: true
 InsertNewlineAtEOF: true
 KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
 LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
@@ -98,13 +98,14 @@
 ObjCSpaceBeforeProtocolList: true
 PackConstructorInitializers: BinPack
 PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
 PenaltyBreakComment: 300
 PenaltyBreakFirstLessLess: 120
 PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
 PointerAlignment: Left
 QualifierAlignment: Left
 ReferenceAlignment: Left
diff --git a/occ_command.cpp b/occ_command.cpp
index e2ec8a7..5ab5e12 100644
--- a/occ_command.cpp
+++ b/occ_command.cpp
@@ -209,8 +209,8 @@
 
             // Validate checksum (last 2 bytes of response)
             const unsigned int csumIndex = response.size() - 2;
-            const uint32_t rspChecksum = (response[csumIndex] << 8) +
-                                         response[csumIndex + 1];
+            const uint32_t rspChecksum =
+                (response[csumIndex] << 8) + response[csumIndex + 1];
             uint32_t calcChecksum = 0;
             for (unsigned int index = 0; index < csumIndex; ++index)
             {
diff --git a/occ_dbus.cpp b/occ_dbus.cpp
index fb2ff27..62ae23f 100644
--- a/occ_dbus.cpp
+++ b/occ_dbus.cpp
@@ -241,8 +241,8 @@
 
 void OccDBusSensors::setDvfsTemp(const std::string& path, double value)
 {
-    dvfsTemps[path] = std::make_unique<SensorIntf>(utils::getBus(),
-                                                   path.c_str());
+    dvfsTemps[path] =
+        std::make_unique<SensorIntf>(utils::getBus(), path.c_str());
     dvfsTemps[path]->value(value);
 }
 
diff --git a/occ_device.hpp b/occ_device.hpp
index b853412..0f7aaaf 100644
--- a/occ_device.hpp
+++ b/occ_device.hpp
@@ -51,8 +51,8 @@
            std::unique_ptr<powermode::PowerMode>& powerModeRef,
 #endif
            unsigned int instance = 0) :
-        devPath(path),
-        instance(instance), statusObject(status), managerObject(manager),
+        devPath(path), instance(instance), statusObject(status),
+        managerObject(manager),
         error(event, path / "occ_error",
               std::bind(std::mem_fn(&Device::errorCallback), this,
                         std::placeholders::_1)),
diff --git a/occ_errors.hpp b/occ_errors.hpp
index 5d2db87..8cd97af 100644
--- a/occ_errors.hpp
+++ b/occ_errors.hpp
@@ -41,8 +41,7 @@
      */
     Error(EventPtr& event, const fs::path& file,
           std::function<void(int)> callBack = nullptr) :
-        event(event),
-        file(file), callBack(callBack)
+        event(event), file(file), callBack(callBack)
     {
         // Nothing to do here.
     }
@@ -76,8 +75,7 @@
          */
         Descriptor(const char* path, int err = 0,
                    const char* callout = nullptr) :
-            log(true),
-            err(err), callout(callout), path(path)
+            log(true), err(err), callout(callout), path(path)
         {}
 
         bool log;
diff --git a/occ_ffdc.cpp b/occ_ffdc.cpp
index 131913b..da3df79 100644
--- a/occ_ffdc.cpp
+++ b/occ_ffdc.cpp
@@ -57,8 +57,8 @@
     }
 
     // Add journal traces to PEL FFDC
-    auto occJournalFile = addJournalEntries(pelFFDCInfo,
-                                            "openpower-occ-control", 25);
+    auto occJournalFile =
+        addJournalEntries(pelFFDCInfo, "openpower-occ-control", 25);
 
     std::map<std::string, std::string> additionalData;
     additionalData.emplace("SRC6", std::to_string(src6));
@@ -69,11 +69,11 @@
 
     try
     {
-        std::string service = utils::getService(loggingObjectPath,
-                                                opLoggingInterface);
-        auto method = bus.new_method_call(service.c_str(), loggingObjectPath,
-                                          opLoggingInterface,
-                                          "CreatePELWithFFDCFiles");
+        std::string service =
+            utils::getService(loggingObjectPath, opLoggingInterface);
+        auto method =
+            bus.new_method_call(service.c_str(), loggingObjectPath,
+                                opLoggingInterface, "CreatePELWithFFDCFiles");
 
         // Set level to Notice (Informational). Error should trigger an OCC
         // reset and if it does not recover, HTMGT/HBRT will create an
@@ -128,14 +128,14 @@
     {
         FFDCFiles ffdc;
         // Add journal traces to PEL FFDC
-        auto occJournalFile = addJournalEntries(ffdc, "openpower-occ-control",
-                                                25);
+        auto occJournalFile =
+            addJournalEntries(ffdc, "openpower-occ-control", 25);
 
-        std::string service = utils::getService(loggingObjectPath,
-                                                opLoggingInterface);
-        auto method = bus.new_method_call(service.c_str(), loggingObjectPath,
-                                          opLoggingInterface,
-                                          "CreatePELWithFFDCFiles");
+        std::string service =
+            utils::getService(loggingObjectPath, opLoggingInterface);
+        auto method =
+            bus.new_method_call(service.c_str(), loggingObjectPath,
+                                opLoggingInterface, "CreatePELWithFFDCFiles");
 
         // Set level to Notice (Informational). Error should trigger an OCC
         // reset and if it does not recover, HTMGT/HBRT will create an
@@ -195,8 +195,8 @@
 
     if (total > sbe_status_header_size)
     {
-        std::string templateString = fs::temp_directory_path() /
-                                     "OCC_FFDC_XXXXXX";
+        std::string templateString =
+            fs::temp_directory_path() / "OCC_FFDC_XXXXXX";
         tfd = mkostemp(templateString.data(), O_RDWR);
         if (tfd < 0)
         {
@@ -232,9 +232,8 @@
 }
 
 // Create file with the latest journal entries for specified executable
-std::unique_ptr<FFDCFile> FFDC::addJournalEntries(FFDCFiles& fileList,
-                                                  const std::string& executable,
-                                                  unsigned int lines)
+std::unique_ptr<FFDCFile> FFDC::addJournalEntries(
+    FFDCFiles& fileList, const std::string& executable, unsigned int lines)
 {
     auto journalFile = makeJsonFFDCFile(getJournalEntries(lines, executable));
     if (journalFile && journalFile->fd() != -1)
@@ -342,8 +341,8 @@
             message = getFieldValue(journal, "MESSAGE");
 
             // Build one line string containing field values
-            entries.push_back(timeStamp + " " + syslogID + "[" + pid +
-                              "]: " + message);
+            entries.push_back(
+                timeStamp + " " + syslogID + "[" + pid + "]: " + message);
 
             // Stop after number of lines was read
             if (count++ >= numLines)
diff --git a/occ_ffdc.hpp b/occ_ffdc.hpp
index 143669a..7578e4d 100644
--- a/occ_ffdc.hpp
+++ b/occ_ffdc.hpp
@@ -137,9 +137,8 @@
      *
      * @return std::unique_ptr<FFDCFile> - The file object
      */
-    static std::unique_ptr<FFDCFile>
-        addJournalEntries(FFDCFiles& fileList, const std::string& executable,
-                          unsigned int lines);
+    static std::unique_ptr<FFDCFile> addJournalEntries(
+        FFDCFiles& fileList, const std::string& executable, unsigned int lines);
 
   private:
     /** @brief OCC instance number. Ex, 0,1, etc */
diff --git a/occ_manager.cpp b/occ_manager.cpp
index eede8d1..932b052 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -379,12 +379,13 @@
 #endif
     }
 
-    passThroughObjects.emplace_back(std::make_unique<PassThrough>(path.c_str()
+    passThroughObjects.emplace_back(std::make_unique<PassThrough>(
+        path.c_str()
 #ifdef POWER10
-                                                                      ,
-                                                                  pmode
+            ,
+        pmode
 #endif
-                                                                  ));
+        ));
 }
 
 void Manager::statusCallBack(instanceID instance, bool status)
@@ -513,8 +514,8 @@
 {
     auto obj = std::find_if(statusObjects.begin(), statusObjects.end(),
                             [instance](const auto& obj) {
-        return instance == obj->getOccInstanceID();
-    });
+                                return instance == obj->getOccInstanceID();
+                            });
 
     if (obj != statusObjects.end() && (*obj)->occActive())
     {
@@ -532,8 +533,8 @@
 {
     auto obj = std::find_if(statusObjects.begin(), statusObjects.end(),
                             [instance](const auto& obj) {
-        return instance == obj->getOccInstanceID();
-    });
+                                return instance == obj->getOccInstanceID();
+                            });
 
     const bool hostRunning = open_power::occ::utils::isHostRunning();
     if (obj != statusObjects.end())
@@ -649,8 +650,8 @@
             constexpr auto interface = "xyz.openbmc_project.Dump.Create";
             constexpr auto function = "CreateDump";
 
-            std::string service = utils::getService(OP_DUMP_OBJ_PATH,
-                                                    interface);
+            std::string service =
+                utils::getService(OP_DUMP_OBJ_PATH, interface);
             auto method = bus.new_method_call(service.c_str(), OP_DUMP_OBJ_PATH,
                                               interface, function);
 
@@ -859,20 +860,20 @@
             continue;
         }
 
-        std::string sensorPath = OCC_SENSORS_ROOT +
-                                 std::string("/temperature/");
+        std::string sensorPath =
+            OCC_SENSORS_ROOT + std::string("/temperature/");
 
         std::string dvfsTempPath;
 
         if (fruTypeValue == VRMVdd)
         {
-            sensorPath.append("vrm_vdd" + std::to_string(occInstance) +
-                              "_temp");
+            sensorPath.append(
+                "vrm_vdd" + std::to_string(occInstance) + "_temp");
         }
         else if (fruTypeValue == processorIoRing)
         {
-            sensorPath.append("proc" + std::to_string(occInstance) +
-                              "_ioring_temp");
+            sensorPath.append(
+                "proc" + std::to_string(occInstance) + "_ioring_temp");
             dvfsTempPath = std::string{OCC_SENSORS_ROOT} + "/temperature/proc" +
                            std::to_string(occInstance) + "_ioring_dvfs_temp";
         }
@@ -900,8 +901,8 @@
                     continue;
                 }
 
-                sensorPath.append("dimm" + std::to_string(instanceID) +
-                                  iter->second);
+                sensorPath.append(
+                    "dimm" + std::to_string(instanceID) + iter->second);
 
                 dvfsTempPath = std::string{OCC_SENSORS_ROOT} + "/temperature/" +
                                dimmDVFSSensorName.at(fruTypeValue);
@@ -1145,8 +1146,8 @@
         dbus::OccDBusSensors::getOccDBus().setValue(
             sensorPath, tempValue * std::pow(10, -3) * std::pow(10, -3));
 
-        dbus::OccDBusSensors::getOccDBus().setOperationalStatus(sensorPath,
-                                                                true);
+        dbus::OccDBusSensors::getOccDBus().setOperationalStatus(
+            sensorPath, true);
 
         if (existingSensors.find(sensorPath) == existingSensors.end())
         {
@@ -1168,8 +1169,8 @@
             dbus::OccDBusSensors::getOccDBus().setValue(
                 sensorPath, std::numeric_limits<double>::quiet_NaN());
 
-            dbus::OccDBusSensors::getOccDBus().setOperationalStatus(sensorPath,
-                                                                    true);
+            dbus::OccDBusSensors::getOccDBus().setOperationalStatus(
+                sensorPath, true);
         }
     }
     return;
@@ -1184,8 +1185,8 @@
             dbus::OccDBusSensors::getOccDBus().setValue(
                 sensorPath, std::numeric_limits<double>::quiet_NaN());
 
-            dbus::OccDBusSensors::getOccDBus().setOperationalStatus(sensorPath,
-                                                                    false);
+            dbus::OccDBusSensors::getOccDBus().setOperationalStatus(
+                sensorPath, false);
         }
     }
     return;
@@ -1432,11 +1433,11 @@
         static constexpr auto loggingObjectPath =
             "/xyz/openbmc_project/logging";
         static constexpr auto opLoggingInterface = "org.open_power.Logging.PEL";
-        std::string service = utils::getService(loggingObjectPath,
-                                                opLoggingInterface);
-        auto method = bus.new_method_call(service.c_str(), loggingObjectPath,
-                                          opLoggingInterface,
-                                          "CreatePELWithFFDCFiles");
+        std::string service =
+            utils::getService(loggingObjectPath, opLoggingInterface);
+        auto method =
+            bus.new_method_call(service.c_str(), loggingObjectPath,
+                                opLoggingInterface, "CreatePELWithFFDCFiles");
 
         // Set level to Warning (Predictive).
         auto level =
diff --git a/occ_pass_through.cpp b/occ_pass_through.cpp
index 230152d..5588e5a 100644
--- a/occ_pass_through.cpp
+++ b/occ_pass_through.cpp
@@ -31,8 +31,7 @@
     std::unique_ptr<open_power::occ::powermode::PowerMode>& powerModeRef
 #endif
     ) :
-    Iface(utils::getBus(), path),
-    path(path),
+    Iface(utils::getBus(), path), path(path),
 #ifdef POWER10
     pmode(powerModeRef),
 #endif
diff --git a/occ_presence.hpp b/occ_presence.hpp
index ef63c89..c9ab3fc 100644
--- a/occ_presence.hpp
+++ b/occ_presence.hpp
@@ -29,8 +29,7 @@
      */
     Presence(EventPtr& event, const fs::path& file, const Manager& mgr,
              std::function<void(int)> callBack = nullptr) :
-        Error(event, file, callBack),
-        manager(mgr)
+        Error(event, file, callBack), manager(mgr)
     {
         // Nothing to do here.
     }
diff --git a/occ_status.cpp b/occ_status.cpp
index 078447c..f8a3e8d 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -360,9 +360,9 @@
         }
 
         // Build the base HWMON path
-        fs::path prefixPath = fs::path{OCC_HWMON_PATH + "occ-hwmon."s +
-                                       std::to_string(instance + 1) +
-                                       "/hwmon/"s};
+        fs::path prefixPath =
+            fs::path{OCC_HWMON_PATH + "occ-hwmon."s +
+                     std::to_string(instance + 1) + "/hwmon/"s};
 
         // Get the hwmonXX directory name
         try
diff --git a/pldm.cpp b/pldm.cpp
index b573d66..67847c8 100644
--- a/pldm.cpp
+++ b/pldm.cpp
@@ -315,10 +315,9 @@
     }
 }
 
-void Interface::fetchEffecterInfo(uint16_t stateSetId,
-                                  InstanceToEffecter& instanceToEffecterMap,
-                                  CompositeEffecterCount& effecterCount,
-                                  uint8_t& stateIdPos)
+void Interface::fetchEffecterInfo(
+    uint16_t stateSetId, InstanceToEffecter& instanceToEffecterMap,
+    CompositeEffecterCount& effecterCount, uint8_t& stateIdPos)
 {
     PdrList pdrs{};
 
@@ -390,10 +389,9 @@
     }
 }
 
-std::vector<uint8_t>
-    Interface::prepareSetEffecterReq(EffecterID effecterId,
-                                     CompositeEffecterCount effecterCount,
-                                     uint8_t stateIdPos, uint8_t stateSetValue)
+std::vector<uint8_t> Interface::prepareSetEffecterReq(
+    EffecterID effecterId, CompositeEffecterCount effecterCount,
+    uint8_t stateIdPos, uint8_t stateSetValue)
 {
     if (!getPldmInstanceId())
     {
@@ -860,8 +858,8 @@
     pldmIface->pldmInstanceID = std::nullopt;
 
     // Set pointer to autodelete
-    std::unique_ptr<uint8_t, decltype(std::free)*> responseMsgPtr{responseMsg,
-                                                                  std::free};
+    std::unique_ptr<uint8_t, decltype(std::free)*> responseMsgPtr{
+        responseMsg, std::free};
 
     auto response = reinterpret_cast<pldm_msg*>(responseMsgPtr.get());
     if (response->payload[0] != PLDM_SUCCESS)
@@ -945,8 +943,8 @@
     return 0;
 };
 
-std::vector<uint8_t> Interface::encodeGetStateSensorRequest(uint8_t instance,
-                                                            uint16_t sensorId)
+std::vector<uint8_t>
+    Interface::encodeGetStateSensorRequest(uint8_t instance, uint16_t sensorId)
 {
     if (!getPldmInstanceId())
     {
@@ -956,8 +954,8 @@
     }
 
     bitfield8_t sRearm = {0};
-    const size_t msgSize = sizeof(pldm_msg_hdr) +
-                           PLDM_GET_STATE_SENSOR_READINGS_REQ_BYTES;
+    const size_t msgSize =
+        sizeof(pldm_msg_hdr) + PLDM_GET_STATE_SENSOR_READINGS_REQ_BYTES;
     std::vector<uint8_t> request(msgSize);
 
     auto msg = reinterpret_cast<pldm_msg*>(request.data());
diff --git a/pldm.hpp b/pldm.hpp
index 1f1bad1..384ad20 100644
--- a/pldm.hpp
+++ b/pldm.hpp
@@ -63,9 +63,8 @@
         std::function<bool(open_power::occ::instanceID, bool)> callBack,
         std::function<void(open_power::occ::instanceID, bool)> sbeCallBack,
         std::function<void(bool)> safeModeCallBack, EventPtr& event) :
-        callBack(callBack),
-        sbeCallBack(sbeCallBack), safeModeCallBack(safeModeCallBack),
-        event(event),
+        callBack(callBack), sbeCallBack(sbeCallBack),
+        safeModeCallBack(safeModeCallBack), event(event),
         pldmEventSignal(
             open_power::occ::utils::getBus(),
             MatchRules::type::signal() +
@@ -135,10 +134,9 @@
      *  @return PLDM request message to be sent to host for OCC reset or SBE
      *          HRESET, empty response in the case of failure.
      */
-    std::vector<uint8_t>
-        prepareSetEffecterReq(EffecterID effecterId,
-                              CompositeEffecterCount effecterCount,
-                              uint8_t stateIdPos, uint8_t stateSetValue);
+    std::vector<uint8_t> prepareSetEffecterReq(
+        EffecterID effecterId, CompositeEffecterCount effecterCount,
+        uint8_t stateIdPos, uint8_t stateSetValue);
 
     /** @brief Send the PLDM message to reset the OCC
      *
@@ -346,8 +344,8 @@
      *
      *  @return request - The encoded PLDM messsage to be sent
      */
-    std::vector<uint8_t> encodeGetStateSensorRequest(uint8_t instance,
-                                                     uint16_t sensorId);
+    std::vector<uint8_t>
+        encodeGetStateSensorRequest(uint8_t instance, uint16_t sensorId);
 
     /** @brief setup PLDM transport for sending and receiving PLDM messages.
      *
diff --git a/powercap.cpp b/powercap.cpp
index be9f90e..a70d4e9 100644
--- a/powercap.cpp
+++ b/powercap.cpp
@@ -463,8 +463,8 @@
 
     try
     {
-        prop = utils::getProperty(PCAP_PATH, PCAP_INTERFACE,
-                                  POWER_CAP_SOFT_MIN);
+        prop =
+            utils::getProperty(PCAP_PATH, PCAP_INTERFACE, POWER_CAP_SOFT_MIN);
         softMin = std::get<uint32_t>(prop);
     }
     catch (const sdbusplus::exception_t& e)
@@ -479,8 +479,8 @@
 
     try
     {
-        prop = utils::getProperty(PCAP_PATH, PCAP_INTERFACE,
-                                  POWER_CAP_HARD_MIN);
+        prop =
+            utils::getProperty(PCAP_PATH, PCAP_INTERFACE, POWER_CAP_HARD_MIN);
         hardMin = std::get<uint32_t>(prop);
     }
     catch (const sdbusplus::exception_t& e)
diff --git a/powercap.hpp b/powercap.hpp
index 3ef09c9..45d1203 100644
--- a/powercap.hpp
+++ b/powercap.hpp
@@ -51,7 +51,7 @@
                 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::placeholders::_1)) {};
 
     /** @brief Return the appropriate value to write to the OCC (output/DC
      * power)
diff --git a/powermode.cpp b/powermode.cpp
index 3055050..776edc4 100644
--- a/powermode.cpp
+++ b/powermode.cpp
@@ -71,9 +71,9 @@
         using Mode =
             sdbusplus::xyz::openbmc_project::Control::Power::server::Mode;
         // Update power modes that will be allowed by the Redfish interface
-        ModeInterface::allowedPowerModes({Mode::PowerMode::Static,
-                                          Mode::PowerMode::MaximumPerformance,
-                                          Mode::PowerMode::PowerSaving});
+        ModeInterface::allowedPowerModes(
+            {Mode::PowerMode::Static, Mode::PowerMode::MaximumPerformance,
+             Mode::PowerMode::PowerSaving});
     }
 
     SysPwrMode currentMode;
@@ -136,8 +136,8 @@
                           .c_str());
     if (!occCmd)
     {
-        occCmd = std::make_unique<open_power::occ::OccCommand>(occInstance,
-                                                               path.c_str());
+        occCmd = std::make_unique<open_power::occ::OccCommand>(
+            occInstance, path.c_str());
     }
     masterOccSet = true;
 };
@@ -857,9 +857,9 @@
         std::string path = "/";
         std::string service =
             utils::getServiceUsingSubTree(PMODE_DEFAULT_INTERFACE, path);
-        auto method = bus.new_method_call(service.c_str(), path.c_str(),
-                                          "org.freedesktop.DBus.Properties",
-                                          "Get");
+        auto method =
+            bus.new_method_call(service.c_str(), path.c_str(),
+                                "org.freedesktop.DBus.Properties", "Get");
         method.append(PMODE_DEFAULT_INTERFACE, "PowerMode");
         auto reply = bus.call(method);
 
@@ -867,8 +867,8 @@
         reply.read(stateEntryValue);
         auto propVal = std::get<std::string>(stateEntryValue);
 
-        const std::string fullModeString = PMODE_INTERFACE + ".PowerMode."s +
-                                           propVal;
+        const std::string fullModeString =
+            PMODE_INTERFACE + ".PowerMode."s + propVal;
         defaultMode = powermode::convertStringToMode(fullModeString);
         if (!VALID_POWER_MODE_SETTING(defaultMode))
         {
@@ -914,9 +914,9 @@
         std::string path = "/";
         std::string service =
             utils::getServiceUsingSubTree(PMODE_DEFAULT_INTERFACE, path);
-        auto method = bus.new_method_call(service.c_str(), path.c_str(),
-                                          "org.freedesktop.DBus.Properties",
-                                          "GetAll");
+        auto method =
+            bus.new_method_call(service.c_str(), path.c_str(),
+                                "org.freedesktop.DBus.Properties", "GetAll");
         method.append(PMODE_DEFAULT_INTERFACE);
         auto reply = bus.call(method);
         reply.read(ipsProperties);
@@ -1035,10 +1035,10 @@
     const int open_errno = errno;
     if (fd < 0)
     {
-        log<level::ERR>(std::format("openIpsFile Error({})={} : File={}",
-                                    open_errno, strerror(open_errno),
-                                    ipsStatusFile.c_str())
-                            .c_str());
+        log<level::ERR>(
+            std::format("openIpsFile Error({})={} : File={}", open_errno,
+                        strerror(open_errno), ipsStatusFile.c_str())
+                .c_str());
 
         close(fd);
 
@@ -1200,10 +1200,10 @@
 
         // If the Retry did not get to "watching = true" we already have an
         // error log, just post trace.
-        log<level::ERR>(std::format("Retry on File seek Error({})={} : File={}",
-                                    open_errno, strerror(open_errno),
-                                    ipsStatusFile.c_str())
-                            .c_str());
+        log<level::ERR>(
+            std::format("Retry on File seek Error({})={} : File={}", open_errno,
+                        strerror(open_errno), ipsStatusFile.c_str())
+                .c_str());
 
         // NOTE: this will leave the system not reporting IPS active state to
         // Fan Controls, Until an APP reload, or IPL and we will attempt again.
@@ -1305,9 +1305,9 @@
         std::string path = "/";
         std::string service =
             utils::getServiceUsingSubTree(PMODE_DEFAULT_INTERFACE, path);
-        auto method = bus.new_method_call(service.c_str(), path.c_str(),
-                                          "org.freedesktop.DBus.Properties",
-                                          "GetAll");
+        auto method =
+            bus.new_method_call(service.c_str(), path.c_str(),
+                                "org.freedesktop.DBus.Properties", "GetAll");
         method.append(PMODE_DEFAULT_INTERFACE);
         auto reply = bus.call(method);
         reply.read(powerModeProperties);
@@ -1340,8 +1340,8 @@
         for (auto mode : modeList)
         {
             // Ensure mode is valid
-            const std::string fullModeString = PMODE_INTERFACE +
-                                               ".PowerMode."s + mode;
+            const std::string fullModeString =
+                PMODE_INTERFACE + ".PowerMode."s + mode;
             log<level::INFO>(
                 std::format("getSupportedModes(): {}", mode).c_str());
             SysPwrMode modeValue =
@@ -1385,8 +1385,8 @@
         for (auto mode : OmodeList)
         {
             // Ensure mode is valid
-            const std::string fullModeString = PMODE_INTERFACE +
-                                               ".PowerMode."s + mode;
+            const std::string fullModeString =
+                PMODE_INTERFACE + ".PowerMode."s + mode;
             SysPwrMode modeValue =
                 powermode::convertStringToMode(fullModeString);
             if (VALID_POWER_MODE_SETTING(modeValue) ||
diff --git a/powermode.hpp b/powermode.hpp
index 7133948..a9b01de 100644
--- a/powermode.hpp
+++ b/powermode.hpp
@@ -378,9 +378,9 @@
                                         SysPwrMode::MAX_FREQ};
 
     /** @brief IPS status data filename to read */
-    const fs::path ipsStatusFile = std::filesystem::path{OCC_HWMON_PATH} /
-                                   std::filesystem::path{OCC_MASTER_NAME} /
-                                   "occ_ips_status";
+    const fs::path ipsStatusFile =
+        std::filesystem::path{OCC_HWMON_PATH} /
+        std::filesystem::path{OCC_MASTER_NAME} / "occ_ips_status";
 
     /** @brief Current state of error watching */
     bool watching = false;
diff --git a/utils.cpp b/utils.cpp
index 4b85604..44abfa4 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -122,9 +122,8 @@
     }
 }
 
-std::vector<std::string>
-    getSubtreePaths(const std::vector<std::string>& interfaces,
-                    const std::string& path)
+std::vector<std::string> getSubtreePaths(
+    const std::vector<std::string>& interfaces, const std::string& path)
 {
     std::vector<std::string> paths;
 
@@ -199,9 +198,9 @@
             throw std::runtime_error("getStateValue: Failed to get service");
         }
 
-        auto method = bus.new_method_call(service.c_str(), objPath.c_str(),
-                                          "org.freedesktop.DBus.Properties",
-                                          "Get");
+        auto method =
+            bus.new_method_call(service.c_str(), objPath.c_str(),
+                                "org.freedesktop.DBus.Properties", "Get");
 
         method.append(intf, state);
 
diff --git a/utils.hpp b/utils.hpp
index eb38c03..2085bf4 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -75,9 +75,8 @@
  *
  *  @throw sdbusplus::exception_t when it fails
  */
-std::vector<std::string>
-    getSubtreePaths(const std::vector<std::string>& interfaces,
-                    const std::string& path = "/");
+std::vector<std::string> getSubtreePaths(
+    const std::vector<std::string>& interfaces, const std::string& path = "/");
 
 /**
  * @brief Get the D-Bus service and object path for an interface
