clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version.  The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I1210c7b95e65a82cc5675ada03441af6727a3930
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
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())
         {