From patchwork Mon Feb 7 23:10:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alison Schofield X-Patchwork-Id: 12737968 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3288CC38A2B for ; Tue, 8 Feb 2022 01:05:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235122AbiBHBFI (ORCPT ); Mon, 7 Feb 2022 20:05:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245486AbiBGXGQ (ORCPT ); Mon, 7 Feb 2022 18:06:16 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8871FC061355 for ; Mon, 7 Feb 2022 15:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644275176; x=1675811176; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F44UHN3rHqegtj2FoCEG5GqNLVnIuqt9mQoN6J5UurI=; b=Jtm74o8C5faTdtkSk07OaM7LNWPMzolGEvt6IihCxoMAxrZylYAyAlSI fUtSZ0fD/yVujXGS3Bm1wfIE25F1P/gojz/h6cJoel/wUQKH07Yi25AVV Spc0pJk+Posg+gWHg4S6i1rWv//J4g+nSRSh9HQOvZSdckMrGPNP+qK5M fhrZDNPOC7pC/EilynsVctlcvV5vUBPLnFX3/BZp9vQcrE3pdxxTEjiLN /lmOoKw2PPVqtXDKkRU7MVcVAgUSjawKu8yZTpFyD6POIQHb1JuGYacxM nwhh8st2Awx/+hYxByCRAz3zhnuvuKKFkMvyv2vWTxxpqhiRBHG/Bg519 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10251"; a="248775571" X-IronPort-AV: E=Sophos;i="5.88,351,1635231600"; d="scan'208";a="248775571" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 15:06:14 -0800 X-IronPort-AV: E=Sophos;i="5.88,351,1635231600"; d="scan'208";a="632639204" Received: from alison-desk.jf.intel.com (HELO localhost) ([10.54.74.41]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 15:06:14 -0800 From: alison.schofield@intel.com To: Ben Widawsky , Dan Williams , Ira Weiny , Vishal Verma Cc: Alison Schofield , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org Subject: [ndctl PATCH v4 3/6] libcxl: return the partition alignment field in bytes Date: Mon, 7 Feb 2022 15:10:17 -0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org From: Alison Schofield 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 --- 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)