summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>2023-08-09 07:35:12 +0200
committerDave Jiang <dave.jiang@intel.com>2023-08-11 18:15:05 +0200
commitfeb72e9b20823419aaed57801018eeffc7be7e82 (patch)
tree8e3b4ce04ef54138efba356977b730bda66fa52c /drivers/nvdimm
parentnvdimm/pfn_dev: Prevent the creation of zero-sized namespaces (diff)
downloadlinux-feb72e9b20823419aaed57801018eeffc7be7e82.tar.xz
linux-feb72e9b20823419aaed57801018eeffc7be7e82.zip
nvdimm/pfn_dev: Avoid unnecessary endian conversion
use the local variable that already have the converted values. No functional change in this patch. Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Link: https://lore.kernel.org/r/20230809053512.350660-2-aneesh.kumar@linux.ibm.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/pfn_devs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
index 0777b1626f6c..c662d8964802 100644
--- a/drivers/nvdimm/pfn_devs.c
+++ b/drivers/nvdimm/pfn_devs.c
@@ -601,14 +601,12 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn, const char *sig)
return -EOPNOTSUPP;
}
- if (!IS_ALIGNED(res->start + le32_to_cpu(pfn_sb->start_pad),
- memremap_compat_align())) {
+ if (!IS_ALIGNED(res->start + start_pad, memremap_compat_align())) {
dev_err(&nd_pfn->dev, "resource start misaligned\n");
return -EOPNOTSUPP;
}
- if (!IS_ALIGNED(res->end + 1 - le32_to_cpu(pfn_sb->end_trunc),
- memremap_compat_align())) {
+ if (!IS_ALIGNED(res->end + 1 - end_trunc, memremap_compat_align())) {
dev_err(&nd_pfn->dev, "resource end misaligned\n");
return -EOPNOTSUPP;
}