From: Arnaud Patard Date: Thu, 29 Apr 2010 09:58:49 +0000 (+0200) Subject: MIPS: Loongson: Fix phys_mem_access_prot() check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=514b6d0c06a5d751259f145d9593b4d084c1cce3;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git MIPS: Loongson: Fix phys_mem_access_prot() check The check used to determine if uncached accelerated should be used or not is wrong. The parenthesis are misplaced and making the test fail. Signed-off-by: Arnaud Patard To: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/1161/ Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/loongson/common/mem.c b/arch/mips/loongson/common/mem.c index b5f402578a87..30eba6001205 100644 --- a/arch/mips/loongson/common/mem.c +++ b/arch/mips/loongson/common/mem.c @@ -75,7 +75,7 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, unsigned long end = offset + size; if (__uncached_access(file, offset)) { - if (((uca_start && offset) >= uca_start) && + if (uca_start && (offset >= uca_start) && (end <= uca_end)) return __pgprot((pgprot_val(vma_prot) & ~_CACHE_MASK) |