Skip to content

Commit feb72e9

Browse files
kvaneeshdavejiang
authored andcommitted
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 <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent e96d9a9 commit feb72e9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/nvdimm/pfn_devs.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,14 +601,12 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn, const char *sig)
601601
return -EOPNOTSUPP;
602602
}
603603

604-
if (!IS_ALIGNED(res->start + le32_to_cpu(pfn_sb->start_pad),
605-
memremap_compat_align())) {
604+
if (!IS_ALIGNED(res->start + start_pad, memremap_compat_align())) {
606605
dev_err(&nd_pfn->dev, "resource start misaligned\n");
607606
return -EOPNOTSUPP;
608607
}
609608

610-
if (!IS_ALIGNED(res->end + 1 - le32_to_cpu(pfn_sb->end_trunc),
611-
memremap_compat_align())) {
609+
if (!IS_ALIGNED(res->end + 1 - end_trunc, memremap_compat_align())) {
612610
dev_err(&nd_pfn->dev, "resource end misaligned\n");
613611
return -EOPNOTSUPP;
614612
}

0 commit comments

Comments
 (0)