aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/mm/hugetlbpage.c6
-rw-r--r--include/asm-powerpc/page_64.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 9250f14be8ef..f867bba893ca 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -287,15 +287,15 @@ static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)
287 287
288int prepare_hugepage_range(unsigned long addr, unsigned long len) 288int prepare_hugepage_range(unsigned long addr, unsigned long len)
289{ 289{
290 int err; 290 int err = 0;
291 291
292 if ( (addr+len) < addr ) 292 if ( (addr+len) < addr )
293 return -EINVAL; 293 return -EINVAL;
294 294
295 if ((addr + len) < 0x100000000UL) 295 if (addr < 0x100000000UL)
296 err = open_low_hpage_areas(current->mm, 296 err = open_low_hpage_areas(current->mm,
297 LOW_ESID_MASK(addr, len)); 297 LOW_ESID_MASK(addr, len));
298 else 298 if ((addr + len) >= 0x100000000UL)
299 err = open_high_hpage_areas(current->mm, 299 err = open_high_hpage_areas(current->mm,
300 HTLB_AREA_MASK(addr, len)); 300 HTLB_AREA_MASK(addr, len));
301 if (err) { 301 if (err) {
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h
index 1e6e7846824f..58a3dd9a79ec 100644
--- a/include/asm-powerpc/page_64.h
+++ b/include/asm-powerpc/page_64.h
@@ -135,9 +135,9 @@ extern unsigned int HPAGE_SHIFT;
135 135
136#define in_hugepage_area(context, addr) \ 136#define in_hugepage_area(context, addr) \
137 (cpu_has_feature(CPU_FTR_16M_PAGE) && \ 137 (cpu_has_feature(CPU_FTR_16M_PAGE) && \
138 ( ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) || \ 138 ( ( (addr) >= 0x100000000UL) \
139 ( ((addr) < 0x100000000L) && \ 139 ? ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) \
140 ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) ) ) 140 : ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) )
141 141
142#else /* !CONFIG_HUGETLB_PAGE */ 142#else /* !CONFIG_HUGETLB_PAGE */
143 143