diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> | 2019-09-05 21:16:02 +0530 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2019-09-05 16:11:14 -0700 |
commit | 5b26db95fee3f1ce0d096b2de0ac6f3716171093 (patch) | |
tree | d927139658fccca825a0448052d32693dac766e6 /drivers/nvdimm/region_devs.c | |
parent | 047e0eff1f150220d615c35c36af225f3e1ed057 (diff) | |
download | linux-stable-5b26db95fee3f1ce0d096b2de0ac6f3716171093.tar.gz linux-stable-5b26db95fee3f1ce0d096b2de0ac6f3716171093.tar.bz2 linux-stable-5b26db95fee3f1ce0d096b2de0ac6f3716171093.zip |
libnvdimm: Use PAGE_SIZE instead of SZ_4K for align check
Architectures have different page size than 4K. Use the PAGE_SIZE
to make sure ranges are correctly aligned.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Link: https://lore.kernel.org/r/20190905154603.10349-7-aneesh.kumar@linux.ibm.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/region_devs.c')
-rw-r--r-- | drivers/nvdimm/region_devs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index cd6da354eae4..3fd6b59abd33 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -944,10 +944,10 @@ static struct nd_region *nd_region_create(struct nvdimm_bus *nvdimm_bus, struct nd_mapping_desc *mapping = &ndr_desc->mapping[i]; struct nvdimm *nvdimm = mapping->nvdimm; - if ((mapping->start | mapping->size) % SZ_4K) { - dev_err(&nvdimm_bus->dev, "%s: %s mapping%d is not 4K aligned\n", - caller, dev_name(&nvdimm->dev), i); - + if ((mapping->start | mapping->size) % PAGE_SIZE) { + dev_err(&nvdimm_bus->dev, + "%s: %s mapping%d is not %ld aligned\n", + caller, dev_name(&nvdimm->dev), i, PAGE_SIZE); return NULL; } |