From patchwork Sat Jun 17 08:19:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 109438 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1854854vqr; Sat, 17 Jun 2023 01:36:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4tZZPQ/8k4zUiVquYELbRciiRqKYra5zEPEEojUmcYpGaj2gJVJIJ2UQavIpJhJfRd3OFT X-Received: by 2002:a05:6a00:15cc:b0:655:89f1:2db8 with SMTP id o12-20020a056a0015cc00b0065589f12db8mr6558922pfu.16.1686990993201; Sat, 17 Jun 2023 01:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686990993; cv=none; d=google.com; s=arc-20160816; b=oV65tgXZK3+hE1RRwsLpcONV14gzPVpPg62cmcIIYbgFvYBJyd+FHX4j5DxAP/x6Hb az5OAywzNge1Z5KXUqEcJT5RSpp+wtH5wZnnv2rYbF5Dor7jipI0Fcuicl0pPHsDEmQA MTY7ZaOuEt/t6a9P1Iijp+gtDPVZ5ZOfeXFe6kBljnipKBEuCeHFcpk+5l3OB0cmGUDv fJ5b1JjIibeJqkmLXmXv3Ato1j3Qh6LEahet/LHt9lcjs9YfsBrZy7r6BOOrS6dcvVd7 Nw71x8jVDj4g/E/nZ1DoXVRbeAn1DdSkNWeAv1MYWp84YANldQJovCcJMpoZJXWO8zJJ Mryw== 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 :message-id:date:subject:cc:to:from; bh=M87+fjaUz8Wn0QWb5HW65ws4H0ZMsGoR6DXDXcqj09o=; b=ZbmOzQkdyS7Z+qQsUBBiB+GSuU+nbwt6pIFO551v5QJDcSov+1xeCvSmEf7OEIHv6h kh3gES9CsVx/aojqHU+fveN0oMfu5eI5DLyntSqP+s4HCve/6SPK53HdYoo4WYdQL+EK PUA5L8BWZpKzzeeqoURCy8Zkss3mRy5d7wSTl0BliLXfcnPZbcaojBlVi032QimPXiMm bgMO2xvGlNUY9KAS3UrDTGt8fyI+0zQ/TEDLaseqbD7EeSoO5LeMHGNd44kTBW/sYfts JB6wC0mwt8w1grxkKT2pH9GrfZNvkzUHTM5EB1qHBUf59ZOlVlEoH/zwo+QJUrpEny4c iaSQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020aa793cc000000b0066854219b5esi678139pff.186.2023.06.17.01.36.20; Sat, 17 Jun 2023 01:36:33 -0700 (PDT) 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 S1346126AbjFQIUA (ORCPT + 99 others); Sat, 17 Jun 2023 04:20:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbjFQIT6 (ORCPT ); Sat, 17 Jun 2023 04:19:58 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D976173A for ; Sat, 17 Jun 2023 01:19:57 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QjpqF1rqjz18MBy; Sat, 17 Jun 2023 16:19:53 +0800 (CST) Received: from huawei.com (10.175.104.170) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 17 Jun 2023 16:19:54 +0800 From: Miaohe Lin To: , , , CC: , , , , , , , Subject: [PATCH] sched/topology: remove unneeded do while loop in cpu_attach_domain() Date: Sat, 17 Jun 2023 16:19:26 +0800 Message-ID: <20230617081926.2035113-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) 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,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768938267391991812?= X-GMAIL-MSGID: =?utf-8?q?1768938267391991812?= When sg != sd->groups, the do while loop would cause deadloop here. But that won't occur because sg is always equal to sd->groups now. Remove this unneeded do while loop. Signed-off-by: Miaohe Lin Reviewed-by: Chen Yu --- kernel/sched/topology.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index ca4472281c28..9010c93c3fdb 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -750,10 +750,7 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu) * domain for convenience. Clear such flags since * the child is being destroyed. */ - do { - sg->flags = 0; - } while (sg != sd->groups); - + sg->flags = 0; sd->child = NULL; } }