Skip to contentSkip to conversation

iio: accel: kxcjk-1013: Fix defined but unused warning

PATCH In review Daniel Baluta 2 participants 2 messages Sep 3, 2014 – Sep 14, 2014 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: accel: kxcjk-1013: Fix defined but unused warning

Noticed when compiling with CONFIG_PM_RUNTIME not set:
kxcjk-1013.c: warning: ‘kxcjk1013_get_startup_times’ defined but not used [-Wunused-function]

Introduced by commit 124e1b1d (iio: accel: kxcjk-1013: support runtime pm).

---
 drivers/iio/accel/kxcjk-1013.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/accel/kxcjk-1013.c +2 -0
index 736231d..eb1b8b6 100644
@@ -307,6 +307,7 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
 	return 0;
 }
 
+#ifdef CONFIG_PM_RUNTIME
 static int kxcjk1013_get_startup_times(struct kxcjk1013_data *data)
 {
 	int i;
@@ -318,6 +319,7 @@ static int kxcjk1013_get_startup_times(struct kxcjk1013_data *data)
 
 	return KXCJK1013_MAX_STARTUP_TIME_US;
 }
+#endif
 
 static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool on)
 {
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 7 lines · Daniel Baluta

Noticed when compiling with CONFIG_PM_RUNTIME not set:
kxcjk-1013.c: warning: ‘kxcjk1013_get_startup_times’ defined but not used [-Wunused-function]

Introduced by commit 124e1b1d (iio: accel: kxcjk-1013: support runtime pm).

Note, convention is author first in this list then reviewers etc then sign offs from those handling the patch.

Applied to the togreg branch of iio.git - initially pushed out as testing.

Thanks,

J

Quoted 25 lines
---
 drivers/iio/accel/kxcjk-1013.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/accel/kxcjk-1013.c +2 -0
index 736231d..eb1b8b6 100644
@@ -307,6 +307,7 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
 	return 0;
 }
 
+#ifdef CONFIG_PM_RUNTIME
 static int kxcjk1013_get_startup_times(struct kxcjk1013_data *data)
 {
 	int i;
@@ -318,6 +319,7 @@ static int kxcjk1013_get_startup_times(struct kxcjk1013_data *data)
 
 	return KXCJK1013_MAX_STARTUP_TIME_US;
 }
+#endif
 
 static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool on)
 {