Skip to contentSkip to conversation

libndctl: Fix the failure interpretation for status translations

PATCH In review Vishal Verma 2 participants 2 messages Jan 30, 2019 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 libndctl: Fix the failure interpretation for status translations

commit 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation") has the unfortunate side effect of making all NDCTL commands fail with -ENOMSG unless an xlat_firmware_status function is defined for the DIMM family. A failure to translate just means proceed with the information that we do have, not report a command failure.

Fixes 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation")
---
 ndctl/lib/libndctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ndctl/lib/libndctl.c +1 -1
index 830b791..2fa8916 100644
@@ -2710,7 +2710,7 @@ NDCTL_EXPORT int ndctl_cmd_xlat_firmware_status(struct ndctl_cmd *cmd)
 	struct ndctl_dimm_ops *ops = dimm ? dimm->ops : NULL;
 
 	if (!dimm || !ops || !ops->xlat_firmware_status)
-		return -ENOMSG;
+		return 0;
 	return ops->xlat_firmware_status(cmd);
 }
 
Signature · 6 lines
2.20.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Vishal Verma

commit 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation") has the unfortunate side effect of making all NDCTL commands fail with -ENOMSG unless an xlat_firmware_status function is defined for the DIMM family. A failure to translate just means proceed with the information that we do have, not report a command failure.

Fixes 62bbfce3cb62 ("libndctl, intel: Add infrastructure for firmware_status translation")

You can just replace that with:

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