diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100755
--- 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/include/cpu.hpp b/include/cpu.hpp
index 20ff0cf..2cdc161 100644
--- a/include/cpu.hpp
+++ b/include/cpu.hpp
@@ -289,22 +289,23 @@
 
 // Definition follow smbios spec DSP0134 3.0.0
 static const std::array<std::optional<processor::Capability>, 16>
-    characteristicsTable{std::nullopt,
-                         std::nullopt,
-                         processor::Capability::Capable64bit,
-                         processor::Capability::MultiCore,
-                         processor::Capability::HardwareThread,
-                         processor::Capability::ExecuteProtection,
-                         processor::Capability::EnhancedVirtualization,
-                         processor::Capability::PowerPerformanceControl,
-                         std::nullopt,
-                         std::nullopt,
-                         std::nullopt,
-                         std::nullopt,
-                         std::nullopt,
-                         std::nullopt,
-                         std::nullopt,
-                         std::nullopt};
+    characteristicsTable{
+        std::nullopt,
+        std::nullopt,
+        processor::Capability::Capable64bit,
+        processor::Capability::MultiCore,
+        processor::Capability::HardwareThread,
+        processor::Capability::ExecuteProtection,
+        processor::Capability::EnhancedVirtualization,
+        processor::Capability::PowerPerformanceControl,
+        std::nullopt,
+        std::nullopt,
+        std::nullopt,
+        std::nullopt,
+        std::nullopt,
+        std::nullopt,
+        std::nullopt,
+        std::nullopt};
 
 class Cpu :
     sdbusplus::server::object_t<processor, asset, location, connector, rev,
