Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac8ab8dd authored by Tobias Klauser's avatar Tobias Klauser Committed by Ley Foon Tan
Browse files

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: default avatarTobias Klauser <tklauser@distanz.ch>
Acked-by: default avatarLey Foon Tan <lftan@altera.com>
parent 2fc8483f
Loading
Loading
Loading
Loading
+5 −9
Original line number Original line Diff line number Diff line
@@ -73,18 +73,14 @@ void __init setup_cpuinfo(void)
	cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul");
	cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul");
	cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx");
	cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx");


#ifdef CONFIG_NIOS2_HW_DIV_SUPPORT
	if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div)
	if (!cpuinfo.has_div)
		err_cpu("DIV");
		err_cpu("DIV");
#endif

#ifdef CONFIG_NIOS2_HW_MUL_SUPPORT
	if (IS_ENABLED(CONFIG_NIOS2_HW_MUL_SUPPORT) && !cpuinfo.has_mul)
	if (!cpuinfo.has_mul)
		err_cpu("MUL");
		err_cpu("MUL");
#endif

#ifdef CONFIG_NIOS2_HW_MULX_SUPPORT
	if (IS_ENABLED(CONFIG_NIOS2_HW_MULX_SUPPORT) && !cpuinfo.has_mulx)
	if (!cpuinfo.has_mulx)
		err_cpu("MULX");
		err_cpu("MULX");
#endif


	cpuinfo.tlb_num_ways = fcpu(cpu, "altr,tlb-num-ways");
	cpuinfo.tlb_num_ways = fcpu(cpu, "altr,tlb-num-ways");
	if (!cpuinfo.tlb_num_ways)
	if (!cpuinfo.tlb_num_ways)