Skip to contentSkip to conversation

BUG: Re: [PATCH] I2C: add new rx8025 driver

lm-sensors Uwe Zeisberger 1 participant 1 message Mar 21, 2006

lore
Share & tools
lore
#0 lore raw

Hello,

I just found a bug in that driver:

Review

Quoted 7 lines

...

(quoted diff) +5 -0
+	if (result[0] | RX8025_BIT_CTRL1_1224)
+		dt->tm_hour = BCD2BIN(result[2 + RX8025_REG_HOUR] & 0x3f);
+	else
+		dt->tm_hour = BCD2BIN(result[2 + RX8025_REG_HOUR] & 0x1f) % 12
+			+ (result[2 + RX8025_REG_HOUR] & 0x20 ? 12 : 0);
...

That "|" has to be an "&", else the test is quite useless.

just in case someone wants to use this driver before I'm able to submit an updated version...

Best regards
Uwe Zeisberger

Signature · 3 lines
Uwe Zeisberger

$ dc -e "5735816763073014741799356604682P"