From 4512848c056185c654be8645314d46787581beec Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 24 Jun 2019 23:46:31 +0800 Subject: [PATCH] msg/async/dpdk: silence GCC warning no need to std::move() a local variable when returning it. Signed-off-by: Kefu Chai --- src/msg/async/dpdk/DPDK.h | 4 ++-- src/msg/async/dpdk/Packet.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msg/async/dpdk/DPDK.h b/src/msg/async/dpdk/DPDK.h index fa12af6b279..6bb52973e09 100644 --- a/src/msg/async/dpdk/DPDK.h +++ b/src/msg/async/dpdk/DPDK.h @@ -833,7 +833,7 @@ class DPDKDevice { subscription receive(unsigned cpuid, std::function next_packet) { auto sub = _queues[cpuid]->_rx_stream.listen(std::move(next_packet)); _queues[cpuid]->rx_start(); - return std::move(sub); + return sub; } ethernet_address hw_address() { struct ether_addr mac; @@ -849,7 +849,7 @@ class DPDKDevice { std::unique_ptr init_local_queue(CephContext *c, EventCenter *center, string hugepages, uint16_t qid) { std::unique_ptr qp; qp = std::unique_ptr(new DPDKQueuePair(c, center, this, qid)); - return std::move(qp); + return qp; } unsigned hash2qid(uint32_t hash) { // return hash % hw_queues_count(); diff --git a/src/msg/async/dpdk/Packet.h b/src/msg/async/dpdk/Packet.h index db9cd2a7649..f929da31786 100644 --- a/src/msg/async/dpdk/Packet.h +++ b/src/msg/async/dpdk/Packet.h @@ -125,7 +125,7 @@ class Packet { n->rss_hash.construct(old->rss_hash); std::copy(old->frags, old->frags + old->_nr_frags, n->frags); old->copy_internal_fragment_to(n.get()); - return std::move(n); + return n; } static std::unique_ptr copy(impl* old) { @@ -134,7 +134,7 @@ class Packet { static std::unique_ptr allocate_if_needed(std::unique_ptr old, size_t extra_frags) { if (old->_allocated_frags >= old->_nr_frags + extra_frags) { - return std::move(old); + return old; } return copy(old.get(), std::max(old->_nr_frags + extra_frags, 2 * old->_nr_frags)); } -- 2.39.5