Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3762297rwd; Sat, 17 Jun 2023 01:34:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mI9Cu27W3YzjgnUWxjybfQx2V8Jaq0YS7+n3gNglJRyKBVYTDvvH1ndOFMA7VnJoDZ58y X-Received: by 2002:a05:6a20:8e05:b0:ff:ed6b:4c9e with SMTP id y5-20020a056a208e0500b000ffed6b4c9emr6677710pzj.36.1686990878328; Sat, 17 Jun 2023 01:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686990878; cv=none; d=google.com; s=arc-20160816; b=bcq7KZ7mWkp3+cHD7AkA6ZYZOfJmyQ+uQLe/ShHMFA1lF1m6ZCm/TV2oPoIebjR3LC SipiwtrnDyrpwwNHZTGyI7a7/QzXBTdTR6mcB9wmQcptwI5+8iiMJXGnoRA8fzlf5/dx eIAXypcsXwQlvVSvOIt3QjV9AbUvCe/4L1oh/o2HL+Thd92r7vg+YEDBcQ0JbbRckokN AViGXS6W8G/MDr+xWp5vVjImbEOjxQbbhENlKusMegI2coFC0VCWrZbODYsvrl+bcZg+ LSsWqVeYC3yiCWNS14v9KMOsirZhHH58dlj3VGQRF5hZsFVXpf2IBn+Pu7ej7aoVFPEl PBnA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020aa79e4a000000b006667a4ebfa8si6517877pfq.336.2023.06.17.01.34.24; Sat, 17 Jun 2023 01:34:38 -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 S234191AbjFQIUA (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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 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 --- 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; } } -- 2.27.0