diff mbox series

[ndctl,v3,3/5] ndctl, monitor: Don't require the support of ND_CMD_SMART_THRESHOLD

Message ID 20190323042028.4310-4-decui@microsoft.com (mailing list archive)
State Accepted
Commit c22fe7b4038904d73ad94e176315e641ea90f1e5
Headers show
Series Add the support for Hyper-V virtual NVDIMM | expand

Commit Message

Dexuan Cui March 23, 2019, 4:20 a.m. UTC
When a NVDIMM doesn't support ND_CMD_SMART_THRESHOLD, it may support
ND_CMD_SMART or a variant of ND_CMD_SMART. Allow such a NVDIMM to work
with "ndctl monitor".

Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
 ndctl/monitor.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index 43b2abe..346a6df 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -275,17 +275,13 @@  static void filter_dimm(struct ndctl_dimm *dimm, struct util_filter_ctx *fctx)
 		err(&monitor, "%s: no smart support\n", name);
 		return;
 	}
-	if (!ndctl_dimm_is_cmd_supported(dimm, ND_CMD_SMART_THRESHOLD)) {
-		err(&monitor, "%s: no smart threshold support\n", name);
-		return;
-	}
 
-	if (!ndctl_dimm_is_flag_supported(dimm, ND_SMART_ALARM_VALID)) {
+	if (!ndctl_dimm_is_cmd_supported(dimm, ND_CMD_SMART_THRESHOLD)) {
+		dbg(&monitor, "%s: no smart threshold support\n", name);
+	} else if (!ndctl_dimm_is_flag_supported(dimm, ND_SMART_ALARM_VALID)) {
 		err(&monitor, "%s: smart alarm invalid\n", name);
 		return;
-	}
-
-	if (enable_dimm_supported_threshold_alarms(dimm)) {
+	} else if (enable_dimm_supported_threshold_alarms(dimm)) {
 		err(&monitor, "%s: enable supported threshold alarms failed\n", name);
 		return;
 	}