linux-mips
[Top] [All Lists]

Suspicious test in dma-default.c

To: linux-mips@linux-mips.org
Subject: Suspicious test in dma-default.c
From: Maxime Bizon <mbizon@freebox.fr>
Date: Fri, 31 Aug 2007 11:03:14 +0200
Cc: Ralf Baechle <ralf@linux-mips.org>
Organization: Freebox
Original-recipient: rfc822;linux-mips@linux-mips.org
Reply-to: mbizon@freebox.fr
Sender: linux-mips-bounce@linux-mips.org
Hello,


I don't know exactly why cpu_is_noncoherent_r10000() is needed, but the
test looks wrong:

        return !plat_device_is_coherent(dev) &&
               (current_cpu_data.cputype == CPU_R10000 &&
               current_cpu_data.cputype == CPU_R12000);


I suggest the following patch:

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>

--- linux-git/arch/mips/mm/dma-default.c.orig   2007-08-31 10:55:17.000000000 
+0200
+++ linux-git/arch/mips/mm/dma-default.c        2007-08-31 10:55:25.000000000 
+0200
@@ -35,7 +35,7 @@
 static inline int cpu_is_noncoherent_r10000(struct device *dev)
 {
        return !plat_device_is_coherent(dev) &&
-              (current_cpu_data.cputype == CPU_R10000 &&
+              (current_cpu_data.cputype == CPU_R10000 ||
               current_cpu_data.cputype == CPU_R12000);
 }
 

-- 
Maxime


<Prev in Thread] Current Thread [Next in Thread>
  • Suspicious test in dma-default.c, Maxime Bizon <=