[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZECFjQMLwnoYPMeL@yoga>
Date: Thu, 20 Apr 2023 05:51:33 +0530
From: Anup Sharma <anupnewsmail@...il.com>
To: zbr@...emap.net
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] drivers: w1: slaves: Drop unnecessary explicit casting
Provide correct specifiers while printing error logs to discard the use
of unnecessary explicit casting.
Signed-off-by: Anup Sharma <anupnewsmail@...il.com>
---
drivers/w1/slaves/w1_ds2433.c | 6 +++---
drivers/w1/slaves/w1_ds28e04.c | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c
index 0f72df15a024..ba441d42b0b0 100644
--- a/drivers/w1/slaves/w1_ds2433.c
+++ b/drivers/w1/slaves/w1_ds2433.c
@@ -213,15 +213,15 @@ static ssize_t eeprom_write(struct file *filp, struct kobject *kobj,
#ifdef CONFIG_W1_SLAVE_DS2433_CRC
/* can only write full blocks in cached mode */
if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) {
- dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n",
- (int)off, count);
+ dev_err(&sl->dev, "invalid offset/count off=%pe cnt=%zd\n",
+ off, count);
return -EINVAL;
}
/* make sure the block CRCs are valid */
for (idx = 0; idx < count; idx += W1_PAGE_SIZE) {
if (crc16(CRC16_INIT, &buf[idx], W1_PAGE_SIZE) != CRC16_VALID) {
- dev_err(&sl->dev, "bad CRC at offset %d\n", (int)off);
+ dev_err(&sl->dev, "bad CRC at offset %pe\n", off);
return -EINVAL;
}
}
diff --git a/drivers/w1/slaves/w1_ds28e04.c b/drivers/w1/slaves/w1_ds28e04.c
index 6cef6e2edb89..6edfe6a4600a 100644
--- a/drivers/w1/slaves/w1_ds28e04.c
+++ b/drivers/w1/slaves/w1_ds28e04.c
@@ -234,8 +234,8 @@ static ssize_t eeprom_write(struct file *filp, struct kobject *kobj,
if (w1_enable_crccheck) {
/* can only write full blocks in cached mode */
if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) {
- dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n",
- (int)off, count);
+ dev_err(&sl->dev, "invalid offset/count off=%pe cnt=%zd\n",
+ off, count);
return -EINVAL;
}
@@ -243,8 +243,8 @@ static ssize_t eeprom_write(struct file *filp, struct kobject *kobj,
for (idx = 0; idx < count; idx += W1_PAGE_SIZE) {
if (crc16(CRC16_INIT, &buf[idx], W1_PAGE_SIZE)
!= CRC16_VALID) {
- dev_err(&sl->dev, "bad CRC at offset %d\n",
- (int)off);
+ dev_err(&sl->dev, "bad CRC at offset %pe\n",
+ off);
return -EINVAL;
}
}
--
2.34.1
Powered by blists - more mailing lists