summaryrefslogtreecommitdiff
path: root/include/ibm
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-01-25 21:07:45 +0300
committerEd Tanous <ed@tanous.net>2022-02-07 19:41:37 +0300
commitdcf2ebc020257bc298d948fcb4da761c284e84d7 (patch)
tree5e1ee6dc29480f7b26cd39bf9a9bd0d6759bfdaa /include/ibm
parent104f09c95af2b3068e7afd655e4cebcad2bf0617 (diff)
downloadbmcweb-dcf2ebc020257bc298d948fcb4da761c284e84d7.tar.xz
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
Diffstat (limited to 'include/ibm')
-rw-r--r--include/ibm/locks.hpp7
-rw-r--r--include/ibm/management_console_rest.hpp8
2 files changed, 1 insertions, 14 deletions
diff --git a/include/ibm/locks.hpp b/include/ibm/locks.hpp
index 4434e1f117..10f0a9a66b 100644
--- a/include/ibm/locks.hpp
+++ b/include/ibm/locks.hpp
@@ -544,12 +544,7 @@ inline bool Lock::checkByte(uint64_t resourceId1, uint64_t resourceId2,
BMCWEB_LOG_DEBUG << "Comparing bytes " << std::to_string(pPosition) << ","
<< std::to_string(qPosition);
- if (pPosition != qPosition)
- {
- return false;
- }
-
- return true;
+ return pPosition == qPosition;
}
inline bool Lock::isConflictRecord(const LockRequest& refLockRecord1,
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index 57c9d8328f..876ceb3d18 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -257,7 +257,6 @@ inline void
asyncResp->res.jsonValue["Actions"]["#IBMConfigFiles.DeleteAll"] = {
{"target",
"/ibm/v1/Host/ConfigFiles/Actions/IBMConfigFiles.DeleteAll"}};
- return;
}
inline void
@@ -280,7 +279,6 @@ inline void
<< ec;
}
}
- return;
}
inline void
@@ -297,7 +295,6 @@ inline void
{"target", "/ibm/v1/HMC/LockService/Actions/LockService.ReleaseLock"}};
asyncResp->res.jsonValue["Actions"]["#LockService.GetLockList"] = {
{"target", "/ibm/v1/HMC/LockService/Actions/LockService.GetLockList"}};
- return;
}
inline void handleFileGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -330,7 +327,6 @@ inline void handleFileGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
fileData = {std::istreambuf_iterator<char>(readfile),
std::istreambuf_iterator<char>()};
asyncResp->res.jsonValue["Data"] = fileData;
- return;
}
inline void
@@ -362,7 +358,6 @@ inline void
asyncResp->res.result(boost::beast::http::status::not_found);
asyncResp->res.jsonValue["Description"] = resourceNotFoundMsg;
}
- return;
}
inline void
@@ -385,7 +380,6 @@ inline void
return;
}
redfish::EventServiceManager::getInstance().sendBroadcastMsg(broadcastMsg);
- return;
}
inline void handleFileUrl(const crow::Request& req,
@@ -545,7 +539,6 @@ inline void
{
crow::ibm_mc_lock::Lock::getInstance().releaseLock(req.session->uniqueId);
asyncResp->res.result(boost::beast::http::status::ok);
- return;
}
inline void
@@ -603,7 +596,6 @@ inline void
returnJson["SegmentFlags"] = myArray;
asyncResp->res.jsonValue["Record"] = returnJson;
- return;
}
inline void