Remove unused variables
Using clang-tidy, it was detected that some variables are no longer
in use. This commit remove unused variables.
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I382e6ce07e66dc5ad082be9b36d217a037e609b5
diff --git a/app/watchdog.cpp b/app/watchdog.cpp
index 99e4c40..aea13fd 100644
--- a/app/watchdog.cpp
+++ b/app/watchdog.cpp
@@ -78,7 +78,6 @@
}
}
-static constexpr uint8_t wd_dont_stop = 0x1 << 6;
static constexpr uint8_t wd_timeout_action_mask = 0x3;
static constexpr uint8_t wdTimerUseResTimer1 = 0x0;
@@ -343,8 +342,6 @@
}
}
-static constexpr uint8_t wd_running = 0x1 << 6;
-
/**@brief The getWatchdogTimer ipmi command.
*
* @return Completion code plus timer details.
diff --git a/apphandler.cpp b/apphandler.cpp
index d1d4301..2ce19e8 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -213,8 +213,6 @@
{
using namespace sdbusplus::server::xyz::openbmc_project::control::power;
-const static constexpr char* acpiObjPath =
- "/xyz/openbmc_project/control/host0/acpi_power_state";
const static constexpr char* acpiInterface =
"xyz.openbmc_project.Control.Power.ACPIPowerState";
const static constexpr char* sysACPIProp = "SysACPIStatus";
@@ -1317,19 +1315,14 @@
static constexpr uint8_t setComplete = 0x0;
static constexpr uint8_t setInProgress = 0x1;
-static constexpr uint8_t commitWrite = 0x2;
static uint8_t transferStatus = setComplete;
static constexpr uint8_t configDataOverhead = 2;
-// For EFI based system, 256 bytes is recommended.
-static constexpr size_t maxBytesPerParameter = 256;
-
namespace ipmi
{
constexpr Cc ccParmNotSupported = 0x80;
constexpr Cc ccSetInProgressActive = 0x81;
-constexpr Cc ccSystemInfoParameterSetReadOnly = 0x82;
static inline auto responseParmNotSupported()
{
@@ -1339,10 +1332,6 @@
{
return response(ccSetInProgressActive);
}
-static inline auto responseSystemInfoParameterSetReadOnly()
-{
- return response(ccSystemInfoParameterSetReadOnly);
-}
} // namespace ipmi
ipmi::RspType<uint8_t, // Parameter revision
@@ -1499,10 +1488,6 @@
}
size_t stringLen = configData.at(1); // string length
- // maxBytesPerParamter is 256. It will always be greater than stringLen
- // (unit8_t) if maxBytes changes in future, then following line is
- // needed.
- // stringLen = std::min(stringLen, maxBytesPerParameter);
count = std::min(stringLen, smallChunkSize);
count = std::min(count, configData.size());
paramString.resize(stringLen); // reserve space
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 34e8822..850b090 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -40,7 +40,6 @@
__attribute__((init_priority(101)));
static ChassisIDState chassisIDState = ChassisIDState::reserved;
-static constexpr uint8_t setParmVersion = 0x01;
constexpr size_t sizeVersion = 2;
constexpr size_t DEFAULT_IDENTIFY_TIME_OUT = 15;
@@ -58,11 +57,6 @@
static constexpr size_t addrTypeOffset = 16;
static constexpr size_t ipAddrOffset = 17;
-static constexpr size_t encIdentifyObjectsSize = 1;
-static constexpr size_t chassisIdentifyReqLength = 2;
-static constexpr size_t identifyIntervalPos = 0;
-static constexpr size_t forceIdentifyPos = 1;
-
namespace ipmi
{
constexpr Cc ccParmNotSupported = 0x80;
@@ -106,7 +100,6 @@
const static constexpr char chassisSELDevAddrProp[] = "SELDeviceAddress";
const static constexpr char chassisSMDevAddrProp[] = "SMDeviceAddress";
const static constexpr char chassisBridgeDevAddrProp[] = "BridgeDeviceAddress";
-static constexpr uint8_t chassisCapFlagMask = 0x0f;
static constexpr uint8_t chassisCapAddrMask = 0xfe;
static constexpr const char* powerButtonIntf =
"xyz.openbmc_project.Chassis.Buttons.Power";
diff --git a/dbus-sdr/storagecommands.cpp b/dbus-sdr/storagecommands.cpp
index a93a045..125e89e 100644
--- a/dbus-sdr/storagecommands.cpp
+++ b/dbus-sdr/storagecommands.cpp
@@ -71,7 +71,6 @@
namespace storage
{
-constexpr static const size_t maxMessageSize = 64;
constexpr static const size_t maxFruSdrNameSize = 16;
using ObjectType =
boost::container::flat_map<std::string,
@@ -90,9 +89,6 @@
constexpr static const char* chassisTypeRackMount = "23";
constexpr static const char* chassisTypeMainServer = "17";
-// event direction is bit[7] of eventType where 1b = Deassertion event
-constexpr static const uint8_t deassertionEvent = 0x80;
-
static std::vector<uint8_t> fruCache;
static constexpr uint16_t invalidBus = 0xFFFF;
static constexpr uint8_t invalidAddr = 0xFF;
diff --git a/ipmi_fru_info_area.cpp b/ipmi_fru_info_area.cpp
index ed02179..d259731 100644
--- a/ipmi_fru_info_area.cpp
+++ b/ipmi_fru_info_area.cpp
@@ -39,7 +39,6 @@
static constexpr auto typeLengthByteNull = 0x0;
static constexpr auto endOfCustomFields = 0xC1;
static constexpr auto commonHeaderFormatSize = 0x8; // size in bytes
-static constexpr auto manufacturingDateSize = 0x3;
static constexpr auto areaSizeOffset = 0x1;
static constexpr uint8_t typeASCII = 0xC0;
static constexpr auto maxRecordAttributeValue = 0x3F;
diff --git a/selutility.hpp b/selutility.hpp
index 3c9b098..29f925a 100644
--- a/selutility.hpp
+++ b/selutility.hpp
@@ -19,6 +19,7 @@
static constexpr auto mapperObjPath = "/xyz/openbmc_project/object_mapper";
static constexpr auto mapperIntf = "xyz.openbmc_project.ObjectMapper";
+static constexpr auto logWatchPath = "/xyz/openbmc_project/logging";
static constexpr auto logBasePath = "/xyz/openbmc_project/logging/entry";
static constexpr auto logEntryIntf = "xyz.openbmc_project.Logging.Entry";
static constexpr auto logDeleteIntf = "xyz.openbmc_project.Object.Delete";
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 954ec7b..4a97b47 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -53,11 +53,6 @@
constexpr auto BMC_TIME_PATH = "/xyz/openbmc_project/time/bmc";
constexpr auto DBUS_PROPERTIES = "org.freedesktop.DBus.Properties";
constexpr auto PROPERTY_ELAPSED = "Elapsed";
-
-constexpr auto logWatchPath = "/xyz/openbmc_project/logging";
-constexpr auto logBasePath = "/xyz/openbmc_project/logging/entry";
-constexpr auto logEntryIntf = "xyz.openbmc_project.Logging.Entry";
-constexpr auto logDeleteIntf = "xyz.openbmc_project.Object.Delete";
} // namespace
using InternalFailure =
@@ -170,13 +165,13 @@
if (!selAddedMatch)
{
selAddedMatch = std::make_unique<sdbusplus::bus::match_t>(
- bus, interfacesAdded(logWatchPath),
+ bus, interfacesAdded(ipmi::sel::logWatchPath),
std::bind(selAddedCallback, std::placeholders::_1));
}
if (!selRemovedMatch)
{
selRemovedMatch = std::make_unique<sdbusplus::bus::match_t>(
- bus, interfacesRemoved(logWatchPath),
+ bus, interfacesRemoved(ipmi::sel::logWatchPath),
std::bind(selRemovedCallback, std::placeholders::_1));
}
if (!selUpdatedMatch)
@@ -185,7 +180,7 @@
bus,
type::signal() + member("PropertiesChanged"s) +
interface("org.freedesktop.DBus.Properties"s) +
- argN(0, logEntryIntf),
+ argN(0, ipmi::sel::logEntryIntf),
std::bind(selUpdatedCallback, std::placeholders::_1));
}
}
diff --git a/test/message/unpack.cpp b/test/message/unpack.cpp
index 644d2d3..acc6088 100644
--- a/test/message/unpack.cpp
+++ b/test/message/unpack.cpp
@@ -500,7 +500,6 @@
ASSERT_NE(p.unpack(v), 0);
// check that the payload was not fully unpacked (comprehends unpack errors)
ASSERT_FALSE(p.fullyUnpacked());
- std::bitset<33> k(0);
// check that v is zero
ASSERT_EQ(v, 0);
}
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index ed95271..ed123ad 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -73,13 +73,11 @@
static constexpr const char* sessionSupportedString = "session_supported";
static constexpr const char* isIpmiString = "is_ipmi";
static constexpr const char* isManagementNIC = "is_management_nic";
-static constexpr const char* authTypeSupportedString = "auth_type_supported";
static constexpr const char* accessModeString = "access_mode";
static constexpr const char* userAuthDisabledString = "user_auth_disabled";
static constexpr const char* perMsgAuthDisabledString = "per_msg_auth_disabled";
static constexpr const char* alertingDisabledString = "alerting_disabled";
static constexpr const char* privLimitString = "priv_limit";
-static constexpr const char* authTypeEnabledString = "auth_type_enabled";
// Default values
static constexpr const char* defaultChannelName = "RESERVED";