Allow parse_smart_temperature() to be called by other modules with similar temperature decoding needs.
Cc: Dan Williams <[email protected]> Reviewed-by: Jerry Hoemann <[email protected]> Signed-off-by: Brian Boylston <[email protected]> --- ndctl/util/json-smart.c | 2 +- ndctl/util/json.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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) { -- 2.8.3 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
