[Bugme-new] [Bug 13595] New: wrong #endif in arch/mips/mipssim/sim_time.c

bugzilla-daemon at bugzilla.kernel.org bugzilla-daemon at bugzilla.kernel.org
Sun Jun 21 13:02:03 PDT 2009


http://bugzilla.kernel.org/show_bug.cgi?id=13595

           Summary: wrong #endif in arch/mips/mipssim/sim_time.c
           Product: Platform Specific/Hardware
           Version: 2.5
    Kernel Version: latest in git:
                    c277331d5fbaae5772ed19862feefa91f4e477d3
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: MIPS
        AssignedTo: ralf at linux-mips.org
        ReportedBy: dvice_null at yahoo.com
        Regression: No


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/

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Bugme-new mailing list