user_channel: user_mgmt: minor cleanup from cppcheck
[user_channel/user_mgmt.cpp:1628]: (style) The scope
of the variable 'usrEnabled' can be reduced.
[user_channel/user_mgmt.cpp:310]: (style) Unused variable: update
Tested: Not tested.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Id38469ab5d5b0fa9c512f5a77fff1f1372e794c2
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index 000e9b1..bf43f88 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -307,7 +307,7 @@
{
static sdbusplus::bus::bus bus(ipmid_get_sd_bus_connection());
std::string signal = msg.get_member();
- std::string userName, update, priv, newUserName;
+ std::string userName, priv, newUserName;
std::vector<std::string> groups;
bool enabled = false;
UserUpdateEvent userEvent = UserUpdateEvent::reservedEvent;
@@ -1625,7 +1625,6 @@
{
std::vector<std::string> usrGrps;
std::string usrPriv;
- bool usrEnabled;
std::string userName(
reinterpret_cast<char*>(userData->user[usrIdx].userName), 0,
@@ -1636,6 +1635,8 @@
auto usrObj = managedObjs.find(usersPath);
if (usrObj != managedObjs.end())
{
+ bool usrEnabled;
+
// User exist. Lets check and update other fileds
getUserObjProperties(usrObj->second, usrGrps, usrPriv,
usrEnabled);