linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] iio: Use suitable format specifiers
@ 2020-03-21 21:01 Nishant Malpani
  2020-03-21 21:01 ` [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier Nishant Malpani
                   ` (12 more replies)
  0 siblings, 13 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:01 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

This patchset utilizes suitable format specifiers 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>

Links: https://marc.info/?l=linux-iio&m=158427554607223&w=2
Links: https://marc.info/?l=linux-iio&m=158481647605891&w=2

Nishant Malpani (13):
  iio: accel: kxsd9: Use suitable format specifier
  iio: gyro: bmg160_i2c: Use suitable format specifier
  iio: gyro: bmg160_spi: Use suitable format specifier
  iio: gyro: mpu3050: Use suitable format specifier
  iio: imu: bmi160_i2c: Use suitable format specifier
  iio: imu: bmi160_spi: Use suitable format specifier
  iio: imu: inv_mpu6050_i2c: Use suitable format specifier
  iio: imu: inv_mpu6050_spi: Use suitable format specifier
  iio: magn: bmc150: Use suitable format specifier
  iio: light: st_uvis25_i2c: Use suitable format specifier
  iio: light: st_uvis25_spi: Use suitable format specifier
  iio: st_sensors_i2c: Use suitable format specifier
  iio: st_sensors_spi: Use suitable format specifier

 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] 19+ messages in thread

* [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
@ 2020-03-21 21:01 ` Nishant Malpani
  2020-03-21 21:09   ` Joe Perches
                     ` (3 more replies)
  2020-03-21 21:01 ` [PATCH 02/13] iio: gyro: bmg160_i2c: " Nishant Malpani
                   ` (11 subsequent siblings)
  12 siblings, 4 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:01 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..39a9daa7566f 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] 19+ messages in thread

* [PATCH 02/13] iio: gyro: bmg160_i2c: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
  2020-03-21 21:01 ` [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier Nishant Malpani
@ 2020-03-21 21:01 ` Nishant Malpani
  2020-03-21 21:01 ` [PATCH 03/13] iio: gyro: bmg160_spi: " Nishant Malpani
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:01 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..d276e3308b13 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] 19+ messages in thread

* [PATCH 03/13] iio: gyro: bmg160_spi: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
  2020-03-21 21:01 ` [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier Nishant Malpani
  2020-03-21 21:01 ` [PATCH 02/13] iio: gyro: bmg160_i2c: " Nishant Malpani
@ 2020-03-21 21:01 ` Nishant Malpani
  2020-03-21 21:01 ` [PATCH 04/13] iio: gyro: mpu3050: " Nishant Malpani
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:01 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..75e63a9214d8 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] 19+ messages in thread

* [PATCH 04/13] iio: gyro: mpu3050: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (2 preceding siblings ...)
  2020-03-21 21:01 ` [PATCH 03/13] iio: gyro: bmg160_spi: " Nishant Malpani
@ 2020-03-21 21:01 ` Nishant Malpani
  2020-03-21 21:01 ` [PATCH 05/13] iio: imu: bmi160_i2c: " Nishant Malpani
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:01 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..fbac6972f77b 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] 19+ messages in thread

* [PATCH 05/13] iio: imu: bmi160_i2c: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (3 preceding siblings ...)
  2020-03-21 21:01 ` [PATCH 04/13] iio: gyro: mpu3050: " Nishant Malpani
@ 2020-03-21 21:01 ` Nishant Malpani
  2020-03-21 21:01 ` [PATCH 06/13] iio: imu: bmi160_spi: " Nishant Malpani
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:01 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..97d7a39c03df 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] 19+ messages in thread

* [PATCH 06/13] iio: imu: bmi160_spi: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (4 preceding siblings ...)
  2020-03-21 21:01 ` [PATCH 05/13] iio: imu: bmi160_i2c: " Nishant Malpani
@ 2020-03-21 21:01 ` Nishant Malpani
  2020-03-21 21:01 ` [PATCH 07/13] iio: imu: inv_mpu6050_i2c: " Nishant Malpani
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:01 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..b52085937fb9 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] 19+ messages in thread

* [PATCH 07/13] iio: imu: inv_mpu6050_i2c: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (5 preceding siblings ...)
  2020-03-21 21:01 ` [PATCH 06/13] iio: imu: bmi160_spi: " Nishant Malpani
