Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp119282rwb; Sat, 17 Sep 2022 02:01:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5afLZsbycgDWVjJ69HoiAsK5KcyKeZ25IqXqK+bxUNhUwvDJEw/cyOXnbehMVpv5c3eon4 X-Received: by 2002:a05:6a00:c89:b0:543:edb9:9dbc with SMTP id a9-20020a056a000c8900b00543edb99dbcmr9283943pfv.50.1663405280803; Sat, 17 Sep 2022 02:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663405280; cv=none; d=google.com; s=arc-20160816; b=z/UPutSj34swpgxVr5ASHK34sI1b78NP0sYEDs7gWdyRQU43+SL+aXwR+0wsbEkLdK OWq8Pg+drcenVJO6RwWUv6ztCr1hKNs2YzkRqhqN3bjP3S9DfG7KjlZA8lcflAy3+Q8A HF+3Y77RnKRkZJVhdQbrhDqRFp7ONK1hopYePeblpvK+FIrEP62pCWD2R1DsWz1fHBcB fByFJj4OUJTLDWu7DdJzMi+iYECKO/HAsB9w6/NwVS7Wjl9HifHgyK2nAvyb/I1n1E/j cTOZ/IUy2i4bMClv9Gb++GMx/QScDhEJnZJOxNPTiMFzuqJtWj4chuEbVugNbpzWcMQ9 jp1Q== 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:dkim-signature; bh=vO2ff7f+cjYtcbeBGzWru6y8NNAZmlNdhrWX/ZBZ7DE=; b=hxUp/6v5TvImBuxsk7azUutwVU5tqB8+nmW9sYfgv/CshkdIdAGfioGVZ7BItI9qFL q+PfwRf9saZ7CcWDgh/WTFsy43TmcUQEe2qBGpRqWGw0THonkqnwz97v9D6HA6/bCECf f/zMvYfWhy4NKf/xBY65UF7D7HtIF8WUuboWSSssfaP8+8BTLzCucSYV51Fp0fuEA/wN JAUGuwxzn88TW011Whnj01U6UBjdrKnHeOpdLseQOMP2kf6EfdfiCrWjv9vUVJ9fWDBx I2Bw0lmP8bCkVp3SUsK8Y4FvEVWSzjouzTSj3bV2pZLbtHVFdXZvrpTidWocWyuYBQO3 BWZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=Rlv2gthX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h189-20020a6383c6000000b0043949ac7067si13284732pge.200.2022.09.17.02.01.08; Sat, 17 Sep 2022 02:01:20 -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; dkim=pass header.i=@163.com header.s=s110527 header.b=Rlv2gthX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbiIQIk6 (ORCPT + 99 others); Sat, 17 Sep 2022 04:40:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiIQIky (ORCPT ); Sat, 17 Sep 2022 04:40:54 -0400 Received: from mail-m971.mail.163.com (mail-m971.mail.163.com [123.126.97.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 654B818B35; Sat, 17 Sep 2022 01:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=vO2ff 7f+cjYtcbeBGzWru6y8NNAZmlNdhrWX/ZBZ7DE=; b=Rlv2gthXQP/yutEvEmIMG JRGcgkdPhTXIbKSo1WPWccwfkFON3yL4tA006dk8D8N1qRnhJ6QJ+TxqD2v88fcm g6/YomqSDOzDQ6V9yPG96srFUpnmmZmbNwEY5YljUrCFOKMyZPndqUN5z4CQryF0 CX5H+LnWMlcXjzxbI26AeI= Received: from DESKTOP-CE2KKHI.localdomain (unknown [124.160.210.227]) by smtp1 (Coremail) with SMTP id GdxpCgBXHdYIiCVjibP5dQ--.36181S2; Sat, 17 Sep 2022 16:40:41 +0800 (CST) From: williamsukatube@163.com To: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Cc: William Dean Subject: [PATCH -next] cgroup: simplify code in cgroup_apply_control Date: Sat, 17 Sep 2022 16:40:39 +0800 Message-Id: <20220917084039.3177-1-williamsukatube@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: GdxpCgBXHdYIiCVjibP5dQ--.36181S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7GFWkZF43KFWxZw1DGF48JFb_yoW3Crg_Aw 1xZrsFgr92ya4jyrWqqFs8WFZ7Wrs8CF9Y9r47tFW7J3W8Grs5AwnxA3s8GrsrAa4kJFyU Cr9xGryvyrs3GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRMVyIJUUUUU== X-Originating-IP: [124.160.210.227] X-CM-SenderInfo: xzlozx5dpv3yxdwxuvi6rwjhhfrp/xtbBSQl-g1aEEv3ZsQAAsp X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 From: William Dean It could directly return 'cgroup_update_dfl_csses' to simplify code. Signed-off-by: William Dean --- kernel/cgroup/cgroup.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index e4bb5d57f4d1..1958f8bd93d6 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -3292,11 +3292,7 @@ static int cgroup_apply_control(struct cgroup *cgrp) * making the following cgroup_update_dfl_csses() properly update * css associations of all tasks in the subtree. */ - ret = cgroup_update_dfl_csses(cgrp); - if (ret) - return ret; - - return 0; + return cgroup_update_dfl_csses(cgrp); } /** -- 2.25.1