diff mbox

[ndctl,1/2] util: make parse_smart_temperature() global

Message ID 20160902133238.22200-2-brian.boylston@hpe.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boylston, Brian Sept. 2, 2016, 1:32 p.m. UTC
Allow parse_smart_temperature() to be called by other modules with similar
temperature decoding needs.

Cc: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Brian Boylston <brian.boylston@hpe.com>
---
 ndctl/util/json-smart.c | 2 +-
 ndctl/util/json.h       | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/ndctl/util/json-smart.c b/ndctl/util/json-smart.c
index 824c51e..103af19 100644
--- a/ndctl/util/json-smart.c
+++ b/ndctl/util/json-smart.c
@@ -11,7 +11,7 @@ 
 #include <ndctl.h>
 #endif
 
-static double parse_smart_temperature(unsigned int temp)
+double parse_smart_temperature(unsigned int temp)
 {
 	bool negative = !!(temp & (1 << 15));
 	double t;
diff --git a/ndctl/util/json.h b/ndctl/util/json.h
index 7492e51..e8b1549 100644
--- a/ndctl/util/json.h
+++ b/ndctl/util/json.h
@@ -13,8 +13,13 @@  struct json_object *util_mapping_to_json(struct ndctl_mapping *mapping);
 struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
 		bool include_idle);
 #ifdef HAVE_NDCTL_SMART
+double parse_smart_temperature(unsigned int temp);
 struct json_object *util_dimm_health_to_json(struct ndctl_dimm *dimm);
 #else
+static inline double parse_smart_temperature(unsigned int temp)
+{
+	return 0.0;
+}
 static inline struct json_object *util_dimm_health_to_json(
 		struct ndctl_dimm *dimm)
 {