Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp203863rwb; Mon, 28 Nov 2022 19:21:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf6+ZbKXxm6gghF4kESQy1ReMXjCoC7FNeWBKptuwV+YyHjaoHyIP9NLp+eslzPM/AnCw1MU X-Received: by 2002:a17:902:b416:b0:187:3157:a0ee with SMTP id x22-20020a170902b41600b001873157a0eemr41095331plr.146.1669692080929; Mon, 28 Nov 2022 19:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669692080; cv=none; d=google.com; s=arc-20160816; b=aGi7mE7lwkXSkN3rwiTflSBMeXl+fkULAhaewPZRUwPmeLZR7R1n3qEkImXB2skcmG yXdhkGwD1nGvFToYHFYHVlz9ePBYXj9MYr+Du704Hfl2Q7Zg0S7USx3s7yC9lm7gfX4v FE6Y2FCPK/IYlu7ZJOGWvKVKLdJfkBxkBJPjZxa63fqXIRbDXdwrePjDfJRTHrVKUOjn S+V+bmIcyfvFKgvoMkGWWV6ae3BwbXwKU0YbCJzo5P3fE9pzR9hwNvEalfgEPb/1fqmh qtJniZON6l1URtEMQJiDzBL4O1sItijAJxVpRtPQ+0xD7lgZG1B5jIwO9QDnHrkEyC5p EHqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=S4Tq52lxeYWl2BC+Uou6Ihyg54euLcPlgL4zeIFThJ0=; b=d/IrMUo7aQ5gHP96BU/mz9aZqW97Pd8bgQOdfxsOJlIybCXZ5V0dgYdI1a1UNFka0N erpcrUng1JmNWgTwL4DeUIAvJ011dmXmpHmdK8i2Eda6uL67qjVOG06QU2jv1nzRxs4a D8ABG3fnPMmCIExnJHPiAiNiewno14570lXoxgz6AKEFy8Ogtw1LVat6G4nY8AdXMV5G 3IdnPzaLaX4J91avSssZc7OcMaIzSWqh6ADP7JBf8DPga40csEfJKt66Zste5sGDRF8C Ay5qzC0YvU6Nd+0dLPYLRTA+5gOeKT1Nz/yXNHizCVwa+lIEBQjxXq3sTl0crqhZwMtV bu8g== 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:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a170902ea0100b0018554535de8si14780466plg.83.2022.11.28.19.21.09; Mon, 28 Nov 2022 19:21:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235417AbiK2DCj (ORCPT + 82 others); Mon, 28 Nov 2022 22:02:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235317AbiK2DB7 (ORCPT ); Mon, 28 Nov 2022 22:01:59 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBE445084; Mon, 28 Nov 2022 19:01:58 -0800 (PST) Received: from kwepemi500016.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NLnCy4y5WzRpX3; Tue, 29 Nov 2022 11:01:18 +0800 (CST) Received: from huawei.com (10.174.178.129) by kwepemi500016.china.huawei.com (7.221.188.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 29 Nov 2022 11:01:56 +0800 From: Kemeng Shi To: , , CC: , , , Subject: [PATCH v2 10/10] blk-throttle: avoid dead code in throtl_hierarchy_can_upgrade Date: Tue, 29 Nov 2022 11:01:47 +0800 Message-ID: <20221129030147.27400-11-shikemeng@huawei.com> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20221129030147.27400-1-shikemeng@huawei.com> References: <20221129030147.27400-1-shikemeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.178.129] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500016.china.huawei.com (7.221.188.220) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Function throtl_hierarchy_can_upgrade will always return from while loop, so the return outside while loop is never reached. Break the loop when we traverse to root as throtl_hierarchy_can_downgrade do to avoid dead code. Signed-off-by: Kemeng Shi --- block/blk-throttle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 4c80f2aa1e29..9946524de158 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1854,7 +1854,7 @@ static bool throtl_hierarchy_can_upgrade(struct throtl_grp *tg) return true; tg = sq_to_tg(tg->service_queue.parent_sq); if (!tg || !tg_to_blkg(tg)->parent) - return false; + break; } return false; } -- 2.30.0