diff --git a/include/cpuinfo.hpp b/include/cpuinfo.hpp
index 39ae4d1..2788120 100644
--- a/include/cpuinfo.hpp
+++ b/include/cpuinfo.hpp
@@ -40,8 +40,8 @@
 {
     CPUInfo(const size_t cpuId, const uint8_t peciAddress,
             const uint8_t i2cBusNum, const uint8_t i2cSlaveAddress) :
-        id(cpuId),
-        peciAddr(peciAddress), i2cBus(i2cBusNum), i2cDevice(i2cSlaveAddress)
+        id(cpuId), peciAddr(peciAddress), i2cBus(i2cBusNum),
+        i2cDevice(i2cSlaveAddress)
     {}
 
     void publishUUID(sdbusplus::bus_t& bus, const std::string& uuid)
diff --git a/include/mdrv2.hpp b/include/mdrv2.hpp
index 315bdab..5834408 100644
--- a/include/mdrv2.hpp
+++ b/include/mdrv2.hpp
@@ -144,10 +144,9 @@
 
     std::vector<uint8_t> getDataInformation(uint8_t idIndex) override;
 
-    bool sendDirectoryInformation(uint8_t dirVersion, uint8_t dirIndex,
-                                  uint8_t returnedEntries,
-                                  uint8_t remainingEntries,
-                                  std::vector<uint8_t> dirEntry) override;
+    bool sendDirectoryInformation(
+        uint8_t dirVersion, uint8_t dirIndex, uint8_t returnedEntries,
+        uint8_t remainingEntries, std::vector<uint8_t> dirEntry) override;
 
     std::vector<uint8_t> getDataOffer() override;
 
diff --git a/src/cpuinfo_main.cpp b/src/cpuinfo_main.cpp
index 9860a00..6eb60e4 100644
--- a/src/cpuinfo_main.cpp
+++ b/src/cpuinfo_main.cpp
@@ -100,8 +100,8 @@
 static void createCpuUpdatedMatch(
     const std::shared_ptr<sdbusplus::asio::connection>& conn, size_t cpu);
 
-static std::optional<std::string> readSSpec(uint8_t bus, uint8_t slaveAddr,
-                                            uint8_t regAddr, size_t count)
+static std::optional<std::string>
+    readSSpec(uint8_t bus, uint8_t slaveAddr, uint8_t regAddr, size_t count)
 {
     unsigned long funcs = 0;
     std::string devPath = "/dev/i2c-" + std::to_string(bus);
@@ -193,9 +193,8 @@
  * successful and return matching data. When we have confidence that the data
  * read is correct, then set the property on D-Bus.
  */
-static void
-    tryReadSSpec(const std::shared_ptr<sdbusplus::asio::connection>& conn,
-                 size_t cpuIndex)
+static void tryReadSSpec(
+    const std::shared_ptr<sdbusplus::asio::connection>& conn, size_t cpuIndex)
 {
     static int failedReads = 0;
 
@@ -242,12 +241,12 @@
         conn->get_io_context(), std::chrono::seconds(retrySeconds));
     sspecTimer->async_wait(
         [sspecTimer, conn, cpuIndex](boost::system::error_code ec) {
-        if (ec)
-        {
-            return;
-        }
-        tryReadSSpec(conn, cpuIndex);
-    });
+            if (ec)
+            {
+                return;
+            }
+            tryReadSSpec(conn, cpuIndex);
+        });
 }
 
 /**
@@ -291,13 +290,13 @@
     createCpuUpdatedMatch(conn, cpu);
     conn->async_method_call(
         [](const boost::system::error_code ec) {
-        if (ec)
-        {
-            phosphor::logging::log<phosphor::logging::level::ERR>(
-                "Cannot set CPU property!");
-            return;
-        }
-    },
+            if (ec)
+            {
+                phosphor::logging::log<phosphor::logging::level::ERR>(
+                    "Cannot set CPU property!");
+                return;
+            }
+        },
         cpuProcessName, newProp.object.c_str(),
         "org.freedesktop.DBus.Properties", "Set", newProp.interface,
         newProp.name, std::variant<std::string>{newProp.value});
@@ -332,24 +331,26 @@
             sdbusplus::bus::match::rules::interfacesAdded() +
                 sdbusplus::bus::match::rules::argNpath(0, objectPath.c_str()),
             [conn, cpu](sdbusplus::message_t& msg) {
-        sdbusplus::message::object_path objectName;
-        boost::container::flat_map<
-            std::string, boost::container::flat_map<
-                             std::string, std::variant<std::string, uint64_t>>>
-            msgData;
+                sdbusplus::message::object_path objectName;
+                boost::container::flat_map<
+                    std::string,
+                    boost::container::flat_map<
+                        std::string, std::variant<std::string, uint64_t>>>
+                    msgData;
 
-        msg.read(objectName, msgData);
+                msg.read(objectName, msgData);
 
-        // Go through all the property changes, and retry all of them
-        // targeting this object/interface which was just added.
-        for (const CpuProperty& prop : propertiesToSet)
-        {
-            if (prop.object == objectName && msgData.contains(prop.interface))
-            {
-                setDbusProperty(conn, cpu, prop);
-            }
-        }
-    }));
+                // Go through all the property changes, and retry all of them
+                // targeting this object/interface which was just added.
+                for (const CpuProperty& prop : propertiesToSet)
+                {
+                    if (prop.object == objectName &&
+                        msgData.contains(prop.interface))
+                    {
+                        setDbusProperty(conn, cpu, prop);
+                    }
+                }
+            }));
 }
 
 #if PECI_ENABLED
@@ -390,20 +391,20 @@
 
         waitTimer->async_wait(
             [waitTimer, &io, conn, cpu](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                // operation_aborted is expected if timer is canceled
-                // before completion.
-                if (ec != boost::asio::error::operation_aborted)
+                if (ec)
                 {
-                    phosphor::logging::log<phosphor::logging::level::ERR>(
-                        "info update timer async_wait failed ",
-                        phosphor::logging::entry("EC=0x%x", ec.value()));
+                    // operation_aborted is expected if timer is canceled
+                    // before completion.
+                    if (ec != boost::asio::error::operation_aborted)
+                    {
+                        phosphor::logging::log<phosphor::logging::level::ERR>(
+                            "info update timer async_wait failed ",
+                            phosphor::logging::entry("EC=0x%x", ec.value()));
+                    }
+                    return;
                 }
-                return;
-            }
-            getPPIN(io, conn, cpu);
-        });
+                getPPIN(io, conn, cpu);
+            });
         return;
     }
 
@@ -425,9 +426,9 @@
             uint64_t cpuPPIN = 0;
             uint32_t u32PkgValue = 0;
 
-            int ret = peci_RdPkgConfig(cpuAddr, u8PPINPkgIndex,
-                                       u16PPINPkgParamLow, u8Size,
-                                       (uint8_t*)&u32PkgValue, &cc);
+            int ret =
+                peci_RdPkgConfig(cpuAddr, u8PPINPkgIndex, u16PPINPkgParamLow,
+                                 u8Size, (uint8_t*)&u32PkgValue, &cc);
             if (0 != ret)
             {
                 phosphor::logging::log<phosphor::logging::level::ERR>(
@@ -487,82 +488,83 @@
                         std::string,
                         std::variant<std::string, uint64_t, uint32_t, uint16_t,
                                      std::vector<std::string>>>& properties) {
-        const uint64_t* value = nullptr;
-        std::optional<uint8_t> peciAddress;
-        uint8_t i2cBus = defaultI2cBus;
-        std::optional<uint8_t> i2cDevice;
-        std::optional<size_t> cpu;
+            const uint64_t* value = nullptr;
+            std::optional<uint8_t> peciAddress;
+            uint8_t i2cBus = defaultI2cBus;
+            std::optional<uint8_t> i2cDevice;
+            std::optional<size_t> cpu;
 
-        if (ec)
-        {
-            std::cerr << "DBUS response error " << ec.value() << ": "
-                      << ec.message() << "\n";
-            return;
-        }
-
-        for (const auto& property : properties)
-        {
-            std::cerr << "property " << property.first << "\n";
-            if (property.first == "Address")
+            if (ec)
             {
-                value = std::get_if<uint64_t>(&property.second);
-                if (value != nullptr)
+                std::cerr << "DBUS response error " << ec.value() << ": "
+                          << ec.message() << "\n";
+                return;
+            }
+
+            for (const auto& property : properties)
+            {
+                std::cerr << "property " << property.first << "\n";
+                if (property.first == "Address")
                 {
-                    peciAddress = static_cast<uint8_t>(*value);
+                    value = std::get_if<uint64_t>(&property.second);
+                    if (value != nullptr)
+                    {
+                        peciAddress = static_cast<uint8_t>(*value);
+                    }
+                }
+                if (property.first == "CpuID")
+                {
+                    value = std::get_if<uint64_t>(&property.second);
+                    if (value != nullptr)
+                    {
+                        cpu = static_cast<size_t>(*value);
+                    }
+                }
+                if (property.first == "PiromI2cAddress")
+                {
+                    value = std::get_if<uint64_t>(&property.second);
+                    if (value != nullptr)
+                    {
+                        i2cDevice = static_cast<uint8_t>(*value);
+                    }
+                }
+                if (property.first == "PiromI2cBus")
+                {
+                    value = std::get_if<uint64_t>(&property.second);
+                    if (value != nullptr)
+                    {
+                        i2cBus = static_cast<uint8_t>(*value);
+                    }
                 }
             }
-            if (property.first == "CpuID")
+
+            if (!cpu || !peciAddress)
             {
-                value = std::get_if<uint64_t>(&property.second);
-                if (value != nullptr)
-                {
-                    cpu = static_cast<size_t>(*value);
-                }
+                return;
             }
-            if (property.first == "PiromI2cAddress")
+
+            if (!i2cDevice)
             {
-                value = std::get_if<uint64_t>(&property.second);
-                if (value != nullptr)
-                {
-                    i2cDevice = static_cast<uint8_t>(*value);
-                }
+                i2cDevice = defaultI2cSlaveAddr0 + *cpu - 1;
             }
-            if (property.first == "PiromI2cBus")
+
+            auto key = cpuInfoMap.find(*cpu);
+
+            if (key != cpuInfoMap.end())
             {
-                value = std::get_if<uint64_t>(&property.second);
-                if (value != nullptr)
-                {
-                    i2cBus = static_cast<uint8_t>(*value);
-                }
+                cpuInfoMap.erase(key);
             }
-        }
 
-        if (!cpu || !peciAddress)
-        {
-            return;
-        }
+            cpuInfoMap.emplace(*cpu,
+                               std::make_shared<CPUInfo>(*cpu, *peciAddress,
+                                                         i2cBus, *i2cDevice));
 
-        if (!i2cDevice)
-        {
-            i2cDevice = defaultI2cSlaveAddr0 + *cpu - 1;
-        }
-
-        auto key = cpuInfoMap.find(*cpu);
-
-        if (key != cpuInfoMap.end())
-        {
-            cpuInfoMap.erase(key);
-        }
-
-        cpuInfoMap.emplace(*cpu, std::make_shared<CPUInfo>(*cpu, *peciAddress,
-                                                           i2cBus, *i2cDevice));
-
-        tryReadSSpec(conn, *cpu);
+            tryReadSSpec(conn, *cpu);
 
 #if PECI_ENABLED
-        getPPIN(io, conn, *cpu);
+            getPPIN(io, conn, *cpu);
 #endif
-    },
+        },
         service, object, "org.freedesktop.DBus.Properties", "GetAll",
         interface);
 }
@@ -584,24 +586,26 @@
             "PropertiesChanged',arg0='xyz.openbmc_project."
             "Configuration.XeonCPU'",
             [&io, conn, &objServer](sdbusplus::message_t& /* msg */) {
-        std::cerr << "get cpu configuration match\n";
-        static boost::asio::steady_timer filterTimer(io);
-        filterTimer.expires_after(std::chrono::seconds(configCheckInterval));
+                std::cerr << "get cpu configuration match\n";
+                static boost::asio::steady_timer filterTimer(io);
+                filterTimer.expires_after(
+                    std::chrono::seconds(configCheckInterval));
 
-        filterTimer.async_wait(
-            [&io, conn, &objServer](const boost::system::error_code& ec) {
-            if (ec == boost::asio::error::operation_aborted)
-            {
-                return; // we're being canceled
-            }
-            else if (ec)
-            {
-                std::cerr << "Error: " << ec.message() << "\n";
-                return;
-            }
-            getCpuConfiguration(io, conn, objServer);
-        });
-    });
+                filterTimer.async_wait(
+                    [&io, conn,
+                     &objServer](const boost::system::error_code& ec) {
+                        if (ec == boost::asio::error::operation_aborted)
+                        {
+                            return; // we're being canceled
+                        }
+                        else if (ec)
+                        {
+                            std::cerr << "Error: " << ec.message() << "\n";
+                            return;
+                        }
+                        getCpuConfiguration(io, conn, objServer);
+                    });
+            });
 
     conn->async_method_call(
         [&io, conn](
@@ -610,33 +614,33 @@
                 std::string,
                 std::vector<std::pair<std::string, std::vector<std::string>>>>>&
                 subtree) {
-        if constexpr (debug)
-            std::cerr << "async_method_call callback\n";
+            if constexpr (debug)
+                std::cerr << "async_method_call callback\n";
 
-        if (ec)
-        {
-            std::cerr << "error with async_method_call\n";
-            return;
-        }
-        if (subtree.empty())
-        {
-            // No config data yet, so wait for the match
-            return;
-        }
-
-        for (const auto& object : subtree)
-        {
-            for (const auto& service : object.second)
+            if (ec)
             {
-                getCpuAddress(io, conn, service.first, object.first,
-                              "xyz.openbmc_project.Configuration.XeonCPU");
+                std::cerr << "error with async_method_call\n";
+                return;
             }
-        }
-        if constexpr (debug)
-            std::cerr << "getCpuConfiguration callback complete\n";
+            if (subtree.empty())
+            {
+                // No config data yet, so wait for the match
+                return;
+            }
 
-        return;
-    },
+            for (const auto& object : subtree)
+            {
+                for (const auto& service : object.second)
+                {
+                    getCpuAddress(io, conn, service.first, object.first,
+                                  "xyz.openbmc_project.Configuration.XeonCPU");
+                }
+            }
+            if constexpr (debug)
+                std::cerr << "getCpuConfiguration callback complete\n";
+
+            return;
+        },
         "xyz.openbmc_project.ObjectMapper",
         "/xyz/openbmc_project/object_mapper",
         "xyz.openbmc_project.ObjectMapper", "GetSubTree",
