Skip to contentSkip to conversation

drivers: iio: accel: Switch hardcoded function name with a reference to __func__ making the code more maintainable

PATCH In review Mohan Kumar 2 participants 2 messages Apr 19, 2019 – Apr 22, 2019 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: iio: accel: Switch hardcoded function name with a reference to __func__ making the code more maintainable

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using function's name, in a string

---
 drivers/iio/accel/bmc150-accel-core.c | 2 +-
 drivers/iio/accel/kxcjk-1013.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +1 -1
index b4e2d9b..44d7c49 100644
@@ -394,7 +394,7 @@ static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on)
 
 	if (ret < 0) {
 		dev_err(dev,
-			"Failed: bmc150_accel_set_power_state for %d\n", on);
+			"Failed: %s for %d\n", __func__, on);
 		if (on)
 			pm_runtime_put_noidle(dev);
 
drivers/iio/accel/kxcjk-1013.c +1 -1
index a5c9d3d..cbcf3ee0 100644
@@ -451,7 +451,7 @@ static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool on)
 	}
 	if (ret < 0) {
 		dev_err(&data->client->dev,
-			"Failed: kxcjk1013_set_power_state for %d\n", on);
+			"Failed: %s for %d\n", __func__, on);
 		if (on)
 			pm_runtime_put_noidle(&data->client->dev);
 		return ret;
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 6 lines · On Fri, 19 Apr 2019 11:36:51 +0300 Mohan Kumar <[email protected]> wrote:

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using function's name, in a string

Patch is good, but please check other patches for the area git log --oneline -- drivers/iio to get the standard formatting for descriptions. The patch title is also a bit to long.

I've edited that and applied the patch to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks

Jonathan

Quoted 31 lines
---
 drivers/iio/accel/bmc150-accel-core.c | 2 +-
 drivers/iio/accel/kxcjk-1013.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +1 -1
index b4e2d9b..44d7c49 100644
@@ -394,7 +394,7 @@ static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on)
 
 	if (ret < 0) {
 		dev_err(dev,
-			"Failed: bmc150_accel_set_power_state for %d\n", on);
+			"Failed: %s for %d\n", __func__, on);
 		if (on)
 			pm_runtime_put_noidle(dev);
 
drivers/iio/accel/kxcjk-1013.c +1 -1
index a5c9d3d..cbcf3ee0 100644
@@ -451,7 +451,7 @@ static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool on)
 	}
 	if (ret < 0) {
 		dev_err(&data->client->dev,
-			"Failed: kxcjk1013_set_power_state for %d\n", on);
+			"Failed: %s for %d\n", __func__, on);
 		if (on)
 			pm_runtime_put_noidle(&data->client->dev);
 		return ret;