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: I362352dcb341658501899267c2ff3ad044ed5912
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
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/subprojects/bare-metal-host-monitor/host_gpio_monitor.cpp b/subprojects/bare-metal-host-monitor/host_gpio_monitor.cpp
index 36a0ec3..0c9f697 100644
--- a/subprojects/bare-metal-host-monitor/host_gpio_monitor.cpp
+++ b/subprojects/bare-metal-host-monitor/host_gpio_monitor.cpp
@@ -42,24 +42,25 @@
         OperatingSystemStatusInterface, OperatingSystemStateProperty,
         [&, state, action](const boost::system::error_code& ec,
                            const std::string& postCompleteState) {
-        if (ec)
-        {
-            lg2::error("Error when checking Post Complete GPIO state");
-            return;
-        }
+            if (ec)
+            {
+                lg2::error("Error when checking Post Complete GPIO state");
+                return;
+            }
 
-        lg2::info("Post Complete state is {STATE}", "STATE", postCompleteState);
+            lg2::info("Post Complete state is {STATE}", "STATE",
+                      postCompleteState);
 
-        /*
-         * If state is Standby, enable the bare-metal-active systemd
-         * target.
-         * If state is Inactive, no-op cause IPMI is enabled by default.
-         */
-        if (postCompleteState == state)
-        {
-            setUnitStatus(bus, action);
-        }
-    });
+            /*
+             * If state is Standby, enable the bare-metal-active systemd
+             * target.
+             * If state is Inactive, no-op cause IPMI is enabled by default.
+             */
+            if (postCompleteState == state)
+            {
+                setUnitStatus(bus, action);
+            }
+        });
 }
 
 /* This only gets called once on startup. */
@@ -96,39 +97,40 @@
                 "/xyz/openbmc_project/state/os',arg0namespace='{}'",
                 OperatingSystemStatusInterface),
             [&](sdbusplus::message_t& message) {
-            if (message.is_method_error())
-            {
-                lg2::error("eventHandler callback method error");
-                return;
-            }
-
-            /*
-             * This implicitly cancels the timer, if it's already pending.
-             * If there's a burst of events within a short period, we want
-             * to handle them all at once. So, we will wait this long for no
-             * more events to occur, before processing them.
-             */
-            filterTimer.expires_from_now(std::chrono::seconds(1));
-
-            filterTimer.async_wait([&](const boost::system::error_code& ec) {
-                if (ec == boost::asio::error::operation_aborted)
+                if (message.is_method_error())
                 {
-                    /* we were canceled */
-                    return;
-                }
-                if (ec)
-                {
-                    lg2::error("timer error");
+                    lg2::error("eventHandler callback method error");
                     return;
                 }
 
                 /*
-                 * Stop the bare metal active target if the post complete got
-                 * deasserted.
+                 * This implicitly cancels the timer, if it's already pending.
+                 * If there's a burst of events within a short period, we want
+                 * to handle them all at once. So, we will wait this long for no
+                 * more events to occur, before processing them.
                  */
-                checkPostCompleteEvent(conn);
+                filterTimer.expires_from_now(std::chrono::seconds(1));
+
+                filterTimer.async_wait(
+                    [&](const boost::system::error_code& ec) {
+                        if (ec == boost::asio::error::operation_aborted)
+                        {
+                            /* we were canceled */
+                            return;
+                        }
+                        if (ec)
+                        {
+                            lg2::error("timer error");
+                            return;
+                        }
+
+                        /*
+                         * Stop the bare metal active target if the post
+                         * complete got deasserted.
+                         */
+                        checkPostCompleteEvent(conn);
+                    });
             });
-        });
 
         io.run();
         return 0;