diff --git a/src/cpuinfo_utils.cpp b/src/cpuinfo_utils.cpp
index 82277ab..005bc86 100644
--- a/src/cpuinfo_utils.cpp
+++ b/src/cpuinfo_utils.cpp
@@ -174,14 +174,14 @@
         *dbusConn, service, object, interface, propertyName,
         [handler, propertyName = std::string(propertyName)](
             boost::system::error_code ec, const PropertyType& newValue) {
-        if (ec)
-        {
-            std::cerr << "Failed to read property " << propertyName << ": "
-                      << ec << "\n";
-            return;
-        }
-        handler(newValue);
-    });
+            if (ec)
+            {
+                std::cerr << "Failed to read property " << propertyName << ": "
+                          << ec << "\n";
+                return;
+            }
+            handler(newValue);
+        });
 
     using ChangedPropertiesType =
         std::vector<std::pair<std::string, InterfaceVariant>>;
@@ -218,13 +218,13 @@
         sdbusplus::bus::match::rules::sender(service) +
             sdbusplus::bus::match::rules::propertiesChanged(object, interface),
         [commonPropHandler](sdbusplus::message_t& reply) {
-        ChangedPropertiesType changedProps;
-        // ignore first param (interface name), it has to be correct
-        reply.read(std::string(), changedProps);
+            ChangedPropertiesType changedProps;
+            // ignore first param (interface name), it has to be correct
+            reply.read(std::string(), changedProps);
 
-        DEBUG_PRINT << "PropertiesChanged handled\n";
-        commonPropHandler(changedProps);
-    });
+            DEBUG_PRINT << "PropertiesChanged handled\n";
+            commonPropHandler(changedProps);
+        });
 
     // Set up a match for the InterfacesAdded signal from the service's
     // ObjectManager. This is useful in the case where the object is not added
