diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2014-11-17 05:30:37 -0500 |
|---|---|---|
| committer | Ley Foon Tan <lftan@altera.com> | 2014-12-07 23:56:07 -0500 |
| commit | ac8ab8dd95f6fae76f0742499206d29eea4604cd (patch) | |
| tree | 90e4bfb7904fe3b9cfcc4d913576dc05bedceed6 /arch/nios2/kernel | |
| parent | 2fc8483fdcde767795402a38a53e647811dc9abf (diff) | |
nios2: Use IS_ENABLED instead of #ifdefs to check config symbols
Make the checking for div/mul/mulx instruction config symbols easier to
read by using IS_ENABLED instead of #ifdefs.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Ley Foon Tan <lftan@altera.com>
Diffstat (limited to 'arch/nios2/kernel')
| -rw-r--r-- | arch/nios2/kernel/cpuinfo.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/nios2/kernel/cpuinfo.c b/arch/nios2/kernel/cpuinfo.c index b8081c5f50a1..51d5bb90d3e5 100644 --- a/arch/nios2/kernel/cpuinfo.c +++ b/arch/nios2/kernel/cpuinfo.c | |||
| @@ -73,18 +73,14 @@ void __init setup_cpuinfo(void) | |||
| 73 | cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul"); | 73 | cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul"); |
| 74 | cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx"); | 74 | cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx"); |
| 75 | 75 | ||
| 76 | #ifdef CONFIG_NIOS2_HW_DIV_SUPPORT | 76 | if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div) |
| 77 | if (!cpuinfo.has_div) | ||
| 78 | err_cpu("DIV"); | 77 | err_cpu("DIV"); |
| 79 | #endif | 78 | |
| 80 | #ifdef CONFIG_NIOS2_HW_MUL_SUPPORT | 79 | if (IS_ENABLED(CONFIG_NIOS2_HW_MUL_SUPPORT) && !cpuinfo.has_mul) |
| 81 | if (!cpuinfo.has_mul) | ||
| 82 | err_cpu("MUL"); | 80 | err_cpu("MUL"); |
| 83 | #endif | 81 | |
| 84 | #ifdef CONFIG_NIOS2_HW_MULX_SUPPORT | 82 | if (IS_ENABLED(CONFIG_NIOS2_HW_MULX_SUPPORT) && !cpuinfo.has_mulx) |
| 85 | if (!cpuinfo.has_mulx) | ||
| 86 | err_cpu("MULX"); | 83 | err_cpu("MULX"); |
| 87 | #endif | ||
| 88 | 84 | ||
| 89 | cpuinfo.tlb_num_ways = fcpu(cpu, "altr,tlb-num-ways"); | 85 | cpuinfo.tlb_num_ways = fcpu(cpu, "altr,tlb-num-ways"); |
| 90 | if (!cpuinfo.tlb_num_ways) | 86 | if (!cpuinfo.tlb_num_ways) |