diff --git a/subprojects/dhcp-done/dhcp-done.cpp b/subprojects/dhcp-done/dhcp-done.cpp
index 7ea8761..bf429cb 100644
--- a/subprojects/dhcp-done/dhcp-done.cpp
+++ b/subprojects/dhcp-done/dhcp-done.cpp
@@ -29,8 +29,8 @@
 stdplus::ManagedFd createListener()
 {
     using namespace stdplus::fd;
-    auto sock = socket(SocketDomain::INet6, SocketType::Stream,
-                       SocketProto::TCP);
+    auto sock =
+        socket(SocketDomain::INet6, SocketType::Stream, SocketProto::TCP);
     setFileFlags(sock, getFileFlags(sock).set(stdplus::fd::FileFlag::NonBlock));
     sockaddr_in6 addr = {};
     addr.sin6_family = AF_INET6;
@@ -49,25 +49,26 @@
         sdeventplus::source::IO do_accept(
             event, listener.get(), EPOLLIN | EPOLLET,
             [&](sdeventplus::source::IO&, int, uint32_t) {
-            while (auto fd = stdplus::fd::accept(listener))
-            {
-                std::string data;
-                try
+                while (auto fd = stdplus::fd::accept(listener))
                 {
-                    data = fileRead(statusFile);
-                }
-                catch (const std::exception& e)
-                {
-                    // we don't want to fail the upgrade process, set the status
-                    // to ONGOING
-                    data.push_back(2);
-                    data.append("Failed to read status ");
-                    data.append(e.what());
-                }
+                    std::string data;
+                    try
+                    {
+                        data = fileRead(statusFile);
+                    }
+                    catch (const std::exception& e)
+                    {
+                        // we don't want to fail the upgrade process, set the
+                        // status to ONGOING
+                        data.push_back(2);
+                        data.append("Failed to read status ");
+                        data.append(e.what());
+                    }
 
-                stdplus::fd::sendExact(*fd, data, stdplus::fd::SendFlags(0));
-            }
-        });
+                    stdplus::fd::sendExact(*fd, data,
+                                           stdplus::fd::SendFlags(0));
+                }
+            });
         return event.loop();
     }
     catch (const std::exception& e)
diff --git a/subprojects/espi-control/npcm7xx_espi_control.cpp b/subprojects/espi-control/npcm7xx_espi_control.cpp
index 661a48c..8fcf024 100644
--- a/subprojects/espi-control/npcm7xx_espi_control.cpp
+++ b/subprojects/espi-control/npcm7xx_espi_control.cpp
@@ -86,8 +86,8 @@
 static inline volatile uint32_t* getReg(stdplus::fd::MMap& map,
                                         size_t regOffset)
 {
-    uintptr_t regPtr = reinterpret_cast<uintptr_t>(map.get().data()) +
-                       regOffset;
+    uintptr_t regPtr =
+        reinterpret_cast<uintptr_t>(map.get().data()) + regOffset;
     /* Make sure the register pointer is properly aligned. */
     assert((regPtr & ~(REGISTER_WIDTH - 1)) == regPtr);
 
@@ -112,8 +112,8 @@
     stdplus::fd::MMap pdidMap(fd, mapLength, ProtFlags().set(ProtFlag::Read),
                               MMapFlags(MMapAccess::Shared), pageBase);
 
-    volatile uint32_t* const pdidReg = getReg(pdidMap,
-                                              pageOffset + PDID_OFFSET);
+    volatile uint32_t* const pdidReg =
+        getReg(pdidMap, pageOffset + PDID_OFFSET);
 
     /*
      * Read the PDID register to make sure we're running on a Nuvoton NPCM7xx
@@ -144,8 +144,8 @@
         MMapFlags(MMapAccess::Shared), pageBase);
 
     /* Read the ESPICFG register. */
-    volatile uint32_t* const espicfgReg = getReg(espiMap,
-                                                 pageOffset + ESPICFG_OFFSET);
+    volatile uint32_t* const espicfgReg =
+        getReg(espiMap, pageOffset + ESPICFG_OFFSET);
     uint32_t espicfgValue = *espicfgReg;
 
     if (disable)
@@ -167,8 +167,8 @@
              *     channel enable bits to the core channel enable bits.
              *   - Clear the automatic ready bits in ESPIHINDP.
              */
-            uint32_t hostChannelEnableBits = espicfgValue &
-                                             ESPICFG_HOST_CHANNEL_ENABLE_MASK;
+            uint32_t hostChannelEnableBits =
+                espicfgValue & ESPICFG_HOST_CHANNEL_ENABLE_MASK;
             espicfgValue |= (hostChannelEnableBits >> 4);
             *espicfgReg = espicfgValue;
 
diff --git a/subprojects/libcr51sign/include/libcr51sign/cr51_image_descriptor.h b/subprojects/libcr51sign/include/libcr51sign/cr51_image_descriptor.h
index e52fb84..d1f28a5 100644
--- a/subprojects/libcr51sign/include/libcr51sign/cr51_image_descriptor.h
+++ b/subprojects/libcr51sign/include/libcr51sign/cr51_image_descriptor.h
@@ -393,10 +393,9 @@
                    0,
                "bad payload_security_version alignment");
 
