linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: Add missing cpu_has_mips_1 guardian

To: Tony Wu <tung7970@gmail.com>
Subject: Re: [PATCH] MIPS: Add missing cpu_has_mips_1 guardian
From: Ralf Baechle <ralf@linux-mips.org>
Date: Wed, 26 Jun 2013 16:31:16 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <20130621110301.GA23195@hades.local>
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
References: <20130621110301.GA23195@hades.local>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Jun 21, 2013 at 07:03:01PM +0800, Tony Wu wrote:

>  arch/mips/include/asm/cpu-features.h |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/mips/include/asm/cpu-features.h 
> b/arch/mips/include/asm/cpu-features.h
> index e5ec8fc..df5e523 100644
> --- a/arch/mips/include/asm/cpu-features.h
> +++ b/arch/mips/include/asm/cpu-features.h
> @@ -136,7 +136,9 @@
>  #endif
>  #endif
>  
> +#ifndef cpu_has_mips_1
>  # define cpu_has_mips_1              (cpu_data[0].isa_level & MIPS_CPU_ISA_I)
> +#endif

cpu_has_mips_1 will always evaluate as MIPS I because later ISA revisions
always contain MIPS I as a subset.  So maybe we should rather remove
cpu_has_mips_1 and MIPS_CPU_ISA_I entirely.  The sole user of cpu_has_mips_1,
proc.c could easily be cleaned up, the sole test for MIPS_CPU_ISA_I in
traps.c is slightly more work to clean up because it really is a test for
the cp0 architecture.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>