Skip to contentSkip to conversation

mm: thp: simplify the implementation of mk_huge_pmd()

PATCH New [email protected] 1 participant 1 message May 20, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 22/162 mm: thp: simplify the implementation of mk_huge_pmd()

From: Yang Shi <[email protected]>
Subject: mm: thp: simplify the implementation of mk_huge_pmd()

The implementation of mk_huge_pmd looks verbose, it could be just simplified to one line code.

---

 mm/huge_memory.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
mm/huge_memory.c renamed from mm/huge_memory.c~mm-thp-simplify-the-implementation-of-mk_huge_pmd +1 -4
diff -puN mm/huge_memory.c~mm-thp-simplify-the-implementation-of-mk_huge_pmd mm/huge_memory.c
@@ -764,10 +764,7 @@ pmd_t maybe_pmd_mkwrite(pmd_t pmd, struc
 
 static inline pmd_t mk_huge_pmd(struct page *page, pgprot_t prot)
 {
-	pmd_t entry;
-	entry = mk_pmd(page, prot);
-	entry = pmd_mkhuge(entry);
-	return entry;
+	return pmd_mkhuge(mk_pmd(page, prot));
 }
 
 static inline struct list_head *page_deferred_list(struct page *page)

_