Commit 630a2ef3 authored by Dan Williams's avatar Dan Williams Committed by Greg Kroah-Hartman

libnvdimm, pfn: fix align attribute

commit af7d9f0c upstream.

Fix the format specifier so that the attribute can be parsed correctly.
Currently it returns decimal 1000 for a 4096-byte alignment.
Reported-by: default avatarDave Jiang <dave.jiang@intel.com>
Fixes: 315c5625 ("libnvdimm, pfn: add 'align' attribute, default to HPAGE_SIZE")
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6838ac12
...@@ -108,7 +108,7 @@ static ssize_t align_show(struct device *dev, ...@@ -108,7 +108,7 @@ static ssize_t align_show(struct device *dev,
{ {
struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev);
return sprintf(buf, "%lx\n", nd_pfn->align); return sprintf(buf, "%ld\n", nd_pfn->align);
} }
static ssize_t __align_store(struct nd_pfn *nd_pfn, const char *buf) static ssize_t __align_store(struct nd_pfn *nd_pfn, const char *buf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment