summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-20 19:54:27 -0700
committerPatrick Venture <venture@google.com>2018-10-29 15:49:58 +0000
commit19bea9ae44ea9af30e1e4443c69a22b04e2cd56d (patch)
treede4b2481d464cbeacf5815d27801b40ecc7a216b
parent5c2bd5ed35e73299a525a2ae1296174d0d4a5356 (diff)
downloadipmi-fru-parser-19bea9ae44ea9af30e1e4443c69a22b04e2cd56d.zip
ipmi-fru-parser-19bea9ae44ea9af30e1e4443c69a22b04e2cd56d.tar.gz
cleanup: rename fru_area_vec_t type and use using
Rename fru_area_vec_t to FruAreaVector and declare with using instead of typedef. Change-Id: I482c8ce7cedef1c67efb49b2e066ba9867547e93 Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--fru_area.hpp3
-rw-r--r--writefrudata.cpp10
2 files changed, 6 insertions, 7 deletions
diff --git a/fru_area.hpp b/fru_area.hpp
index 2595e54..6cebb3c 100644
--- a/fru_area.hpp
+++ b/fru_area.hpp
@@ -12,9 +12,6 @@
#include <string>
#include <vector>
-class IPMIFruArea;
-typedef std::vector<std::unique_ptr<IPMIFruArea>> fru_area_vec_t;
-
class IPMIFruArea
{
private:
diff --git a/writefrudata.cpp b/writefrudata.cpp
index 0294e57..1cbf210 100644
--- a/writefrudata.cpp
+++ b/writefrudata.cpp
@@ -27,6 +27,8 @@ using namespace phosphor::logging;
extern const FruMap frus;
extern const std::map<Path, InterfaceMap> extras;
+using FruAreaVector = std::vector<std::unique_ptr<IPMIFruArea>>;
+
namespace
{
@@ -34,7 +36,7 @@ namespace
// Cleanup routine
// Must always be called as last reference to fru_fp.
//------------------------------------------------------------
-int cleanupError(FILE* fru_fp, fru_area_vec_t& fru_area_vec)
+int cleanupError(FILE* fru_fp, FruAreaVector& fru_area_vec)
{
if (fru_fp != NULL)
{
@@ -142,7 +144,7 @@ auto getService(sdbusplus::bus::bus& bus, const std::string& intf,
// Takes FRU data, invokes Parser for each fru record area and updates
// Inventory
//------------------------------------------------------------------------
-int updateInventory(fru_area_vec_t& area_vec, sd_bus* bus_sd)
+int updateInventory(FruAreaVector& area_vec, sd_bus* bus_sd)
{
// Generic error reporter
int rc = 0;
@@ -466,7 +468,7 @@ bool remove_invalid_area(const std::unique_ptr<IPMIFruArea>& fru_area)
// @prereq : This must be called only after validating common header.
///----------------------------------------------------------------------------------
int ipmi_populate_fru_areas(uint8_t* fru_data, const size_t data_len,
- fru_area_vec_t& fru_area_vec)
+ FruAreaVector& fru_area_vec)
{
int rc = -1;
@@ -594,7 +596,7 @@ int validateFRUArea(const uint8_t fruid, const char* fru_file_name,
// Vector that holds individual IPMI FRU AREAs. Although MULTI and INTERNAL
// are not used, keeping it here for completeness.
- fru_area_vec_t fru_area_vec;
+ FruAreaVector fru_area_vec;
for (uint8_t fru_entry = IPMI_FRU_INTERNAL_OFFSET;
fru_entry < (sizeof(struct common_header) - 2); fru_entry++)
OpenPOWER on IntegriCloud