clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I44441096113929ce96eb1439e2932e6ff3c87f27
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
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))
     {