Commit f30dc520 authored by Cyrille Pitchen's avatar Cyrille Pitchen Committed by Wolfram Sang

i2c: at91: fix code checker warnings

buf_len is a size_t, so unsigned, but was tested with '<= 0'.
Reported-by: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarCyrille Pitchen <cyrille.pitchen@atmel.com>
Acked-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent d8453403
...@@ -232,7 +232,7 @@ static void at91_twi_dma_cleanup(struct at91_twi_dev *dev) ...@@ -232,7 +232,7 @@ static void at91_twi_dma_cleanup(struct at91_twi_dev *dev)
static void at91_twi_write_next_byte(struct at91_twi_dev *dev) static void at91_twi_write_next_byte(struct at91_twi_dev *dev)
{ {
if (dev->buf_len <= 0) if (!dev->buf_len)
return; return;
/* 8bit write works with and without FIFO */ /* 8bit write works with and without FIFO */
...@@ -275,7 +275,7 @@ static void at91_twi_write_data_dma(struct at91_twi_dev *dev) ...@@ -275,7 +275,7 @@ static void at91_twi_write_data_dma(struct at91_twi_dev *dev)
struct dma_chan *chan_tx = dma->chan_tx; struct dma_chan *chan_tx = dma->chan_tx;
unsigned int sg_len = 1; unsigned int sg_len = 1;
if (dev->buf_len <= 0) if (!dev->buf_len)
return; return;
dma->direction = DMA_TO_DEVICE; dma->direction = DMA_TO_DEVICE;
...@@ -347,7 +347,7 @@ static void at91_twi_write_data_dma(struct at91_twi_dev *dev) ...@@ -347,7 +347,7 @@ static void at91_twi_write_data_dma(struct at91_twi_dev *dev)
static void at91_twi_read_next_byte(struct at91_twi_dev *dev) static void at91_twi_read_next_byte(struct at91_twi_dev *dev)
{ {
if (dev->buf_len <= 0) if (!dev->buf_len)
return; return;
/* 8bit read works with and without FIFO */ /* 8bit read works with and without FIFO */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment