i2c: Timeouts off by 1
with while (timeout++ < MAX_TIMEOUT); timeout reaches MAX_TIMEOUT + 1 after the loop, so the tests below are off by one. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
此提交包含在:
@@ -112,7 +112,7 @@ static int sch_transaction(void)
|
||||
} while ((temp & 0x08) && (timeout++ < MAX_TIMEOUT));
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout >= MAX_TIMEOUT) {
|
||||
if (timeout > MAX_TIMEOUT) {
|
||||
dev_err(&sch_adapter.dev, "SMBus Timeout!\n");
|
||||
result = -ETIMEDOUT;
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者