summaryrefslogtreecommitdiffstats
path: root/ubi/watch.hpp
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2019-03-05 16:02:31 +0800
committerLei YU <mine260309@gmail.com>2019-03-13 11:01:53 +0800
commit1db9adf37900c8503b3c9fa3fe39eef9406a30ff (patch)
tree7bc71b34d81babad764997c3c7620b88c9a2da31 /ubi/watch.hpp
parent07830764398601b38d6dea9db269a7fb8efabbc8 (diff)
downloadopenpower-pnor-code-mgmt-1db9adf37900c8503b3c9fa3fe39eef9406a30ff.tar.gz
openpower-pnor-code-mgmt-1db9adf37900c8503b3c9fa3fe39eef9406a30ff.zip
Refactor: Fix issues found by cppcheck
Resolve several issues found by cppcheck: [msl_verify.hpp:28]: (style) Class 'MinimumShipLevel' has a constructor with 1 argument that is not explicit. [ubi/watch.hpp:21]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [item_updater_main.cpp:22] -> [item_updater_main.cpp:49]: (style) Local variable rc shadows outer symbol [serialize.cpp:19]: (performance) Function parameter 'versionId' should be passed by const reference. [ubi/watch.hpp:43]: (style) Struct 'CustomFd' has a constructor with 1 argument that is not explicit. [serialize.cpp:52]: (performance) Function parameter 'versionId' should be passed by const reference. [serialize.cpp:116]: (performance) Function parameter 'versionId' should be passed by const reference. [activation.cpp:115] -> [activation.cpp:152]: (style) Local variable mapperResponseMsg shadows outer symbol [version.hpp:114]: (performance) Variable 'eraseCallback' is assigned in constructor body. Consider performing initialization in initialization list. [image_verify.hpp:53]: (style) Struct 'CustomFd' has a constructor with 1 argument that is not explicit. [ubi/item_updater_ubi.cpp:192]: (performance) Function parameter 'versionId' should be passed by const reference. [ubi/item_updater_ubi.cpp:203]: (performance) Function parameter 'versionId' should be passed by const reference. Tested: Verify the code compiles and cppcheck does not report the above issues. Change-Id: I096392a2a7a283fe198c9c29185125e61295e10f Signed-off-by: Lei YU <mine260309@gmail.com>
Diffstat (limited to 'ubi/watch.hpp')
-rw-r--r--ubi/watch.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ubi/watch.hpp b/ubi/watch.hpp
index a04967e57..4d195a3e1 100644
--- a/ubi/watch.hpp
+++ b/ubi/watch.hpp
@@ -18,7 +18,7 @@ struct EventSourceDeleter
{
void operator()(sd_event_source* eventSource) const
{
- eventSource = sd_event_source_unref(eventSource);
+ sd_event_source_unref(eventSource);
}
};
using EventSourcePtr = std::unique_ptr<sd_event_source, EventSourceDeleter>;
@@ -40,7 +40,7 @@ struct CustomFd
*
* @param[in] fd - File descriptor
*/
- CustomFd(int fd) : fd(fd)
+ explicit CustomFd(int fd) : fd(fd)
{
}
OpenPOWER on IntegriCloud