use sdbusplus unpack syntax

Rather than defining a variable and then reading it from a message,
sdbusplus also supports directly unpack-ing from the message.  Use
this syntax instead as it is more efficient and succinct.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia8fd88354883f8a91310de477abeef444fa6bc5f
diff --git a/phosphor-power-supply/new_power_supply.cpp b/phosphor-power-supply/new_power_supply.cpp
index b3ba1c7..d35cbd8 100644
--- a/phosphor-power-supply/new_power_supply.cpp
+++ b/phosphor-power-supply/new_power_supply.cpp
@@ -848,8 +848,8 @@
 
 void PowerSupply::inventoryAdded(sdbusplus::message_t& msg)
 {
-    sdbusplus::message::object_path path;
-    msg.read(path);
+    auto path = msg.unpack<sdbusplus::message::object_path>();
+
     // Make sure the signal is for the PSU inventory path
     if (path == inventoryPath)
     {
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 65e7b62..fba8930 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -833,8 +833,8 @@
 
 void PowerSupply::inventoryAdded(sdbusplus::message_t& msg)
 {
-    sdbusplus::message::object_path path;
-    msg.read(path);
+    auto path = msg.unpack<sdbusplus::message::object_path>();
+
     // Make sure the signal is for the PSU inventory path
     if (path == inventoryPath)
     {
diff --git a/utility.cpp b/utility.cpp
index 53fe965..94de833 100644
--- a/utility.cpp
+++ b/utility.cpp
@@ -47,8 +47,8 @@
 
     auto reply = bus.call(method);
 
-    std::map<std::string, std::vector<std::string>> response;
-    reply.read(response);
+    auto response =
+        reply.unpack<std::map<std::string, std::vector<std::string>>>();
 
     if (response.empty())
     {
@@ -106,8 +106,8 @@
 
     auto reply = bus.call(mapperCall);
 
-    DbusSubtree response;
-    reply.read(response);
+    auto response = reply.unpack<DbusSubtree>();
+
     return response;
 }
 
@@ -127,8 +127,8 @@
 
     auto reply = bus.call(mapperCall);
 
-    std::vector<DbusPath> response;
-    reply.read(response);
+    auto response = reply.unpack<std::vector<DbusPath>>();
+
     return response;
 }