Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

w1: fix test in ds2482_wait_1wire_idle()

With `while (++retries < DS2482_WAIT_IDLE_TIMEOUT)' retries reaches
DS2482_WAIT_IDLE_TIMEOUT after the loop

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Roel Kluin and committed by
Linus Torvalds
67860739 7ed63d5e

+1 -1
+1 -1
drivers/w1/masters/ds2482.c
··· 214 214 (++retries < DS2482_WAIT_IDLE_TIMEOUT)); 215 215 } 216 216 217 - if (retries > DS2482_WAIT_IDLE_TIMEOUT) 217 + if (retries >= DS2482_WAIT_IDLE_TIMEOUT) 218 218 printk(KERN_ERR "%s: timeout on channel %d\n", 219 219 __func__, pdev->channel); 220 220