• Roel Kluin's avatar
    i2c: Timeouts reach -1 · a746b578
    Roel Kluin authored
    With a postfix decrement these timeouts reach -1 rather than 0, but
    after the loop it is tested whether they have become 0.
    
    As pointed out by Jean Delvare, the condition we are waiting for should
    also be tested before the timeout. With the current order, you could
    exit with a timeout error while the job is actually done.
    Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
    Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
    a746b578
i2c-amd8111.c 11.1 KB