Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36219852rwd; Mon, 10 Jul 2023 20:30:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlGXG9WgJ2eHi/nP1LEAm0fuFzGDe3Bx15k+tLEwZ8k6wjTxkUvmwHmAFqa3wiCDkghW1+23 X-Received: by 2002:a2e:8809:0:b0:2b7:15d:24 with SMTP id x9-20020a2e8809000000b002b7015d0024mr11719816ljh.41.1689046236242; Mon, 10 Jul 2023 20:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689046236; cv=none; d=google.com; s=arc-20160816; b=OXbMSgdLA0uwzt4iNu9B68ok8hVlrPjirHMG6iu+NoYaTW74sZLfXS2/twzm0XIjR1 tBdvi/gnJR3baIHc8zueOMx/R3z0+6p8HqwqhpJGgh6h1aYTBy5vpQno9w7JSlg9UoxY aTcv/GsOAdULOJwaQaWPsQt5LUmHD2TlZ0YGjXaDOene8DZ31B1Pe3Ij5EJyYznycnIr X8+BJBGu4GWIRRLM5QdeIdZl95vaEIrD9vabRhZufia0HcuRNYIldlhhgopvSFzvukik FhGC3mjU0cB3VMqL2j28/uLkZw9Lsa5SAIoKM77aiij5L/PyWgDQDn8Wak0N9F7gzBAr q01g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=GTz1vWf5DJRjTGGlM+rU9OZ+m9BxrATRDHpgNU+7iU8=; fh=EIr5iKR3gxNZB3ZyyYc2owdMbX6wiMBOyhaPna+rKeA=; b=dnUzr7PFwa7Dk2ATZyD1EjAtoOq8uyka1xSbDtHncftaB89n5CyC6qk68NE4jmnsjR /n0fOZcvGFh4iGTEja/r6baeAI4cyEwWdrUiVrewYvEyqFh6JB8rLrkOOeqZo3JS8ATd zjou30MygT5bcdip2IK5Wo+Fi3mQ+TKG8jfoAffk4yuVLZq1bXAUutUCCW+4cr6CnDFy 2DTBgOWuQih51eh5M0Zd4Zli674/Wkq8o+4PnmNtkpPwDSFpQiOnM9Pz2TmHgxmuitJG YFNeAgiCU3P2+xEkaRMwVjFlvu5/iAdeFJCv+VpE07we9GOlqHkRiksIqOh3pBe4yoOw OS6Q== 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 i21-20020a1709061cd500b009871456e3cdsi1166139ejh.439.2023.07.10.20.30.11; Mon, 10 Jul 2023 20:30: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 S229924AbjGKC7A (ORCPT + 99 others); Mon, 10 Jul 2023 22:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjGKC66 (ORCPT ); Mon, 10 Jul 2023 22:58:58 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D449E7C; Mon, 10 Jul 2023 19:58:52 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R0QVH1Q4LztR8t; Tue, 11 Jul 2023 10:55:51 +0800 (CST) Received: from [10.174.151.185] (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; Tue, 11 Jul 2023 10:58:48 +0800 Subject: Re: [PATCH] cgroup: remove unneeded return value of cgroup_rm_cftypes_locked() To: =?UTF-8?Q?Michal_Koutn=c3=bd?= CC: , , , , References: <20230701073856.2095425-1-linmiaohe@huawei.com> From: Miaohe Lin Message-ID: <7d3323ab-f796-6846-ab08-5d48734595e1@huawei.com> Date: Tue, 11 Jul 2023 10:58:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 On 2023/7/10 23:46, Michal Koutn? wrote: > Hi. > > On Sat, Jul 01, 2023 at 03:38:56PM +0800, Miaohe Lin wrote: >> The return value of cgroup_rm_cftypes_locked() is always 0. So remove >> it to simplify the code. No functional change intended. > > I'd add a comment that it builds upon cgroup_addrm_files()'s: Do you mean something like below: diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index b0d98542eea2..2c02f319a7d4 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -4320,6 +4320,7 @@ static int cgroup_init_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) return ret; } +/* It builds upon cgroup_addrm_files()'s. */ static void cgroup_rm_cftypes_locked(struct cftype *cfts) { lockdep_assert_held(&cgroup_mutex); >> For removals, this function never fails. > >> Signed-off-by: Miaohe Lin >> --- >> kernel/cgroup/cgroup.c | 9 +++------ >> 1 file changed, 3 insertions(+), 6 deletions(-) > > Reviewed-by: Michal Koutn? Thanks for review and suggestion.