Make clang-tidy changes
clang-tidy has a number of checks it recommends. These checks are
documented in the next commit, but make the code pass our coding
standard.
Tested:
Minor changes made by the robot.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I6cfaab92211af9c4c1eccd981ba9fe7b8c523457
diff --git a/src/overlay.cpp b/src/overlay.cpp
index 966bfd1..9dfb6b1 100644
--- a/src/overlay.cpp
+++ b/src/overlay.cpp
@@ -17,8 +17,8 @@
#include "overlay.hpp"
-#include "utils.hpp"
#include "devices.hpp"
+#include "utils.hpp"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/asio/io_context.hpp>
@@ -187,7 +187,7 @@
const std::string& destructor, const bool createsHWMon,
const size_t retries = 5)
{
- if (!retries)
+ if (retries == 0U)
{
return -1;
}
@@ -282,7 +282,8 @@
int err = buildDevice(busPath, parameters, bus, address, constructor,
destructor, createsHWMon);
- if (!err && boost::ends_with(type, "Mux") && bus && address && channels)
+ if ((err == 0) && boost::ends_with(type, "Mux") && bus && address &&
+ (channels != nullptr))
{
linkMux(name, static_cast<size_t>(*bus), static_cast<size_t>(*address),
*channels);
@@ -302,7 +303,7 @@
continue;
}
- for (auto& configuration : *findExposes)
+ for (const auto& configuration : *findExposes)
{
auto findStatus = configuration.find("Status");
// status missing is assumed to be 'okay'