diff --git a/libpldmresponder/pdr_utils.cpp b/libpldmresponder/pdr_utils.cpp
index c15e282..7d87c67 100644
--- a/libpldmresponder/pdr_utils.cpp
+++ b/libpldmresponder/pdr_utils.cpp
@@ -48,9 +48,9 @@
 {
     constexpr uint32_t firstNum = 0;
     uint8_t* pdrData = nullptr;
-    auto record = pldm_pdr_find_record(getPdr(), firstNum, &pdrData,
-                                       &pdrEntry.size,
-                                       &pdrEntry.handle.nextRecordHandle);
+    auto record =
+        pldm_pdr_find_record(getPdr(), firstNum, &pdrData, &pdrEntry.size,
+                             &pdrEntry.handle.nextRecordHandle);
     if (record)
     {
         pdrEntry.data = pdrData;
@@ -63,9 +63,9 @@
                                            PdrEntry& pdrEntry)
 {
     uint8_t* pdrData = nullptr;
-    auto record = pldm_pdr_get_next_record(getPdr(), currRecord, &pdrData,
-                                           &pdrEntry.size,
-                                           &pdrEntry.handle.nextRecordHandle);
+    auto record =
+        pldm_pdr_get_next_record(getPdr(), currRecord, &pdrData, &pdrEntry.size,
+                                 &pdrEntry.handle.nextRecordHandle);
     if (record)
     {
         pdrEntry.data = pdrData;
@@ -209,8 +209,8 @@
                            std::move(sensorInfo));
 }
 
-std::vector<FruRecordDataFormat> parseFruRecordTable(const uint8_t* fruData,
-                                                     size_t fruLen)
+std::vector<FruRecordDataFormat>
+    parseFruRecordTable(const uint8_t* fruData, size_t fruLen)
 {
     // Refer: DSP0257_1.0.0 Table 2
     // 7: uint16_t(FRU Record Set Identifier), uint8_t(FRU Record Type),
@@ -239,23 +239,24 @@
 
         index += 5;
 
-        std::ranges::for_each(std::views::iota(0, (int)record->num_fru_fields),
-                              [fruData, &fru, &index](int) {
-            auto tlv =
-                reinterpret_cast<const pldm_fru_record_tlv*>(fruData + index);
-            FruTLV frutlv;
-            frutlv.fruFieldType = tlv->type;
-            frutlv.fruFieldLen = tlv->length;
-            frutlv.fruFieldValue.resize(tlv->length);
-            for (const auto& i : std::views::iota(0, (int)tlv->length))
-            {
-                memcpy(frutlv.fruFieldValue.data() + i, tlv->value + i, 1);
-            }
-            fru.fruTLV.push_back(frutlv);
+        std::ranges::for_each(
+            std::views::iota(0, (int)record->num_fru_fields),
+            [fruData, &fru, &index](int) {
+                auto tlv = reinterpret_cast<const pldm_fru_record_tlv*>(
+                    fruData + index);
+                FruTLV frutlv;
+                frutlv.fruFieldType = tlv->type;
+                frutlv.fruFieldLen = tlv->length;
+                frutlv.fruFieldValue.resize(tlv->length);
+                for (const auto& i : std::views::iota(0, (int)tlv->length))
+                {
+                    memcpy(frutlv.fruFieldValue.data() + i, tlv->value + i, 1);
+                }
+                fru.fruTLV.push_back(frutlv);
 
-            // 2: 1byte FRU Field Type, 1byte FRU Field Length
-            index += fruFieldTypeLength + (unsigned)tlv->length;
-        });
+                // 2: 1byte FRU Field Type, 1byte FRU Field Length
+                index += fruFieldTypeLength + (unsigned)tlv->length;
+            });
 
         frus.push_back(fru);
     }