@@ -236,28 +236,29 @@
             sdbusplus::bus::match::rules::interfacesAdded(),
         [object = std::string(object), interface = std::string(interface),
          commonPropHandler](sdbusplus::message_t& reply) {
-        sdbusplus::message::object_path changedObject;
-        reply.read(changedObject);
-        if (changedObject != object)
-        {
-            return;
-        }
-
-        std::vector<std::pair<std::string, ChangedPropertiesType>>
-            changedInterfaces;
-        reply.read(changedInterfaces);
-
-        for (const auto& [changedInterface, changedProps] : changedInterfaces)
-        {
-            if (changedInterface != interface)
+            sdbusplus::message::object_path changedObject;
+            reply.read(changedObject);
+            if (changedObject != object)
             {
-                continue;
+                return;
             }
 
-            DEBUG_PRINT << "InterfacesAdded handled\n";
-            commonPropHandler(changedProps);
-        }
-    });
+            std::vector<std::pair<std::string, ChangedPropertiesType>>
+                changedInterfaces;
+            reply.read(changedInterfaces);
+
+            for (const auto& [changedInterface, changedProps] :
+                 changedInterfaces)
+            {
+                if (changedInterface != interface)
+                {
+                    continue;
+                }
+
+                DEBUG_PRINT << "InterfacesAdded handled\n";
+                commonPropHandler(changedProps);
+            }
+        });
 
     if (propertiesChangedMatch != nullptr)
     {
diff --git a/src/dimm.cpp b/src/dimm.cpp
index 14a4984..b667179 100644
--- a/src/dimm.cpp
+++ b/src/dimm.cpp
@@ -194,10 +194,10 @@
                              const uint8_t deviceLocatorPositionNum,
                              const uint8_t structLen, uint8_t* dataIn)
 {
-    std::string deviceLocator = positionToString(deviceLocatorPositionNum,
-                                                 structLen, dataIn);
-    std::string bankLocator = positionToString(bankLocatorPositionNum,
-                                               structLen, dataIn);
+    std::string deviceLocator =
+        positionToString(deviceLocatorPositionNum, structLen, dataIn);
+    std::string bankLocator =
+        positionToString(bankLocatorPositionNum, structLen, dataIn);
 
     std::string result;
     if (bankLocator.empty() || onlyDimmLocationCode)
diff --git a/src/mdrv2.cpp b/src/mdrv2.cpp
index 6886c8f..d65fd12 100644
--- a/src/mdrv2.cpp
+++ b/src/mdrv2.cpp
@@ -59,8 +59,8 @@
     }
     else
     {
-        responseDir.push_back(smbiosDir.dirEntries - dirIndex -
-                              returnedEntries);
+        responseDir.push_back(
+            smbiosDir.dirEntries - dirIndex - returnedEntries);
     }
     for (uint8_t index = dirIndex; index < smbiosDir.dirEntries; index++)
     {
@@ -254,10 +254,9 @@
     return true;
 }
 
