[PATCH v1 08/10] misc: eeprom_93xx46: Replace explicit castings with proper specifiers

Andy Shevchenko posted 10 patches 1 year, 9 months ago
[PATCH v1 08/10] misc: eeprom_93xx46: Replace explicit castings with proper specifiers
Posted by Andy Shevchenko 1 year, 9 months ago
There is no need to have an explicit casting when we can simply use
the correct printf() specifier.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/misc/eeprom/eeprom_93xx46.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c
index 18a3b534ea73..ac485b2827db 100644
--- a/drivers/misc/eeprom/eeprom_93xx46.c
+++ b/drivers/misc/eeprom/eeprom_93xx46.c
@@ -162,8 +162,8 @@ static int eeprom_93xx46_read(void *priv, unsigned int off,
 		ndelay(250);
 
 		if (err) {
-			dev_err(&edev->spi->dev, "read %zu bytes at %d: err. %d\n",
-				nbytes, (int)off, err);
+			dev_err(&edev->spi->dev, "read %zu bytes at %u: err. %d\n",
+				nbytes, off, err);
 			break;
 		}
 
@@ -274,7 +274,8 @@ static int eeprom_93xx46_write(void *priv, unsigned int off,
 {
 	struct eeprom_93xx46_dev *edev = priv;
 	char *buf = val;
-	int i, ret, step = 1;
+	int ret, step = 1;
+	unsigned int i;
 
 	if (unlikely(off >= edev->size))
 		return -EFBIG;
@@ -301,8 +302,7 @@ static int eeprom_93xx46_write(void *priv, unsigned int off,
 	for (i = 0; i < count; i += step) {
 		ret = eeprom_93xx46_write_word(edev, &buf[i], off + i);
 		if (ret) {
-			dev_err(&edev->spi->dev, "write failed at %d: %d\n",
-				(int)off + i, ret);
+			dev_err(&edev->spi->dev, "write failed at %u: %d\n", off + i, ret);
 			break;
 		}
 	}
-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v1 08/10] misc: eeprom_93xx46: Replace explicit castings with proper specifiers
Posted by Linus Walleij 1 year, 8 months ago
On Wed, May 8, 2024 at 8:49 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> There is no need to have an explicit casting when we can simply use
> the correct printf() specifier.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij