nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [ndctl PATCH] ndctl, smart: fix threshold temperature helper
@ 2018-02-14 20:37 Dan Williams
  0 siblings, 0 replies; only message in thread
From: Dan Williams @ 2018-02-14 20:37 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: Dariusz Dokupil

In version v53 libndctl gained smart support and the 'get_temperature'
helper that retrieved media temperature. In v59 libndctl gained
threshold support, and the 'get_temperature_threshold' helper. The
implementation of 'set_temperature_threshold' was inadvertently omitted
from v59. Add a definition so that applications that use the declared
symbol can build.

Reported-by: Dariusz Dokupil <dariusz.dokupil@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/lib/smart.c |    6 ++++++
 test/libndctl.c   |    3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ndctl/lib/smart.c b/ndctl/lib/smart.c
index 4ab94bb780cf..b76a4de1db62 100644
--- a/ndctl/lib/smart.c
+++ b/ndctl/lib/smart.c
@@ -117,6 +117,12 @@ smart_cmd_set_op(smart_threshold_set_media_temperature)
 smart_cmd_set_op(smart_threshold_set_ctrl_temperature)
 smart_cmd_set_op(smart_threshold_set_spares)
 
+NDCTL_EXPORT int ndctl_cmd_smart_threshold_set_temperature(
+		struct ndctl_cmd *cmd, unsigned int val)
+{
+	return ndctl_cmd_smart_threshold_set_media_temperature(cmd, val);
+}
+
 NDCTL_EXPORT struct ndctl_cmd *ndctl_dimm_cmd_new_smart_inject(
 		struct ndctl_dimm *dimm)
 {
diff --git a/test/libndctl.c b/test/libndctl.c
index 7fecfe2e804b..a66bcb7dfe87 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -2297,7 +2297,8 @@ static int check_smart_threshold(struct ndctl_bus *bus, struct ndctl_dimm *dimm,
 		 */
 		rc = ndctl_cmd_smart_threshold_set_alarm_control(cmd_set,
 				ndctl_cmd_smart_threshold_get_supported_alarms(cmd_set));
-		rc |= ndctl_cmd_smart_threshold_set_media_temperature(cmd_set,
+		/* 'set_temperature' and 'set_media_temperature' are aliases */
+		rc |= ndctl_cmd_smart_threshold_set_temperature(cmd_set,
 				ndctl_cmd_smart_get_media_temperature(cmd_smart));
 		rc |= ndctl_cmd_smart_threshold_set_ctrl_temperature(cmd_set,
 				ndctl_cmd_smart_get_ctrl_temperature(cmd_smart));

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-14 20:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14 20:37 [ndctl PATCH] ndctl, smart: fix threshold temperature helper Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).