user_channel: Optimize ipmi complete code
Encapsulate the custom status return code into an ipmi method and
then use it in cpp.
Change-Id: I72ce8bb4d262c98cb41635c985e229e1f9b593a3
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/user_channel/usercommands.cpp b/user_channel/usercommands.cpp
index 78c2647..2d0ed1f 100644
--- a/user_channel/usercommands.cpp
+++ b/user_channel/usercommands.cpp
@@ -87,7 +87,7 @@
if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
{
lg2::debug("Set user access - No support on channel");
- return ipmi::response(ccActionNotSupportedForChannel);
+ return ipmi::responseActionNotSupportedForChannel();
}
if (!ipmiUserIsValidUserId(static_cast<uint8_t>(userId)))
{
@@ -160,7 +160,7 @@
if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
{
lg2::debug("Get user access - No support on channel");
- return ipmi::response(ccActionNotSupportedForChannel);
+ return ipmi::responseActionNotSupportedForChannel();
}
if (!ipmiUserIsValidUserId(static_cast<uint8_t>(userId)))
{
@@ -431,7 +431,7 @@
if (getChannelSessionSupport(channel) == EChannelSessSupported::none)
{
lg2::debug("Get channel auth capabilities - No support on channel");
- return ipmi::response(ccActionNotSupportedForChannel);
+ return ipmi::responseActionNotSupportedForChannel();
}
constexpr bool extDataSupport = true; // true for IPMI 2.0 extensions
@@ -524,7 +524,7 @@
}
if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
{
- return ipmi::response(ccActionNotSupportedForChannel);
+ return ipmi::responseActionNotSupportedForChannel();
}
if (!ipmiUserIsValidUserId(static_cast<uint8_t>(userId)))
{
@@ -609,7 +609,7 @@
}
if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
{
- return ipmi::response(ccActionNotSupportedForChannel);
+ return ipmi::responseActionNotSupportedForChannel();
}
if (!ipmiUserIsValidUserId(static_cast<uint8_t>(userId)))
{