summaryrefslogtreecommitdiff
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-08-19 00:55:27 +0300
committerJens Axboe <axboe@fb.com>2015-08-19 01:49:18 +0300
commit5332dfc36483d2373d980526145789a354af2d49 (patch)
tree8e651633e054aa973eefec787b73ced5013ec107 /block/cfq-iosched.c
parent3a7faeada20d72f07d3a7b13454859025cd50a36 (diff)
downloadlinux-5332dfc36483d2373d980526145789a354af2d49.tar.xz
blkcg: remove unnecessary NULL checks from __cfqg_set_weight_device()
blkg_to_cfqg() and blkcg_to_cfqgd() on a valid blkg with the policy enabled are guaranteed to return non-NULL and the counterpart in blk-throttle doesn't have these checks either. Remove the spurious NULL checks. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 395476ab14fe..bcf40266bd0a 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1752,12 +1752,10 @@ static ssize_t __cfqg_set_weight_device(struct kernfs_open_file *of,
if (ret)
return ret;
- ret = -EINVAL;
cfqg = blkg_to_cfqg(ctx.blkg);
cfqgd = blkcg_to_cfqgd(blkcg);
- if (!cfqg || !cfqgd)
- goto err;
+ ret = -EINVAL;
if (!ctx.v || (ctx.v >= CFQ_WEIGHT_MIN && ctx.v <= CFQ_WEIGHT_MAX)) {
if (!is_leaf_weight) {
cfqg->dev_weight = ctx.v;
@@ -1769,7 +1767,6 @@ static ssize_t __cfqg_set_weight_device(struct kernfs_open_file *of,
ret = 0;
}
-err:
blkg_conf_finish(&ctx);
return ret ?: nbytes;
}