diff options
author | Jens Axboe <axboe@fb.com> | 2015-06-19 10:13:01 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-06-19 10:13:01 -0600 |
commit | 4ceab71b9d84e55b59a76b54b2999dc377aae6e6 (patch) | |
tree | 94c7b34981ec9ae3e2c506892488c538add0bcd9 /block/cfq-iosched.c | |
parent | 0bb979472a7401022109e81dd89d777adea58710 (diff) | |
download | linux-rpi3-4ceab71b9d84e55b59a76b54b2999dc377aae6e6.tar.gz linux-rpi3-4ceab71b9d84e55b59a76b54b2999dc377aae6e6.tar.bz2 linux-rpi3-4ceab71b9d84e55b59a76b54b2999dc377aae6e6.zip |
cfq-iosched: move group scheduling functions under ifdef
If CFQ_GROUP_IOSCHED is not set, the 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)
^
In reality, two other lookup functions aren't used either if
CFQ_GROUP_IOSCHED isn't set. Move all three under one of the
CFQ_GROUP_IOSCHED sections in the code.
Reported-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index d1d0cb235cd2..dbd0207928fb 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -460,22 +460,6 @@ CFQ_CFQQ_FNS(deep); CFQ_CFQQ_FNS(wait_busy); #undef CFQ_CFQQ_FNS -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) -{ - return cpd ? container_of(cpd, struct cfq_group_data, pd) : NULL; -} - -static inline struct blkcg_gq *cfqg_to_blkg(struct cfq_group *cfqg) -{ - return pd_to_blkg(&cfqg->pd); -} - #if defined(CONFIG_CFQ_GROUP_IOSCHED) && defined(CONFIG_DEBUG_BLK_CGROUP) /* cfqg stats flags */ @@ -620,6 +604,22 @@ static inline void cfqg_stats_update_avg_queue_size(struct cfq_group *cfqg) { } #ifdef CONFIG_CFQ_GROUP_IOSCHED +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) +{ + return cpd ? container_of(cpd, struct cfq_group_data, pd) : NULL; +} + +static inline struct blkcg_gq *cfqg_to_blkg(struct cfq_group *cfqg) +{ + return pd_to_blkg(&cfqg->pd); +} + static struct blkcg_policy blkcg_policy_cfq; static inline struct cfq_group *blkg_to_cfqg(struct blkcg_gq *blkg) |