From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E7C9921962301 for ; Mon, 21 Jan 2019 18:49:16 -0800 (PST) From: Wei Yang Subject: [PATCH 2/2] libnvdimm, pfn: use PAGE_SIZE to calculate npfns Date: Tue, 22 Jan 2019 10:48:10 +0800 Message-Id: <20190122024810.4448-2-richardw.yang@linux.intel.com> In-Reply-To: <20190122024810.4448-1-richardw.yang@linux.intel.com> References: <20190122024810.4448-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: linux-nvdimm@lists.01.org Cc: zwisler@kernel.org List-ID: There are two places to calculate npfns in nd_pfn_init(), while they use difference size to calculate. Use PAGE_SIZE would be more proper for calculation. Signed-off-by: Wei Yang --- drivers/nvdimm/pfn_devs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index 5eca050b3660..383f01bedd40 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -770,7 +770,7 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) return -ENXIO; } - npfns = (size - offset - start_pad - end_trunc) / SZ_4K; + npfns = (size - offset - start_pad - end_trunc) / PAGE_SIZE; pfn_sb->mode = cpu_to_le32(nd_pfn->mode); pfn_sb->dataoff = cpu_to_le64(offset); pfn_sb->npfns = cpu_to_le64(npfns); -- 2.19.1 _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm