All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: cfq-iosched: fix unused 'cpd_to_cfqgd' function warning
@ 2015-06-18 22:33 Vladimir Zapolskiy
  2015-06-19 16:15 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zapolskiy @ 2015-06-18 22:33 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel

If CFQ_GROUP_IOSCHED kernel option is not set, a compiler produces the
following warning:

  CC      block/cfq-iosched.o
  linux/block/cfq-iosched.c:469:2:
    warning: 'cpd_to_cfqgd' defined but not used [-Wunused-function]
    *cpd_to_cfqgd(struct blkcg_policy_data *cpd)
     ^

Define this function only if CFQ_GROUP_IOSCHED is set and remove
the compilation warning.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 block/cfq-iosched.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 64d59a5..9c294cd 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -465,11 +465,12 @@ static inline struct cfq_group *pd_to_cfqg(struct blkg_policy_data *pd)
 	return pd ? container_of(pd, struct cfq_group, pd) : NULL;
 }
 
-static struct cfq_group_data
-*cpd_to_cfqgd(struct blkcg_policy_data *cpd)
+#ifdef CONFIG_CFQ_GROUP_IOSCHED
+static struct cfq_group_data *cpd_to_cfqgd(struct blkcg_policy_data *cpd)
 {
 	return cpd ? container_of(cpd, struct cfq_group_data, pd) : NULL;
 }
+#endif
 
 static inline struct blkcg_gq *cfqg_to_blkg(struct cfq_group *cfqg)
 {
-- 
2.1.4


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

end of thread, other threads:[~2015-06-19 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-18 22:33 [PATCH] block: cfq-iosched: fix unused 'cpd_to_cfqgd' function warning Vladimir Zapolskiy
2015-06-19 16:15 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.