]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/async/dpdk: silence GCC warning
authorKefu Chai <kchai@redhat.com>
Mon, 24 Jun 2019 15:46:31 +0000 (23:46 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 27 Jun 2019 11:53:41 +0000 (19:53 +0800)
no need to std::move() a local variable when returning it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/msg/async/dpdk/DPDK.h
src/msg/async/dpdk/Packet.h

index fa12af6b279a06716dee3cec4338011dd35c64c3..6bb52973e095a0e0c35c3a036297d864599e82ef 100644 (file)
@@ -833,7 +833,7 @@ class DPDKDevice {
   subscription<Packet> receive(unsigned cpuid, std::function<int (Packet)> 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<DPDKQueuePair> init_local_queue(CephContext *c, EventCenter *center, string hugepages, uint16_t qid) {
     std::unique_ptr<DPDKQueuePair> qp;
     qp = std::unique_ptr<DPDKQueuePair>(new DPDKQueuePair(c, center, this, qid));
-    return std::move(qp);
+    return qp;
   }
   unsigned hash2qid(uint32_t hash) {
     // return hash % hw_queues_count();
index db9cd2a7649d638fb4ea7a0abda2d95f1a8a8d09..f929da317860e64b5b7bef5f6cf1f311587d668c 100644 (file)
@@ -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<impl> copy(impl* old) {
@@ -134,7 +134,7 @@ class Packet {
 
     static std::unique_ptr<impl> allocate_if_needed(std::unique_ptr<impl> 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<size_t>(old->_nr_frags + extra_frags, 2 * old->_nr_frags));
     }