diff --git a/extensions/phal/create_pel.cpp b/extensions/phal/create_pel.cpp
index d3810ef..a61c080 100644
--- a/extensions/phal/create_pel.cpp
+++ b/extensions/phal/create_pel.cpp
@@ -104,11 +104,11 @@
                             static_cast<uint8_t>(0xCA),
                             static_cast<uint8_t>(0x01), ffdcFile.getFileFD()));
 
-        std::string service = util::getService(bus, loggingObjectPath,
-                                               loggingInterface);
-        auto method = bus.new_method_call(service.c_str(), loggingObjectPath,
-                                          loggingInterface,
-                                          "CreateWithFFDCFiles");
+        std::string service =
+            util::getService(bus, loggingObjectPath, loggingInterface);
+        auto method =
+            bus.new_method_call(service.c_str(), loggingObjectPath,
+                                loggingInterface, "CreateWithFFDCFiles");
         auto level =
             sdbusplus::xyz::openbmc_project::Logging::server::convertForMessage(
                 severity);
@@ -204,11 +204,11 @@
 
     try
     {
-        std::string service = util::getService(bus, loggingObjectPath,
-                                               opLoggingInterface);
-        auto method = bus.new_method_call(service.c_str(), loggingObjectPath,
-                                          opLoggingInterface,
-                                          "CreatePELWithFFDCFiles");
+        std::string service =
+            util::getService(bus, loggingObjectPath, opLoggingInterface);
+        auto method =
+            bus.new_method_call(service.c_str(), loggingObjectPath,
+                                opLoggingInterface, "CreatePELWithFFDCFiles");
         auto level =
             sdbusplus::xyz::openbmc_project::Logging::server::convertForMessage(
                 severity);
@@ -224,11 +224,11 @@
     }
     catch (const sdbusplus::exception_t& e)
     {
-        log<level::ERR>(std::format("D-Bus call exception",
-                                    "OBJPATH={}, INTERFACE={}, EXCEPTION={}",
-                                    loggingObjectPath, loggingInterface,
-                                    e.what())
-                            .c_str());
+        log<level::ERR>(
+            std::format("D-Bus call exception",
+                        "OBJPATH={}, INTERFACE={}, EXCEPTION={}",
+                        loggingObjectPath, loggingInterface, e.what())
+                .c_str());
         throw std::runtime_error(
             "Error in invoking D-Bus logging create interface");
     }
@@ -253,8 +253,8 @@
 
     try
     {
-        std::string service = util::getService(bus, loggingObjectPath,
-                                               loggingInterface);
+        std::string service =
+            util::getService(bus, loggingObjectPath, loggingInterface);
         auto method = bus.new_method_call(service.c_str(), loggingObjectPath,
                                           loggingInterface, "Create");
         auto level =
@@ -265,11 +265,11 @@
     }
     catch (const sdbusplus::exception_t& e)
     {
-        log<level::ERR>(std::format("sdbusplus D-Bus call exception",
-                                    "OBJPATH={}, INTERFACE={}, EXCEPTION={}",
-                                    loggingObjectPath, loggingInterface,
-                                    e.what())
-                            .c_str());
+        log<level::ERR>(
+            std::format("sdbusplus D-Bus call exception",
+                        "OBJPATH={}, INTERFACE={}, EXCEPTION={}",
+                        loggingObjectPath, loggingInterface, e.what())
+                .c_str());
         ;
 
         throw std::runtime_error(
diff --git a/extensions/phal/dump_utils.cpp b/extensions/phal/dump_utils.cpp
index dff3470..6d2a666 100644
--- a/extensions/phal/dump_utils.cpp
+++ b/extensions/phal/dump_utils.cpp
@@ -75,8 +75,8 @@
             sdbusplus::bus::match::rules::propertiesChanged(
                 path.c_str(), matchInterface.c_str()),
             [&](auto& msg) {
-        return dumpStatusChanged(msg, path, inProgress);
-    });
+                return dumpStatusChanged(msg, path, inProgress);
+            });
 
     // wait for dump status to be completed (complete == true)
     // or until timeout interval
