On Fri, Jan 11, 2019 at 5:31 PM Vishal Verma <[email protected]> wrote:
>
> The ndctl inject-smart command was neglecting to check the
> 'firmware_status' field that is set by the platform firmware to indicate
> failure. Use the new ndctl_cmd_submit_xlat facility to include the
> firmware_status check as part of the command submission.
>
> Reported-by: Ami Pathak <[email protected]>
> Cc: Dan Williams <[email protected]>
> Signed-off-by: Vishal Verma <[email protected]>
[..]
> diff --git a/ndctl/util/json-smart.c b/ndctl/util/json-smart.c
> index 3c1b917..92a9313 100644
> --- a/ndctl/util/json-smart.c
> +++ b/ndctl/util/json-smart.c
> @@ -30,8 +30,8 @@ static void smart_threshold_to_json(struct ndctl_dimm *dimm,
> if (!cmd)
> return;
>
> - rc = ndctl_cmd_submit(cmd);
> - if (rc || ndctl_cmd_get_firmware_status(cmd))
> + rc = ndctl_cmd_submit_xlat(cmd);
> + if ((rc < 0) || ndctl_cmd_get_firmware_status(cmd))
> goto out;
Can't we just do:
rc = ndctl_cmd_submit_xlat(cmd);
if (rc < 0)
goto out;
...and drop the open coded ndctl_cmd_get_firmware_status()?
In general it seems like most users of ndctl_cmd_get_firmware_status()
would be happy with ndctl_cmd_submit_xlat() instead.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm