Now that if bfqq is under root group, 'bfqq->entity.parent' is set to root group's entity instead of NULL, there is no point for the judgement in bfqq_group() anymore. Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx> --- block/bfq-cgroup.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index 58acaf14a91d..1fcb13e97cf0 100644 --- a/block/bfq-cgroup.c +++ b/block/bfq-cgroup.c @@ -307,11 +307,7 @@ static struct bfq_group *bfqg_parent(struct bfq_group *bfqg) struct bfq_group *bfqq_group(struct bfq_queue *bfqq) { - struct bfq_entity *group_entity = bfqq->entity.parent; - - return group_entity ? container_of(group_entity, struct bfq_group, - entity) : - bfqq->bfqd->root_group; + return container_of(bfqq->entity.parent, struct bfq_group, entity); } /* -- 2.31.1