-_Static_assert(offsetof(struct image_mauv, version_denylist) %
-                       sizeof(uint64_t) ==
-                   0,
-               "bad denylist alignment");
+_Static_assert(
+    offsetof(struct image_mauv, version_denylist) % sizeof(uint64_t) == 0,
+    "bad denylist alignment");
 
 // When A/B updates are enabled, SPS_EEPROM_LOCKDOWN_IMMUTABLE is invalid.
 enum sps_eeprom_lockdown_status
diff --git a/subprojects/libcr51sign/include/libcr51sign/libcr51sign.h b/subprojects/libcr51sign/include/libcr51sign/libcr51sign.h
index 99936b0..e1e1ace 100644
--- a/subprojects/libcr51sign/include/libcr51sign/libcr51sign.h
+++ b/subprojects/libcr51sign/include/libcr51sign/libcr51sign.h
@@ -231,10 +231,9 @@
 //
 // @return nonzero on error, zero on success
 
-enum libcr51sign_validation_failure_reason
-    libcr51sign_validate(const struct libcr51sign_ctx* ctx,
-                         struct libcr51sign_intf* intf,
-                         struct libcr51sign_validated_regions* image_regions);
+enum libcr51sign_validation_failure_reason libcr51sign_validate(
+    const struct libcr51sign_ctx* ctx, struct libcr51sign_intf* intf,
+    struct libcr51sign_validated_regions* image_regions);
 
 // Function to convert error code to string format
 // @param[in] ec - error code
@@ -249,9 +248,8 @@
 //
 // @return nonzero on error, zero on success
 
-enum libcr51sign_validation_failure_reason
-    get_hash_type_from_signature(enum signature_scheme scheme,
-                                 enum hash_type* type);
+enum libcr51sign_validation_failure_reason get_hash_type_from_signature(
+    enum signature_scheme scheme, enum hash_type* type);
 
 #ifdef __cplusplus
 } //  extern "C"
diff --git a/subprojects/libcr51sign/include/libcr51sign/libcr51sign_mauv.h b/subprojects/libcr51sign/include/libcr51sign/libcr51sign_mauv.h
index 9b0e814..78ddefa 100644
--- a/subprojects/libcr51sign/include/libcr51sign/libcr51sign_mauv.h
+++ b/subprojects/libcr51sign/include/libcr51sign/libcr51sign_mauv.h
@@ -26,10 +26,9 @@
 {
 #endif
 
-failure_reason validate_payload_image_mauv(const struct libcr51sign_ctx* ctx,
-                                           const struct libcr51sign_intf* intf,
-                                           uint32_t payload_blob_offset,
-                                           uint32_t payload_blob_size);
+failure_reason validate_payload_image_mauv(
+    const struct libcr51sign_ctx* ctx, const struct libcr51sign_intf* intf,
+    uint32_t payload_blob_offset, uint32_t payload_blob_size);
 
 #ifdef __cplusplus
 } //  extern "C"
diff --git a/subprojects/libcr51sign/src/libcr51sign.c b/subprojects/libcr51sign/src/libcr51sign.c
index e5f5cf7..6632f8e 100644
--- a/subprojects/libcr51sign/src/libcr51sign.c
+++ b/subprojects/libcr51sign/src/libcr51sign.c
@@ -32,7 +32,7 @@
 #endif
 
 // True of x is a power of two
-#define POWER_OF_TWO(x) ((x) && !((x) & ((x)-1)))
+#define POWER_OF_TWO(x) ((x) && !((x) & ((x) - 1)))
 
 // Maximum version supported. Major revisions are not backwards compatible.
 #define MAX_MAJOR_VERSION 1