@@ -117,8 +117,8 @@
     try
     {
         std::string service = util::getService(bus, path, interface);
-        auto method = bus.new_method_call(service.c_str(), path, interface,
-                                          function);
+        auto method =
+            bus.new_method_call(service.c_str(), path, interface, function);
 
         // dbus call arguments
         std::map<std::string, std::variant<std::string, uint64_t>> createParams;
diff --git a/extensions/phal/phal_error.cpp b/extensions/phal/phal_error.cpp
index e249595..8677b6a 100644
--- a/extensions/phal/phal_error.cpp
+++ b/extensions/phal/phal_error.cpp
@@ -325,8 +325,8 @@
     for_each(
         traceLog.begin(), traceLog.end(),
         [&pelAdditionalData](std::pair<std::string, std::string>& ele) -> void {
-        pelAdditionalData.emplace_back(ele.first, ele.second);
-    });
+            pelAdditionalData.emplace_back(ele.first, ele.second);
+        });
     openpower::pel::createErrorPEL(
         "org.open_power.PHAL.Error.NonFunctionalBootProc", jsonCalloutDataList,
         pelAdditionalData, Severity::Error);
@@ -370,11 +370,11 @@
                  ffdc->hwp_errorinfo.ffdcs_data.end(),
                  [&pelAdditionalData, &ffdc_prefix](
                      std::pair<std::string, std::string>& ele) -> void {
-            std::string keyWithPrefix(ffdc_prefix + "FFDC_");
-            keyWithPrefix.append(ele.first);
+                     std::string keyWithPrefix(ffdc_prefix + "FFDC_");
+                     keyWithPrefix.append(ele.first);
 
-            pelAdditionalData.emplace_back(keyWithPrefix, ele.second);
-        });
+                     pelAdditionalData.emplace_back(keyWithPrefix, ele.second);
+                 });
         // get clock position information
         auto clk_pos = 0xFF; // Invalid position.
         for (auto& hwCallout : ffdc->hwp_errorinfo.hwcallouts)
@@ -392,21 +392,22 @@
                  ffdc->hwp_errorinfo.cdg_targets.end(),
                  [&pelAdditionalData, &jsonCalloutDataList,
                   clk_pos](const CDG_Target& cdg_tgt) -> void {
-            json jsonCalloutData;
-            std::string pelPriority = "L";
-            jsonCalloutData["Priority"] = pelPriority; // Not used
-            jsonCalloutData["SymbolicFRU"] = "REFCLK" + std::to_string(clk_pos);
-            jsonCalloutData["Deconfigured"] = cdg_tgt.deconfigure;
-            jsonCalloutData["EntityPath"] = cdg_tgt.target_entity_path;
-            jsonCalloutDataList.emplace_back(jsonCalloutData);
-        });
+                     json jsonCalloutData;
+                     std::string pelPriority = "L";
+                     jsonCalloutData["Priority"] = pelPriority; // Not used
+                     jsonCalloutData["SymbolicFRU"] =
+                         "REFCLK" + std::to_string(clk_pos);
+                     jsonCalloutData["Deconfigured"] = cdg_tgt.deconfigure;
+                     jsonCalloutData["EntityPath"] = cdg_tgt.target_entity_path;
+                     jsonCalloutDataList.emplace_back(jsonCalloutData);
+                 });
 
         // Adding collected phal logs into PEL additional data
         for_each(traceLog.begin(), traceLog.end(),
                  [&pelAdditionalData](
                      std::pair<std::string, std::string>& ele) -> void {
-            pelAdditionalData.emplace_back(ele.first, ele.second);
-        });
+                     pelAdditionalData.emplace_back(ele.first, ele.second);
+                 });
 
         openpower::pel::createErrorPEL("org.open_power.PHAL.Error.SpareClock",
                                        jsonCalloutDataList, pelAdditionalData,
@@ -534,8 +535,8 @@
         for_each(traceLog.begin(), traceLog.end(),
                  [&pelAdditionalData](
                      std::pair<std::string, std::string>& ele) -> void {
-            pelAdditionalData.emplace_back(ele.first, ele.second);
-        });
+                     pelAdditionalData.emplace_back(ele.first, ele.second);
+                 });
 
         openpower::pel::createErrorPEL("org.open_power.PHAL.Error.Boot", {},
                                        pelAdditionalData,
@@ -586,38 +587,88 @@
                      ffdc->hwp_errorinfo.ffdcs_data.end(),
                      [&pelAdditionalData, &ffdc_prefix](
                          std::pair<std::string, std::string>& ele) -> void {
-                std::string keyWithPrefix(ffdc_prefix + "FFDC_");
-                keyWithPrefix.append(ele.first);
+                         std::string keyWithPrefix(ffdc_prefix + "FFDC_");
+                         keyWithPrefix.append(ele.first);
 
-                pelAdditionalData.emplace_back(keyWithPrefix, ele.second);
-            });
+                         pelAdditionalData.emplace_back(keyWithPrefix,
+                                                        ele.second);
+                     });
 
             // Adding hardware callout details
             int calloutCount = 0;
