vibe 500: Fix ide_powered() always returning false

While the right GPIO location is accessed,
the result of the logical AND was tested wrong.

I don't have this hardware, but I can imagine
that bug caused ide_power_enable() to be called
more times than it needed to be.

cppcheck reported:
[rockbox/firmware/target/arm/pbell/vibe500/power-vibe500.c:101]: (style) Expression '(X & 0x8) == 0x1' is always false.

Change-Id: I98498f79d383c6f29869e170bfc94ba9a0d2ba7e
This commit is contained in:
Thomas Jarosch 2014-12-20 13:57:54 +01:00
parent ef1497c3df
commit d62e1b3c5f

View file

@ -98,7 +98,7 @@ void ide_power_enable(bool on)
bool ide_powered(void) bool ide_powered(void)
{ {
return ((GPIOC_INPUT_VAL & 0x08) == 1); return ((GPIOC_INPUT_VAL & 0x08) != 0);
} }
void power_off(void) void power_off(void)