-bool MDRV2::sendDirectoryInformation(uint8_t dirVersion, uint8_t dirIndex,
-                                     uint8_t returnedEntries,
-                                     uint8_t remainingEntries,
-                                     std::vector<uint8_t> dirEntry)
+bool MDRV2::sendDirectoryInformation(
+    uint8_t dirVersion, uint8_t dirIndex, uint8_t returnedEntries,
+    uint8_t remainingEntries, std::vector<uint8_t> dirEntry)
 {
     bool terminate = false;
     if ((dirIndex >= maxDirEntries) || (returnedEntries < 1))
@@ -469,38 +468,39 @@
                 sdbusplus::bus::match::rules::interfacesAdded() +
                     sdbusplus::bus::match::rules::argNpath(0, matchParentPath),
                 [this, requireExactMatch](sdbusplus::message_t& msg) {
-                sdbusplus::message::object_path objectName;
-                boost::container::flat_map<
-                    std::string,
+                    sdbusplus::message::object_path objectName;
                     boost::container::flat_map<
-                        std::string, std::variant<std::string, uint64_t>>>
-                    msgData;
-                msg.read(objectName, msgData);
-                bool gotMatch = false;
+                        std::string,
+                        boost::container::flat_map<
+                            std::string, std::variant<std::string, uint64_t>>>
+                        msgData;
+                    msg.read(objectName, msgData);
+                    bool gotMatch = false;
 
-                if (msgData.contains(systemInterface))
-                {
-                    lg2::info("Successful match on system interface");
-                    gotMatch = true;
-                }
+                    if (msgData.contains(systemInterface))
+                    {
+                        lg2::info("Successful match on system interface");
+                        gotMatch = true;
+                    }
 
-                // If customized, also accept Board as anchor, not just System
-                if (requireExactMatch && msgData.contains(boardInterface))
-                {
-                    lg2::info("Successful match on board interface");
-                    gotMatch = true;
-                }
+                    // If customized, also accept Board as anchor, not just
+                    // System
+                    if (requireExactMatch && msgData.contains(boardInterface))
+                    {
+                        lg2::info("Successful match on board interface");
+                        gotMatch = true;
+                    }
 
-                if (gotMatch)
-                {
-                    // There is a race condition here: our desired interface
-                    // has just been created, triggering the D-Bus callback,
-                    // but Object Mapper has not been told of it yet. The
-                    // mapper must also add it. Stall for time, so it can.
-                    sleep(2);
-                    systemInfoUpdate();
-                }
-            });
+                    if (gotMatch)
+                    {
+                        // There is a race condition here: our desired interface
+                        // has just been created, triggering the D-Bus callback,
+                        // but Object Mapper has not been told of it yet. The
+                        // mapper must also add it. Stall for time, so it can.
+                        sleep(2);
+                        systemInfoUpdate();
+                    }
+                });
         }
     }
     else
