diff --git a/user_channel/channel_layer.hpp b/user_channel/channel_layer.hpp
index 42e5b5e..37d2b90 100644
--- a/user_channel/channel_layer.hpp
+++ b/user_channel/channel_layer.hpp
@@ -16,8 +16,9 @@
 #pragma once
 #include <openssl/crypto.h>
 
-#include <array>
 #include <ipmid/api.hpp>
+
+#include <array>
 #include <string>
 
 namespace ipmi
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 94137ff..a179b37 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -25,13 +25,14 @@
 #include <unistd.h>
 
 #include <boost/interprocess/sync/scoped_lock.hpp>
+#include <phosphor-logging/log.hpp>
+#include <sdbusplus/bus/match.hpp>
+#include <sdbusplus/server/object.hpp>
+
 #include <cerrno>
 #include <exception>
 #include <filesystem>
 #include <fstream>
-#include <phosphor-logging/log.hpp>
-#include <sdbusplus/bus/match.hpp>
-#include <sdbusplus/server/object.hpp>
 #include <unordered_map>
 
 namespace ipmi
@@ -180,7 +181,6 @@
 
 std::string ChannelConfig::getChannelNameFromPath(const std::string& path)
 {
-
     constexpr size_t length = strlen(networkIntfObjectBasePath);
     if (((length + 1) >= path.size()) ||
         path.compare(0, length, networkIntfObjectBasePath))
@@ -350,11 +350,11 @@
                     dBusPropertiesInterface) +
                 sdbusplus::bus::match::rules::argN(0, networkChConfigIntfName),
             [&](sdbusplus::message_t& msg) {
-                DbusChObjProperties props;
-                std::string iface;
-                std::string path = msg.get_path();
-                msg.read(iface, props);
-                processChAccessPropChange(path, props);
+            DbusChObjProperties props;
+            std::string iface;
+            std::string path = msg.get_path();
+            msg.read(iface, props);
+            processChAccessPropChange(path, props);
             });
         signalHndlrObjectState = true;
 
