From patchwork Sat Jul 1 07:38:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 115008 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp10897016vqr; Sat, 1 Jul 2023 01:04:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5X5id2oj8ep7tDzN2XlKy1cnQ5EsZrHNvnB5F+lkQ5DlYd5UASBiT/JnDqm5Vx3XIjHIOZ X-Received: by 2002:a5d:9601:0:b0:77a:c741:b749 with SMTP id w1-20020a5d9601000000b0077ac741b749mr4967597iol.1.1688198676611; Sat, 01 Jul 2023 01:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688198676; cv=none; d=google.com; s=arc-20160816; b=cyCkZ/2teFx8y5jyDj7tROuCaA6MKlsUCAYKDN8QK/YB5CmZqI93f9prPRKTU3I1fZ Mv+AKuhrh/1h9oMkl2C5OvhdnjA/M6uMCTcqgR9C2bI9CDK5K3f4OpNvbPQaGzYKu7JR 7VOKwTvFN4IZJWAPk1b11S210tkonLfKMGoZ01K/6wKUrwce2s8Pe4j2ufjJ3k6zIVri ak2tdhglfljqSv5XyKX7xC1poU5WF+mofmdZAJKdf0SKpw81X0/cHiDnEvPZ8/aMCygC JYQ+oTHP/OdsJFHbzMmVPQaan4uDTgFhCZ0rY/QWbmvwIbL29J12p45U3ZuzQgNRimGg wfiQ== 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=VYaot9a6LTC4ap0a0DDTSfvsDq/vrJkA8HTxWBCJTh4=; fh=/oR+NcEnzekdk9My/33KlMJIJsUMb/9hQpen5cpkHSY=; b=ocEkXINzTbhNJ7CUvBe5lOrkIe0fAosKVIHyvuNqcBtZAqBN/YPsHbz1a6PLBJtZ5E 2bSKS79i6/72X6/zK8cNdA8VQ4cordQaOnSASl/KezA4S2/u3b8lpeflgJvwwrZ6JOPv aF6JeOI8NBiRrvrkNshYHPz+6o+FiC1IStYKH/Fb+E67kWeznj6Vpy0CfpnWC0KR72hW KFycwNKfBiVRHq1CKKwg8BQ6+KsydYOOyWysYUZnx8Uuf4klXe9cL/tWWQBHOvDONK2g Ru976e6e6fPacLGO9L31u3NWwtpHmJGtCyAJWzNJoyqaq7fS2I0oEIw6QJkRvaIu//Kx yhsw== 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 y64-20020a638a43000000b0054fd4d7d642si13610785pgd.4.2023.07.01.01.04.23; Sat, 01 Jul 2023 01:04:36 -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 S229665AbjGAHik (ORCPT + 99 others); Sat, 1 Jul 2023 03:38:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbjGAHih (ORCPT ); Sat, 1 Jul 2023 03:38:37 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCA11199; Sat, 1 Jul 2023 00:38:34 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QtPCx4LL3zTknD; Sat, 1 Jul 2023 15:37:33 +0800 (CST) Received: from huawei.com (10.174.151.185) 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.27; Sat, 1 Jul 2023 15:38:29 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH] cgroup: remove unneeded return value of cgroup_rm_cftypes_locked() Date: Sat, 1 Jul 2023 15:38:56 +0800 Message-ID: <20230701073856.2095425-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) 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, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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?1770204615515806947?= X-GMAIL-MSGID: =?utf-8?q?1770204615515806947?= The return value of cgroup_rm_cftypes_locked() is always 0. So remove it to simplify the code. No functional change intended. Signed-off-by: Miaohe Lin Reviewed-by: Michal Koutný --- kernel/cgroup/cgroup.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index bfe3cd8ccf36..b0d98542eea2 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -4320,14 +4320,13 @@ static int cgroup_init_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) return ret; } -static int cgroup_rm_cftypes_locked(struct cftype *cfts) +static void cgroup_rm_cftypes_locked(struct cftype *cfts) { lockdep_assert_held(&cgroup_mutex); list_del(&cfts->node); cgroup_apply_cftypes(cfts, false); cgroup_exit_cftypes(cfts); - return 0; } /** @@ -4343,8 +4342,6 @@ static int cgroup_rm_cftypes_locked(struct cftype *cfts) */ int cgroup_rm_cftypes(struct cftype *cfts) { - int ret; - if (!cfts || cfts[0].name[0] == '\0') return 0; @@ -4352,9 +4349,9 @@ int cgroup_rm_cftypes(struct cftype *cfts) return -ENOENT; cgroup_lock(); - ret = cgroup_rm_cftypes_locked(cfts); + cgroup_rm_cftypes_locked(cfts); cgroup_unlock(); - return ret; + return 0; } /**