i2c: observe scl_count in i2c_deblock_gpio_loop()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 9 May 2020 16:20:18 +0000 (18:20 +0200)
committerHeiko Schocher <hs@denx.de>
Thu, 28 May 2020 03:52:46 +0000 (05:52 +0200)
commitda585c3c680add381662417b11cfc7d0ac310ba5
treebc6aef5ae81511cba52577ff09f90b538cb62508
parentf6f9a016899e62cb65016421a09fd3fe06ce660f
i2c: observe scl_count in i2c_deblock_gpio_loop()

When compiling with -Wtype-limits we see this error:

drivers/i2c/i2c-uclass.c: In function ‘i2c_deblock_gpio_loop’:
drivers/i2c/i2c-uclass.c:517:21: error: comparison of
unsigned expression >= 0 is always true [-Werror=type-limits]
  517 |  while (scl_count-- >= 0) {
      |

Don't loop forever.

Fixes: 1f746a2c82b1 ("i2c: Make deblock delay and SCL clock configurable")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
drivers/i2c/i2c-uclass.c