health_metric: simplify type aliases

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I116b46a0633daae6c0b44e0419434f01a58aad58
diff --git a/health_metric.cpp b/health_metric.cpp
index e29954a..31de153 100644
--- a/health_metric.cpp
+++ b/health_metric.cpp
@@ -12,8 +12,8 @@
 
 using association_t = std::tuple<std::string, std::string, std::string>;
 
-auto HealthMetric::getPath(phosphor::health::metric::Type type,
-                           std::string name, SubType subType) -> std::string
+auto HealthMetric::getPath(MType type, std::string name, SubType subType)
+    -> std::string
 {
     std::string path;
     switch (subType)
@@ -53,7 +53,7 @@
         }
         case SubType::NA:
         {
-            if (type == phosphor::health::metric::Type::storage)
+            if (type == MType::storage)
             {
                 static constexpr auto nameDelimiter = "_";
                 auto storageType = name.substr(
@@ -105,12 +105,12 @@
     }
     ValueIntf::value(std::numeric_limits<double>::quiet_NaN(), true);
 
-    using bound_map_t = std::map<ThresholdIntf::Bound, double>;
-    std::map<ThresholdIntf::Type, bound_map_t> thresholds;
+    using bound_map_t = std::map<Bound, double>;
+    std::map<Type, bound_map_t> thresholds;
     for (const auto& [key, value] : config.thresholds)
     {
-        auto type = std::get<ThresholdIntf::Type>(key);
-        auto bound = std::get<ThresholdIntf::Bound>(key);
+        auto type = std::get<Type>(key);
+        auto bound = std::get<Bound>(key);
         auto threshold = thresholds.find(type);
         if (threshold == thresholds.end())
         {
@@ -147,8 +147,7 @@
     }
 }
 
-void HealthMetric::checkThreshold(ThresholdIntf::Type type,
-                                  ThresholdIntf::Bound bound, MValue value)
+void HealthMetric::checkThreshold(Type type, Bound bound, MValue value)
 {
     auto threshold = std::make_tuple(type, bound);
     auto thresholds = ThresholdIntf::value();
@@ -197,14 +196,11 @@
 {
     if (!ThresholdIntf::value().empty())
     {
-        for (auto type :
-             {ThresholdIntf::Type::HardShutdown,
-              ThresholdIntf::Type::SoftShutdown,
-              ThresholdIntf::Type::PerformanceLoss,
-              ThresholdIntf::Type::Critical, ThresholdIntf::Type::Warning})
+        for (auto type : {Type::HardShutdown, Type::SoftShutdown,
+                          Type::PerformanceLoss, Type::Critical, Type::Warning})
         {
-            checkThreshold(type, ThresholdIntf::Bound::Lower, value);
-            checkThreshold(type, ThresholdIntf::Bound::Upper, value);
+            checkThreshold(type, Bound::Lower, value);
+            checkThreshold(type, Bound::Upper, value);
         }
     }
 }
diff --git a/health_metric.hpp b/health_metric.hpp
index 8d3dee4..9584953 100644
--- a/health_metric.hpp
+++ b/health_metric.hpp
@@ -25,7 +25,6 @@
 using BmcIntf = sdbusplus::xyz::openbmc_project::Inventory::Item::server::Bmc;
 using MetricIntf =
     sdbusplus::server::object_t<ValueIntf, ThresholdIntf, AssociationIntf>;
-using MType = phosphor::health::metric::Type;
 
 struct MValue
 {
@@ -38,6 +37,8 @@
 class HealthMetric : public MetricIntf
 {
   public:
+    using MType = phosphor::health::metric::Type;
+
     HealthMetric() = delete;
     HealthMetric(const HealthMetric&) = delete;
     HealthMetric(HealthMetric&&) = delete;
@@ -62,13 +63,11 @@
     /** @brief Init properties for the health metric object */
     void initProperties();
     /** @brief Check specified threshold for the given value */
-    void checkThreshold(ThresholdIntf::Type type, ThresholdIntf::Bound bound,
-                        MValue value);
+    void checkThreshold(Type type, Bound bound, MValue value);
     /** @brief Check all thresholds for the given value */
     void checkThresholds(MValue value);
     /** @brief Get the object path for the given type, name and subtype */
-    auto getPath(phosphor::health::metric::Type type, std::string name,
-                 SubType subType) -> std::string;
+    auto getPath(MType type, std::string name, SubType subType) -> std::string;
     /** @brief D-Bus bus connection */
     sdbusplus::bus_t& bus;
     /** @brief Metric type */