linux-mips
[Top] [All Lists]

[PATCH] MIPS: c-r4k: Avoid duplicate CPU_74K/CPU_1074K checks

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH] MIPS: c-r4k: Avoid duplicate CPU_74K/CPU_1074K checks
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Sat, 28 Jun 2014 23:28:08 +0100 (BST)
Cc: "Steven J. Hill" <Steven.Hill@imgtec.com>, linux-mips@linux-mips.org
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Alpine 2.11 (LFD 23 2013-08-11)
Code in a switch statement in probe_pcache checks the CPU type twice 
unnecessarily for processor implementations that have the alias removal 
feature reported by the CP0 Config7.AR and Config7.IAR bits.  This change 
rewrites the affected fragment avoiding the extraneous check and improving 
readability.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
Since nobody bothered to earn credit for integrating the proposal I posted 
earlier on:

http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=alpine.LFD.2.10.1403222210230.21669%40eddie.linux-mips.org

I decided to take the credit myself.  Ralf, please apply.

  Maciej

linux-mips-c-r4k-1074k-cleanup.patch
Index: linux-20140623-4maxp64/arch/mips/mm/c-r4k.c
===================================================================
--- linux-20140623-4maxp64.orig/arch/mips/mm/c-r4k.c
+++ linux-20140623-4maxp64/arch/mips/mm/c-r4k.c
@@ -1230,19 +1230,19 @@ static void probe_pcache(void)
        case CPU_R14000:
                break;
 
+       case CPU_74K:
+       case CPU_1074K:
+               alias_74k_erratum(c);
+               /* Fall through. */
        case CPU_M14KC:
        case CPU_M14KEC:
        case CPU_24K:
        case CPU_34K:
-       case CPU_74K:
        case CPU_1004K:
-       case CPU_1074K:
        case CPU_INTERAPTIV:
        case CPU_P5600:
        case CPU_PROAPTIV:
        case CPU_M5150:
-               if ((c->cputype == CPU_74K) || (c->cputype == CPU_1074K))
-                       alias_74k_erratum(c);
                if (!(read_c0_config7() & MIPS_CONF7_IAR) &&
                    (c->icache.waysize > PAGE_SIZE))
                        c->icache.flags |= MIPS_CACHE_ALIASES;

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS: c-r4k: Avoid duplicate CPU_74K/CPU_1074K checks, Maciej W. Rozycki <=