Skip to contentSkip to conversation

i2c: at91: fix code checker warnings

PATCH Applied Cyrille Pitchen 3 participants 5 messages Jun 11, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover i2c: at91: fix code checker warnings

ChangeLog

v1:
This patch fixes somes code checker warnings reported by Wolfram Sang:

drivers/i2c/busses/i2c-at91.c:213: style: Checking if unsigned variable 'buf_len' is less than zero. drivers/i2c/busses/i2c-at91.c:254: style: Checking if unsigned variable 'buf_len' is less than zero. drivers/i2c/busses/i2c-at91.c:293: style: Checking if unsigned variable 'buf_len' is less than zero.

Thanks for reporting!

Cyrille Pitchen (1):
i2c: at91: fix code checker warnings

 drivers/i2c/busses/i2c-at91.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.2.2
#1 lore raw

PATCH 1/1 i2c: at91: fix code checker warnings

buf_len is a size_t, so unsigned but was tested with '<= 0'.

---
 drivers/i2c/busses/i2c-at91.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-at91.c +3 -3
index 0d2dc7d..967c0cb 100644
@@ -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)
 {
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
 		return;
 
 	/* 8bit write works with and without FIFO */
@@ -275,7 +275,7 @@ static void at91_twi_write_data_dma(struct at91_twi_dev *dev)
 	struct dma_chan *chan_tx = dma->chan_tx;
 	unsigned int sg_len = 1;
 
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
 		return;
 
 	dma->direction = DMA_TO_DEVICE;
@@ -347,7 +347,7 @@ error:
 
 static void at91_twi_read_next_byte(struct at91_twi_dev *dev)
 {
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
 		return;
 
 	/* 8bit read works with and without FIFO */
Signature · 1 line
1.8.2.2
Acked-by on v1 1/1
#2 lore raw
Quoted 3 lines · Cyrille Pitchen

buf_len is a size_t, so unsigned but was tested with '<= 0'.

Thanks

Quoted 38 lines
---
 drivers/i2c/busses/i2c-at91.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-at91.c +3 -3
index 0d2dc7d..967c0cb 100644
@@ -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)
 {
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
 		return;
 
 	/* 8bit write works with and without FIFO */
@@ -275,7 +275,7 @@ static void at91_twi_write_data_dma(struct at91_twi_dev *dev)
 	struct dma_chan *chan_tx = dma->chan_tx;
 	unsigned int sg_len = 1;
 
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
 		return;
 
 	dma->direction = DMA_TO_DEVICE;
@@ -347,7 +347,7 @@ error:
 
 static void at91_twi_read_next_byte(struct at91_twi_dev *dev)
 {
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
 		return;
 
 	/* 8bit read works with and without FIFO */
Signature · 1 line
1.8.2.2
Applied
#3 lore raw
In reply to Cyrille Pitchen
Quoted 3 lines · Cyrille Pitchen

buf_len is a size_t, so unsigned but was tested with '<= 0'.

Applied to for-next, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150611/88e0d7ec/attachment.sig>

#4 lore raw
In reply to Cyrille Pitchen

Hi all,

this patch was made after applying the previous series "[PATCH v6 0/6] i2c: at91: add support to FIFOs and alternative command", which was already accepted.

Best Regards,

Cyrille

Le 11/06/2015 11:16, Cyrille Pitchen a ?crit :

Quoted 17 lines

ChangeLog

v1:
This patch fixes somes code checker warnings reported by Wolfram Sang:

drivers/i2c/busses/i2c-at91.c:213: style: Checking if unsigned variable 'buf_len' is less than zero. drivers/i2c/busses/i2c-at91.c:254: style: Checking if unsigned variable 'buf_len' is less than zero. drivers/i2c/busses/i2c-at91.c:293: style: Checking if unsigned variable 'buf_len' is less than zero.

Thanks for reporting!

Cyrille Pitchen (1):
i2c: at91: fix code checker warnings

 drivers/i2c/busses/i2c-at91.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)