Fix build issues after migrating to Clang 20

With the recent migration to Clang 20 in openbmc-build-scripts, the
current PLDM codebase fails to compile due to stricter type checking
and unused field warnings introduced by the updated compiler.

This commit addresses the following issues to restore build stability:

1. Callback compatibility: Replaced std::bind_front with lambda
   expressions that explicitly capture this, resolving type mismatch
   errors when assigning member function callbacks to std::function.
2. Unused field warning: Removed the unused `bus` member variable from
   the `SoftPowerOff` class and updated its constructor accordingly to
   eliminate `-Wunused-private-field` warnings.

These changes are required to allow successful CI builds under the
Clang 20 toolchain.

Change-Id: I8eb909c2b1263bf7b2dbf53cdfc0424d425d352b
Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
diff --git a/fw-update/device_updater.cpp b/fw-update/device_updater.cpp
index 644883e..77412b9 100644
--- a/fw-update/device_updater.cpp
+++ b/fw-update/device_updater.cpp
@@ -57,7 +57,9 @@
 
     rc = updateManager->handler.registerRequest(
         eid, instanceId, PLDM_FWUP, PLDM_REQUEST_UPDATE, std::move(request),
-        std::bind_front(&DeviceUpdater::requestUpdate, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->requestUpdate(eid, response, respMsgLen);
+        });
     if (rc)
     {
         // Handle error scenario
@@ -186,7 +188,9 @@
     rc = updateManager->handler.registerRequest(
         eid, instanceId, PLDM_FWUP, PLDM_PASS_COMPONENT_TABLE,
         std::move(request),
-        std::bind_front(&DeviceUpdater::passCompTable, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->passCompTable(eid, response, respMsgLen);
+        });
     if (rc)
     {
         // Handle error scenario
@@ -317,7 +321,9 @@
 
     rc = updateManager->handler.registerRequest(
         eid, instanceId, PLDM_FWUP, PLDM_UPDATE_COMPONENT, std::move(request),
-        std::bind_front(&DeviceUpdater::updateComponent, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->updateComponent(eid, response, respMsgLen);
+        });
     if (rc)
     {
         // Handle error scenario
@@ -669,7 +675,9 @@
 
     rc = updateManager->handler.registerRequest(
         eid, instanceId, PLDM_FWUP, PLDM_ACTIVATE_FIRMWARE, std::move(request),
-        std::bind_front(&DeviceUpdater::activateFirmware, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->activateFirmware(eid, response, respMsgLen);
+        });
     if (rc)
     {
         error(
diff --git a/fw-update/inventory_manager.cpp b/fw-update/inventory_manager.cpp
index 98d56d1..38e8392 100644
--- a/fw-update/inventory_manager.cpp
+++ b/fw-update/inventory_manager.cpp
@@ -53,7 +53,9 @@
     rc = handler.registerRequest(
         eid, instanceId, PLDM_FWUP, PLDM_QUERY_DEVICE_IDENTIFIERS,
         std::move(requestMsg),
-        std::bind_front(&InventoryManager::queryDeviceIdentifiers, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->queryDeviceIdentifiers(eid, response, respMsgLen);
+        });
     if (rc)
     {
         error(
@@ -184,7 +186,9 @@
     rc = handler.registerRequest(
         eid, instanceId, PLDM_FWUP, PLDM_QUERY_DOWNSTREAM_DEVICES,
         std::move(requestMsg),
-        std::bind_front(&InventoryManager::queryDownstreamDevices, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->queryDownstreamDevices(eid, response, respMsgLen);
+        });
     if (rc)
     {
         error(
@@ -296,7 +300,9 @@
     rc = handler.registerRequest(
         eid, instanceId, PLDM_FWUP, PLDM_QUERY_DOWNSTREAM_IDENTIFIERS,
         std::move(requestMsg),
-        std::bind_front(&InventoryManager::queryDownstreamIdentifiers, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->queryDownstreamIdentifiers(eid, response, respMsgLen);
+        });
     if (rc)
     {
         error(
@@ -467,8 +473,9 @@
     rc = handler.registerRequest(
         eid, instanceId, PLDM_FWUP, PLDM_QUERY_DOWNSTREAM_FIRMWARE_PARAMETERS,
         std::move(requestMsg),
-        std::bind_front(&InventoryManager::getDownstreamFirmwareParameters,
-                        this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->getDownstreamFirmwareParameters(eid, response, respMsgLen);
+        });
     if (rc)
     {
         error(
@@ -557,7 +564,9 @@
     rc = handler.registerRequest(
         eid, instanceId, PLDM_FWUP, PLDM_GET_FIRMWARE_PARAMETERS,
         std::move(requestMsg),
-        std::bind_front(&InventoryManager::getFirmwareParameters, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->getFirmwareParameters(eid, response, respMsgLen);
+        });
     if (rc)
     {
         error(
diff --git a/fw-update/update_manager.hpp b/fw-update/update_manager.hpp
index c24af61..012c83e 100644
--- a/fw-update/update_manager.hpp
+++ b/fw-update/update_manager.hpp
@@ -49,7 +49,10 @@
         event(event), handler(handler), instanceIdDb(instanceIdDb),
         descriptorMap(descriptorMap), componentInfoMap(componentInfoMap),
         watch(event.get(),
-              std::bind_front(&UpdateManager::processPackage, this)),
+              [this](std::string& packageFilePath) {
+                  return this->processPackage(
+                      std::filesystem::path(packageFilePath));
+              }),
         totalNumComponentUpdates(0), compUpdateCompletedCount(0)
     {}
 
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index 052e7e2..61b4ccb 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -205,7 +205,9 @@
     rc = handler->registerRequest(
         mctp_eid, instanceId, PLDM_PLATFORM, PLDM_GET_PDR,
         std::move(requestMsg),
-        std::bind_front(&HostPDRHandler::processHostPDRs, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->processHostPDRs(eid, response, respMsgLen);
+        });
     if (rc)
     {
         error(
diff --git a/libpldmresponder/base.cpp b/libpldmresponder/base.cpp
index 4a78ee8..37d0dab 100644
--- a/libpldmresponder/base.cpp
+++ b/libpldmresponder/base.cpp
@@ -190,7 +190,9 @@
     if (oemPlatformHandler)
     {
         survEvent = std::make_unique<sdeventplus::source::Defer>(
-            event, std::bind_front(&Handler::_processSetEventReceiver, this));
+            event, [this](sdeventplus::source::EventBase& source) {
+                this->_processSetEventReceiver(source);
+            });
     }
 
     return response;
diff --git a/platform-mc/sensor_manager.cpp b/platform-mc/sensor_manager.cpp
index 46e0786..1cd4826 100644
--- a/platform-mc/sensor_manager.cpp
+++ b/platform-mc/sensor_manager.cpp
@@ -39,8 +39,7 @@
     updateAvailableState(tid, true);
 
     sensorPollTimers[tid] = std::make_unique<sdbusplus::Timer>(
-        event.get(),
-        std::bind_front(&SensorManager::doSensorPolling, this, tid));
+        event.get(), [this, tid] { this->doSensorPolling(tid); });
 
     startSensorPollTimer(tid);
 }
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp
index cdb20b7..9387ffe 100644
--- a/pldmd/pldmd.cpp
+++ b/pldmd/pldmd.cpp
@@ -444,7 +444,10 @@
 #endif
     stdplus::signal::block(SIGUSR1);
     sdeventplus::source::Signal sigUsr1(
-        event, SIGUSR1, std::bind_front(&interruptFlightRecorderCallBack));
+        event, SIGUSR1,
+        [](Signal& signal, const struct signalfd_siginfo* info) {
+            interruptFlightRecorderCallBack(signal, info);
+        });
     int returnCode = event.loop();
     if (returnCode)
     {
diff --git a/requester/mctp_endpoint_discovery.cpp b/requester/mctp_endpoint_discovery.cpp
index ac1277f..db764bf 100644
--- a/requester/mctp_endpoint_discovery.cpp
+++ b/requester/mctp_endpoint_discovery.cpp
@@ -26,15 +26,16 @@
 MctpDiscovery::MctpDiscovery(
     sdbusplus::bus_t& bus,
     std::initializer_list<MctpDiscoveryHandlerIntf*> list) :
-    bus(bus), mctpEndpointAddedSignal(
-                  bus, interfacesAdded(MCTPPath),
-                  std::bind_front(&MctpDiscovery::discoverEndpoints, this)),
+    bus(bus),
+    mctpEndpointAddedSignal(
+        bus, interfacesAdded(MCTPPath),
+        [this](sdbusplus::message_t& msg) { this->discoverEndpoints(msg); }),
     mctpEndpointRemovedSignal(
         bus, interfacesRemoved(MCTPPath),
-        std::bind_front(&MctpDiscovery::removeEndpoints, this)),
+        [this](sdbusplus::message_t& msg) { this->removeEndpoints(msg); }),
     mctpEndpointPropChangedSignal(
         bus, propertiesChangedNamespace(MCTPPath, MCTPInterfaceCC),
-        std::bind_front(&MctpDiscovery::propertiesChangedCb, this)),
+        [this](sdbusplus::message_t& msg) { this->propertiesChangedCb(msg); }),
     handlers(list)
 {
     std::map<MctpInfo, Availability> currentMctpInfoMap;
diff --git a/requester/request.hpp b/requester/request.hpp
index 7182c4b..e5cc9db 100644
--- a/requester/request.hpp
+++ b/requester/request.hpp
@@ -49,7 +49,7 @@
                                std::chrono::milliseconds timeout) :
 
         event(event), numRetries(numRetries), timeout(timeout),
-        timer(event.get(), std::bind_front(&RequestRetryTimer::callback, this))
+        timer(event.get(), [this] { this->callback(); })
     {}
 
     /** @brief Starts the request flow and arms the timer for request retries
diff --git a/requester/test/handler_test.cpp b/requester/test/handler_test.cpp
index 17560c5..caa4663 100644
--- a/requester/test/handler_test.cpp
+++ b/requester/test/handler_test.cpp
@@ -83,7 +83,9 @@
     EXPECT_EQ(instanceId, 0);
     auto rc = reqHandler.registerRequest(
         eid, instanceId, 0, 0, std::move(request),
-        std::bind_front(&HandlerTest::pldmResponseCallBack, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->pldmResponseCallBack(eid, response, respMsgLen);
+        });
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     pldm::Response response(sizeof(pldm_msg_hdr) + sizeof(uint8_t));
@@ -104,7 +106,9 @@
     EXPECT_EQ(instanceId, 0);
     auto rc = reqHandler.registerRequest(
         eid, instanceId, 0, 0, std::move(request),
-        std::bind_front(&HandlerTest::pldmResponseCallBack, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->pldmResponseCallBack(eid, response, respMsgLen);
+        });
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     // Waiting for 500ms so that the instance ID expiry callback is invoked
@@ -123,7 +127,9 @@
     EXPECT_EQ(instanceId, 0);
     auto rc = reqHandler.registerRequest(
         eid, instanceId, 0, 0, std::move(request),
-        std::bind_front(&HandlerTest::pldmResponseCallBack, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->pldmResponseCallBack(eid, response, respMsgLen);
+        });
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     pldm::Request requestNxt{};
@@ -131,7 +137,9 @@
     EXPECT_EQ(instanceIdNxt, 1);
     rc = reqHandler.registerRequest(
         eid, instanceIdNxt, 0, 0, std::move(requestNxt),
-        std::bind_front(&HandlerTest::pldmResponseCallBack, this));
+        [this](mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen) {
+            this->pldmResponseCallBack(eid, response, respMsgLen);
+        });
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     pldm::Response response(sizeof(pldm_msg_hdr) + sizeof(uint8_t));
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp
index 3608002..9721c7e 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -39,7 +39,7 @@
 
 SoftPowerOff::SoftPowerOff(sdbusplus::bus_t& bus, sd_event* event,
                            pldm::InstanceIdDb& instanceIdDb) :
-    bus(bus), timer(event), instanceIdDb(instanceIdDb)
+    timer(event), instanceIdDb(instanceIdDb)
 {
     auto jsonData = parseConfig();
 
diff --git a/softoff/softoff.hpp b/softoff/softoff.hpp
index 866784b..20a59d3 100644
--- a/softoff/softoff.hpp
+++ b/softoff/softoff.hpp
@@ -148,9 +148,6 @@
      */
     bool responseReceived = false;
 
-    /* @brief sdbusplus handle */
-    sdbusplus::bus_t& bus;
-
     /** @brief Reference to Timer object */
     sdbusplus::Timer timer;