-            for_each(ffdc->hwp_errorinfo.hwcallouts.begin(),
-                     ffdc->hwp_errorinfo.hwcallouts.end(),
-                     [&pelAdditionalData, &calloutCount, &jsonCalloutDataList,
-                      &ffdc_prefix](const HWCallout& hwCallout) -> void {
-                calloutCount++;
-                std::stringstream keyPrefix;
-                keyPrefix << ffdc_prefix << "HW_CO_" << std::setfill('0')
-                          << std::setw(2) << calloutCount << "_";
+            for_each(
+                ffdc->hwp_errorinfo.hwcallouts.begin(),
+                ffdc->hwp_errorinfo.hwcallouts.end(),
+                [&pelAdditionalData, &calloutCount, &jsonCalloutDataList,
+                 &ffdc_prefix](const HWCallout& hwCallout) -> void {
+                    calloutCount++;
+                    std::stringstream keyPrefix;
+                    keyPrefix << ffdc_prefix << "HW_CO_" << std::setfill('0')
+                              << std::setw(2) << calloutCount << "_";
 
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("HW_ID"),
-                    hwCallout.hwid);
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("HW_ID"),
+                        hwCallout.hwid);
 
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("PRIORITY"),
-                    hwCallout.callout_priority);
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("PRIORITY"),
+                        hwCallout.callout_priority);
 
