From: Alison Schofield <[email protected]>

Per the CXL specification, the partition alignment field reports
the alignment value in multiples of 256MB. In the libcxl API, values
for all capacity fields are defined to return bytes.

Update the partition alignment accessor to return bytes so that it
is in sync with other capacity related fields.

Signed-off-by: Alison Schofield <[email protected]>
---
 cxl/lib/libcxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c
index e9d7762..307e5c4 100644
--- a/cxl/lib/libcxl.c
+++ b/cxl/lib/libcxl.c
@@ -2306,7 +2306,7 @@ CXL_EXPORT unsigned long long 
cxl_cmd_identify_get_partition_align(
        if (cmd->status < 0)
                return cmd->status;
 
-       return le64_to_cpu(id->partition_align);
+       return capacity_to_bytes(id->partition_align);
 }
 
 CXL_EXPORT unsigned int cxl_cmd_identify_get_label_size(struct cxl_cmd *cmd)
-- 
2.31.1


Reply via email to