[PATCH] arch: arm: reuse addr variable in pfn_valid

From: Clemens Gruber
Date: Mon Sep 02 2019 - 12:59:03 EST


Avoid calling __pfn_to_phys twice.

Cc: Russell King <linux@xxxxxxxxxxxxxxx>
Cc: Mike Rapoport <rppt@xxxxxxxxxxxxx>
Cc: zhaoyang <huangzhaoyang@xxxxxxxxx>
Signed-off-by: Clemens Gruber <clemens.gruber@xxxxxxxxxxxx>
---
arch/arm/mm/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 98e17388a563..a5fe2bdc76de 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -179,7 +179,7 @@ int pfn_valid(unsigned long pfn)
if (__phys_to_pfn(addr) != pfn)
return 0;

- return memblock_is_map_memory(__pfn_to_phys(pfn));
+ return memblock_is_map_memory(addr);
}
EXPORT_SYMBOL(pfn_valid);
#endif
--
2.23.0