Skip to contentSkip to conversation

x86/mm: remove redundant computation of pmd_leaf

PATCH New chengkaitao 1 participant 1 message Jan 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm: remove redundant computation of pmd_leaf

From: Chengkaitao <[email protected]>

In the function vmemmap_check_pmd, the result of pmd_leaf(*pmd) has already been stored in the variable large. The subsequent code can directly use this precomputed value instead of recalculating it.

---
 arch/x86/mm/init_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/init_64.c +1 -1
index 9983017ecbe0..e361a81f7ccb 100644
@@ -1551,7 +1551,7 @@ int __meminit vmemmap_check_pmd(pmd_t *pmd, int node,
 {
 	int large = pmd_leaf(*pmd);
 
-	if (pmd_leaf(*pmd)) {
+	if (large) {
 		vmemmap_verify((pte_t *)pmd, node, addr, next);
 		vmemmap_use_sub_pmd(addr, next);
 	}
Signature · 1 line
2.50.1 (Apple Git-155)