@ 2020-03-21 21:01 ` Nishant Malpani
  2020-03-21 21:01 ` [PATCH 08/13] iio: imu: inv_mpu6050_spi: " Nishant Malpani
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:01 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..5588946dd60d 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] 19+ messages in thread

* [PATCH 08/13] iio: imu: inv_mpu6050_spi: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (6 preceding siblings ...)
  2020-03-21 21:01 ` [PATCH 07/13] iio: imu: inv_mpu6050_i2c: " Nishant Malpani
@ 2020-03-21 21:01 ` Nishant Malpani
  2020-03-21 21:02 ` [PATCH 09/13] iio: magn: bmc150: " Nishant Malpani
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:01 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..fa1d571cb4b8 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] 19+ messages in thread

* [PATCH 09/13] iio: magn: bmc150: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (7 preceding siblings ...)
  2020-03-21 21:01 ` [PATCH 08/13] iio: imu: inv_mpu6050_spi: " Nishant Malpani
@ 2020-03-21 21:02 ` Nishant Malpani
  2020-03-21 21:02 ` [PATCH 10/13] iio: light: st_uvis25_i2c: " Nishant Malpani
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:02 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..7f42ee04a6b7 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] 19+ messages in thread

* [PATCH 10/13] iio: light: st_uvis25_i2c: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (8 preceding siblings ...)
  2020-03-21 21:02 ` [PATCH 09/13] iio: magn: bmc150: " Nishant Malpani
@ 2020-03-21 21:02 ` Nishant Malpani
  2020-03-21 21:02 ` [PATCH 11/13] iio: light: st_uvis25_spi: " Nishant Malpani
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:02 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..7a1185a874e0 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] 19+ messages in thread

* [PATCH 11/13] iio: light: st_uvis25_spi: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (9 preceding siblings ...)
  2020-03-21 21:02 ` [PATCH 10/13] iio: light: st_uvis25_i2c: " Nishant Malpani
@ 2020-03-21 21:02 ` Nishant Malpani
  2020-03-21 21:02 ` [PATCH 12/13] iio: st_sensors_i2c: " Nishant Malpani
  2020-03-21 21:02 ` [PATCH 13/13] iio: st_sensors_spi: " Nishant Malpani
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:02 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..2afc3fea7357 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] 19+ messages in thread

* [PATCH 12/13] iio: st_sensors_i2c: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (10 preceding siblings ...)
  2020-03-21 21:02 ` [PATCH 11/13] iio: light: st_uvis25_spi: " Nishant Malpani
@ 2020-03-21 21:02 ` Nishant Malpani
  2020-03-21 21:02 ` [PATCH 13/13] iio: st_sensors_spi: " Nishant Malpani
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:02 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..6f2f6915107d 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] 19+ messages in thread

* [PATCH 13/13] iio: st_sensors_spi: Use suitable format specifier
  2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
                   ` (11 preceding siblings ...)
  2020-03-21 21:02 ` [PATCH 12/13] iio: st_sensors_i2c: " Nishant Malpani
