[PATCH 2/3] cfq-iosched: Fix warning about unused dummy functions
From: Matthias Kaehlcke
Date: Fri May 26 2017 - 21:17:08 EST
Only define dummies for cfqg_stats_set_start_group_wait_time()
and cfqg_stats_end_empty_time() when CONFIG_CFQ_GROUP_IOSCHED=y. This
fixes the following warnings when building with clang:
block/cfq-iosched.c:589:20: error: unused function
'cfqg_stats_set_start_group_wait_time' [-Werror,-Wunused-function]
block/cfq-iosched.c:590:20: error: unused function
'cfqg_stats_end_empty_time' [-Werror,-Wunused-function]
Signed-off-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>
---
block/cfq-iosched.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 36ab3645effc..b23c73db4cc0 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -588,8 +588,10 @@ static void cfqg_stats_update_avg_queue_size(struct cfq_group *cfqg)
#else /* CONFIG_CFQ_GROUP_IOSCHED && CONFIG_DEBUG_BLK_CGROUP */
+#ifdef CONFIG_CFQ_GROUP_IOSCHED
static inline void cfqg_stats_set_start_group_wait_time(struct cfq_group *cfqg, struct cfq_group *curr_cfqg) { }
static inline void cfqg_stats_end_empty_time(struct cfqg_stats *stats) { }
+#endif
static inline void cfqg_stats_update_dequeue(struct cfq_group *cfqg) { }
static inline void cfqg_stats_set_start_empty_time(struct cfq_group *cfqg) { }
static inline void cfqg_stats_update_idle_time(struct cfq_group *cfqg) { }
--
2.13.0.219.gdb65acc882-goog