-                // Log target details only if entity path is
-                // available. For example target entity path will not
-                // be available for non-hwp clock failure.
-                if (!hwCallout.target_entity_path.empty())
-                {
+                    // Log target details only if entity path is
+                    // available. For example target entity path will not
+                    // be available for non-hwp clock failure.
+                    if (!hwCallout.target_entity_path.empty())
+                    {
+                        phal::TargetInfo targetInfo;
+                        phal::getTgtReqAttrsVal(hwCallout.target_entity_path,
+                                                targetInfo);
+
+                        std::string locationCode =
+                            std::string(targetInfo.locationCode);
+                        pelAdditionalData.emplace_back(
+                            std::string(keyPrefix.str()).append("LOC_CODE"),
+                            locationCode);
+
+                        std::string physPath =
+                            std::string(targetInfo.physDevPath);
+                        pelAdditionalData.emplace_back(
+                            std::string(keyPrefix.str()).append("PHYS_PATH"),
+                            physPath);
+                    }
+
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("CLK_POS"),
+                        std::to_string(hwCallout.clkPos));
+
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("CALLOUT_PLANAR"),
+                        (hwCallout.isPlanarCallout == true ? "true" : "false"));
+
+                    std::string pelPriority =
+                        getPelPriority(hwCallout.callout_priority);
+
+                    if (hwCallout.isPlanarCallout)
+                    {
+                        addPlanarCallout(jsonCalloutDataList, pelPriority);
+                    }
+                });
+
+            // Adding CDG (callout, deconfigure and guard) targets details
+            calloutCount = 0;
+            for_each(
+                ffdc->hwp_errorinfo.cdg_targets.begin(),
+                ffdc->hwp_errorinfo.cdg_targets.end(),
+                [&pelAdditionalData, &calloutCount, &jsonCalloutDataList,
+                 &ffdc_prefix](const CDG_Target& cdg_tgt) -> void {
+                    calloutCount++;
+                    std::stringstream keyPrefix;
+                    keyPrefix << ffdc_prefix << "CDG_TGT_" << std::setfill('0')
+                              << std::setw(2) << calloutCount << "_";
+
                     phal::TargetInfo targetInfo;
-                    phal::getTgtReqAttrsVal(hwCallout.target_entity_path,
+                    targetInfo.deconfigure = cdg_tgt.deconfigure;
+
+                    phal::getTgtReqAttrsVal(cdg_tgt.target_entity_path,
                                             targetInfo);
 
                     std::string locationCode =
@@ -625,93 +676,51 @@
                     pelAdditionalData.emplace_back(
                         std::string(keyPrefix.str()).append("LOC_CODE"),
                         locationCode);
-
                     std::string physPath = std::string(targetInfo.physDevPath);
                     pelAdditionalData.emplace_back(
                         std::string(keyPrefix.str()).append("PHYS_PATH"),
                         physPath);
-                }
 
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("CLK_POS"),
-                    std::to_string(hwCallout.clkPos));
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("CO_REQ"),
+                        (cdg_tgt.callout == true ? "true" : "false"));
 
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("CALLOUT_PLANAR"),
-                    (hwCallout.isPlanarCallout == true ? "true" : "false"));
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("CO_PRIORITY"),
+                        cdg_tgt.callout_priority);
 
-                std::string pelPriority =
-                    getPelPriority(hwCallout.callout_priority);
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("DECONF_REQ"),
+                        (cdg_tgt.deconfigure == true ? "true" : "false"));
 
-                if (hwCallout.isPlanarCallout)
-                {
-                    addPlanarCallout(jsonCalloutDataList, pelPriority);
-                }
-            });
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("GUARD_REQ"),
+                        (cdg_tgt.guard == true ? "true" : "false"));
 