@ 2020-03-21 21:02 ` Nishant Malpani
  12 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:02 UTC (permalink / raw)
  To: jic23
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, nish.malpani25,
	linux-iio, linux-kernel

Provide more suitable format specifiers while printing error logs.
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>
---

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..052fb21f2769 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] 19+ messages in thread

* Re: [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier
  2020-03-21 21:01 ` [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier Nishant Malpani
@ 2020-03-21 21:09   ` Joe Perches
  2020-03-21 21:23     ` Nishant Malpani
  2020-03-22  0:36   ` kbuild test robot
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 19+ messages in thread
From: Joe Perches @ 2020-03-21 21:09 UTC (permalink / raw)
  To: Nishant Malpani, jic23
  Cc: andriy.shevchenko, knaack.h, lars, pmeerw, linux-iio, linux-kernel

On Sun, 2020-03-22 at 02:31 +0530, Nishant Malpani wrote:
> Provide more suitable format specifiers while printing error logs.
> Discards the use of unnecessary explicit casting and prints symbolic
> error name which might prove to be convenient during debugging.


'Use suitable format specifier' is obscure and not specific.

All the subjects should likely be something like

[PATCH] subsystem: Use vsprintf extension %pe for symbolic error name


> diff --git 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;

And this could use a separator between regmap and errname like

		dev_err(&i2c->dev, "Failed to register i2c regmap: %pe\n",
or
		dev_err(&i2c->dev, "Failed to register i2c regmap - %pe\n",



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier
  2020-03-21 21:09   ` Joe Perches
@ 2020-03-21 21:23     ` Nishant Malpani
  0 siblings, 0 replies; 19+ messages in thread
From: Nishant Malpani @ 2020-03-21 21:23 UTC (permalink / raw)
  To: Joe Perches, jic23
  Cc: andriy.shevchenko, knaack.h, lars, pmeerw, linux-iio, linux-kernel

On 22/03/20 2:39 am, Joe Perches wrote:
> On Sun, 2020-03-22 at 02:31 +0530, Nishant Malpani wrote:
>> Provide more suitable format specifiers while printing error logs.
>> Discards the use of unnecessary explicit casting and prints symbolic
>> error name which might prove to be convenient during debugging.
> 
> 
> 'Use suitable format specifier' is obscure and not specific.
> 
> All the subjects should likely be something like
> 
> [PATCH] subsystem: Use vsprintf extension %pe for symbolic error name
> 
Agreed. I was just skeptical about that previously because the commit 
subject line's length was going way beyond 50 chars. I do get your point 
though; I'll send in a v2!

> 
>> diff --git 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;
> 
> And this could use a separator between regmap and errname like
> 
> 		dev_err(&i2c->dev, "Failed to register i2c regmap: %pe\n",
> or
> 		dev_err(&i2c->dev, "Failed to register i2c regmap - %pe\n",
> 
> 

Yes, I had thought of this but was too timid to ask, thinking it was 
perhaps there for legacy reasons :P

I'll add a separator in v2. Thanks for reviewing!

With regards,
Nishant Malpani

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier
  2020-03-21 21:01 ` [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier Nishant Malpani
  2020-03-21 21:09   ` Joe Perches
@ 2020-03-22  0:36   ` kbuild test robot
  2020-03-22  3:27   ` kbuild test robot
  2020-03-22 15:13   ` Jonathan Cameron
  3 siblings, 0 replies; 19+ messages in thread
From: kbuild test robot @ 2020-03-22  0:36 UTC (permalink / raw)
  To: Nishant Malpani
  Cc: kbuild-all, jic23, andriy.shevchenko, joe, knaack.h, lars,
	pmeerw, nish.malpani25, linux-iio, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3873 bytes --]

Hi Nishant,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v5.6-rc6]
[also build test ERROR on next-20200320]
[cannot apply to iio/togreg]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Nishant-Malpani/iio-Use-suitable-format-specifiers/20200322-050532
base:    fb33c6510d5595144d585aa194d377cf74d31911
config: x86_64-randconfig-s0-20200322 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/iio/accel/kxsd9-i2c.c: In function 'kxsd9_i2c_probe':
   drivers/iio/accel/kxsd9-i2c.c:68:0: error: unterminated argument list invoking macro "dev_err"
    MODULE_DESCRIPTION("KXSD9 accelerometer I2C interface");
    ^
