Bug 13595 - wrong #endif in arch/mips/mipssim/sim_time.c
Summary: wrong #endif in arch/mips/mipssim/sim_time.c
Status: CLOSED CODE_FIX
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: MIPS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: ralf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-21 20:02 UTC by dvice_null
Modified: 2012-06-08 15:37 UTC (History)
1 user (show)

See Also:
Kernel Version: latest in git: c277331d5fbaae5772ed19862feefa91f4e477d3
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description dvice_null 2009-06-21 20:02:02 UTC
In file arch/mips/mipssim/sim_time.c
There is this function:

unsigned __cpuinit get_c0_compare_int(void)
{
#ifdef MSC01E_INT_BASE
	if (cpu_has_veic) {
		set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch);
		mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR;
	} else {
#endif
		if (cpu_has_vint)
			set_vi_handler(cp0_compare_irq, mips_timer_dispatch);
		mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
	}

	return mips_cpu_timer_irq;
}

If MSC01E_INT_BASE is not defined, the code will be:
unsigned __cpuinit get_c0_compare_int(void)
{
		if (cpu_has_vint)
			set_vi_handler(cp0_compare_irq, mips_timer_dispatch);
		mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
	}

	return mips_cpu_timer_irq;
}

As you can see, right before the return, there is }-character without {-character (as it was inside the #ifdef). This can probably be fixed by moving the last {-character before #endif after the #endif. 

This bug was found using Cppcheck: http://cppcheck.wiki.sourceforge.net/

Note You need to log in before you can comment on or make changes to this bug.