Skip to contentSkip to conversation

block: cfq-iosched: fix unused 'cpd_to_cfqgd' function warning

PATCH In review Vladimir Zapolskiy 2 participants 2 messages Jun 18, 2015 – Jun 19, 2015 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: cfq-iosched: fix unused 'cpd_to_cfqgd' function warning

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.

---
 block/cfq-iosched.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
block/cfq-iosched.c +3 -2
index 64d59a5..9c294cd 100644
@@ -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)
 {
Signature · 1 line
2.1.4
maintainer
#1 lore raw
Quoted 11 lines · Vladimir Zapolskiy

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.

The two other related functions aren't used either if group scheduling isn't enabled. I committed this instead:

http://git.kernel.dk/cgit/linux-block/commit/?h=for-4.2/core&id=4ceab71b9d84e55b59a76b54b2999dc377aae6e6

Signature · 5 lines
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/