diff mbox series

[v5,33/36] i2c: tegra: Clean up variable types

Message ID 20200906185039.22700-34-digetx@gmail.com
State New
Headers show
Series None | expand

Commit Message

Dmitry Osipenko Sept. 6, 2020, 6:50 p.m. UTC
Don't use signed types for unsigned values.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/i2c/busses/i2c-tegra.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Andy Shevchenko Sept. 7, 2020, 8:30 a.m. UTC | #1
On Sun, Sep 6, 2020 at 9:52 PM Dmitry Osipenko <digetx@gmail.com> wrote:
>
> Don't use signed types for unsigned values.

This is a potential semantic changer, so should go even before all
whitespace / comment cleanups.
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index ddd39af4ebd4..1f3110a589af 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -326,13 +326,13 @@  static u32 i2c_readl(struct tegra_i2c_dev *i2c_dev, u32 reg)
 }
 
 static void i2c_writesl(struct tegra_i2c_dev *i2c_dev, void *data,
-			u32 reg, int len)
+			u32 reg, unsigned int len)
 {
 	writesl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg), data, len);
 }
 
 static void i2c_readsl(struct tegra_i2c_dev *i2c_dev, void *data,
-		       u32 reg, int len)
+		       u32 reg, unsigned int len)
 {
 	readsl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg), data, len);
 }
@@ -695,9 +695,8 @@  static int tegra_i2c_disable_packet_mode(struct tegra_i2c_dev *i2c_dev)
 static int tegra_i2c_empty_rx_fifo(struct tegra_i2c_dev *i2c_dev)
 {
 	size_t buf_remaining = i2c_dev->msg_buf_remaining;
+	unsigned int words_to_transfer, rx_fifo_avail;
 	u8 *buf = i2c_dev->msg_buf;
-	int words_to_transfer;
-	int rx_fifo_avail;
 	u32 val;
 
 	/*
@@ -756,9 +755,8 @@  static int tegra_i2c_empty_rx_fifo(struct tegra_i2c_dev *i2c_dev)
 static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev)
 {
 	size_t buf_remaining = i2c_dev->msg_buf_remaining;
+	unsigned int words_to_transfer, tx_fifo_avail;
 	u8 *buf = i2c_dev->msg_buf;
-	int words_to_transfer;
-	int tx_fifo_avail;
 	u32 val;
 
 	if (i2c_dev->hw->has_mst_fifo) {