Skip to contentSkip to conversation

AVR32 code: Mismatching comparison

DISCUSSION Thomas Jarosch 1 participant 1 message Nov 17, 2011

lore
Share & tools
lore
#0 lore raw

Hi Haavard,

consider this piece of code from
arch/avr32/kernel/module.c:

....
case R_AVR32_GOT18SW:

    if ((relocation & 0xfffe0003) != 0
        && (relocation & 0xfffc0003) != 0xffff0000)
        return reloc_overflow(module, "R_AVR32_GOT18SW",
                    relocation);
    relocation >>= 2;
    /* fall through */

...

cppcheck reports for line 267:
"Mismatching comparison, the result is always true"

This probably needs a fix.

Cheers,
Thomas