From patchwork Thu Jul 6 09:42:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 116599 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2441793vqx; Thu, 6 Jul 2023 03:03:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlGWSl5uTp+agtQAsJqj6LV+8XwE1TiVsl8EmjYx3nam01agwNn31nzx8MDRrkO6/FjqA7AM X-Received: by 2002:a17:902:f54a:b0:1b5:5162:53bd with SMTP id h10-20020a170902f54a00b001b5516253bdmr1962734plf.33.1688637813237; Thu, 06 Jul 2023 03:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688637813; cv=none; d=google.com; s=arc-20160816; b=ofnTKguN02n6fDqOJJPyUKwl2et1zWgIyCx/fJCOGkKiMUHmitKhbqPqGJmG3rvYpW jsI90HqLPA5LngS9vRpG2kNdckrZlRCxpOKLU9vIJEhaU745aSiRJbHoO37hz9MvyI/x pA2YSKUuxAecy4LZ2PubU4RhF9cCnE/Nzylbt2H9Mk+7OnQvWgZVb9/OiY8jFrSbqSOF jMWOLo4YRZ7XgkVKFLzfYWBJghDPmbo7owG1EC46oMH7ztZmMgdAY4Y5ZJTQCTyxm6Fr pPXsbxZJyaFnaCw4/6308uJyhJdePP7JNCJK7iQp1jtEQ1gfxfXrnKecNpZpJquTzpI0 YTcw== 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=W1+3MILF7e0XWr54Q/fLRykzZwEna7Y45h9YM9at1OE=; fh=pZWOv2pRkfQFUJ1QSi9xw43l3YtSwTmReJZNUnZfmEA=; b=EBqmvROTCbil2Jt4lGgSMDADdXbW5PcpZCHcgs/VciOXdQOvFSpptBN8PkcZYS9waT sonehnh3mRHrdarNeo4GoojKJGe9/bO0AOiD549MHVM7f3Les1nJ3QzKP+xIfQKKMryK uVoiUai+jYDqRqpTPKFE017sSRF3z1RQprQXM/E4I/tnGw9CsdQm39dJ4sTvvvp825cD yVG8QVRDONsHWblwSvAFGfCpmHhlHN0U2kW6lG9QaL3svwZs6O+vtvV/hQZOa1n/VH4j mpuzBko/Mrb3EPOzuykKQuvxzg2q1b3l/3tMCcxoICjta3LBQNdZd51UGrQkxaesRi6Y YtxQ== 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 im22-20020a170902bb1600b001b8aeb3a6cesi941643plb.351.2023.07.06.03.03.18; Thu, 06 Jul 2023 03:03: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 S231367AbjGFJm0 (ORCPT + 99 others); Thu, 6 Jul 2023 05:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjGFJmZ (ORCPT ); Thu, 6 Jul 2023 05:42:25 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C54801727; Thu, 6 Jul 2023 02:42:23 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QxWkP2wlGzTmH6; Thu, 6 Jul 2023 17:41:17 +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; Thu, 6 Jul 2023 17:42:21 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH] cgroup: minor cleanup for cgroup_extra_stat_show() Date: Thu, 6 Jul 2023 17:42:42 +0800 Message-ID: <20230706094242.1707709-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: dggems706-chm.china.huawei.com (10.3.19.183) 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?1770665083517519195?= X-GMAIL-MSGID: =?utf-8?q?1770665083517519195?= Make it under CONFIG_CGROUP_SCHED to rid of __maybe_unused annotation. And further fetch cgrp inside cgroup_extra_stat_show() directly to rid of __maybe_unused annotation of cgrp. No functional change intended. Signed-off-by: Miaohe Lin --- kernel/cgroup/cgroup.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index bfe3cd8ccf36..b990eda6b3cd 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -3654,9 +3654,10 @@ static int cgroup_stat_show(struct seq_file *seq, void *v) return 0; } -static int __maybe_unused cgroup_extra_stat_show(struct seq_file *seq, - struct cgroup *cgrp, int ssid) +#ifdef CONFIG_CGROUP_SCHED +static int cgroup_extra_stat_show(struct seq_file *seq, int ssid) { + struct cgroup *cgrp = seq_css(seq)->cgroup; struct cgroup_subsys *ss = cgroup_subsys[ssid]; struct cgroup_subsys_state *css; int ret; @@ -3672,15 +3673,15 @@ static int __maybe_unused cgroup_extra_stat_show(struct seq_file *seq, css_put(css); return ret; } +#endif static int cpu_stat_show(struct seq_file *seq, void *v) { - struct cgroup __maybe_unused *cgrp = seq_css(seq)->cgroup; int ret = 0; cgroup_base_stat_cputime_show(seq); #ifdef CONFIG_CGROUP_SCHED - ret = cgroup_extra_stat_show(seq, cgrp, cpu_cgrp_id); + ret = cgroup_extra_stat_show(seq, cpu_cgrp_id); #endif return ret; }