From: Danny Al-Gaaf Date: Thu, 5 Mar 2015 05:47:57 +0000 (+0100) Subject: rgw_rados: don't assign value to parameter X-Git-Tag: v9.0.0~186^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db175fb93802995f1625612818680e45d8650c9a;p=ceph.git rgw_rados: don't assign value to parameter Fix for cppcheck issue: Assignment of function parameter has no effect outside the function. Remove assignment to need_to_wait before exit. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index cb2ed4bd049d..2f7c7af1b30b 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -975,6 +975,8 @@ int RGWPutObjProcessor_Aio::drain_pending() int RGWPutObjProcessor_Aio::throttle_data(void *handle, bool need_to_wait) { + bool _wait = need_to_wait; + if (handle) { struct put_obj_aio_info info; info.handle = handle; @@ -988,7 +990,7 @@ int RGWPutObjProcessor_Aio::throttle_data(void *handle, bool need_to_wait) if (r < 0) return r; - need_to_wait = false; + _wait = false; } /* resize window in case messages are draining too fast */ @@ -997,13 +999,10 @@ int RGWPutObjProcessor_Aio::throttle_data(void *handle, bool need_to_wait) } /* now throttle. Note that need_to_wait should only affect the first IO operation */ - if (pending.size() > max_chunks || - need_to_wait) { + if (pending.size() > max_chunks || _wait) { int r = wait_pending_front(); if (r < 0) return r; - - need_to_wait = false; } return 0; }