* [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error
@ 2020-03-22 17:23 Nishant Malpani
2020-03-22 17:23 ` [PATCH v2 01/13] iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name Nishant Malpani
` (12 more replies)
0 siblings, 13 replies; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
This patchset utilizes %pe format specifier from vsprintf while logging
errors which removes unnecessary explicit casting and logs symbolic error
names instead of the error number.
Suggested-by: Joe Perches <joe@perches.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Jonathan Cameron <jic23@kernel.org>
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Nishant Malpani (13):
iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name
iio: st_sensors_i2c: Use vsprintf extension %pe for symbolic error
name
iio: st_sensors_spi: Use vsprintf extension %pe for symbolic error
name
iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error
name
iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error
name
iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error name
iio: imu: bmi160_i2c: Use vsprintf extension %pe for symbolic error
name
iio: imu: bmi160_spi: Use vsprintf extension %pe for symbolic error
name
iio: imu: inv_mpu6050_i2c: Use vsprintf extension %pe for symbolic
error name
iio: imu: inv_mpu6050_spi: Use vsprintf extension %pe for symbolic
error name
iio: light: st_uvis25_i2c: Use vsprintf extension %pe for symbolic
error name
iio: light: st_uvis25_spi: Use vsprintf extension %pe for symbolic
error name
iio: magn: bmc150: Use vsprintf extension %pe for symbolic error name
drivers/iio/accel/kxsd9-i2c.c | 4 ++--
drivers/iio/common/st_sensors/st_sensors_i2c.c | 4 ++--
drivers/iio/common/st_sensors/st_sensors_spi.c | 4 ++--
drivers/iio/gyro/bmg160_i2c.c | 4 ++--
drivers/iio/gyro/bmg160_spi.c | 4 ++--
drivers/iio/gyro/mpu3050-i2c.c | 4 ++--
drivers/iio/imu/bmi160/bmi160_i2c.c | 4 ++--
drivers/iio/imu/bmi160/bmi160_spi.c | 4 ++--
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 4 ++--
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 4 ++--
drivers/iio/light/st_uvis25_i2c.c | 4 ++--
drivers/iio/light/st_uvis25_spi.c | 4 ++--
drivers/iio/magnetometer/bmc150_magn_spi.c | 4 ++--
13 files changed, 26 insertions(+), 26 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v2 01/13] iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:10 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 02/13] iio: st_sensors_i2c: " Nishant Malpani
` (11 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/accel/kxsd9-i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/accel/kxsd9-i2c.c b/drivers/iio/accel/kxsd9-i2c.c
index 38411e1c155b..b6f3de7ef8ea 100644
--- a/drivers/iio/accel/kxsd9-i2c.c
+++ b/drivers/iio/accel/kxsd9-i2c.c
@@ -21,8 +21,8 @@ static int kxsd9_i2c_probe(struct i2c_client *i2c,
regmap = devm_regmap_init_i2c(i2c, &config);
if (IS_ERR(regmap)) {
- dev_err(&i2c->dev, "Failed to register i2c regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&i2c->dev, "Failed to register i2c regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 02/13] iio: st_sensors_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
2020-03-22 17:23 ` [PATCH v2 01/13] iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:11 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 03/13] iio: st_sensors_spi: " Nishant Malpani
` (10 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/common/st_sensors/st_sensors_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/common/st_sensors/st_sensors_i2c.c b/drivers/iio/common/st_sensors/st_sensors_i2c.c
index 286830fb5d35..4f7ae273ac98 100644
--- a/drivers/iio/common/st_sensors/st_sensors_i2c.c
+++ b/drivers/iio/common/st_sensors/st_sensors_i2c.c
@@ -49,8 +49,8 @@ int st_sensors_i2c_configure(struct iio_dev *indio_dev,
sdata->regmap = devm_regmap_init_i2c(client, config);
if (IS_ERR(sdata->regmap)) {
- dev_err(&client->dev, "Failed to register i2c regmap (%d)\n",
- (int)PTR_ERR(sdata->regmap));
+ dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
+ sdata->regmap);
return PTR_ERR(sdata->regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 03/13] iio: st_sensors_spi: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
2020-03-22 17:23 ` [PATCH v2 01/13] iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name Nishant Malpani
2020-03-22 17:23 ` [PATCH v2 02/13] iio: st_sensors_i2c: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:12 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 04/13] iio: gyro: bmg160_i2c: " Nishant Malpani
` (9 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/common/st_sensors/st_sensors_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c
index 1275fb0eda31..efa93928b498 100644
--- a/drivers/iio/common/st_sensors/st_sensors_spi.c
+++ b/drivers/iio/common/st_sensors/st_sensors_spi.c
@@ -101,8 +101,8 @@ int st_sensors_spi_configure(struct iio_dev *indio_dev,
sdata->regmap = devm_regmap_init_spi(spi, config);
if (IS_ERR(sdata->regmap)) {
- dev_err(&spi->dev, "Failed to register spi regmap (%d)\n",
- (int)PTR_ERR(sdata->regmap));
+ dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
+ sdata->regmap);
return PTR_ERR(sdata->regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 04/13] iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (2 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 03/13] iio: st_sensors_spi: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:13 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 05/13] iio: gyro: bmg160_spi: " Nishant Malpani
` (8 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/gyro/bmg160_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c
index 4fc9c6a3321f..513473fb2055 100644
--- a/drivers/iio/gyro/bmg160_i2c.c
+++ b/drivers/iio/gyro/bmg160_i2c.c
@@ -21,8 +21,8 @@ static int bmg160_i2c_probe(struct i2c_client *client,
regmap = devm_regmap_init_i2c(client, &bmg160_regmap_i2c_conf);
if (IS_ERR(regmap)) {
- dev_err(&client->dev, "Failed to register i2c regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 05/13] iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (3 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 04/13] iio: gyro: bmg160_i2c: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:16 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 06/13] iio: gyro: mpu3050: " Nishant Malpani
` (7 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/gyro/bmg160_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/gyro/bmg160_spi.c b/drivers/iio/gyro/bmg160_spi.c
index 182a59c42507..6f82bbe0ae92 100644
--- a/drivers/iio/gyro/bmg160_spi.c
+++ b/drivers/iio/gyro/bmg160_spi.c
@@ -19,8 +19,8 @@ static int bmg160_spi_probe(struct spi_device *spi)
regmap = devm_regmap_init_spi(spi, &bmg160_regmap_spi_conf);
if (IS_ERR(regmap)) {
- dev_err(&spi->dev, "Failed to register spi regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 06/13] iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (4 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 05/13] iio: gyro: bmg160_spi: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:18 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 07/13] iio: imu: bmi160_i2c: " Nishant Malpani
` (6 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/gyro/mpu3050-i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c
index afa8018b9238..ef5bcbc4b45b 100644
--- a/drivers/iio/gyro/mpu3050-i2c.c
+++ b/drivers/iio/gyro/mpu3050-i2c.c
@@ -51,8 +51,8 @@ static int mpu3050_i2c_probe(struct i2c_client *client,
regmap = devm_regmap_init_i2c(client, &mpu3050_i2c_regmap_config);
if (IS_ERR(regmap)) {
- dev_err(&client->dev, "Failed to register i2c regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 07/13] iio: imu: bmi160_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (5 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 06/13] iio: gyro: mpu3050: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:19 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 08/13] iio: imu: bmi160_spi: " Nishant Malpani
` (5 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/imu/bmi160/bmi160_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
index e36f5e82d400..26398614eddf 100644
--- a/drivers/iio/imu/bmi160/bmi160_i2c.c
+++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
@@ -24,8 +24,8 @@ static int bmi160_i2c_probe(struct i2c_client *client,
regmap = devm_regmap_init_i2c(client, &bmi160_regmap_config);
if (IS_ERR(regmap)) {
- dev_err(&client->dev, "Failed to register i2c regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 08/13] iio: imu: bmi160_spi: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (6 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 07/13] iio: imu: bmi160_i2c: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:20 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 09/13] iio: imu: inv_mpu6050_i2c: " Nishant Malpani
` (4 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/imu/bmi160/bmi160_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c b/drivers/iio/imu/bmi160/bmi160_spi.c
index c19e3df35559..61389b41c6d9 100644
--- a/drivers/iio/imu/bmi160/bmi160_spi.c
+++ b/drivers/iio/imu/bmi160/bmi160_spi.c
@@ -20,8 +20,8 @@ static int bmi160_spi_probe(struct spi_device *spi)
regmap = devm_regmap_init_spi(spi, &bmi160_regmap_config);
if (IS_ERR(regmap)) {
- dev_err(&spi->dev, "Failed to register spi regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
return bmi160_core_probe(&spi->dev, regmap, id->name, true);
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 09/13] iio: imu: inv_mpu6050_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (7 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 08/13] iio: imu: bmi160_spi: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:21 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 10/13] iio: imu: inv_mpu6050_spi: " Nishant Malpani
` (3 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
index 6993d3b87bb0..28cfae1e61cf 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
@@ -122,8 +122,8 @@ static int inv_mpu_probe(struct i2c_client *client,
regmap = devm_regmap_init_i2c(client, &inv_mpu_regmap_config);
if (IS_ERR(regmap)) {
- dev_err(&client->dev, "Failed to register i2c regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 10/13] iio: imu: inv_mpu6050_spi: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (8 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 09/13] iio: imu: inv_mpu6050_i2c: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:22 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 11/13] iio: light: st_uvis25_i2c: " Nishant Malpani
` (2 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
index 673b198e6368..6f968ce687e1 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
@@ -53,8 +53,8 @@ static int inv_mpu_probe(struct spi_device *spi)
regmap = devm_regmap_init_spi(spi, &inv_mpu_regmap_config);
if (IS_ERR(regmap)) {
- dev_err(&spi->dev, "Failed to register spi regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 11/13] iio: light: st_uvis25_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (9 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 10/13] iio: imu: inv_mpu6050_spi: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:25 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 12/13] iio: light: st_uvis25_spi: " Nishant Malpani
2020-03-22 17:23 ` [PATCH v2 13/13] iio: magn: bmc150: " Nishant Malpani
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/light/st_uvis25_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/light/st_uvis25_i2c.c b/drivers/iio/light/st_uvis25_i2c.c
index 4889bbeb0c73..801f754bc1a5 100644
--- a/drivers/iio/light/st_uvis25_i2c.c
+++ b/drivers/iio/light/st_uvis25_i2c.c
@@ -31,8 +31,8 @@ static int st_uvis25_i2c_probe(struct i2c_client *client,
regmap = devm_regmap_init_i2c(client, &st_uvis25_i2c_regmap_config);
if (IS_ERR(regmap)) {
- dev_err(&client->dev, "Failed to register i2c regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 12/13] iio: light: st_uvis25_spi: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (10 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 11/13] iio: light: st_uvis25_i2c: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-22 17:23 ` [PATCH v2 13/13] iio: magn: bmc150: " Nishant Malpani
12 siblings, 0 replies; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/light/st_uvis25_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/light/st_uvis25_spi.c b/drivers/iio/light/st_uvis25_spi.c
index a9ceae4f58b3..ae57e80a2e8f 100644
--- a/drivers/iio/light/st_uvis25_spi.c
+++ b/drivers/iio/light/st_uvis25_spi.c
@@ -31,8 +31,8 @@ static int st_uvis25_spi_probe(struct spi_device *spi)
regmap = devm_regmap_init_spi(spi, &st_uvis25_spi_regmap_config);
if (IS_ERR(regmap)) {
- dev_err(&spi->dev, "Failed to register spi regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 13/13] iio: magn: bmc150: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
` (11 preceding siblings ...)
2020-03-22 17:23 ` [PATCH v2 12/13] iio: light: st_uvis25_spi: " Nishant Malpani
@ 2020-03-22 17:23 ` Nishant Malpani
2020-03-28 14:26 ` Jonathan Cameron
12 siblings, 1 reply; 26+ messages in thread
From: Nishant Malpani @ 2020-03-22 17:23 UTC (permalink / raw)
To: jic23
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
linux-iio, linux-kernel
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
Changes in v2:
- Rewrite commit subject line outlining the usage of %pe.
- Add a separator between regmap and its error name.
Based on conversations in [1] & [2].
[1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
[2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
---
drivers/iio/magnetometer/bmc150_magn_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/magnetometer/bmc150_magn_spi.c b/drivers/iio/magnetometer/bmc150_magn_spi.c
index ed9be0490d77..c6ed3ea8460a 100644
--- a/drivers/iio/magnetometer/bmc150_magn_spi.c
+++ b/drivers/iio/magnetometer/bmc150_magn_spi.c
@@ -22,8 +22,8 @@ static int bmc150_magn_spi_probe(struct spi_device *spi)
regmap = devm_regmap_init_spi(spi, &bmc150_magn_regmap_config);
if (IS_ERR(regmap)) {
- dev_err(&spi->dev, "Failed to register spi regmap %d\n",
- (int)PTR_ERR(regmap));
+ dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
+ regmap);
return PTR_ERR(regmap);
}
return bmc150_magn_probe(&spi->dev, regmap, spi->irq, id->name);
--
2.20.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH v2 01/13] iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 01/13] iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name Nishant Malpani
@ 2020-03-28 14:10 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:10 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:03 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.
Thanks,
Jonathan
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/accel/kxsd9-i2c.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/accel/kxsd9-i2c.c b/drivers/iio/accel/kxsd9-i2c.c
> index 38411e1c155b..b6f3de7ef8ea 100644
> --- a/drivers/iio/accel/kxsd9-i2c.c
> +++ b/drivers/iio/accel/kxsd9-i2c.c
> @@ -21,8 +21,8 @@ static int kxsd9_i2c_probe(struct i2c_client *i2c,
>
> regmap = devm_regmap_init_i2c(i2c, &config);
> if (IS_ERR(regmap)) {
> - dev_err(&i2c->dev, "Failed to register i2c regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&i2c->dev, "Failed to register i2c regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 02/13] iio: st_sensors_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 02/13] iio: st_sensors_i2c: " Nishant Malpani
@ 2020-03-28 14:11 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:11 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:04 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
This one doesn't apply because the original 'fix' that the whole series
was based on from Andy has already been applied.
Whilst you could propose a change on top of that it probably isn't
worth the effort, so unless others disagree I'd just drop this one.
Thanks,
Jonathan
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/common/st_sensors/st_sensors_i2c.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/common/st_sensors/st_sensors_i2c.c b/drivers/iio/common/st_sensors/st_sensors_i2c.c
> index 286830fb5d35..4f7ae273ac98 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_i2c.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_i2c.c
> @@ -49,8 +49,8 @@ int st_sensors_i2c_configure(struct iio_dev *indio_dev,
>
> sdata->regmap = devm_regmap_init_i2c(client, config);
> if (IS_ERR(sdata->regmap)) {
> - dev_err(&client->dev, "Failed to register i2c regmap (%d)\n",
> - (int)PTR_ERR(sdata->regmap));
> + dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
> + sdata->regmap);
> return PTR_ERR(sdata->regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 03/13] iio: st_sensors_spi: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 03/13] iio: st_sensors_spi: " Nishant Malpani
@ 2020-03-28 14:12 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:12 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:05 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Same comment as for the previous patch.
Thanks,
J
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/common/st_sensors/st_sensors_spi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c
> index 1275fb0eda31..efa93928b498 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_spi.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_spi.c
> @@ -101,8 +101,8 @@ int st_sensors_spi_configure(struct iio_dev *indio_dev,
>
> sdata->regmap = devm_regmap_init_spi(spi, config);
> if (IS_ERR(sdata->regmap)) {
> - dev_err(&spi->dev, "Failed to register spi regmap (%d)\n",
> - (int)PTR_ERR(sdata->regmap));
> + dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
> + sdata->regmap);
> return PTR_ERR(sdata->regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 04/13] iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 04/13] iio: gyro: bmg160_i2c: " Nishant Malpani
@ 2020-03-28 14:13 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:13 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:06 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Applied
Thanks,
Jonathan
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/gyro/bmg160_i2c.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c
> index 4fc9c6a3321f..513473fb2055 100644
> --- a/drivers/iio/gyro/bmg160_i2c.c
> +++ b/drivers/iio/gyro/bmg160_i2c.c
> @@ -21,8 +21,8 @@ static int bmg160_i2c_probe(struct i2c_client *client,
>
> regmap = devm_regmap_init_i2c(client, &bmg160_regmap_i2c_conf);
> if (IS_ERR(regmap)) {
> - dev_err(&client->dev, "Failed to register i2c regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 05/13] iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 05/13] iio: gyro: bmg160_spi: " Nishant Malpani
@ 2020-03-28 14:16 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:16 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:07 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Side note on this one. Would have made sense to combine the two patches
for the bmg160 gyro into one, but doesn't really matter.
Applied.
Thanks,
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/gyro/bmg160_spi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/gyro/bmg160_spi.c b/drivers/iio/gyro/bmg160_spi.c
> index 182a59c42507..6f82bbe0ae92 100644
> --- a/drivers/iio/gyro/bmg160_spi.c
> +++ b/drivers/iio/gyro/bmg160_spi.c
> @@ -19,8 +19,8 @@ static int bmg160_spi_probe(struct spi_device *spi)
>
> regmap = devm_regmap_init_spi(spi, &bmg160_regmap_spi_conf);
> if (IS_ERR(regmap)) {
> - dev_err(&spi->dev, "Failed to register spi regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 06/13] iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 06/13] iio: gyro: mpu3050: " Nishant Malpani
@ 2020-03-28 14:18 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:18 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:08 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Applied.
Thanks,
Jonathan
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/gyro/mpu3050-i2c.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c
> index afa8018b9238..ef5bcbc4b45b 100644
> --- a/drivers/iio/gyro/mpu3050-i2c.c
> +++ b/drivers/iio/gyro/mpu3050-i2c.c
> @@ -51,8 +51,8 @@ static int mpu3050_i2c_probe(struct i2c_client *client,
>
> regmap = devm_regmap_init_i2c(client, &mpu3050_i2c_regmap_config);
> if (IS_ERR(regmap)) {
> - dev_err(&client->dev, "Failed to register i2c regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 07/13] iio: imu: bmi160_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 07/13] iio: imu: bmi160_i2c: " Nishant Malpani
@ 2020-03-28 14:19 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:19 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:09 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Applied
Thanks,
J
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/imu/bmi160/bmi160_i2c.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
> index e36f5e82d400..26398614eddf 100644
> --- a/drivers/iio/imu/bmi160/bmi160_i2c.c
> +++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
> @@ -24,8 +24,8 @@ static int bmi160_i2c_probe(struct i2c_client *client,
>
> regmap = devm_regmap_init_i2c(client, &bmi160_regmap_config);
> if (IS_ERR(regmap)) {
> - dev_err(&client->dev, "Failed to register i2c regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 08/13] iio: imu: bmi160_spi: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 08/13] iio: imu: bmi160_spi: " Nishant Malpani
@ 2020-03-28 14:20 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:20 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:10 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Applied,
Thanks,
Jonathan
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/imu/bmi160/bmi160_spi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c b/drivers/iio/imu/bmi160/bmi160_spi.c
> index c19e3df35559..61389b41c6d9 100644
> --- a/drivers/iio/imu/bmi160/bmi160_spi.c
> +++ b/drivers/iio/imu/bmi160/bmi160_spi.c
> @@ -20,8 +20,8 @@ static int bmi160_spi_probe(struct spi_device *spi)
>
> regmap = devm_regmap_init_spi(spi, &bmi160_regmap_config);
> if (IS_ERR(regmap)) {
> - dev_err(&spi->dev, "Failed to register spi regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
> return bmi160_core_probe(&spi->dev, regmap, id->name, true);
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 09/13] iio: imu: inv_mpu6050_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 09/13] iio: imu: inv_mpu6050_i2c: " Nishant Malpani
@ 2020-03-28 14:21 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:21 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:11 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Applied,
Thanks,
J
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
> index 6993d3b87bb0..28cfae1e61cf 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
> @@ -122,8 +122,8 @@ static int inv_mpu_probe(struct i2c_client *client,
>
> regmap = devm_regmap_init_i2c(client, &inv_mpu_regmap_config);
> if (IS_ERR(regmap)) {
> - dev_err(&client->dev, "Failed to register i2c regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 10/13] iio: imu: inv_mpu6050_spi: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 10/13] iio: imu: inv_mpu6050_spi: " Nishant Malpani
@ 2020-03-28 14:22 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:22 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:12 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Applied,
Thanks,
J
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
> index 673b198e6368..6f968ce687e1 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
> @@ -53,8 +53,8 @@ static int inv_mpu_probe(struct spi_device *spi)
>
> regmap = devm_regmap_init_spi(spi, &inv_mpu_regmap_config);
> if (IS_ERR(regmap)) {
> - dev_err(&spi->dev, "Failed to register spi regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 11/13] iio: light: st_uvis25_i2c: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 11/13] iio: light: st_uvis25_i2c: " Nishant Malpani
@ 2020-03-28 14:25 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:25 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:13 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
This one was already fixed up as well, so not applied.
Thanks,
Jonathan
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/light/st_uvis25_i2c.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/light/st_uvis25_i2c.c b/drivers/iio/light/st_uvis25_i2c.c
> index 4889bbeb0c73..801f754bc1a5 100644
> --- a/drivers/iio/light/st_uvis25_i2c.c
> +++ b/drivers/iio/light/st_uvis25_i2c.c
> @@ -31,8 +31,8 @@ static int st_uvis25_i2c_probe(struct i2c_client *client,
>
> regmap = devm_regmap_init_i2c(client, &st_uvis25_i2c_regmap_config);
> if (IS_ERR(regmap)) {
> - dev_err(&client->dev, "Failed to register i2c regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 13/13] iio: magn: bmc150: Use vsprintf extension %pe for symbolic error name
2020-03-22 17:23 ` [PATCH v2 13/13] iio: magn: bmc150: " Nishant Malpani
@ 2020-03-28 14:26 ` Jonathan Cameron
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2020-03-28 14:26 UTC (permalink / raw)
To: Nishant Malpani
Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel
On Sun, 22 Mar 2020 22:53:15 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:
> Utilize %pe format specifier from vsprintf while printing error logs
> with dev_err(). Discards the use of unnecessary explicit casting and
> prints symbolic error name which might prove to be convenient during
> debugging.
>
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Applied,
Thanks,
Jonathan
> ---
>
> Changes in v2:
> - Rewrite commit subject line outlining the usage of %pe.
> - Add a separator between regmap and its error name.
>
> Based on conversations in [1] & [2].
>
> [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2
> [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2
> ---
> drivers/iio/magnetometer/bmc150_magn_spi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/magnetometer/bmc150_magn_spi.c b/drivers/iio/magnetometer/bmc150_magn_spi.c
> index ed9be0490d77..c6ed3ea8460a 100644
> --- a/drivers/iio/magnetometer/bmc150_magn_spi.c
> +++ b/drivers/iio/magnetometer/bmc150_magn_spi.c
> @@ -22,8 +22,8 @@ static int bmc150_magn_spi_probe(struct spi_device *spi)
>
> regmap = devm_regmap_init_spi(spi, &bmc150_magn_regmap_config);
> if (IS_ERR(regmap)) {
> - dev_err(&spi->dev, "Failed to register spi regmap %d\n",
> - (int)PTR_ERR(regmap));
> + dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
> + regmap);
> return PTR_ERR(regmap);
> }
> return bmc150_magn_probe(&spi->dev, regmap, spi->irq, id->name);
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2020-03-28 14:26 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-22 17:23 [PATCH v2 00/13] Use vsprintf extension %pe for symbolic error Nishant Malpani
2020-03-22 17:23 ` [PATCH v2 01/13] iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name Nishant Malpani
2020-03-28 14:10 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 02/13] iio: st_sensors_i2c: " Nishant Malpani
2020-03-28 14:11 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 03/13] iio: st_sensors_spi: " Nishant Malpani
2020-03-28 14:12 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 04/13] iio: gyro: bmg160_i2c: " Nishant Malpani
2020-03-28 14:13 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 05/13] iio: gyro: bmg160_spi: " Nishant Malpani
2020-03-28 14:16 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 06/13] iio: gyro: mpu3050: " Nishant Malpani
2020-03-28 14:18 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 07/13] iio: imu: bmi160_i2c: " Nishant Malpani
2020-03-28 14:19 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 08/13] iio: imu: bmi160_spi: " Nishant Malpani
2020-03-28 14:20 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 09/13] iio: imu: inv_mpu6050_i2c: " Nishant Malpani
2020-03-28 14:21 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 10/13] iio: imu: inv_mpu6050_spi: " Nishant Malpani
2020-03-28 14:22 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 11/13] iio: light: st_uvis25_i2c: " Nishant Malpani
2020-03-28 14:25 ` Jonathan Cameron
2020-03-22 17:23 ` [PATCH v2 12/13] iio: light: st_uvis25_spi: " Nishant Malpani
2020-03-22 17:23 ` [PATCH v2 13/13] iio: magn: bmc150: " Nishant Malpani
2020-03-28 14:26 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).