-            // Adding CDG (callout, deconfigure and guard) targets details
-            calloutCount = 0;
-            for_each(ffdc->hwp_errorinfo.cdg_targets.begin(),
-                     ffdc->hwp_errorinfo.cdg_targets.end(),
-                     [&pelAdditionalData, &calloutCount, &jsonCalloutDataList,
-                      &ffdc_prefix](const CDG_Target& cdg_tgt) -> void {
-                calloutCount++;
-                std::stringstream keyPrefix;
-                keyPrefix << ffdc_prefix << "CDG_TGT_" << std::setfill('0')
-                          << std::setw(2) << calloutCount << "_";
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("GUARD_TYPE"),
+                        cdg_tgt.guard_type);
 
-                phal::TargetInfo targetInfo;
-                targetInfo.deconfigure = cdg_tgt.deconfigure;
+                    json jsonCalloutData;
+                    jsonCalloutData["LocationCode"] = locationCode;
+                    std::string pelPriority =
+                        getPelPriority(cdg_tgt.callout_priority);
+                    jsonCalloutData["Priority"] = pelPriority;
 
-                phal::getTgtReqAttrsVal(cdg_tgt.target_entity_path, targetInfo);
+                    if (targetInfo.mruId != 0)
+                    {
+                        jsonCalloutData["MRUs"] = json::array({
+                            {{"ID", targetInfo.mruId},
+                             {"Priority", pelPriority}},
+                        });
+                    }
+                    jsonCalloutData["Deconfigured"] = cdg_tgt.deconfigure;
+                    jsonCalloutData["Guarded"] = cdg_tgt.guard;
+                    jsonCalloutData["GuardType"] = cdg_tgt.guard_type;
+                    jsonCalloutData["EntityPath"] = cdg_tgt.target_entity_path;
 
-                std::string locationCode = std::string(targetInfo.locationCode);
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("LOC_CODE"),
-                    locationCode);
-                std::string physPath = std::string(targetInfo.physDevPath);
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("PHYS_PATH"), physPath);
-
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("CO_REQ"),
-                    (cdg_tgt.callout == true ? "true" : "false"));
-
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("CO_PRIORITY"),
-                    cdg_tgt.callout_priority);
-
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("DECONF_REQ"),
-                    (cdg_tgt.deconfigure == true ? "true" : "false"));
-
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("GUARD_REQ"),
-                    (cdg_tgt.guard == true ? "true" : "false"));
-
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("GUARD_TYPE"),
-                    cdg_tgt.guard_type);
-
-                json jsonCalloutData;
-                jsonCalloutData["LocationCode"] = locationCode;
-                std::string pelPriority =
-                    getPelPriority(cdg_tgt.callout_priority);
-                jsonCalloutData["Priority"] = pelPriority;
-
-                if (targetInfo.mruId != 0)
-                {
-                    jsonCalloutData["MRUs"] = json::array({
-                        {{"ID", targetInfo.mruId}, {"Priority", pelPriority}},
-                    });
-                }
-                jsonCalloutData["Deconfigured"] = cdg_tgt.deconfigure;
-                jsonCalloutData["Guarded"] = cdg_tgt.guard;
-                jsonCalloutData["GuardType"] = cdg_tgt.guard_type;
-                jsonCalloutData["EntityPath"] = cdg_tgt.target_entity_path;
-
-                jsonCalloutDataList.emplace_back(jsonCalloutData);
-            });
+                    jsonCalloutDataList.emplace_back(jsonCalloutData);
+                });
             // Adding procedure callout
             calloutCount = 0;
             for_each(
@@ -719,26 +728,26 @@
                 ffdc->hwp_errorinfo.procedures_callout.end(),
                 [&pelAdditionalData, &calloutCount, &jsonCalloutDataList,
                  &ffdc_prefix](const ProcedureCallout& procCallout) -> void {
-                calloutCount++;
-                std::stringstream keyPrefix;
-                keyPrefix << ffdc_prefix << "PROC_CO_" << std::setfill('0')
-                          << std::setw(2) << calloutCount << "_";
+                    calloutCount++;
+                    std::stringstream keyPrefix;
+                    keyPrefix << ffdc_prefix << "PROC_CO_" << std::setfill('0')
+                              << std::setw(2) << calloutCount << "_";
 
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("PRIORITY"),
-                    procCallout.callout_priority);
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("PRIORITY"),
+                        procCallout.callout_priority);
 
-                pelAdditionalData.emplace_back(
-                    std::string(keyPrefix.str()).append("MAINT_PROCEDURE"),
-                    procCallout.proc_callout);
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("MAINT_PROCEDURE"),
+                        procCallout.proc_callout);
 
-                json jsonCalloutData;
-                jsonCalloutData["Procedure"] = procCallout.proc_callout;
-                std::string pelPriority =
-                    getPelPriority(procCallout.callout_priority);
-                jsonCalloutData["Priority"] = pelPriority;
-                jsonCalloutDataList.emplace_back(jsonCalloutData);
-            });
+                    json jsonCalloutData;
+                    jsonCalloutData["Procedure"] = procCallout.proc_callout;
+                    std::string pelPriority =
+                        getPelPriority(procCallout.callout_priority);
+                    jsonCalloutData["Priority"] = pelPriority;
+                    jsonCalloutDataList.emplace_back(jsonCalloutData);
+                });
         }
         else if ((ffdc->ffdc_type != FFDC_TYPE_NONE) &&
                  (ffdc->ffdc_type != FFDC_TYPE_UNSUPPORTED))
