Return code cleanup
Moved attention handler return codes to hpp file and removed their
usage in the analyzer code since technically the analyzer is a
seperate library.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I57eb66330bf0db40edb6e2b1994c1c7e062c1744
diff --git a/analyzer/analyzer_main.cpp b/analyzer/analyzer_main.cpp
index 327dd1c..8de5924 100644
--- a/analyzer/analyzer_main.cpp
+++ b/analyzer/analyzer_main.cpp
@@ -7,7 +7,7 @@
{
/** Analyze error condition using the hardware error isolator */
-int analyzeHardware(std::map<std::string, std::string>& i_errors)
+bool analyzeHardware(std::map<std::string, std::string>& i_errors)
{
using namespace libhei;
@@ -37,7 +37,7 @@
// FIXME TEMP CODE - end
- return 0; // FIXME - error/success from isolator or isolation data
+ return true; // FIXME - error/success from isolator or isolation data
}
} // namespace analyzer
diff --git a/analyzer/analyzer_main.hpp b/analyzer/analyzer_main.hpp
index c7284ea..922179f 100644
--- a/analyzer/analyzer_main.hpp
+++ b/analyzer/analyzer_main.hpp
@@ -13,6 +13,6 @@
* component that caused the error(s).
*/
-int analyzeHardware(std::map<std::string, std::string>& i_errors);
+bool analyzeHardware(std::map<std::string, std::string>& i_errors);
} // namespace analyzer
diff --git a/attn/attn_handler.cpp b/attn/attn_handler.cpp
index 341fe2b..945156d 100644
--- a/attn/attn_handler.cpp
+++ b/attn/attn_handler.cpp
@@ -1,6 +1,7 @@
#include <analyzer/analyzer_main.hpp>
#include <attention.hpp>
#include <attn_config.hpp>
+#include <attn_handler.hpp>
#include <attn_logging.hpp>
#include <bp_handler.hpp>
#include <ti_handler.hpp>
@@ -14,15 +15,6 @@
namespace attn
{
-/** @brief Return codes */
-enum ReturnCodes
-{
- RC_SUCCESS = 0,
- RC_NOT_HANDLED,
- RC_ANALYZER_ERROR,
- RC_CFAM_ERROR
-};
-
/**
* @brief Handle SBE vital attention
*
@@ -226,9 +218,8 @@
// errors that were isolated
std::map<std::string, std::string> errors;
- rc = analyzer::analyzeHardware(errors); // analyze hardware
-
- if (RC_SUCCESS != rc)
+ // analyze errors
+ if (true != analyzer::analyzeHardware(errors))
{
rc = RC_ANALYZER_ERROR;
}
diff --git a/attn/attn_handler.hpp b/attn/attn_handler.hpp
index f81a9e7..1500d39 100644
--- a/attn/attn_handler.hpp
+++ b/attn/attn_handler.hpp
@@ -5,6 +5,15 @@
namespace attn
{
+/** @brief Attention handler return codes */
+enum ReturnCodes
+{
+ RC_SUCCESS = 0,
+ RC_NOT_HANDLED,
+ RC_ANALYZER_ERROR,
+ RC_CFAM_ERROR
+};
+
/**
* @brief The main attention handler logic
*