@@ -538,8 +538,8 @@
 
     for (unsigned int index = 0; index < *num; index++)
     {
-        std::string path = smbiosInventoryPath + cpuSuffix +
-                           std::to_string(index);
+        std::string path =
+            smbiosInventoryPath + cpuSuffix + std::to_string(index);
         if (index + 1 > cpus.size())
         {
             cpus.emplace_back(std::make_unique<phosphor::smbios::Cpu>(
@@ -571,8 +571,8 @@
 
     for (unsigned int index = 0; index < *num; index++)
     {
-        std::string path = smbiosInventoryPath + dimmSuffix +
-                           std::to_string(index);
+        std::string path =
+            smbiosInventoryPath + dimmSuffix + std::to_string(index);
         if (index + 1 > dimms.size())
         {
             dimms.emplace_back(std::make_unique<phosphor::smbios::Dimm>(
@@ -604,8 +604,8 @@
 
     for (unsigned int index = 0; index < *num; index++)
     {
-        std::string path = smbiosInventoryPath + pcieSuffix +
-                           std::to_string(index);
+        std::string path =
+            smbiosInventoryPath + pcieSuffix + std::to_string(index);
         if (index + 1 > pcies.size())
         {
             pcies.emplace_back(std::make_unique<phosphor::smbios::Pcie>(
@@ -794,12 +794,12 @@
     lg2::info("SMBIOS VERSION - {MAJOR}.{MINOR}", "MAJOR", foundMajorVersion,
               "MINOR", foundMinorVersion);
 
-    auto itr = std::find_if(std::begin(supportedSMBIOSVersions),
-                            std::end(supportedSMBIOSVersions),
-                            [&](SMBIOSVersion versionItr) {
-        return versionItr.majorVersion == foundMajorVersion &&
-               versionItr.minorVersion == foundMinorVersion;
-    });
+    auto itr = std::find_if(
+        std::begin(supportedSMBIOSVersions), std::end(supportedSMBIOSVersions),
+        [&](SMBIOSVersion versionItr) {
+            return versionItr.majorVersion == foundMajorVersion &&
+                   versionItr.minorVersion == foundMinorVersion;
+        });
     if (itr == std::end(supportedSMBIOSVersions))
     {
         return false;
@@ -836,8 +836,8 @@
     return true;
 }
 
-std::vector<uint32_t> MDRV2::synchronizeDirectoryCommonData(uint8_t idIndex,
-                                                            uint32_t size)
+std::vector<uint32_t>
+    MDRV2::synchronizeDirectoryCommonData(uint8_t idIndex, uint32_t size)
 {
     std::chrono::microseconds usec(
         defaultTimeout); // default lock time out is 2s
@@ -875,8 +875,8 @@
 
         do
         {
-            dataIn = getSMBIOSTypePtr(dataIn, memoryDeviceType,
-                                      sizeof(MemoryInfo));
+            dataIn =
+                getSMBIOSTypePtr(dataIn, memoryDeviceType, sizeof(MemoryInfo));
             if (dataIn == nullptr)
             {
                 break;
diff --git a/src/smbios-ipmi-blobs/handler.cpp b/src/smbios-ipmi-blobs/handler.cpp
index 28d3a00..b30a99a 100644
--- a/src/smbios-ipmi-blobs/handler.cpp
+++ b/src/smbios-ipmi-blobs/handler.cpp
@@ -113,9 +113,8 @@
     return true;
 }
 
-std::vector<uint8_t> SmbiosBlobHandler::read(uint16_t /* session */,
-                                             uint32_t /* offset */,
-                                             uint32_t /* requestedSize */)
+std::vector<uint8_t> SmbiosBlobHandler::read(
+    uint16_t /* session */, uint32_t /* offset */, uint32_t /* requestedSize */)
 {
     /* SMBIOS blob handler does not support read. */
     return std::vector<uint8_t>();
diff --git a/src/speed_select.cpp b/src/speed_select.cpp
index b4f4890..8d4db67 100644
--- a/src/speed_select.cpp
+++ b/src/speed_select.cpp
@@ -424,8 +424,8 @@
             continue;
         }
 
-        std::unique_ptr<SSTInterface> sst = getInstance(i, cpuModel,
-                                                        wakeAllowed);
+        std::unique_ptr<SSTInterface> sst =
+            getInstance(i, cpuModel, wakeAllowed);
 
         if (!sst)
         {
diff --git a/src/sst_mailbox.cpp b/src/sst_mailbox.cpp
index 00bdc9d..e574b96 100644
--- a/src/sst_mailbox.cpp
+++ b/src/sst_mailbox.cpp
@@ -81,9 +81,9 @@
     void setWakeOnPECI(bool enable)
     {
         uint8_t completionCode;
-        EPECIStatus libStatus = peci_WrPkgConfig(peciAddress, 5, enable ? 1 : 0,
-                                                 0, sizeof(uint32_t),
-                                                 &completionCode);
+        EPECIStatus libStatus =
+            peci_WrPkgConfig(peciAddress, 5, enable ? 1 : 0, 0,
+                             sizeof(uint32_t), &completionCode);
         if (!checkPECIStatus(libStatus, completionCode))
         {
             throw PECIError("Failed to set Wake-On-PECI mode bit");
@@ -279,8 +279,8 @@
     {
         DEBUG_PRINT << "Running OS Mailbox command "
                     << static_cast<int>(subcommand) << '\n';
-        PECIManager::MailboxStatus* callStatus = errorPolicy == Throw ? nullptr
-                                                                      : &status;
+        PECIManager::MailboxStatus* callStatus =
+            errorPolicy == Throw ? nullptr : &status;
         uint32_t param = (static_cast<uint32_t>(param4) << 24) |
                          (static_cast<uint32_t>(param3) << 16) |
                          (static_cast<uint32_t>(param2) << 8) | param1;
@@ -530,12 +530,12 @@
     std::vector<unsigned int>
         bfHighPriorityCoreList(unsigned int level) override
     {
-        uint64_t coreMaskLo = PbfGetCoreMaskInfo(pm,
-                                                 static_cast<uint8_t>(level), 0)
-                                  .p1HiCoreMask();
-        uint64_t coreMaskHi = PbfGetCoreMaskInfo(pm,
-                                                 static_cast<uint8_t>(level), 1)
-                                  .p1HiCoreMask();
+        uint64_t coreMaskLo =
+            PbfGetCoreMaskInfo(pm, static_cast<uint8_t>(level), 0)
+                .p1HiCoreMask();
+        uint64_t coreMaskHi =
+            PbfGetCoreMaskInfo(pm, static_cast<uint8_t>(level), 1)
+                .p1HiCoreMask();
         std::bitset<64> hiFreqCoreList = (coreMaskHi << 32) | coreMaskLo;
         return convertMaskToList(hiFreqCoreList);
     }
diff --git a/src/system.cpp b/src/system.cpp
index a838577..7a37263 100644
--- a/src/system.cpp
+++ b/src/system.cpp
@@ -73,10 +73,10 @@
                               const std::string& objectPath,
                               const std::string& interface)
 {
-    auto method = bus.new_method_call("xyz.openbmc_project.ObjectMapper",
-                                      "/xyz/openbmc_project/object_mapper",
-                                      "xyz.openbmc_project.ObjectMapper",
-                                      "GetObject");
+    auto method =
+        bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+                            "/xyz/openbmc_project/object_mapper",
+                            "xyz.openbmc_project.ObjectMapper", "GetObject");
 
     method.append(objectPath);
     method.append(std::vector<std::string>({interface}));
@@ -128,8 +128,8 @@
     if (dataIn != nullptr)
     {
         auto biosInfo = reinterpret_cast<struct BIOSInfo*>(dataIn);
-        std::string tempS = positionToString(biosInfo->biosVersion,
-                                             biosInfo->length, dataIn);
+        std::string tempS =
+            positionToString(biosInfo->biosVersion, biosInfo->length, dataIn);
         if (std::find_if(tempS.begin(), tempS.end(),
                          [](char ch) { return !isprint(ch); }) != tempS.end())
         {