@@ -774,8 +774,8 @@
 EChannelSessSupported
     ChannelConfig::convertToSessionSupportIndex(const std::string& value)
 {
-    auto iter =
-        std::find(sessionSupportList.begin(), sessionSupportList.end(), value);
+    auto iter = std::find(sessionSupportList.begin(), sessionSupportList.end(),
+                          value);
     if (iter == sessionSupportList.end())
     {
         log<level::ERR>("Invalid session supported.",
@@ -981,11 +981,11 @@
             ChannelProperties& chData = channelData[chNum];
             chData.chID = chNum;
             chData.chName = jsonChData[nameString].get<std::string>();
-            chData.isChValid =
-                channelFound && jsonChData[isValidString].get<bool>();
+            chData.isChValid = channelFound &&
+                               jsonChData[isValidString].get<bool>();
             chData.activeSessCount = jsonChData.value(activeSessionsString, 0);
-            chData.maxTransferSize =
-                jsonChData.value(maxTransferSizeString, smallChannelSize);
+            chData.maxTransferSize = jsonChData.value(maxTransferSizeString,
+                                                      smallChannelSize);
             if (jsonChData.count(isManagementNIC) != 0)
             {
                 chData.isManagementNIC =
@@ -1310,9 +1310,9 @@
 {
     try
     {
-        auto method =
-            bus.new_method_call(service.c_str(), objPath.c_str(),
-                                "org.freedesktop.DBus.Properties", "Set");
+        auto method = bus.new_method_call(service.c_str(), objPath.c_str(),
+                                          "org.freedesktop.DBus.Properties",
+                                          "Set");
 
         method.append(interface, property, value);
 
@@ -1339,9 +1339,9 @@
 {
     try
     {
-        auto method =
-            bus.new_method_call(service.c_str(), objPath.c_str(),
-                                "org.freedesktop.DBus.Properties", "Get");
+        auto method = bus.new_method_call(service.c_str(), objPath.c_str(),
+                                          "org.freedesktop.DBus.Properties",
+                                          "Get");
 
         method.append(interface, property);
 
diff --git a/user_channel/channel_mgmt.hpp b/user_channel/channel_mgmt.hpp
index 9b03063..a8de017 100644
--- a/user_channel/channel_mgmt.hpp
+++ b/user_channel/channel_mgmt.hpp
@@ -20,10 +20,11 @@
 
 #include <boost/interprocess/sync/file_lock.hpp>
 #include <boost/interprocess/sync/named_recursive_mutex.hpp>
-#include <cstdint>
-#include <ctime>
 #include <nlohmann/json.hpp>
 #include <sdbusplus/bus.hpp>
+
+#include <cstdint>
+#include <ctime>
 #include <variant>
 
 namespace ipmi
diff --git a/user_channel/channelcommands.cpp b/user_channel/channelcommands.cpp
index 769f9ff..02a50ce 100644
--- a/user_channel/channelcommands.cpp
+++ b/user_channel/channelcommands.cpp
@@ -19,6 +19,7 @@
 
 #include <ipmid/api.hpp>
 #include <phosphor-logging/log.hpp>
+
 #include <regex>
 
 using namespace phosphor::logging;
@@ -255,8 +256,8 @@
         return responseInvalidFieldRequest();
     }
 
-    uint8_t chNum =
-        convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
+    uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
+                                             ctx->channel);
     if (!isValidChannel(chNum))
     {
         log<level::DEBUG>("Get channel Info - No support on channel");
@@ -323,8 +324,8 @@
     ipmiGetChannelPayloadSupport(Context::ptr ctx, uint4_t channel,
                                  uint4_t reserved)
 {
-    uint8_t chNum =
-        convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
+    uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
+                                             ctx->channel);
 
     if (!doesDeviceExist(chNum) || !isValidChannel(chNum) || reserved)
     {
@@ -367,8 +368,8 @@
     ipmiGetChannelPayloadVersion(Context::ptr ctx, uint4_t chNum,
                                  uint4_t reserved, uint8_t payloadTypeNum)
 {
-    uint8_t channel =
-        convertCurrentChannelNum(static_cast<uint8_t>(chNum), ctx->channel);
+    uint8_t channel = convertCurrentChannelNum(static_cast<uint8_t>(chNum),
+                                               ctx->channel);
     constexpr uint8_t payloadTypeNotSupported = 0x80;
 
     if (reserved || !isValidChannel(channel))
diff --git a/user_channel/cipher_mgmt.cpp b/user_channel/cipher_mgmt.cpp
index 5f50c86..a2f024b 100644
--- a/user_channel/cipher_mgmt.cpp
+++ b/user_channel/cipher_mgmt.cpp
@@ -20,9 +20,10 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <phosphor-logging/log.hpp>
+
 #include <filesystem>
 #include <fstream>
-#include <phosphor-logging/log.hpp>
 
 namespace ipmi
 {
@@ -117,8 +118,8 @@
 
 int CipherConfig::writeCSPrivilegeLevels(const Json& jsonData)
 {
-    std::string tmpFile =
-        static_cast<std::string>(cipherSuitePrivFileName) + "_tmpXXXXXX";
+    std::string tmpFile = static_cast<std::string>(cipherSuitePrivFileName) +
+                          "_tmpXXXXXX";
 
     std::vector<char> tmpRandomFile(tmpFile.length() + 1);
     strncpy(tmpRandomFile.data(), tmpFile.c_str(), tmpFile.length() + 1);
diff --git a/user_channel/cipher_mgmt.hpp b/user_channel/cipher_mgmt.hpp
index f2ea9f3..0bd6b1d 100644
--- a/user_channel/cipher_mgmt.hpp
+++ b/user_channel/cipher_mgmt.hpp
@@ -18,9 +18,10 @@
 
 #include <ipmid/api-types.hpp>
 #include <ipmid/message/types.hpp>
-#include <map>
 #include <nlohmann/json.hpp>
 
+#include <map>
+
 namespace ipmi
 {
 static const std::string csPrivDefaultFileName =
diff --git a/user_channel/passwd_mgr.cpp b/user_channel/passwd_mgr.cpp
index 9b232b5..7b5b7ec 100644
--- a/user_channel/passwd_mgr.cpp
+++ b/user_channel/passwd_mgr.cpp
@@ -26,11 +26,12 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include <phosphor-logging/log.hpp>
+
 #include <cerrno>
 #include <cstring>
 #include <fstream>
 #include <iomanip>
-#include <phosphor-logging/log.hpp>
 
 namespace ipmi
 {
@@ -199,8 +200,8 @@
                                    inBytes, inBytesLen)))
     {
         outLen += outEVPLen;
-        if ((retval =
-                 EVP_CipherFinal(ctx.get(), outBytes + outLen, &outEVPLen)))
+        if ((retval = EVP_CipherFinal(ctx.get(), outBytes + outLen,
+                                      &outEVPLen)))
         {
             outLen += outEVPLen;
             *outBytesLen = outLen;
@@ -381,8 +382,8 @@
 
     if (dataBuf.size() != 0)
     {
-        inBytesLen =
-            dataBuf.size() + newUserName.size() + EVP_CIPHER_block_size(cipher);
+        inBytesLen = dataBuf.size() + newUserName.size() +
+                     EVP_CIPHER_block_size(cipher);
     }
 
     SecureString inBytes(inBytesLen, '\0');
diff --git a/user_channel/passwd_mgr.hpp b/user_channel/passwd_mgr.hpp
index 8704f83..338f249 100644
--- a/user_channel/passwd_mgr.hpp
+++ b/user_channel/passwd_mgr.hpp
@@ -16,8 +16,9 @@
 #pragma once
 #include <openssl/evp.h>
 
-#include <ctime>
 #include <ipmid/types.hpp>
+
+#include <ctime>
 #include <string>
 #include <unordered_map>
 #include <vector>
diff --git a/user_channel/user_layer.cpp b/user_channel/user_layer.cpp
index bb9ac38..5a2e7e0 100644
--- a/user_channel/user_layer.cpp
+++ b/user_channel/user_layer.cpp
@@ -141,7 +141,6 @@
 Cc ipmiUserGetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
                               PrivAccess& privAccess)
 {
-
     if (!UserAccess::isValidChannel(chNum))
     {
         return ccInvalidFieldRequest;
@@ -185,7 +184,6 @@
                                 const uint8_t userId,
                                 const PayloadAccess& payloadAccess)
 {
-
     if (!UserAccess::isValidChannel(chNum))
     {
         return ccInvalidFieldRequest;
@@ -202,7 +200,6 @@
 Cc ipmiUserGetUserPayloadAccess(const uint8_t chNum, const uint8_t userId,
                                 PayloadAccess& payloadAccess)
 {
-
     if (!UserAccess::isValidChannel(chNum))
     {
         return ccInvalidFieldRequest;
diff --git a/user_channel/user_layer.hpp b/user_channel/user_layer.hpp
index 82e0d31..8258f6b 100644
--- a/user_channel/user_layer.hpp
+++ b/user_channel/user_layer.hpp
@@ -15,9 +15,10 @@
 */
 #pragma once
 
-#include <bitset>
 #include <ipmid/api.hpp>
 #include <ipmid/types.hpp>
+
+#include <bitset>
 #include <string>
 
 namespace ipmi
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index 7ffee61..2e6e841 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -25,19 +25,20 @@
 
 #include <boost/interprocess/sync/named_recursive_mutex.hpp>
 #include <boost/interprocess/sync/scoped_lock.hpp>
-#include <cerrno>
-#include <fstream>
 #include <ipmid/types.hpp>
 #include <nlohmann/json.hpp>
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/log.hpp>
-#include <regex>
 #include <sdbusplus/bus/match.hpp>
 #include <sdbusplus/server/object.hpp>
-#include <variant>
 #include <xyz/openbmc_project/Common/error.hpp>
 #include <xyz/openbmc_project/User/Common/error.hpp>
 
+#include <cerrno>
+#include <fstream>
+#include <regex>
+#include <variant>
+
 namespace ipmi
 {
 
@@ -158,9 +159,9 @@
 {
     try
     {
-        auto method =
-            bus.new_method_call(service.c_str(), objPath.c_str(),
-                                dBusPropertiesInterface, setPropertiesMethod);
+        auto method = bus.new_method_call(service.c_str(), objPath.c_str(),
+                                          dBusPropertiesInterface,
+                                          setPropertiesMethod);
         method.append(interface, property, value);
         bus.call(method);
     }
@@ -182,8 +183,8 @@
     {
         try
         {
-            userMgmtService =
-                ipmi::getUserService(bus, userMgrInterface, userMgrObjBasePath);
+            userMgmtService = ipmi::getUserService(bus, userMgrInterface,
+                                                   userMgrObjBasePath);
         }
         catch (const sdbusplus::exception_t& e)
         {
@@ -656,8 +657,8 @@
             return PAM_BUF_ERR;
         }
 
-        void* ptr =
-            calloc(static_cast<size_t>(numMsg), sizeof(struct pam_response));
+        void* ptr = calloc(static_cast<size_t>(numMsg),
+                           sizeof(struct pam_response));
         if (ptr == nullptr)
         {
             free(pass);
@@ -690,8 +691,8 @@
                                                const_cast<char*>(password)};
     pam_handle_t* localAuthHandle = NULL; // this gets set by pam_start
 
-    int retval =
-        pam_start("passwd", username, &localConversation, &localAuthHandle);
+    int retval = pam_start("passwd", username, &localConversation,
+                           &localAuthHandle);
 
     if (retval != PAM_SUCCESS)
     {
@@ -1398,8 +1399,8 @@
 
         readPayloadAccessFromUserInfo(usersTbl.user[usrIndex], stdPayload,
                                       oemPayload);
-        Json jsonPayloadEnabledInfo =
-            constructJsonPayloadEnables(stdPayload, oemPayload);
+        Json jsonPayloadEnabledInfo = constructJsonPayloadEnables(stdPayload,
+                                                                  oemPayload);
         jsonUserInfo[payloadEnabledStr] = jsonPayloadEnabledInfo;
 
         jsonUsersTbl.push_back(jsonUserInfo);
@@ -1662,7 +1663,7 @@
                 sdbusplus::bus::match::rules::interface(dBusObjManager) +
                 sdbusplus::bus::match::rules::path(userMgrObjBasePath),
             [&](sdbusplus::message_t& msg) {
-                userUpdatedSignalHandler(*this, msg);
+            userUpdatedSignalHandler(*this, msg);
             });
         userMgrRenamedSignal = std::make_unique<sdbusplus::bus::match_t>(
             bus,
@@ -1670,7 +1671,7 @@
                 sdbusplus::bus::match::rules::interface(userMgrInterface) +
                 sdbusplus::bus::match::rules::path(userMgrObjBasePath),
             [&](sdbusplus::message_t& msg) {
-                userUpdatedSignalHandler(*this, msg);
+            userUpdatedSignalHandler(*this, msg);
             });
         userPropertiesSignal = std::make_unique<sdbusplus::bus::match_t>(
             bus,
@@ -1681,7 +1682,7 @@
                 sdbusplus::bus::match::rules::member(propertiesChangedSignal) +
                 sdbusplus::bus::match::rules::argN(0, usersInterface),
             [&](sdbusplus::message_t& msg) {
-                userUpdatedSignalHandler(*this, msg);
+            userUpdatedSignalHandler(*this, msg);
             });
         signalHndlrObject = true;
     }
@@ -1738,8 +1739,8 @@
                 {
                     // Group "ipmi" is present so lets update other properties
                     // in IPMI
-                    uint8_t priv =
-                        UserAccess::convertToIPMIPrivilege(usrPriv) & privMask;
+                    uint8_t priv = UserAccess::convertToIPMIPrivilege(usrPriv) &
+                                   privMask;
                     // Update all channels priv, only if it is not equivalent to
                     // getUsrMgmtSyncIndex()
                     if (userData->user[usrIdx]
diff --git a/user_channel/user_mgmt.hpp b/user_channel/user_mgmt.hpp
index b3db460..74166c2 100644
--- a/user_channel/user_mgmt.hpp
+++ b/user_channel/user_mgmt.hpp
@@ -18,10 +18,11 @@
 
 #include <boost/interprocess/sync/file_lock.hpp>
 #include <boost/interprocess/sync/named_recursive_mutex.hpp>
-#include <cstdint>
-#include <ctime>
 #include <ipmid/api.hpp>
 #include <sdbusplus/bus.hpp>
+
+#include <cstdint>
+#include <ctime>
 #include <variant>
 
 namespace ipmi
diff --git a/user_channel/usercommands.cpp b/user_channel/usercommands.cpp
index 4ea8c4b..6467e45 100644
--- a/user_channel/usercommands.cpp
+++ b/user_channel/usercommands.cpp
@@ -24,6 +24,7 @@
 
 #include <ipmid/api.hpp>
 #include <phosphor-logging/log.hpp>
+
 #include <regex>
 
 namespace ipmi
@@ -67,8 +68,8 @@
         return ipmi::responseInvalidFieldRequest();
     }
 
-    uint8_t chNum =
-        convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
+    uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
+                                             ctx->channel);
     if (!isValidChannel(chNum))
     {
         log<level::DEBUG>("Set user access - Invalid channel request");
@@ -138,8 +139,8 @@
 
                       uint6_t userId, uint2_t reserved2)
 {
-    uint8_t chNum =
-        convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
+    uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
+                                             ctx->channel);
 
     if (reserved1 || reserved2 || !isValidChannel(chNum))
     {
@@ -167,8 +168,8 @@
     }
 
     bool enabledState = false;
-    retStatus =
-        ipmiUserCheckEnabled(static_cast<uint8_t>(userId), enabledState);
+    retStatus = ipmiUserCheckEnabled(static_cast<uint8_t>(userId),
+                                     enabledState);
     if (retStatus != ccSuccess)
     {
         return ipmi::response(retStatus);
@@ -318,8 +319,8 @@
     }
     else if (operation == opEnableUser || operation == opDisableUser)
     {
-        ipmi::Cc res =
-            ipmiUserUpdateEnabledState(userId, static_cast<bool>(operation));
+        ipmi::Cc res = ipmiUserUpdateEnabledState(userId,
+                                                  static_cast<bool>(operation));
         return ipmi::response(res);
     }
     else if (operation == opTestPassword)
@@ -410,8 +411,8 @@
                                              uint4_t privLevel,
                                              uint4_t reserved2)
 {
-    uint8_t channel =
-        convertCurrentChannelNum(static_cast<uint8_t>(chNum), ctx->channel);
+    uint8_t channel = convertCurrentChannelNum(static_cast<uint8_t>(chNum),
+                                               ctx->channel);
 
     if (reserved1 || reserved2 || !isValidChannel(channel) ||
         !isValidPrivLimit(static_cast<uint8_t>(privLevel)))
@@ -430,16 +431,16 @@
 
     constexpr bool extDataSupport = true; // true for IPMI 2.0 extensions
     constexpr bool reserved3 = false;
-    constexpr uint6_t rmcpAuthTypes = 0; // IPMI 1.5 auth types - not supported
+    constexpr uint6_t rmcpAuthTypes = 0;  // IPMI 1.5 auth types - not supported
     constexpr uint2_t reserved4 = 0;
-    constexpr bool KGStatus = false;       // Not supporting now.
+    constexpr bool KGStatus = false;      // Not supporting now.
     constexpr bool perMessageAuth = false; // Per message auth - enabled
     constexpr bool userAuth = false;       // User authentication - enabled
     constexpr bool nullUsers = false;      // Null user names - not supported
     constexpr bool anonymousLogin = false; // Anonymous login - not supported
     constexpr uint6_t reserved5 = 0;
-    constexpr bool rmcpp = true; // IPMI 2.0 - supported
-    constexpr bool rmcp = false; // IPMI 1.5 - not supported
+    constexpr bool rmcpp = true;           // IPMI 2.0 - supported
+    constexpr bool rmcp = false;           // IPMI 1.5 - not supported
     constexpr uint24_t oemID = 0;
     constexpr uint8_t oemAuxillary = 0;
 
@@ -499,8 +500,8 @@
 
     uint8_t oemPayloadEnables2Reserved)
 {
-    auto chNum =
-        convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
+    auto chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
+                                          ctx->channel);
     // Validate the reserved args. Only SOL payload is supported as on date.
     if (reserved || stdPayload0ipmiReserved || stdPayload2 || stdPayload3 ||
         stdPayload4 || stdPayload5 || stdPayload6 || stdPayload7 ||
@@ -566,27 +567,27 @@
 
  *  - oemPayloadEnables2Reserved - Reserved
  */
-ipmi::RspType<bool, // stdPayload0ipmiReserved
-              bool, // stdPayload1SOL
-              bool, // stdPayload2
-              bool, // stdPayload3
-              bool, // stdPayload4
-              bool, // stdPayload5
-              bool, // stdPayload6
-              bool, // stdPayload7
+ipmi::RspType<bool,    // stdPayload0ipmiReserved
+              bool,    // stdPayload1SOL
+              bool,    // stdPayload2
+              bool,    // stdPayload3
+              bool,    // stdPayload4
+              bool,    // stdPayload5
+              bool,    // stdPayload6
+              bool,    // stdPayload7
 
               uint8_t, // stdPayloadEnables2Reserved
 
-              bool, // oemPayload0
-              bool, // oemPayload1
-              bool, // oemPayload2
-              bool, // oemPayload3
-              bool, // oemPayload4
-              bool, // oemPayload5
-              bool, // oemPayload6
-              bool, // oemPayload7
+              bool,    // oemPayload0
+              bool,    // oemPayload1
+              bool,    // oemPayload2
+              bool,    // oemPayload3
+              bool,    // oemPayload4
+              bool,    // oemPayload5
+              bool,    // oemPayload6
+              bool,    // oemPayload7
 
-              uint8_t // oemPayloadEnables2Reserved
+              uint8_t  // oemPayloadEnables2Reserved
               >
     ipmiGetUserPayloadAccess(ipmi::Context::ptr ctx,
 
@@ -594,8 +595,8 @@
 
                              uint6_t userId, uint2_t reserved2)
 {
-    uint8_t chNum =
-        convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
+    uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
+                                             ctx->channel);
 
     if (reserved1 || reserved2 || !isValidChannel(chNum))
     {