@@ -451,10 +451,9 @@
 // Support validate_payload_regions_helper to remove image_regions as a required
 // input.
 
-static failure_reason
-    allocate_and_validate_payload_regions(const struct libcr51sign_ctx* ctx,
-                                          struct libcr51sign_intf* intf,
-                                          uint32_t d_offset)
+static failure_reason allocate_and_validate_payload_regions(
+    const struct libcr51sign_ctx* ctx, struct libcr51sign_intf* intf,
+    uint32_t d_offset)
 {
     struct libcr51sign_validated_regions image_regions;
     return validate_payload_regions(ctx, intf, d_offset, &image_regions);
@@ -497,8 +496,8 @@
 // Returns size of signature struct size in |size|
 // Returns nonzero on error, zero on success
 
-static failure_reason get_signature_struct_size(enum signature_scheme scheme,
-                                                uint32_t* size)
+static failure_reason
+    get_signature_struct_size(enum signature_scheme scheme, uint32_t* size)
 {
     switch (scheme)
     {
@@ -517,8 +516,8 @@
     }
 }
 
-static failure_reason get_signature_field_offset(enum signature_scheme scheme,
-                                                 uint32_t* offset)
+static failure_reason
+    get_signature_field_offset(enum signature_scheme scheme, uint32_t* offset)
 {
     switch (scheme)
     {
@@ -541,12 +540,10 @@
 //"raw_signature_offset" with "public_key" over a SHA256/SHA512 digest of
 // EEPROM area "data_offset:data_size".
 
-static failure_reason validate_signature(const struct libcr51sign_ctx* ctx,
-                                         const struct libcr51sign_intf* intf,
-                                         uint32_t data_offset,
-                                         uint32_t data_size,
-                                         enum signature_scheme scheme,
-                                         uint32_t raw_signature_offset)
+static failure_reason validate_signature(
+    const struct libcr51sign_ctx* ctx, const struct libcr51sign_intf* intf,
+    uint32_t data_offset, uint32_t data_size, enum signature_scheme scheme,
+    uint32_t raw_signature_offset)
 {
     uint8_t signature[LIBCR51SIGN_MAX_SIGNATURE_SIZE];
     uint16_t key_size;
@@ -636,11 +633,10 @@
 //@param max_size Maximum size of the flash space in bytes.
 //@param[out] payload_blob_offset  Absolute offset of BLOB data in image
 //                                 descriptor (if BLOB data is present)
-static failure_reason
-    validate_descriptor(const struct libcr51sign_ctx* ctx,
-                        const struct libcr51sign_intf* intf, uint32_t offset,
-                        uint32_t relative_offset, uint32_t max_size,
-                        uint32_t* const restrict payload_blob_offset)
+static failure_reason validate_descriptor(
+    const struct libcr51sign_ctx* ctx, const struct libcr51sign_intf* intf,
+    uint32_t offset, uint32_t relative_offset, uint32_t max_size,
+    uint32_t* const restrict payload_blob_offset)
 {
     uint32_t max_descriptor_size, signed_size, signature_scheme,
         signature_offset;
@@ -854,10 +850,9 @@
 //
 // @return nonzero on error, zero on success
 
-failure_reason
-    libcr51sign_validate(const struct libcr51sign_ctx* ctx,
-                         struct libcr51sign_intf* intf,
-                         struct libcr51sign_validated_regions* image_regions)
+failure_reason libcr51sign_validate(
+    const struct libcr51sign_ctx* ctx, struct libcr51sign_intf* intf,
+    struct libcr51sign_validated_regions* image_regions)
 {
     int rv, rv_first_desc = LIBCR51SIGN_SUCCESS;
     uint32_t descriptor_offset;
diff --git a/subprojects/libcr51sign/src/libcr51sign_mauv.c b/subprojects/libcr51sign/src/libcr51sign_mauv.c
index 996260b..653a37e 100644
--- a/subprojects/libcr51sign/src/libcr51sign_mauv.c
+++ b/subprojects/libcr51sign/src/libcr51sign_mauv.c
@@ -139,8 +139,8 @@
             case BLOB_TYPE_MAGIC_MAUV:
                 if (!found_image_mauv_data)
                 {
-                    *payload_image_mauv_data_offset = current_offset +
-                                                      sizeof(struct blob_data);
+                    *payload_image_mauv_data_offset =
+                        current_offset + sizeof(struct blob_data);
                     *payload_image_mauv_data_size =
                         payload_blob_data.blob_payload_size;
                     found_image_mauv_data = true;
@@ -447,11 +447,10 @@
 //                               image descriptor
 //
 // @return `failure_reason`
-failure_reason
-    validate_payload_image_mauv(const struct libcr51sign_ctx* const ctx,
-                                const struct libcr51sign_intf* const intf,
-                                const uint32_t payload_blob_offset,
-                                const uint32_t payload_blob_size)
+failure_reason validate_payload_image_mauv(
+    const struct libcr51sign_ctx* const ctx,
+    const struct libcr51sign_intf* const intf,
+    const uint32_t payload_blob_offset, const uint32_t payload_blob_size)
 {
     uint32_t payload_image_mauv_data_size = 0;
     struct full_mauv payload_image_mauv_data_buffer = {0};
diff --git a/subprojects/metrics-ipmi-blobs/metric.cpp b/subprojects/metrics-ipmi-blobs/metric.cpp
index 59954c4..bbff3ef 100644
--- a/subprojects/metrics-ipmi-blobs/metric.cpp
+++ b/subprojects/metrics-ipmi-blobs/metric.cpp
@@ -41,15 +41,16 @@
 {}
 
 template <typename T>
-static constexpr auto pbEncodeStr = [](pb_ostream_t* stream,
-                                       const pb_field_iter_t* field,
-                                       void* const* arg) noexcept {
-    static_assert(sizeof(*std::declval<T>().data()) == sizeof(pb_byte_t));
-    const auto& s = *reinterpret_cast<const T*>(*arg);
-    return pb_encode_tag_for_field(stream, field) &&
-           pb_encode_string(
-               stream, reinterpret_cast<const pb_byte_t*>(s.data()), s.size());
-};
+static constexpr auto pbEncodeStr =
+    [](pb_ostream_t* stream, const pb_field_iter_t* field,
+       void* const* arg) noexcept {
+        static_assert(sizeof(*std::declval<T>().data()) == sizeof(pb_byte_t));
+        const auto& s = *reinterpret_cast<const T*>(*arg);
+        return pb_encode_tag_for_field(stream, field) &&
+               pb_encode_string(stream,
+                                reinterpret_cast<const pb_byte_t*>(s.data()),
+                                s.size());
+    };
 
 template <typename T>
 static pb_callback_t pbStrEncoder(const T& t) noexcept
@@ -58,19 +59,19 @@
 }
 
 template <auto fields, typename T>
-static constexpr auto pbEncodeSubs = [](pb_ostream_t* stream,
-                                        const pb_field_iter_t* field,
-                                        void* const* arg) noexcept {
-    for (const auto& sub : *reinterpret_cast<const std::vector<T>*>(*arg))
-    {
-        if (!pb_encode_tag_for_field(stream, field) ||
-            !pb_encode_submessage(stream, fields, &sub))
+static constexpr auto pbEncodeSubs =
+    [](pb_ostream_t* stream, const pb_field_iter_t* field,
+       void* const* arg) noexcept {
+        for (const auto& sub : *reinterpret_cast<const std::vector<T>*>(*arg))
         {
-            return false;
+            if (!pb_encode_tag_for_field(stream, field) ||
+                !pb_encode_submessage(stream, fields, &sub))
+            {
+                return false;
+            }
         }
-    }
-    return true;
-};
+        return true;
+    };
 
 template <auto fields, typename T>
 static pb_callback_t pbSubsEncoder(const std::vector<T>& t)
diff --git a/subprojects/metrics-ipmi-blobs/test/util_test.cpp b/subprojects/metrics-ipmi-blobs/test/util_test.cpp
index 8a7e181..60c6063 100644
--- a/subprojects/metrics-ipmi-blobs/test/util_test.cpp
+++ b/subprojects/metrics-ipmi-blobs/test/util_test.cpp
@@ -59,10 +59,11 @@
     // ticks_per_sec is usually 100 on the BMC
     const long ticksPerSec = 100;
 
-    const std::string_view content = "2596 (dbus-broker) R 2577 2577 2577 0 -1 "
-                                     "4194560 299 0 1 0 333037 246110 0 0 20 0 "
-                                     "1 0 1545 3411968 530 4294967295 65536 "
-                                     "246512 2930531712 0 0 0 81923 4";
+    const std::string_view content =
+        "2596 (dbus-broker) R 2577 2577 2577 0 -1 "
+        "4194560 299 0 1 0 333037 246110 0 0 20 0 "
+        "1 0 1545 3411968 530 4294967295 65536 "
+        "246512 2930531712 0 0 0 81923 4";
 
     metric_blob::TcommUtimeStime t =
         metric_blob::parseTcommUtimeStimeString(content, ticksPerSec);
@@ -90,13 +91,14 @@
 
 TEST(ParseMeminfoValue, validInput)
 {
-    const std::string_view content = "MemTotal:        1027040 kB\n"
-                                     "MemFree:          868144 kB\n"
-                                     "MemAvailable:     919308 kB\n"
-                                     "Buffers:           13008 kB\n"
-                                     "Cached:            82840 kB\n"
-                                     "SwapCached:            0 kB\n"
-                                     "Active:            62076 kB\n";
+    const std::string_view content =
+        "MemTotal:        1027040 kB\n"
+        "MemFree:          868144 kB\n"
+        "MemAvailable:     919308 kB\n"
+        "Buffers:           13008 kB\n"
+        "Cached:            82840 kB\n"
+        "SwapCached:            0 kB\n"
+        "Active:            62076 kB\n";
     int value;
     EXPECT_TRUE(metric_blob::parseMeminfoValue(content, "MemTotal:", value));
     EXPECT_EQ(value, 1027040);
diff --git a/subprojects/metrics-ipmi-blobs/util.cpp b/subprojects/metrics-ipmi-blobs/util.cpp
index 0e14698..79d97db 100644
--- a/subprojects/metrics-ipmi-blobs/util.cpp
+++ b/subprojects/metrics-ipmi-blobs/util.cpp
@@ -111,8 +111,8 @@
 
 std::string getCmdLine(const int pid)
 {
-    const std::string& cmdlinePath = "/proc/" + std::to_string(pid) +
-                                     "/cmdline";
+    const std::string& cmdlinePath =
+        "/proc/" + std::to_string(pid) + "/cmdline";
 
     std::string cmdline = readFileThenGrepIntoString(cmdlinePath);
     for (size_t i = 0; i < cmdline.size(); ++i)
@@ -245,8 +245,8 @@
     uint32_t pageOffset = target & ~static_cast<uint32_t>(pageSize - 1);
     uint32_t offsetInPage = target & static_cast<uint32_t>(pageSize - 1);
 
-    void* mapBase = mmap(NULL, pageSize * 2, PROT_READ, MAP_SHARED, fd,
-                         pageOffset);
+    void* mapBase =
+        mmap(NULL, pageSize * 2, PROT_READ, MAP_SHARED, fd, pageOffset);
     if (mapBase == MAP_FAILED)
     {
         close(fd);
@@ -326,8 +326,8 @@
         return false;
     }
 
-    std::string cpuinfo = readFileThenGrepIntoString("/proc/cpuinfo",
-                                                     "Hardware");
+    std::string cpuinfo =
+        readFileThenGrepIntoString("/proc/cpuinfo", "Hardware");
     // Nuvoton NPCM7XX chip has a counter which starts from power-on.
     if (cpuinfo.find("NPCM7XX") != std::string::npos)
     {
diff --git a/subprojects/ncsid/src/ncsi_state_machine.h b/subprojects/ncsid/src/ncsi_state_machine.h
index 07a7b9c..58b202d 100644
--- a/subprojects/ncsid/src/ncsi_state_machine.h
+++ b/subprojects/ncsid/src/ncsi_state_machine.h
@@ -27,10 +27,9 @@
 namespace ncsi
 {
 
-typedef ncsi_response_type_t (*ncsi_simple_poll_f)(ncsi_state_t*,
-                                                   network_debug_t*,
-                                                   ncsi_buf_t*, mac_addr_t*,
-                                                   uint32_t, uint16_t);
+typedef ncsi_response_type_t (*ncsi_simple_poll_f)(
+    ncsi_state_t*, network_debug_t*, ncsi_buf_t*, mac_addr_t*, uint32_t,
+    uint16_t);
 
 // This class encapsulates three state machines:
 //  * L2 -- performs basic NC-SI setup, reads NIC MAC addr
diff --git a/subprojects/ncsid/src/net_config.cpp b/subprojects/ncsid/src/net_config.cpp
index 4e52cc8..e8c00d2 100644
--- a/subprojects/ncsid/src/net_config.cpp
+++ b/subprojects/ncsid/src/net_config.cpp
@@ -76,8 +76,8 @@
     bus(sdbusplus::bus::new_default())
 {}
 
-sdbusplus::message_t PhosphorConfig::new_networkd_call(sdbusplus::bus_t* dbus,
-                                                       bool get) const
+sdbusplus::message_t
+    PhosphorConfig::new_networkd_call(sdbusplus::bus_t* dbus, bool get) const
 {
     auto networkd_call =
         dbus->new_method_call(NETWORK_SERVICE, iface_path_.c_str(),
diff --git a/subprojects/ncsid/test/ncsi_test.cpp b/subprojects/ncsid/test/ncsi_test.cpp
index b613647..39b8378 100644
--- a/subprojects/ncsid/test/ncsi_test.cpp
+++ b/subprojects/ncsid/test/ncsi_test.cpp
@@ -172,8 +172,8 @@
     static constexpr int test_num_states = 9;
 
     // Total number of states in all three state machines.
-    static constexpr int total_num_states = l2_num_states + l3l4_num_states +
-                                            test_num_states;
+    static constexpr int total_num_states =
+        l2_num_states + l3l4_num_states + test_num_states;
 };
 
 TEST_F(TestNcsi, TestMACAddrPropagation)
diff --git a/subprojects/ncsid/test/nic_mock.cpp b/subprojects/ncsid/test/nic_mock.cpp
index 20f7f56..ce3224c 100644
--- a/subprojects/ncsid/test/nic_mock.cpp
+++ b/subprojects/ncsid/test/nic_mock.cpp
@@ -74,8 +74,8 @@
         payload_offset += sizeof(ncsi_oem_extension_header_t);
     }
 
-    packet_raw_ = std::vector<uint8_t>(ncsi_buf.data,
-                                       ncsi_buf.data + ncsi_buf.len);
+    packet_raw_ =
+        std::vector<uint8_t>(ncsi_buf.data, ncsi_buf.data + ncsi_buf.len);
     // TODO: Verify payload length.
 
     return true;
@@ -102,8 +102,8 @@
              simple_commands_.end())
     {
         // Simple Response
-        response_size = ncsi_build_simple_ack(request_buf.data,
-                                              response_buf->data);
+        response_size =
+            ncsi_build_simple_ack(request_buf.data, response_buf->data);
     }
     else
     {
@@ -187,8 +187,8 @@
         }
         break;
         case NCSI_OEM_COMMAND_ECHO:
-            response_size = ncsi_build_oem_echo_ack(request_buf.data,
-                                                    response_buf->data);
+            response_size =
+                ncsi_build_oem_echo_ack(request_buf.data, response_buf->data);
             break;
         case NCSI_OEM_COMMAND_GET_FILTER:
         {
@@ -287,14 +287,14 @@
 
     if (channel_count_ > 0)
     {
-        ch0_filter_.flags = flag_op(ch0_filter_.flags,
-                                    NCSI_OEM_FILTER_FLAGS_HOSTLESS);
+        ch0_filter_.flags =
+            flag_op(ch0_filter_.flags, NCSI_OEM_FILTER_FLAGS_HOSTLESS);
     }
 
     if (channel_count_ > 1)
     {
-        ch1_filter_.flags = flag_op(ch1_filter_.flags,
-                                    NCSI_OEM_FILTER_FLAGS_HOSTLESS);
+        ch1_filter_.flags =
+            flag_op(ch1_filter_.flags, NCSI_OEM_FILTER_FLAGS_HOSTLESS);
     }
 }
 
diff --git a/subprojects/nemora-postd/src/default_addresses.h b/subprojects/nemora-postd/src/default_addresses.h
index 2e1321e..85ed3bf 100644
--- a/subprojects/nemora-postd/src/default_addresses.h
+++ b/subprojects/nemora-postd/src/default_addresses.h
@@ -43,46 +43,26 @@
 #endif
 
 // 2001:4860:f802::c5
-#define DEFAULT_ADDRESSES_TARGET_IP6                                           \
-    {                                                                          \
-        0x20014860, 0xf8020000, 0, 0xc5                                        \
-    }
+#define DEFAULT_ADDRESSES_TARGET_IP6 {0x20014860, 0xf8020000, 0, 0xc5}
 
 #ifdef NETWORK_UNITTEST
 #define DEFAULT_ADDRESSES_GATEWAY ((172 << 24) | (23 << 16) | (130 << 8) | 190)
 #define DEFAULT_ADDRESSES_NETMASK ((255 << 24) | (255 << 16) | (255 << 8) | 192)
 #define DEFAULT_ADDRESSES_LOCAL_IP ((172 << 24) | (23 << 16) | (130 << 8) | 141)
-#define DEFAULT_ADDRESSES_MAC                                                  \
-    {                                                                          \
-        0x00, 0x1a, 0x11, 0x30, 0xc9, 0x6f                                     \
-    }
-#define DEFAULT_ADDRESSES_GATEWAY6                                             \
-    {                                                                          \
-        0, 0, 0, 0                                                             \
-    }
-#define DEFAULT_ADDRESSES_GATEWAY6_MAC                                         \
-    {                                                                          \
-        0, 0, 0, 0, 0, 0                                                       \
-    }
+#define DEFAULT_ADDRESSES_MAC {0x00, 0x1a, 0x11, 0x30, 0xc9, 0x6f}
+#define DEFAULT_ADDRESSES_GATEWAY6 {0, 0, 0, 0}
+#define DEFAULT_ADDRESSES_GATEWAY6_MAC {0, 0, 0, 0, 0, 0}
 #else
 #define DEFAULT_ADDRESSES_GATEWAY 0
 #define DEFAULT_ADDRESSES_NETMASK 0
 #define DEFAULT_ADDRESSES_LOCAL_IP 0
-#define DEFAULT_ADDRESSES_MAC                                                  \
-    {                                                                          \
-        0, 0, 0, 0, 0, 0                                                       \
-    }
+#define DEFAULT_ADDRESSES_MAC {0, 0, 0, 0, 0, 0}
 // fe80::1 -- as of 2016-10-13 this is guaranteed to be the GW in prod.
 #define DEFAULT_ADDRESSES_GATEWAY6                                             \
-    {                                                                          \
-        0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1                   \
-    }
+    {0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
 // 02:32:00:00:00:00 -- as of 2016-10-13 this is guaranteed to be the
 // GW MAC addr in prod.
-#define DEFAULT_ADDRESSES_GATEWAY6_MAC                                         \
-    {                                                                          \
-        0x02, 0x32, 0, 0, 0, 0                                                 \
-    }
+#define DEFAULT_ADDRESSES_GATEWAY6_MAC {0x02, 0x32, 0, 0, 0, 0}
 #endif
 
 #endif // PLATFORMS_NEMORA_PORTABLE_DEFAULT_ADDRESSES_H_
diff --git a/subprojects/nemora-postd/src/nemora.cpp b/subprojects/nemora-postd/src/nemora.cpp
index 403d766..d051241 100644
--- a/subprojects/nemora-postd/src/nemora.cpp
+++ b/subprojects/nemora-postd/src/nemora.cpp
@@ -102,8 +102,8 @@
 
 Nemora::Nemora(const std::string& iface_name, const in_addr ipv4,
                const in6_addr ipv6) :
-    socketManager_(),
-    hostManager_(), iface_path_{std::string(IFACE_ROOT) + iface_name}
+    socketManager_(), hostManager_(),
+    iface_path_{std::string(IFACE_ROOT) + iface_name}
 {
     InitEventData();
     event_data_.destination.sin_addr = ipv4;