style: move getService into anonymous namespace

Move getService into an anonymous namespace.

Change-Id: I75df449858bdc8347fafe3c0ab839ff18b5a2496
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/writefrudata.cpp b/writefrudata.cpp
index 42ebd67..130f30f 100644
--- a/writefrudata.cpp
+++ b/writefrudata.cpp
@@ -105,6 +105,39 @@
     return fruValue;
 }
 
+// Get the inventory service from the mapper.
+auto getService(sdbusplus::bus::bus& bus, const std::string& intf,
+                const std::string& path)
+{
+    auto mapperCall =
+        bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+                            "/xyz/openbmc_project/object_mapper",
+                            "xyz.openbmc_project.ObjectMapper", "GetObject");
+
+    mapperCall.append(path);
+    mapperCall.append(std::vector<std::string>({intf}));
+    std::map<std::string, std::vector<std::string>> mapperResponse;
+
+    try
+    {
+        auto mapperResponseMsg = bus.call(mapperCall);
+        mapperResponseMsg.read(mapperResponse);
+    }
+    catch (const sdbusplus::exception::SdBusError& ex)
+    {
+        log<level::ERR>("Exception from sdbus call",
+                        entry("WHAT=%s", ex.what()));
+        throw;
+    }
+
+    if (mapperResponse.begin() == mapperResponse.end())
+    {
+        throw std::runtime_error("ERROR in reading the mapper response");
+    }
+
+    return mapperResponse.begin()->first;
+}
+
 } // namespace
 
 //----------------------------------------------------------------
@@ -282,39 +315,6 @@
     return EXIT_SUCCESS;
 }
 
-// Get the inventory service from the mapper.
-auto getService(sdbusplus::bus::bus& bus, const std::string& intf,
-                const std::string& path)
-{
-    auto mapperCall =
-        bus.new_method_call("xyz.openbmc_project.ObjectMapper",
-                            "/xyz/openbmc_project/object_mapper",
-                            "xyz.openbmc_project.ObjectMapper", "GetObject");
-
-    mapperCall.append(path);
-    mapperCall.append(std::vector<std::string>({intf}));
-    std::map<std::string, std::vector<std::string>> mapperResponse;
-
-    try
-    {
-        auto mapperResponseMsg = bus.call(mapperCall);
-        mapperResponseMsg.read(mapperResponse);
-    }
-    catch (const sdbusplus::exception::SdBusError& ex)
-    {
-        log<level::ERR>("Exception from sdbus call",
-                        entry("WHAT=%s", ex.what()));
-        throw;
-    }
-
-    if (mapperResponse.begin() == mapperResponse.end())
-    {
-        throw std::runtime_error("ERROR in reading the mapper response");
-    }
-
-    return mapperResponse.begin()->first;
-}
-
 //------------------------------------------------------------------------
 // Takes FRU data, invokes Parser for each fru record area and updates
 // Inventory