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 <[email protected]>
---
 ndctl/monitor.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

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;
        }
-- 
2.19.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to