clang-tidy: Fix unused private field warnings
Resolved -Wunused-private-field warnings flagged by clang-tidy
by eliminating unused private member variables from the class.
Change-Id: I12054e7e32507bf14a3fff0ba2dac4ec4c8f7327
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/fru_area.cpp b/fru_area.cpp
index 328ebad..e1ac49d 100644
--- a/fru_area.cpp
+++ b/fru_area.cpp
@@ -9,9 +9,8 @@
using namespace phosphor::logging;
-IPMIFruArea::IPMIFruArea(const uint8_t fruID, const ipmi_fru_area_type type,
- bool bmcOnlyFru) :
- fruID(fruID), type(type), bmcOnlyFru(bmcOnlyFru)
+IPMIFruArea::IPMIFruArea(const uint8_t fruID, const ipmi_fru_area_type type) :
+ fruID(fruID), type(type)
{
if (type == IPMI_FRU_AREA_INTERNAL_USE)
{
diff --git a/fru_area.hpp b/fru_area.hpp
index 0bee9af..9a39f90 100644
--- a/fru_area.hpp
+++ b/fru_area.hpp
@@ -25,10 +25,8 @@
*
* @param[in] fruID - FRU identifier value
* @param[in] type - the type of FRU area.
- * @param[in] bmcOnlyFru - Is this FRU only accessible via the BMC
*/
- IPMIFruArea(const uint8_t fruID, const ipmi_fru_area_type type,
- bool bmcOnlyFru = false);
+ IPMIFruArea(const uint8_t fruID, const ipmi_fru_area_type type);
/**
* Set whether the FRU is present.
@@ -108,15 +106,9 @@
// Name of the FRU area. ( BOARD/CHASSIS/PRODUCT )
std::string name;
- // Special bit for BMC readable eeprom only.
- bool bmcOnlyFru = false;
-
// If a FRU is physically present.
bool isPresent = false;
- // Whether a particular area is valid ?
- bool isValid = false;
-
// Actual area data.
std::vector<uint8_t> data;
};
diff --git a/readeeprom.cpp b/readeeprom.cpp
index 500d1d8..3f04789 100644
--- a/readeeprom.cpp
+++ b/readeeprom.cpp
@@ -32,8 +32,7 @@
// Now that we have the file that contains the eeprom data, go read it
// and update the Inventory DB.
auto bus = sdbusplus::bus::new_default();
- bool bmc_fru = true;
- rc = validateFRUArea(fruid, eeprom_file.c_str(), bus, bmc_fru);
+ rc = validateFRUArea(fruid, eeprom_file.c_str(), bus);
return (rc < 0 ? EXIT_FAILURE : EXIT_SUCCESS);
}
diff --git a/strgfnhandler.cpp b/strgfnhandler.cpp
index 984eb4a..b3005ff 100644
--- a/strgfnhandler.cpp
+++ b/strgfnhandler.cpp
@@ -103,8 +103,7 @@
// We received some bytes. It may be full or partial. Send a valid
// FRU file to the inventory controller on DBus for the correct number
sdbusplus::bus_t bus{bus_type};
- bool bmcOnlyFru = false;
- validateFRUArea(reqptr->frunum, fruFilename, bus, bmcOnlyFru);
+ validateFRUArea(reqptr->frunum, fruFilename, bus);
return rc;
}
diff --git a/writefrudata.cpp b/writefrudata.cpp
index a4d5509..88b9565 100644
--- a/writefrudata.cpp
+++ b/writefrudata.cpp
@@ -628,7 +628,7 @@
}
int validateFRUArea(const uint8_t fruid, const char* fruFilename,
- sdbusplus::bus_t& bus, const bool bmcOnlyFru)
+ sdbusplus::bus_t& bus)
{
size_t dataLen = 0;
size_t bytesRead = 0;
@@ -642,8 +642,8 @@
fruEntry < (sizeof(struct common_header) - 2); fruEntry++)
{
// Create an object and push onto a vector.
- std::unique_ptr<IPMIFruArea> fruArea = std::make_unique<IPMIFruArea>(
- fruid, getFruAreaType(fruEntry), bmcOnlyFru);
+ std::unique_ptr<IPMIFruArea> fruArea =
+ std::make_unique<IPMIFruArea>(fruid, getFruAreaType(fruEntry));
// Physically being present
bool present = access(fruFilename, F_OK) == 0;
diff --git a/writefrudata.hpp b/writefrudata.hpp
index af3ba1c..ad39ccc 100644
--- a/writefrudata.hpp
+++ b/writefrudata.hpp
@@ -48,9 +48,8 @@
* @param[in] fruid - The ID to use for this FRU.
* @param[in] fruFilename - the filename of the FRU.
* @param[in] bus - an sdbusplus systemd bus for publishing the information.
- * @param[in] bmcOnlyFru - If a particular area accessible only by BMC.
*/
int validateFRUArea(const uint8_t fruid, const char* fruFilename,
- sdbusplus::bus_t& bus, const bool bmcOnlyFru);
+ sdbusplus::bus_t& bus);
#endif