Fix cppcheck warnings

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I18be21d5141630a1da3d5e54740b54a9a06496d9
diff --git a/inc/button_factory.hpp b/inc/button_factory.hpp
index 0d427f7..fc75f4f 100644
--- a/inc/button_factory.hpp
+++ b/inc/button_factory.hpp
@@ -46,7 +46,7 @@
      * @brief this method returns the button interface object
      *    corresponding to the button formfactor name provided
      */
-    std::unique_ptr<ButtonIface> createInstance(std::string name,
+    std::unique_ptr<ButtonIface> createInstance(const std::string& name,
                                                 sdbusplus::bus::bus& bus,
                                                 EventPtr& event,
                                                 buttonConfig& buttonCfg)