diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-02-13 02:01:11 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-03-05 21:24:06 +0100 |
commit | aef25338226660cdd4df908c2eff1abdcfca65e5 (patch) | |
tree | b89be48ddd43730ae5a779252bd6702c5df829cb /tools | |
parent | nfit, tools/testing/nvdimm: test multiple control regions per-dimm (diff) | |
download | linux-aef25338226660cdd4df908c2eff1abdcfca65e5.tar.xz linux-aef25338226660cdd4df908c2eff1abdcfca65e5.zip |
libnvdimm, nfit: centralize command status translation
The return value from an 'ndctl_fn' reports the command execution
status, i.e. was the command properly formatted and was it successfully
submitted to the bus provider. The new 'cmd_rc' parameter allows the bus
provider to communicate command specific results, translated into
common error codes.
Convert the ARS commands to this scheme to:
1/ Consolidate status reporting
2/ Prepare for for expanding ars unit test cases
3/ Make the implementation more generic
Cc: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/nvdimm/test/nfit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index 27b808e0489a..9ead77970546 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c @@ -261,7 +261,7 @@ static int nfit_test_cmd_ars_status(struct nd_cmd_ars_status *nd_cmd, static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, unsigned int cmd, void *buf, - unsigned int buf_len) + unsigned int buf_len, int *cmd_rc) { struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); struct nfit_test *t = container_of(acpi_desc, typeof(*t), acpi_desc); @@ -315,6 +315,9 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc, } } + /* TODO: error status tests */ + if (cmd_rc) + *cmd_rc = 0; return rc; } |