>> drivers/iio/accel/kxsd9-i2c.c:24:3: error: 'dev_err' undeclared (first use in this function)
      dev_err(&i2c->dev, "Failed to register i2c regmap %pe\n",
      ^
   drivers/iio/accel/kxsd9-i2c.c:24:3: note: each undeclared identifier is reported only once for each function it appears in
   drivers/iio/accel/kxsd9-i2c.c:24:3: error: expected ';' at end of input
   drivers/iio/accel/kxsd9-i2c.c:24:3: error: expected declaration or statement at end of input
   drivers/iio/accel/kxsd9-i2c.c:24:3: error: expected declaration or statement at end of input
   drivers/iio/accel/kxsd9-i2c.c:24:3: warning: no return statement in function returning non-void [-Wreturn-type]
   drivers/iio/accel/kxsd9-i2c.c: At top level:
   drivers/iio/accel/kxsd9-i2c.c:12:12: warning: 'kxsd9_i2c_probe' defined but not used [-Wunused-function]
    static int kxsd9_i2c_probe(struct i2c_client *i2c,
               ^

vim +/dev_err +24 drivers/iio/accel/kxsd9-i2c.c

    11	
    12	static int kxsd9_i2c_probe(struct i2c_client *i2c,
    13				   const struct i2c_device_id *id)
    14	{
    15		static const struct regmap_config config = {
    16			.reg_bits = 8,
    17			.val_bits = 8,
    18			.max_register = 0x0e,
    19		};
    20		struct regmap *regmap;
    21	
    22		regmap = devm_regmap_init_i2c(i2c, &config);
    23		if (IS_ERR(regmap)) {
  > 24			dev_err(&i2c->dev, "Failed to register i2c regmap %pe\n",
    25				regmap;
    26			return PTR_ERR(regmap);
    27		}
    28	
    29		return kxsd9_common_probe(&i2c->dev,
    30					  regmap,
    31					  i2c->name);
    32	}
    33	
    34	static int kxsd9_i2c_remove(struct i2c_client *client)
    35	{
    36		return kxsd9_common_remove(&client->dev);
    37	}
    38	
    39	#ifdef CONFIG_OF
    40	static const struct of_device_id kxsd9_of_match[] = {
    41		{ .compatible = "kionix,kxsd9", },
    42		{ },
    43	};
    44	MODULE_DEVICE_TABLE(of, kxsd9_of_match);
    45	#else
    46	#define kxsd9_of_match NULL
    47	#endif
    48	
    49	static const struct i2c_device_id kxsd9_i2c_id[] = {
    50		{"kxsd9", 0},
    51		{ },
    52	};
    53	MODULE_DEVICE_TABLE(i2c, kxsd9_i2c_id);
    54	
    55	static struct i2c_driver kxsd9_i2c_driver = {
    56		.driver = {
    57			.name	= "kxsd9",
    58			.of_match_table = of_match_ptr(kxsd9_of_match),
    59			.pm = &kxsd9_dev_pm_ops,
    60		},
    61		.probe		= kxsd9_i2c_probe,
    62		.remove		= kxsd9_i2c_remove,
    63		.id_table	= kxsd9_i2c_id,
    64	};
    65	module_i2c_driver(kxsd9_i2c_driver);
    66	
    67	MODULE_LICENSE("GPL v2");
  > 68	MODULE_DESCRIPTION("KXSD9 accelerometer I2C interface");

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29460 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier
  2020-03-21 21:01 ` [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier Nishant Malpani
  2020-03-21 21:09   ` Joe Perches
  2020-03-22  0:36   ` kbuild test robot
@ 2020-03-22  3:27   ` kbuild test robot
  2020-03-22 15:13   ` Jonathan Cameron
  3 siblings, 0 replies; 19+ messages in thread
From: kbuild test robot @ 2020-03-22  3:27 UTC (permalink / raw)
  To: Nishant Malpani
  Cc: kbuild-all, jic23, andriy.shevchenko, joe, knaack.h, lars,
	pmeerw, nish.malpani25, linux-iio, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 7003 bytes --]

Hi Nishant,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v5.6-rc6]
[also build test ERROR on next-20200320]
[cannot apply to iio/togreg]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Nishant-Malpani/iio-Use-suitable-format-specifiers/20200322-050532
base:    fb33c6510d5595144d585aa194d377cf74d31911
config: powerpc-randconfig-a001-20200322 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=9.2.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   drivers/iio/accel/kxsd9-i2c.c: In function 'kxsd9_i2c_probe':
>> drivers/iio/accel/kxsd9-i2c.c:68: error: unterminated argument list invoking macro "dev_err"
      68 | MODULE_DESCRIPTION("KXSD9 accelerometer I2C interface");
         | 
>> drivers/iio/accel/kxsd9-i2c.c:24:3: error: 'dev_err' undeclared (first use in this function); did you mean '_dev_err'?
      24 |   dev_err(&i2c->dev, "Failed to register i2c regmap %pe\n",
         |   ^~~~~~~
         |   _dev_err
   drivers/iio/accel/kxsd9-i2c.c:24:3: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/iio/accel/kxsd9-i2c.c:24:10: error: expected ';' at end of input
      24 |   dev_err(&i2c->dev, "Failed to register i2c regmap %pe\n",
         |          ^
         |          ;
   ......
      68 | MODULE_DESCRIPTION("KXSD9 accelerometer I2C interface");
         |           
>> drivers/iio/accel/kxsd9-i2c.c:24:3: error: expected declaration or statement at end of input
      24 |   dev_err(&i2c->dev, "Failed to register i2c regmap %pe\n",
         |   ^~~~~~~
>> drivers/iio/accel/kxsd9-i2c.c:24:3: error: expected declaration or statement at end of input
>> drivers/iio/accel/kxsd9-i2c.c:24:3: warning: no return statement in function returning non-void [-Wreturn-type]
   At top level:
   drivers/iio/accel/kxsd9-i2c.c:12:12: warning: 'kxsd9_i2c_probe' defined but not used [-Wunused-function]
      12 | static int kxsd9_i2c_probe(struct i2c_client *i2c,
         |            ^~~~~~~~~~~~~~~

vim +/dev_err +68 drivers/iio/accel/kxsd9-i2c.c

a483ab796960c9 Linus Walleij   2016-09-01  11  
a483ab796960c9 Linus Walleij   2016-09-01  12  static int kxsd9_i2c_probe(struct i2c_client *i2c,
a483ab796960c9 Linus Walleij   2016-09-01  13  			   const struct i2c_device_id *id)
a483ab796960c9 Linus Walleij   2016-09-01  14  {
a483ab796960c9 Linus Walleij   2016-09-01  15  	static const struct regmap_config config = {
a483ab796960c9 Linus Walleij   2016-09-01  16  		.reg_bits = 8,
a483ab796960c9 Linus Walleij   2016-09-01  17  		.val_bits = 8,
a483ab796960c9 Linus Walleij   2016-09-01  18  		.max_register = 0x0e,
a483ab796960c9 Linus Walleij   2016-09-01  19  	};
a483ab796960c9 Linus Walleij   2016-09-01  20  	struct regmap *regmap;
a483ab796960c9 Linus Walleij   2016-09-01  21  
a483ab796960c9 Linus Walleij   2016-09-01  22  	regmap = devm_regmap_init_i2c(i2c, &config);
a483ab796960c9 Linus Walleij   2016-09-01  23  	if (IS_ERR(regmap)) {
ee70c8726e6050 Nishant Malpani 2020-03-22 @24  		dev_err(&i2c->dev, "Failed to register i2c regmap %pe\n",
ee70c8726e6050 Nishant Malpani 2020-03-22  25  			regmap;
a483ab796960c9 Linus Walleij   2016-09-01  26  		return PTR_ERR(regmap);
a483ab796960c9 Linus Walleij   2016-09-01  27  	}
a483ab796960c9 Linus Walleij   2016-09-01  28  
a483ab796960c9 Linus Walleij   2016-09-01  29  	return kxsd9_common_probe(&i2c->dev,
a483ab796960c9 Linus Walleij   2016-09-01  30  				  regmap,
a483ab796960c9 Linus Walleij   2016-09-01  31  				  i2c->name);
a483ab796960c9 Linus Walleij   2016-09-01  32  }
a483ab796960c9 Linus Walleij   2016-09-01  33  
a483ab796960c9 Linus Walleij   2016-09-01  34  static int kxsd9_i2c_remove(struct i2c_client *client)
a483ab796960c9 Linus Walleij   2016-09-01  35  {
a483ab796960c9 Linus Walleij   2016-09-01  36  	return kxsd9_common_remove(&client->dev);
a483ab796960c9 Linus Walleij   2016-09-01  37  }
a483ab796960c9 Linus Walleij   2016-09-01  38  
a483ab796960c9 Linus Walleij   2016-09-01  39  #ifdef CONFIG_OF
a483ab796960c9 Linus Walleij   2016-09-01  40  static const struct of_device_id kxsd9_of_match[] = {
a483ab796960c9 Linus Walleij   2016-09-01  41  	{ .compatible = "kionix,kxsd9", },
a483ab796960c9 Linus Walleij   2016-09-01  42  	{ },
a483ab796960c9 Linus Walleij   2016-09-01  43  };
a483ab796960c9 Linus Walleij   2016-09-01  44  MODULE_DEVICE_TABLE(of, kxsd9_of_match);
a483ab796960c9 Linus Walleij   2016-09-01  45  #else
a483ab796960c9 Linus Walleij   2016-09-01  46  #define kxsd9_of_match NULL
a483ab796960c9 Linus Walleij   2016-09-01  47  #endif
a483ab796960c9 Linus Walleij   2016-09-01  48  
a483ab796960c9 Linus Walleij   2016-09-01  49  static const struct i2c_device_id kxsd9_i2c_id[] = {
a483ab796960c9 Linus Walleij   2016-09-01  50  	{"kxsd9", 0},
a483ab796960c9 Linus Walleij   2016-09-01  51  	{ },
a483ab796960c9 Linus Walleij   2016-09-01  52  };
a483ab796960c9 Linus Walleij   2016-09-01  53  MODULE_DEVICE_TABLE(i2c, kxsd9_i2c_id);
a483ab796960c9 Linus Walleij   2016-09-01  54  
a483ab796960c9 Linus Walleij   2016-09-01  55  static struct i2c_driver kxsd9_i2c_driver = {
a483ab796960c9 Linus Walleij   2016-09-01  56  	.driver = {
a483ab796960c9 Linus Walleij   2016-09-01  57  		.name	= "kxsd9",
a483ab796960c9 Linus Walleij   2016-09-01  58  		.of_match_table = of_match_ptr(kxsd9_of_match),
9a9a369d6178dd Linus Walleij   2016-09-01  59  		.pm = &kxsd9_dev_pm_ops,
a483ab796960c9 Linus Walleij   2016-09-01  60  	},
a483ab796960c9 Linus Walleij   2016-09-01  61  	.probe		= kxsd9_i2c_probe,
a483ab796960c9 Linus Walleij   2016-09-01  62  	.remove		= kxsd9_i2c_remove,
a483ab796960c9 Linus Walleij   2016-09-01  63  	.id_table	= kxsd9_i2c_id,
a483ab796960c9 Linus Walleij   2016-09-01  64  };
a483ab796960c9 Linus Walleij   2016-09-01  65  module_i2c_driver(kxsd9_i2c_driver);
9a0ebbc93547d8 Linus Walleij   2017-11-13  66  
9a0ebbc93547d8 Linus Walleij   2017-11-13  67  MODULE_LICENSE("GPL v2");
9a0ebbc93547d8 Linus Walleij   2017-11-13 @68  MODULE_DESCRIPTION("KXSD9 accelerometer I2C interface");

:::::: The code at line 68 was first introduced by commit
:::::: 9a0ebbc93547d88f422905c34dcceebe928f3e9e iio: adc/accel: Fix up module licenses

:::::: TO: Linus Walleij <linus.walleij@linaro.org>
:::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28125 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier
  2020-03-21 21:01 ` [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier Nishant Malpani
                     ` (2 preceding siblings ...)
  2020-03-22  3:27   ` kbuild test robot
@ 2020-03-22 15:13   ` Jonathan Cameron
  3 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2020-03-22 15:13 UTC (permalink / raw)
  To: Nishant Malpani
  Cc: andriy.shevchenko, joe, knaack.h, lars, pmeerw, linux-iio, linux-kernel

On Sun, 22 Mar 2020 02:31:52 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:

> Provide more suitable format specifiers while printing error logs.
> 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>
> ---
> 
> 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..39a9daa7566f 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;

Please make sure you do basic build tests. 

			regmap); 

>  		return PTR_ERR(regmap);
>  	}
>  


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-03-22 15:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-21 21:01 [PATCH 00/13] iio: Use suitable format specifiers Nishant Malpani
2020-03-21 21:01 ` [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier Nishant Malpani
2020-03-21 21:09   ` Joe Perches
2020-03-21 21:23     ` Nishant Malpani
2020-03-22  0:36   ` kbuild test robot
2020-03-22  3:27   ` kbuild test robot
2020-03-22 15:13   ` Jonathan Cameron
2020-03-21 21:01 ` [PATCH 02/13] iio: gyro: bmg160_i2c: " Nishant Malpani
2020-03-21 21:01 ` [PATCH 03/13] iio: gyro: bmg160_spi: " Nishant Malpani
2020-03-21 21:01 ` [PATCH 04/13] iio: gyro: mpu3050: " Nishant Malpani
2020-03-21 21:01 ` [PATCH 05/13] iio: imu: bmi160_i2c: " Nishant Malpani
2020-03-21 21:01 ` [PATCH 06/13] iio: imu: bmi160_spi: " Nishant Malpani
2020-03-21 21:01 ` [PATCH 07/13] iio: imu: inv_mpu6050_i2c: " Nishant Malpani
2020-03-21 21:01 ` [PATCH 08/13] iio: imu: inv_mpu6050_spi: " Nishant Malpani
2020-03-21 21:02 ` [PATCH 09/13] iio: magn: bmc150: " Nishant Malpani
2020-03-21 21:02 ` [PATCH 10/13] iio: light: st_uvis25_i2c: " Nishant Malpani
2020-03-21 21:02 ` [PATCH 11/13] iio: light: st_uvis25_spi: " Nishant Malpani
2020-03-21 21:02 ` [PATCH 12/13] iio: st_sensors_i2c: " Nishant Malpani
2020-03-21 21:02 ` [PATCH 13/13] iio: st_sensors_spi: " Nishant Malpani

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).