2019-09-02 17:00:05

by Clemens Gruber

[permalink] [raw]
Subject: [PATCH] arch: arm: reuse addr variable in pfn_valid

Avoid calling __pfn_to_phys twice.

Cc: Russell King <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: zhaoyang <[email protected]>
Signed-off-by: Clemens Gruber <[email protected]>
---
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