Enable readability-redundant-control-flow checks
These checks are a nice addition to our static analysis, as they
simplify code quite a bit, as can be seen by this diff being negative
lines.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I60ede4ad23d7e5337e811d70ddcab24bf8986891
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index b8a916c..556a635 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -660,7 +660,6 @@
subValue->updateRetryConfig(retryAttempts, retryTimeoutInterval);
subValue->updateRetryPolicy();
}
- return;
}
void loadOldBehavior()
@@ -1064,8 +1063,6 @@
// Control would be here when Redfish file is created.
// Reset File Position as new file is created
redfishLogFilePosition = 0;
-
- return;
}
void cacheRedfishLogFile()
diff --git a/redfish-core/include/server_sent_events.hpp b/redfish-core/include/server_sent_events.hpp
index dd3cd36..79703f0 100644
--- a/redfish-core/include/server_sent_events.hpp
+++ b/redfish-core/include/server_sent_events.hpp
@@ -248,8 +248,6 @@
break;
}
}
-
- return;
}
public:
diff --git a/redfish-core/include/utils/fw_utils.hpp b/redfish-core/include/utils/fw_utils.hpp
index 027c851..a0758d9 100644
--- a/redfish-core/include/utils/fw_utils.hpp
+++ b/redfish-core/include/utils/fw_utils.hpp
@@ -253,8 +253,6 @@
std::array<const char*, 1>{
"xyz.openbmc_project.Software.Version"});
});
-
- return;
}
/**
@@ -405,8 +403,6 @@
return;
}
});
-
- return;
}
} // namespace fw_util
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 0bf03cc..d89710b 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -158,8 +158,6 @@
{
messages::internalError(asyncResp->res);
}
-
- return;
}
inline void parseLDAPConfigData(nlohmann::json& jsonResponse,
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 7c2da78..e4e5eb9 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -1853,11 +1853,7 @@
inline bool verifyNames(const std::string& parent, const std::string& iface)
{
- if (!boost::starts_with(iface, parent + "_"))
- {
- return false;
- }
- return true;
+ return boost::starts_with(iface, parent + "_");
}
inline void requestEthernetInterfacesRoutes(App& app)
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index f35db24..9f40725 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -3364,12 +3364,8 @@
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
end = split[1].data() + split[1].size();
auto [ptrValue, ecValue] = std::from_chars(start, end, currentValue);
- if (ptrValue != end || ecValue != std::errc())
- {
- return false;
- }
- return true;
+ return ptrValue == end && ecValue != std::errc();
}
inline void requestRoutesPostCodesEntryAdditionalData(App& app)
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index af0fd12..8e07881 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -201,8 +201,6 @@
}
}
}
-
- return;
}
inline void getCpuDataByService(std::shared_ptr<bmcweb::AsyncResp> aResp,