psu-ng: Refactor VOUT_UV_FAULT detection

Split off code checking for VOUT_UV fault in STATUS_WORD to its own
function.

Change-Id: I3b5e898a7d4f1ad21317c66b7fcb97c211581dcd
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 9e58ff2..5be801a 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -257,6 +257,25 @@
     }
 }
 
+void PowerSupply::analyzeVoutUVFault()
+{
+    if ((statusWord & phosphor::pmbus::status_word::VOUT_FAULT) &&
+        !(statusWord & phosphor::pmbus::status_word::VOUT_OV_FAULT))
+    {
+        if (!voutUVFault)
+        {
+            log<level::ERR>(
+                fmt::format("VOUT_UV_FAULT fault: STATUS_WORD = {:#04x}, "
+                            "STATUS_MFR_SPECIFIC = {:#02x}, "
+                            "STATUS_VOUT = {:#02x}",
+                            statusWord, statusMFR, statusVout)
+                    .c_str());
+        }
+
+        voutUVFault = true;
+    }
+}
+
 void PowerSupply::analyzeTemperatureFault()
 {
     if (statusWord & phosphor::pmbus::status_word::TEMPERATURE_FAULT_WARN)
@@ -375,22 +394,7 @@
 
                 analyzeIoutOCFault();
 
-                if ((statusWord & status_word::VOUT_FAULT) &&
-                    !(statusWord & status_word::VOUT_OV_FAULT))
-                {
-                    if (!voutUVFault)
-                    {
-                        log<level::ERR>(
-                            fmt::format(
-                                "VOUT_UV_FAULT fault: STATUS_WORD = {:#04x}, "
-                                "STATUS_MFR_SPECIFIC = {:#02x}, "
-                                "STATUS_VOUT = {:#02x}",
-                                statusWord, statusMFR, statusVout)
-                                .c_str());
-                    }
-
-                    voutUVFault = true;
-                }
+                analyzeVoutUVFault();
 
                 if (statusWord & status_word::FAN_FAULT)
                 {