controller: Avoid pessimistic moves
clang-6.0 reports that some of the moves prevent further optimisations, so
remove them.
$ make
make all-am
make[1]: Entering directory '/home/andrew/src/openbmc/phosphor-led-sysfs'
CXX controller.o
controller.cpp:60:12: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
path = std::move(DEVPATH + name);
^
controller.cpp:60:12: note: remove std::move call here
path = std::move(DEVPATH + name);
^~~~~~~~~~ ~
controller.cpp:75:16: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
auto bus = std::move(sdbusplus::bus::new_default());
^
controller.cpp:75:16: note: remove std::move call here
auto bus = std::move(sdbusplus::bus::new_default());
^~~~~~~~~~ ~
2 errors generated.
Makefile:761: recipe for target 'controller.o' failed
make[1]: *** [controller.o] Error 1
make[1]: Leaving directory '/home/andrew/src/openbmc/phosphor-led-sysfs'
Makefile:617: recipe for target 'all' failed
make: *** [all] Error 2
Change-Id: I3da6415def4ab183cc9f6c5e176e8bb3666cf1b7
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/controller.cpp b/controller.cpp
index f945034..02120e2 100644
--- a/controller.cpp
+++ b/controller.cpp
@@ -59,7 +59,7 @@
// LED names may have a hyphen and that would be an issue for
// dbus paths and hence need to convert them to underscores.
std::replace(name.begin(), name.end(), '/', '-');
- path = std::move(DEVPATH + name);
+ path = DEVPATH + name;
// Convert to lowercase just in case some are not and that
// we follow lowercase all over
@@ -74,7 +74,7 @@
auto objPath = std::string(OBJPATH) + '/' + name;
// Get a handle to system dbus.
- auto bus = std::move(sdbusplus::bus::new_default());
+ auto bus = sdbusplus::bus::new_default();
// Add systemd object manager.
sdbusplus::server::manager::manager(bus, objPath.c_str());