mm: thp: simplify the implementation of mk_huge_pmd()
authorYang Shi <yang.shi@linaro.org>
Fri, 20 May 2016 23:57:30 +0000 (16:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 May 2016 00:58:30 +0000 (17:58 -0700)
The implementation of mk_huge_pmd looks verbose, it could be just
simplified to one line code.

Signed-off-by: Yang Shi <yang.shi@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c

index 66675eed67be6d76ea45294faf9bfe00568a2cd2..86eafd91c982348544a63eac18cf69ba533d190f 100644 (file)
@@ -764,10 +764,7 @@ pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma)
 
 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)