Commit 2a60aa14 authored by Guo Ren's avatar Guo Ren

csky: fixup compile error with pte_alloc

Commit: 4cf58924 remove the address argument of pte_alloc without
modify csky related code. linux-5.0-rc1 compile failed with csky.

Remove the unnecessary address testing in pte_alloc().
Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
parent 96354ad7
...@@ -24,41 +24,34 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, ...@@ -24,41 +24,34 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
extern void pgd_init(unsigned long *p); extern void pgd_init(unsigned long *p);
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
unsigned long address)
{ {
pte_t *pte; pte_t *pte;
unsigned long *kaddr, i; unsigned long i;
pte = (pte_t *) __get_free_pages(GFP_KERNEL | __GFP_RETRY_MAYFAIL, pte = (pte_t *) __get_free_page(GFP_KERNEL);
PTE_ORDER); if (!pte)
kaddr = (unsigned long *)pte; return NULL;
if (address & 0x80000000)
for (i = 0; i < (PAGE_SIZE/4); i++) for (i = 0; i < PAGE_SIZE/sizeof(pte_t); i++)
*(kaddr + i) = 0x1; (pte + i)->pte_low = _PAGE_GLOBAL;
else
clear_page(kaddr);
return pte; return pte;
} }
static inline struct page *pte_alloc_one(struct mm_struct *mm, static inline struct page *pte_alloc_one(struct mm_struct *mm)
unsigned long address)
{ {
struct page *pte; struct page *pte;
unsigned long *kaddr, i;
pte = alloc_pages(GFP_KERNEL | __GFP_ZERO, 0);
pte = alloc_pages(GFP_KERNEL | __GFP_RETRY_MAYFAIL, PTE_ORDER); if (!pte)
if (pte) { return NULL;
kaddr = kmap_atomic(pte);
if (address & 0x80000000) { if (!pgtable_page_ctor(pte)) {
for (i = 0; i < (PAGE_SIZE/4); i++) __free_page(pte);
*(kaddr + i) = 0x1; return NULL;
} else
clear_page(kaddr);
kunmap_atomic(kaddr);
pgtable_page_ctor(pte);
} }
return pte; return pte;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment