diff options
author | Cyrille Pitchen <cyrille.pitchen@atmel.com> | 2015-06-11 05:16:32 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2015-06-11 09:12:53 -0400 |
commit | f30dc5208ca270ff783fa895b74bdd76dcb4ba3e (patch) | |
tree | 64a0f47a54457ca99ad8f1cdcb98702771f08c68 /drivers/i2c | |
parent | d8453403948cbe2bcfce810d82e1afcc501c3c71 (diff) |
i2c: at91: fix code checker warnings
buf_len is a size_t, so unsigned, but was tested with '<= 0'.
Reported-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-at91.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index 9e54f97a9020..1c758cd1e1ba 100644 --- a/drivers/i2c/busses/i2c-at91.c +++ b/drivers/i2c/busses/i2c-at91.c | |||
@@ -232,7 +232,7 @@ static void at91_twi_dma_cleanup(struct at91_twi_dev *dev) | |||
232 | 232 | ||
233 | static void at91_twi_write_next_byte(struct at91_twi_dev *dev) | 233 | static void at91_twi_write_next_byte(struct at91_twi_dev *dev) |
234 | { | 234 | { |
235 | if (dev->buf_len <= 0) | 235 | if (!dev->buf_len) |
236 | return; | 236 | return; |
237 | 237 | ||
238 | /* 8bit write works with and without FIFO */ | 238 | /* 8bit write works with and without FIFO */ |
@@ -275,7 +275,7 @@ static void at91_twi_write_data_dma(struct at91_twi_dev *dev) | |||
275 | struct dma_chan *chan_tx = dma->chan_tx; | 275 | struct dma_chan *chan_tx = dma->chan_tx; |
276 | unsigned int sg_len = 1; | 276 | unsigned int sg_len = 1; |
277 | 277 | ||
278 | if (dev->buf_len <= 0) | 278 | if (!dev->buf_len) |
279 | return; | 279 | return; |
280 | 280 | ||
281 | dma->direction = DMA_TO_DEVICE; | 281 | dma->direction = DMA_TO_DEVICE; |
@@ -347,7 +347,7 @@ error: | |||
347 | 347 | ||
348 | static void at91_twi_read_next_byte(struct at91_twi_dev *dev) | 348 | static void at91_twi_read_next_byte(struct at91_twi_dev *dev) |
349 | { | 349 | { |
350 | if (dev->buf_len <= 0) | 350 | if (!dev->buf_len) |
351 | return; | 351 | return; |
352 | 352 | ||
353 | /* 8bit read works with and without FIFO */ | 353 | /* 8bit read works with and without FIFO */ |