Add clang-tidy
This commit adds clang-tidy, and fixes most of the issues that tidy
finds that require manual intervention. Note, it also reverts from
c++23 -> c++20 due to a bunch in clang-13 + libstdc++ + std::tuple
packs. At such time as that's fixed, we can roll forward again.
Change-Id: I9bb5381866ef83dc75e41ef314377b19a79141f1
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000..f4d3372
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,335 @@
+Checks: '
+-*,
+boost-use-to-string,
+bugprone-argument-comment,
+bugprone-assert-side-effect,
+bugprone-assignment-in-if-condition,
+bugprone-bad-signal-to-kill-thread,
+bugprone-bool-pointer-implicit-conversion,
+bugprone-branch-clone,
+bugprone-copy-constructor-init,
+bugprone-dangling-handle,
+bugprone-dynamic-static-initializers,
+#bugprone-exception-escape,
+bugprone-fold-init-type,
+bugprone-forward-declaration-namespace,
+bugprone-forwarding-reference-overload,
+bugprone-implicit-widening-of-multiplication-result,
+bugprone-inaccurate-erase,
+bugprone-incorrect-roundings,
+bugprone-infinite-loop,
+bugprone-integer-division,
+bugprone-lambda-function-name,
+bugprone-macro-parentheses,
+bugprone-macro-repeated-side-effects,
+bugprone-misplaced-operator-in-strlen-in-alloc,
+bugprone-misplaced-pointer-arithmetic-in-alloc,
+bugprone-misplaced-widening-cast,
+bugprone-move-forwarding-reference,
+bugprone-multiple-statement-macro,
+#bugprone-narrowing-conversions,
+bugprone-no-escape,
+bugprone-not-null-terminated-result,
+bugprone-parent-virtual-call,
+bugprone-posix-return,
+bugprone-redundant-branch-condition,
+bugprone-reserved-identifier,
+bugprone-shared-ptr-array-mismatch,
+bugprone-signal-handler,
+bugprone-signed-char-misuse,
+bugprone-sizeof-container,
+bugprone-sizeof-expression,
+bugprone-spuriously-wake-up-functions,
+bugprone-standalone-empty,
+bugprone-string-constructor,
+bugprone-string-integer-assignment,
+bugprone-string-literal-with-embedded-nul,
+bugprone-stringview-nullptr,
+bugprone-suspicious-enum-usage,
+bugprone-suspicious-include,
+bugprone-suspicious-memory-comparison,
+bugprone-suspicious-memset-usage,
+bugprone-suspicious-missing-comma,
+bugprone-suspicious-realloc-usage,
+bugprone-suspicious-semicolon,
+bugprone-suspicious-string-compare,
+bugprone-swapped-arguments,
+bugprone-terminating-continue,
+bugprone-throw-keyword-missing,
+bugprone-too-small-loop-variable,
+bugprone-undefined-memory-manipulation,
+bugprone-undelegated-constructor,
+bugprone-unhandled-exception-at-new,
+bugprone-unhandled-self-assignment,
+bugprone-unused-raii,
+bugprone-unused-return-value,
+bugprone-use-after-move,
+bugprone-virtual-near-miss,
+cert-con36-c,
+cert-con54-cpp,
+cert-dcl03-c,
+cert-dcl16-c,
+cert-dcl21-cpp,
+cert-dcl37-c,
+cert-dcl50-cpp,
+cert-dcl51-cpp,
+cert-dcl54-cpp,
+cert-dcl58-cpp,
+cert-dcl59-cpp,
+cert-env33-c,
+cert-err09-cpp,
+cert-err34-c,
+cert-err52-cpp,
+cert-err60-cpp,
+cert-err61-cpp,
+cert-fio38-c,
+cert-flp30-c,
+cert-mem57-cpp,
+cert-msc30-c,
+cert-msc32-c,
+cert-msc50-cpp,
+cert-msc51-cpp,
+cert-oop11-cpp,
+cert-oop54-cpp,
+cert-oop57-cpp,
+cert-oop58-cpp,
+cert-pos44-c,
+cert-pos47-c,
+cert-sig30-c,
+cert-str34-c,
+clang-analyzer-apiModeling.Errno,
+clang-analyzer-apiModeling.StdCLibraryFunctions,
+clang-analyzer-apiModeling.TrustNonnull,
+clang-analyzer-apiModeling.TrustReturnsNonnull,
+clang-analyzer-apiModeling.google.GTest,
+clang-analyzer-apiModeling.llvm.CastValue,
+clang-analyzer-apiModeling.llvm.ReturnValue,
+clang-analyzer-core.CallAndMessage,
+clang-analyzer-core.CallAndMessageModeling,
+clang-analyzer-core.DivideZero,
+clang-analyzer-core.DynamicTypePropagation,
+clang-analyzer-core.NonNullParamChecker,
+clang-analyzer-core.NonnilStringConstants,
+clang-analyzer-core.NullDereference,
+clang-analyzer-core.StackAddrEscapeBase,
+clang-analyzer-core.StackAddressEscape,
+clang-analyzer-core.UndefinedBinaryOperatorResult,
+clang-analyzer-core.VLASize,
+clang-analyzer-core.builtin.BuiltinFunctions,
+clang-analyzer-core.builtin.NoReturnFunctions,
+clang-analyzer-core.uninitialized.ArraySubscript,
+clang-analyzer-core.uninitialized.Assign,
+clang-analyzer-core.uninitialized.Branch,
+clang-analyzer-core.uninitialized.CapturedBlockVariable,
+clang-analyzer-core.uninitialized.NewArraySize,
+clang-analyzer-core.uninitialized.UndefReturn,
+clang-analyzer-cplusplus.InnerPointer,
+clang-analyzer-cplusplus.Move,
+clang-analyzer-cplusplus.NewDelete,
+clang-analyzer-cplusplus.NewDeleteLeaks,
+clang-analyzer-cplusplus.PlacementNew,
+clang-analyzer-cplusplus.PureVirtualCall,
+clang-analyzer-cplusplus.SelfAssignment,
+clang-analyzer-cplusplus.SmartPtrModeling,
+clang-analyzer-cplusplus.StringChecker,
+clang-analyzer-cplusplus.VirtualCallModeling,
+clang-analyzer-deadcode.DeadStores,
+clang-analyzer-fuchsia.HandleChecker,
+clang-analyzer-nullability.NullPassedToNonnull,
+clang-analyzer-nullability.NullReturnedFromNonnull,
+clang-analyzer-nullability.NullabilityBase,
+clang-analyzer-nullability.NullableDereferenced,
+clang-analyzer-nullability.NullablePassedToNonnull,
+clang-analyzer-nullability.NullableReturnedFromNonnull,
+clang-analyzer-optin.cplusplus.UninitializedObject,
+clang-analyzer-optin.cplusplus.VirtualCall,
+clang-analyzer-optin.mpi.MPI-Checker,
+clang-analyzer-optin.osx.OSObjectCStyleCast,
+clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker,
+clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker,
+clang-analyzer-optin.performance.GCDAntipattern,
+clang-analyzer-optin.performance.Padding,
+clang-analyzer-optin.portability.UnixAPI,
+clang-analyzer-osx.API,
+clang-analyzer-osx.MIG,
+clang-analyzer-osx.NSOrCFErrorDerefChecker,
+clang-analyzer-osx.NumberObjectConversion,
+clang-analyzer-osx.OSObjectRetainCount,
+clang-analyzer-osx.ObjCProperty,
+clang-analyzer-osx.SecKeychainAPI,
+clang-analyzer-osx.cocoa.AtSync,
+clang-analyzer-osx.cocoa.AutoreleaseWrite,
+clang-analyzer-osx.cocoa.ClassRelease,
+clang-analyzer-osx.cocoa.Dealloc,
+clang-analyzer-osx.cocoa.IncompatibleMethodTypes,
+clang-analyzer-osx.cocoa.Loops,
+clang-analyzer-osx.cocoa.MissingSuperCall,
+clang-analyzer-osx.cocoa.NSAutoreleasePool,
+clang-analyzer-osx.cocoa.NSError,
+clang-analyzer-osx.cocoa.NilArg,
+clang-analyzer-osx.cocoa.NonNilReturnValue,
+clang-analyzer-osx.cocoa.ObjCGenerics,
+clang-analyzer-osx.cocoa.RetainCount,
+clang-analyzer-osx.cocoa.RetainCountBase,
+clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak,
+clang-analyzer-osx.cocoa.SelfInit,
+clang-analyzer-osx.cocoa.SuperDealloc,
+clang-analyzer-osx.cocoa.UnusedIvars,
+clang-analyzer-osx.cocoa.VariadicMethodTypes,
+clang-analyzer-osx.coreFoundation.CFError,
+clang-analyzer-osx.coreFoundation.CFNumber,
+clang-analyzer-osx.coreFoundation.CFRetainRelease,
+clang-analyzer-osx.coreFoundation.containers.OutOfBounds,
+clang-analyzer-osx.coreFoundation.containers.PointerSizedValues,
+clang-analyzer-security.FloatLoopCounter,
+clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
+clang-analyzer-security.insecureAPI.SecuritySyntaxChecker,
+clang-analyzer-security.insecureAPI.UncheckedReturn,
+clang-analyzer-security.insecureAPI.bcmp,
+clang-analyzer-security.insecureAPI.bcopy,
+clang-analyzer-security.insecureAPI.bzero,
+clang-analyzer-security.insecureAPI.decodeValueOfObjCType,
+clang-analyzer-security.insecureAPI.getpw,
+clang-analyzer-security.insecureAPI.gets,
+clang-analyzer-security.insecureAPI.mkstemp,
+clang-analyzer-security.insecureAPI.mktemp,
+clang-analyzer-security.insecureAPI.rand,
+clang-analyzer-security.insecureAPI.strcpy,
+clang-analyzer-security.insecureAPI.vfork,
+clang-analyzer-unix.API,
+clang-analyzer-unix.DynamicMemoryModeling,
+clang-analyzer-unix.Malloc,
+clang-analyzer-unix.MallocSizeof,
+clang-analyzer-unix.MismatchedDeallocator,
+clang-analyzer-unix.Vfork,
+clang-analyzer-unix.cstring.BadSizeArg,
+clang-analyzer-unix.cstring.CStringModeling,
+clang-analyzer-unix.cstring.NullArg,
+clang-analyzer-valist.CopyToSelf,
+clang-analyzer-valist.Uninitialized,
+clang-analyzer-valist.Unterminated,
+clang-analyzer-valist.ValistBase,
+clang-analyzer-webkit.NoUncountedMemberChecker,
+clang-analyzer-webkit.RefCntblBaseVirtualDtor,
+clang-analyzer-webkit.UncountedLambdaCapturesChecker,
+cppcoreguidelines-avoid-c-arrays,
+cppcoreguidelines-avoid-goto,
+cppcoreguidelines-avoid-non-const-global-variables,
+cppcoreguidelines-c-copy-assignment-signature,
+cppcoreguidelines-explicit-virtual-functions,
+cppcoreguidelines-init-variables,
+cppcoreguidelines-interfaces-global-init,
+cppcoreguidelines-macro-usage,
+#cppcoreguidelines-narrowing-conversions,
+cppcoreguidelines-no-malloc,
+cppcoreguidelines-prefer-member-initializer,
+#cppcoreguidelines-pro-bounds-array-to-pointer-decay,
+#cppcoreguidelines-pro-bounds-pointer-arithmetic,
+cppcoreguidelines-pro-type-const-cast,
+cppcoreguidelines-pro-type-cstyle-cast,
+cppcoreguidelines-pro-type-member-init,
+cppcoreguidelines-pro-type-reinterpret-cast,
+cppcoreguidelines-pro-type-static-cast-downcast,
+cppcoreguidelines-pro-type-union-access,
+cppcoreguidelines-pro-type-vararg,
+cppcoreguidelines-slicing,
+cppcoreguidelines-special-member-functions,
+google-explicit-constructor,
+misc-misplaced-const,
+#misc-no-recursion,
+misc-redundant-expression,
+misc-static-assert,
+misc-throw-by-value-catch-by-reference,
+misc-unconventional-assign-operator,
+misc-uniqueptr-reset-release,
+misc-unused-using-decls,
+modernize-avoid-bind,
+modernize-deprecated-headers,
+modernize-deprecated-ios-base-aliases,
+modernize-loop-convert,
+modernize-make-shared,
+modernize-make-unique,
+modernize-raw-string-literal,
+modernize-redundant-void-arg,
+modernize-replace-auto-ptr,
+modernize-replace-random-shuffle,
+modernize-return-braced-init-list,
+modernize-shrink-to-fit,
+modernize-unary-static-assert,
+modernize-use-bool-literals,
+modernize-use-default-member-init,
+modernize-use-emplace,
+modernize-use-equals-default,
+modernize-use-equals-delete,
+modernize-use-noexcept,
+modernize-use-nullptr,
+modernize-use-override,
+modernize-use-transparent-functors,
+modernize-use-uncaught-exceptions,
+modernize-use-using,
+performance-faster-string-find,
+performance-for-range-copy,
+performance-implicit-conversion-in-loop,
+performance-inefficient-algorithm,
+performance-inefficient-string-concatenation,
+performance-inefficient-vector-operation,
+performance-move-const-arg,
+performance-move-constructor-init,
+performance-no-automatic-move,
+performance-no-int-to-ptr,
+performance-noexcept-move-constructor,
+performance-trivially-destructible,
+performance-type-promotion-in-math-fn,
+performance-unnecessary-copy-initialization,
+performance-unnecessary-value-param,
+readability-avoid-const-params-in-decls,
+readability-braces-around-statements,
+readability-const-return-type,
+readability-container-contains,
+readability-container-data-pointer,
+readability-container-size-empty,
+readability-convert-member-functions-to-static,
+readability-delete-null-pointer,
+readability-deleted-default,
+readability-else-after-return,
+readability-function-size,
+readability-identifier-naming,
+readability-implicit-bool-conversion,
+readability-inconsistent-declaration-parameter-name,
+readability-isolate-declaration,
+readability-make-member-function-const,
+readability-misleading-indentation,
+readability-misplaced-array-index,
+readability-named-parameter,
+readability-non-const-parameter,
+readability-qualified-auto,
+readability-redundant-access-specifiers,
+readability-redundant-control-flow,
+readability-redundant-declaration,
+readability-redundant-function-ptr-dereference,
+readability-redundant-member-init,
+readability-redundant-preprocessor,
+readability-redundant-smartptr-get,
+readability-redundant-string-cstr,
+readability-redundant-string-init,
+readability-simplify-boolean-expr,
+readability-simplify-subscript-expr,
+readability-static-accessed-through-instance,
+readability-static-definition-in-anonymous-namespace,
+readability-string-compare,
+readability-suspicious-call-argument,
+readability-uniqueptr-delete-release,
+readability-uppercase-literal-suffix'
+
+WarningsAsErrors: '*'
+HeaderFilterRegex: '.*'
+CheckOptions:
+ - { key: readability-identifier-naming.ClassCase, value: CamelCase }
+ - { key: readability-identifier-naming.VariableCase, value: camelBack }
+ - { key: readability-identifier-naming.FunctionCase, value: camelBack }
+ - { key: readability-identifier-naming.ParameterCase, value: camelBack }
+ - { key: readability-identifier-naming.NamespaceCase, value: lower_case }
+ - { key: readability-identifier-naming.StructCase, value: CamelCase }
+ - { key: readability-identifier-naming.FunctionIgnoredRegexp, value: (BMCWEB_LOG_DEBUG|BMCWEB_LOG_INFO|BMCWEB_LOG_WARNING|BMCWEB_LOG_ERROR|BMCWEB_LOG_CRITICAL) }
+ - { key: cppcoreguidelines-macro-usage.AllowedRegexp, value: DEBUG*|NLOHMANN_JSON_SERIALIZE_ENUM }
+ - { key: performance-unnecessary-value-param.AllowedTypes, value: ((segments_view)|(url_view)) }
diff --git a/meson.build b/meson.build
index ec37c55..2900ca4 100644
--- a/meson.build
+++ b/meson.build
@@ -4,7 +4,7 @@
'buildtype=debugoptimized',
'warning_level=3',
'werror=true',
- 'cpp_std=c++23',
+ 'cpp_std=c++20',
'b_lto=true',
],
version: '1.0',
diff --git a/ssifbridged.cpp b/ssifbridged.cpp
index 84dd350..22fe893 100644
--- a/ssifbridged.cpp
+++ b/ssifbridged.cpp
@@ -35,7 +35,7 @@
#include <iostream>
/* Max length of ipmi ssif message included netfn and cmd field */
-#define IPMI_SSIF_PAYLOAD_MAX 254
+constexpr const size_t ipmiSsifPayloadMax = 254;
using phosphor::logging::level;
using phosphor::logging::log;
@@ -45,12 +45,10 @@
uint8_t netfn;
uint8_t lun;
uint8_t cmd;
-} prevReqCmd;
+};
-static constexpr const char devBase[] = "/dev/ipmi-ssif-host";
+static constexpr std::string_view devBase = "/dev/ipmi-ssif-host";
/* SSIF use IPMI SSIF channel */
-static constexpr const char* ssifBus =
- "xyz.openbmc_project.Ipmi.Channel.ipmi_ssif";
/* The timer of driver is set to 15 seconds, need to send
* response before timeout occurs
@@ -60,7 +58,7 @@
class SsifChannel
{
public:
- static constexpr size_t ssifMessageSize = IPMI_SSIF_PAYLOAD_MAX +
+ static constexpr size_t ssifMessageSize = ipmiSsifPayloadMax +
sizeof(unsigned int);
size_t sizeofLenField = sizeof(unsigned int);
static constexpr uint8_t netFnShift = 2;
@@ -83,6 +81,7 @@
void processMessage(const boost::system::error_code& ecRd, size_t rlen);
int showNumOfReqNotRsp() const;
boost::asio::posix::stream_descriptor dev;
+ IpmiCmd prevReqCmd{};
protected:
std::array<uint8_t, ssifMessageSize> xferBuffer{};
@@ -99,6 +98,7 @@
boost::asio::steady_timer rspTimer;
};
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
std::unique_ptr<SsifChannel> ssifchannel = nullptr;
SsifChannel::SsifChannel(std::shared_ptr<boost::asio::io_context>& io,
@@ -109,13 +109,14 @@
io(io), bus(bus), verbose(verbose), numberOfReqNotRsp(numberOfReqNotRsp),
rspTimer(*io)
{
- std::string devName = devBase;
+ std::string devName(devBase);
if (!device.empty())
{
devName = device;
}
// open device
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
int fd = open(devName.c_str(), O_RDWR | O_NONBLOCK);
if (fd < 0)
{
@@ -133,7 +134,7 @@
server = std::make_shared<sdbusplus::asio::object_server>(bus);
std::shared_ptr<sdbusplus::asio::dbus_interface> iface =
server->add_interface("/xyz/openbmc_project/Ipmi/Channel/ipmi_ssif",
- ssifBus);
+ "xyz.openbmc_project.Ipmi.Channel.ipmi_ssif");
iface->initialize();
}
@@ -168,7 +169,7 @@
}
std::vector<uint8_t> rsp;
constexpr uint8_t ccResponseNotAvailable = 0xce;
-
+ IpmiCmd& prevReqCmd = ssifchannel->prevReqCmd;
rsp.resize(ssifchannel->sizeofLenField + sizeof(prevReqCmd.cmd) +
sizeof(prevReqCmd.netfn) + sizeof(ccResponseNotAvailable));
std::string msgToLog = "timeout, send response to keep host alive"
@@ -180,8 +181,8 @@
" numberOfReqNotRsp=" +
std::to_string(ssifchannel->showNumOfReqNotRsp());
log<level::INFO>(msgToLog.c_str());
-
- unsigned int* t = (unsigned int*)rsp.data();
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+ unsigned int* t = reinterpret_cast<unsigned int*>(rsp.data());
*t = 3;
rsp[ssifchannel->sizeofLenField] = ((prevReqCmd.netfn + 1)
<< ssifchannel->netFnShift) |
@@ -229,52 +230,50 @@
* */
return;
}
- else
- {
- if ((prevReqCmd.netfn != (netfn - 1) || prevReqCmd.lun != lun ||
- prevReqCmd.cmd != cmd) ||
- ((prevReqCmd.netfn == (netfn - 1) && prevReqCmd.lun == lun &&
- prevReqCmd.cmd == cmd) &&
- numberOfReqNotRsp != 0))
- {
- /* Only send response to the last request command to void
- * duplicated response which makes host driver confused and
- * failed to create interface
- *
- * Drop responses which are (1) different from the request
- * (2) parameters are the same as request but handshake flow
- * are in dupplicate request state
- * */
- if (verbose)
- {
- std::string msgToLog =
- "Drop ssif respond message with"
- " len=" +
- std::to_string(payload.size() + 3) +
- " netfn=" + std::to_string(netfn) +
- " lun=" + std::to_string(lun) +
- " cmd=" + std::to_string(cmd) +
- " cc=" + std::to_string(cc) +
- " numberOfReqNotRsp=" + std::to_string(numberOfReqNotRsp);
- log<level::INFO>(msgToLog.c_str());
- }
- return;
- }
- rsp.resize(sizeofLenField + sizeof(netfn) + sizeof(cmd) + sizeof(cc) +
- payload.size());
- // write the response
- auto rspIter = rsp.begin();
- unsigned int* p = (unsigned int*)&rspIter[0];
- *p = payload.size() + 3;
- rspIter[sizeofLenField] = (netfn << netFnShift) | (lun & lunMask);
- rspIter[sizeofLenField + 1] = cmd;
- rspIter[sizeofLenField + 2] = cc;
- if (!payload.empty() != 0u)
+ if ((prevReqCmd.netfn != (netfn - 1) || prevReqCmd.lun != lun ||
+ prevReqCmd.cmd != cmd) ||
+ ((prevReqCmd.netfn == (netfn - 1) && prevReqCmd.lun == lun &&
+ prevReqCmd.cmd == cmd) &&
+ numberOfReqNotRsp != 0))
+ {
+ /* Only send response to the last request command to void
+ * duplicated response which makes host driver confused and
+ * failed to create interface
+ *
+ * Drop responses which are (1) different from the request
+ * (2) parameters are the same as request but handshake flow
+ * are in dupplicate request state
+ * */
+ if (verbose)
{
- std::copy(payload.cbegin(), payload.cend(),
- rspIter + sizeofLenField + 3);
+ std::string msgToLog =
+ "Drop ssif respond message with"
+ " len=" +
+ std::to_string(payload.size() + 3) +
+ " netfn=" + std::to_string(netfn) +
+ " lun=" + std::to_string(lun) + " cmd=" + std::to_string(cmd) +
+ " cc=" + std::to_string(cc) +
+ " numberOfReqNotRsp=" + std::to_string(numberOfReqNotRsp);
+ log<level::INFO>(msgToLog.c_str());
}
+ return;
+ }
+ rsp.resize(sizeofLenField + sizeof(netfn) + sizeof(cmd) + sizeof(cc) +
+ payload.size());
+
+ // write the response
+ auto rspIter = rsp.begin();
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+ unsigned int* p = reinterpret_cast<unsigned int*>(&rspIter[0]);
+ *p = payload.size() + 3;
+ rspIter[sizeofLenField] = (netfn << netFnShift) | (lun & lunMask);
+ rspIter[sizeofLenField + 1] = cmd;
+ rspIter[sizeofLenField + 2] = cc;
+ if (static_cast<unsigned int>(!payload.empty()) != 0U)
+ {
+ std::copy(payload.cbegin(), payload.cend(),
+ rspIter + sizeofLenField + 3);
}
if (verbose)
{
@@ -333,7 +332,8 @@
if (verbose)
{
unsigned int lenRecv = 0;
- unsigned int* p = (unsigned int*)rawIter;
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+ const unsigned int* p = reinterpret_cast<const unsigned int*>(rawIter);
lenRecv = p[0];
std::string msgToLog =
"Read ssif request message with"
@@ -347,12 +347,12 @@
std::vector<uint8_t> data(rawIter + sizeofLenField + 2, rawEnd);
// non-session bridges still need to pass an empty options map
std::map<std::string, std::variant<int>> options;
- static constexpr const char ipmiQueueService[] =
+ static constexpr const char* ipmiQueueService =
"xyz.openbmc_project.Ipmi.Host";
- static constexpr const char ipmiQueuePath[] = "/xyz/openbmc_project/Ipmi";
- static constexpr const char ipmiQueueIntf[] =
+ static constexpr const char* ipmiQueuePath = "/xyz/openbmc_project/Ipmi";
+ static constexpr const char* ipmiQueueIntf =
"xyz.openbmc_project.Ipmi.Server";
- static constexpr const char ipmiQueueMethod[] = "execute";
+ static constexpr const char* ipmiQueueMethod = "execute";
/* now, we do not care dbus timeout, since we already have actions
* before dbus timeout occurs
*/
@@ -380,7 +380,7 @@
auto io = std::make_shared<boost::asio::io_context>();
auto bus = std::make_shared<sdbusplus::asio::connection>(*io);
- bus->request_name(ssifBus);
+ bus->request_name("xyz.openbmc_project.Ipmi.Channel.ipmi_ssif");
// Create the SSIF channel, listening on D-Bus and on the SSIF device
ssifchannel = make_unique<SsifChannel>(io, bus, device, verbose,
numberOfReqNotRsp);