Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp1998297lfo; Sat, 28 May 2022 13:14:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlh7/GKaovHL++XcNvGk3jsTwriaxO3EtltaNS0rX4lHXfzLc+Lar1BpldyasAjTvInE+T X-Received: by 2002:a17:902:d582:b0:161:c681:c326 with SMTP id k2-20020a170902d58200b00161c681c326mr48265865plh.84.1653768866618; Sat, 28 May 2022 13:14:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653768866; cv=none; d=google.com; s=arc-20160816; b=JsTw5N7IYBj2L+/VWbzQvakVAVaq1zdWcfL0FkUmCaSq7dcRjYVMq88IxEwhenoG/I m63ZX4toUHPX+0qrjUdPlU8Ie8+3SxqDj7+w+/ZU3e9p1isq29t7hQbf/8oNfQRWD5Zc eGdX1E22DF2P4Ywb6qtLfNsEnNSTsSX/H9nctAR2r2KvXbPvBRn20Ou2YqmkqJwggjn2 +iJAD8k3+QO/LYVXoVg2C7WD9aRgzg69Ao2bv0KhagCf3iINtJ+ZmaNbX5el0YJ6TvR0 USP3h8z+G/fyDEpF5DB+LbH3JT3gJQvmSAZQ4E7R99K9+FqyyitDA6QjdMwfc/6Z4Q1l OBpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=G6Z61eDgnKyr9r6FEsDMhn4HWDFCLBEii+eRSDffBWs=; b=P/Qrh+E/hVPzze1PYOV797jZI2a6B9WqEiQft90+BYa/g7fUEsokjZ9G20JM0sTS82 MFMbmnA68R6qFsLCR6iaQrpgbBWczaOua2XP9igLUH0Hq97eQUbK0ImbGxLwB5m0wQrl BofNb/m8T5KDuueCMjde43/0ZQR2bgQJpUKx9MFqWBmtvonipTyrCbznXc5EwGDhlIqM b52GKgatdiKQTcuH87+S1jg535S5fYseyFY05teZSHpMcuiqryhNuRHxHS7+19h8nme/ CL9tn7uHVFNoLLs1J6GD9TM2fcmCCmzWQczU7dOXmB/+bc8WXk6k7m2Ux9i+qEGs/jch RNHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ob1-20020a17090b390100b001d9cd8d2177si1566035pjb.85.2022.05.28.13.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:14:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ABCB014ACA5; Sat, 28 May 2022 12:26:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355402AbiE1Jqz (ORCPT + 99 others); Sat, 28 May 2022 05:46:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239735AbiE1Jqe (ORCPT ); Sat, 28 May 2022 05:46:34 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0126465A0; Sat, 28 May 2022 02:46:33 -0700 (PDT) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L9Gx46dW0z1JCSZ; Sat, 28 May 2022 17:44:56 +0800 (CST) Received: from kwepemm600009.china.huawei.com (7.193.23.164) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 28 May 2022 17:46:31 +0800 Received: from huawei.com (10.175.127.227) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 28 May 2022 17:46:30 +0800 From: Yu Kuai To: , , CC: , , , , Subject: [PATCH -next v3 4/6] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group Date: Sat, 28 May 2022 17:59:56 +0800 Message-ID: <20220528095958.270455-5-yukuai3@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220528095958.270455-1-yukuai3@huawei.com> References: <20220528095958.270455-1-yukuai3@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600009.china.huawei.com (7.193.23.164) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prevent unnecessary format conversion for bfqg->bfqd in multiple places. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara --- block/bfq-cgroup.c | 2 +- block/bfq-iosched.h | 2 +- block/bfq-wf2q.c | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index 4d516879d9fa..b4e39ab4ad17 100644 --- a/block/bfq-cgroup.c +++ b/block/bfq-cgroup.c @@ -224,7 +224,7 @@ void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq, { blkg_rwstat_add(&bfqg->stats.queued, op, 1); bfqg_stats_end_empty_time(&bfqg->stats); - if (!(bfqq == ((struct bfq_data *)bfqg->bfqd)->in_service_queue)) + if (!(bfqq == bfqg->bfqd->in_service_queue)) bfqg_stats_set_start_group_wait_time(bfqg, bfqq_group(bfqq)); } diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h index ecca2c0570ea..c6109512503b 100644 --- a/block/bfq-iosched.h +++ b/block/bfq-iosched.h @@ -895,7 +895,7 @@ struct bfq_group { struct bfq_entity entity; struct bfq_sched_data sched_data; - void *bfqd; + struct bfq_data *bfqd; struct bfq_queue *async_bfqq[2][IOPRIO_NR_LEVELS]; struct bfq_queue *async_idle_bfqq; diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c index 643e57ee3e64..26ab9ba6e5a3 100644 --- a/block/bfq-wf2q.c +++ b/block/bfq-wf2q.c @@ -236,9 +236,8 @@ static void bfq_inc_active_entities(struct bfq_entity *entity) { struct bfq_sched_data *sd = entity->sched_data; struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data); - struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd; - if (bfqg != bfqd->root_group) + if (bfqg != bfqg->bfqd->root_group) bfqg->active_entities++; } @@ -246,9 +245,8 @@ static void bfq_dec_active_entities(struct bfq_entity *entity) { struct bfq_sched_data *sd = entity->sched_data; struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data); - struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd; - if (bfqg != bfqd->root_group) + if (bfqg != bfqg->bfqd->root_group) bfqg->active_entities--; } @@ -745,7 +743,7 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st, else { sd = entity->my_sched_data; bfqg = container_of(sd, struct bfq_group, sched_data); - bfqd = (struct bfq_data *)bfqg->bfqd; + bfqd = bfqg->bfqd; } #endif -- 2.31.1