summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-05-28 15:57:21 -0700
committerPatrick Venture <venture@google.com>2019-05-28 15:57:21 -0700
commitc674474c6b4f665c7584fbcd9d27f35c0e4190ef (patch)
tree722c8dcf427e63dcfbea70ac30e25642ca21e277 /tools
parent0f82ce40757a3a5dedf419baf7da2d76ccc67750 (diff)
downloadphosphor-ipmi-flash-c674474c6b4f665c7584fbcd9d27f35c0e4190ef.tar.gz
phosphor-ipmi-flash-c674474c6b4f665c7584fbcd9d27f35c0e4190ef.zip
tools: updater: cppcheck fixups
The scope of the variable 'commandAttempts' can be reduced. The scope of the variable 'attempts' can be reduced. The scope of the variable 'exitLoop' can be reduced. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ib2e258c1af7110ff4568695b8f1ea877a9ffef99
Diffstat (limited to 'tools')
-rw-r--r--tools/updater.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/updater.cpp b/tools/updater.cpp
index afef26e..0819c80 100644
--- a/tools/updater.cpp
+++ b/tools/updater.cpp
@@ -114,14 +114,15 @@ bool pollVerificationStatus(std::uint16_t session,
using namespace std::chrono_literals;
static constexpr auto verificationSleep = 5s;
- static constexpr int commandAttempts = 20;
- int attempts = 0;
- bool exitLoop = false;
ipmi_flash::VerifyCheckResponses result =
ipmi_flash::VerifyCheckResponses::other;
try
{
+ static constexpr int commandAttempts = 20;
+ int attempts = 0;
+ bool exitLoop = false;
+
/* Reach back the current status from the verification service output.
*/
while (attempts++ < commandAttempts)
OpenPOWER on IntegriCloud