libndctl: Fix the failure interpretation for status translations
Vishal Verma
maintainerPATCH 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.
--- ndctl/lib/libndctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ndctl/lib/libndctl.c +1 -1
@@ -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
Quoted 11 lines · Vishal Verma
commit
62bbfce3cb62("libndctl, intel: Add infrastructure forfirmware_statustranslation") has the unfortunate side effect of making all NDCTL commands fail with-ENOMSGunless anxlat_firmware_statusfunction 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")Reported-by Oliver O'Halloran <[email protected]>Based-on-patch-by Dan Williams <[email protected]>
You can just replace that with:
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm