diff mbox

[2/4] ndctl: fix return value truncation for ndctl_cmd_ars_get_record_{addr, len}

Message ID 20151110003440.18262.55344.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Dan Williams Nov. 10, 2015, 12:34 a.m. UTC
By inspection noticed that these functions were truncating the command
results for these fields from 4-bytes to 8.

Cc: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 lib/libndctl.c       |    8 ++++----
 lib/ndctl/libndctl.h |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/lib/libndctl.c b/lib/libndctl.c
index 6bfc79f95b83..ea3947dd3e33 100644
--- a/lib/libndctl.c
+++ b/lib/libndctl.c
@@ -1873,8 +1873,8 @@  NDCTL_EXPORT unsigned int ndctl_cmd_ars_num_records(struct ndctl_cmd *ars_stat)
 	return 0;
 }
 
-NDCTL_EXPORT unsigned int ndctl_cmd_ars_get_record_addr(struct ndctl_cmd *ars_stat,
-		unsigned int rec_index)
+NDCTL_EXPORT unsigned long long ndctl_cmd_ars_get_record_addr(
+		struct ndctl_cmd *ars_stat, unsigned int rec_index)
 {
 	struct ndctl_ctx *ctx = ndctl_bus_get_ctx(cmd_to_bus(ars_stat));
 
@@ -1890,8 +1890,8 @@  NDCTL_EXPORT unsigned int ndctl_cmd_ars_get_record_addr(struct ndctl_cmd *ars_st
 	return 0;
 }
 
-NDCTL_EXPORT unsigned int ndctl_cmd_ars_get_record_len(struct ndctl_cmd *ars_stat,
-		unsigned int rec_index)
+NDCTL_EXPORT unsigned long long ndctl_cmd_ars_get_record_len(
+		struct ndctl_cmd *ars_stat, unsigned int rec_index)
 {
 	struct ndctl_ctx *ctx = ndctl_bus_get_ctx(cmd_to_bus(ars_stat));
 
diff --git a/lib/ndctl/libndctl.h b/lib/ndctl/libndctl.h
index 1bef168935b0..31118c646520 100644
--- a/lib/ndctl/libndctl.h
+++ b/lib/ndctl/libndctl.h
@@ -156,9 +156,9 @@  struct ndctl_cmd *ndctl_bus_cmd_new_ars_status(struct ndctl_cmd *ars_cap);
 unsigned int ndctl_cmd_ars_cap_get_size(struct ndctl_cmd *ars_cap);
 unsigned int ndctl_cmd_ars_in_progress(struct ndctl_cmd *ars_status);
 unsigned int ndctl_cmd_ars_num_records(struct ndctl_cmd *ars_stat);
-unsigned int ndctl_cmd_ars_get_record_addr(struct ndctl_cmd *ars_stat,
+unsigned long long ndctl_cmd_ars_get_record_addr(struct ndctl_cmd *ars_stat,
 		unsigned int rec_index);
-unsigned int ndctl_cmd_ars_get_record_len(struct ndctl_cmd *ars_stat,
+unsigned long long ndctl_cmd_ars_get_record_len(struct ndctl_cmd *ars_stat,
 		unsigned int rec_index);
 struct ndctl_cmd *ndctl_dimm_cmd_new_vendor_specific(struct ndctl_dimm *dimm,
 		unsigned int opcode, size_t input_size, size_t output_size);