@@ -754,8 +763,8 @@
         for_each(traceLog.begin(), traceLog.end(),
                  [&pelAdditionalData](
                      std::pair<std::string, std::string>& ele) -> void {
-            pelAdditionalData.emplace_back(ele.first, ele.second);
-        });
+                     pelAdditionalData.emplace_back(ele.first, ele.second);
+                 });
 
         // TODO: #ibm-openbmc/dev/issues/2595 : Once enabled this support,
         // callout details is not required to sort in H,M and L orders which
@@ -764,21 +773,24 @@
         // i.e High -> Medium -> Low.
         std::sort(jsonCalloutDataList.begin(), jsonCalloutDataList.end(),
                   [](const json& aEle, const json& bEle) -> bool {
-            // Considering b element having higher priority than a element
-            // or Both element will be same priorty (to keep same order
-            // which are given by phal when two callouts are having same
-            // priority)
-            if (((aEle["Priority"] == "M") && (bEle["Priority"] == "H")) ||
-                ((aEle["Priority"] == "L") &&
-                 ((bEle["Priority"] == "H") || (bEle["Priority"] == "M"))) ||
-                (aEle["Priority"] == bEle["Priority"]))
-            {
-                return false;
-            }
+                      // Considering b element having higher priority than a
+                      // element or Both element will be same priorty (to keep
+                      // same order which are given by phal when two callouts
+                      // are having same priority)
+                      if (((aEle["Priority"] == "M") &&
+                           (bEle["Priority"] == "H")) ||
+                          ((aEle["Priority"] == "L") &&
+                           ((bEle["Priority"] == "H") ||
+                            (bEle["Priority"] == "M"))) ||
+                          (aEle["Priority"] == bEle["Priority"]))
+                      {
+                          return false;
+                      }
 
-            // Considering a element having higher priority than b element
-            return true;
-        });
+                      // Considering a element having higher priority than b
+                      // element
+                      return true;
+                  });
         openpower::pel::createErrorPEL("org.open_power.PHAL.Error.Boot",
                                        jsonCalloutDataList, pelAdditionalData,
                                        Severity::Error);
@@ -861,8 +873,8 @@
     for_each(
         traceLog.begin(), traceLog.end(),
         [&pelAdditionalData](std::pair<std::string, std::string>& ele) -> void {
-        pelAdditionalData.emplace_back(ele.first, ele.second);
-    });
+            pelAdditionalData.emplace_back(ele.first, ele.second);
+        });
 
     // reset the trace log and counter
     reset();
@@ -925,8 +937,8 @@
     uint32_t index = pdbg_target_index(procTarget);
     pelAdditionalData.emplace_back("SRC6", std::to_string(index << 16));
     // Create SBE Error with FFDC data.
-    auto logId = createSbeErrorPEL(event, sbeError, pelAdditionalData,
-                                   procTarget);
+    auto logId =
+        createSbeErrorPEL(event, sbeError, pelAdditionalData, procTarget);
 
     if (dumpIsRequired)
     {
@@ -954,8 +966,8 @@
     for_each(
         traceLog.begin(), traceLog.end(),
         [&pelAdditionalData](std::pair<std::string, std::string>& ele) -> void {
-        pelAdditionalData.emplace_back(ele.first, ele.second);
-    });
+            pelAdditionalData.emplace_back(ele.first, ele.second);
+        });
 
     openpower::pel::createPEL("org.open_power.PHAL.Error.GuardPartitionAccess",
                               pelAdditionalData);
