Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753031AbbFKJQq (ORCPT ); Thu, 11 Jun 2015 05:16:46 -0400 Received: from eusmtp01.atmel.com ([212.144.249.243]:35303 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753037AbbFKJQi (ORCPT ); Thu, 11 Jun 2015 05:16:38 -0400 From: Cyrille Pitchen To: , , CC: , , , Cyrille Pitchen Subject: [PATCH 1/1] i2c: at91: fix code checker warnings Date: Thu, 11 Jun 2015 11:16:32 +0200 Message-ID: <7419376c5a4e60f1b23d36e66a102c7c40db1089.1434013494.git.cyrille.pitchen@atmel.com> X-Mailer: git-send-email 1.8.2.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1353 Lines: 46 buf_len is a size_t, so unsigned but was tested with '<= 0'. Signed-off-by: Cyrille Pitchen --- drivers/i2c/busses/i2c-at91.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index 0d2dc7d..967c0cb 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) 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 */ -- 1.8.2.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/