From nobody Sun Feb 8 05:26:54 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4AD8C7EE23 for ; Mon, 22 May 2023 19:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235507AbjEVTvF (ORCPT ); Mon, 22 May 2023 15:51:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235464AbjEVTu4 (ORCPT ); Mon, 22 May 2023 15:50:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73ECD186 for ; Mon, 22 May 2023 12:50:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2D99B62B11 for ; Mon, 22 May 2023 19:50:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07C60C4339C; Mon, 22 May 2023 19:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684785047; bh=HMrD03u6K+/VHY9xLyPNlLoBBgFtU0+LXebB+R5ntic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HNu10GzquFi3F4cNVyQ1jrCdEeHnO6oQz6W7NEDY7Zexxuma26WWwjKScT2y5r3gM 8WsSXdHyHdKtReVJHbcwXGRWG2KdH3Pi11K4jC37/lg22XdEBuLaaGvsp/4JIHdNt4 092IEA1A311rNFqt1q15Va0jBoFf/JfpYyukqK/chrbCP44M6q57SFcUb9ptS97AKg 2dnRww6uM1CtyJlz5pXVBAlcY46/bKd44rCJ+gmdsmsiyu/IlaWRZvfUt7TptpNTux trWOOmDVhJoXtJ7DVc9Fp0BewdU2zK45qipleGrWesGm0WHUFWbI7skAi+i0CAZZoq NC5p/CLXv9pRw== From: Arnd Bergmann To: Ingo Molnar , Peter Zijlstra Cc: Arnd Bergmann , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org Subject: [PATCH 5/5] sched: fair: move unused stub functions to header Date: Mon, 22 May 2023 21:50:21 +0200 Message-Id: <20230522195021.3456768-6-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522195021.3456768-1-arnd@kernel.org> References: <20230522195021.3456768-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann These four functions have a normal definition for CONFIG_FAIR_GROUP_SCHED, and empty one that is only referenced when FAIR_GROUP_SCHED is disabled but CGROUP_SCHED is still enabled. If both are turned off, the functions are still defined but the misisng prototype causes a W=3D1 warning: kernel/sched/fair.c:12544:6: error: no previous prototype for 'free_fair_sc= hed_group' kernel/sched/fair.c:12546:5: error: no previous prototype for 'alloc_fair_s= ched_group' kernel/sched/fair.c:12553:6: error: no previous prototype for 'online_fair_= sched_group' kernel/sched/fair.c:12555:6: error: no previous prototype for 'unregister_f= air_sched_group' Move the alternatives into the header as static inline functions with the correct combination of #ifdef checks to avoid the warning without adding even more complexity. Signed-off-by: Arnd Bergmann Reviewed-by: Mukesh Ojha --- kernel/sched/fair.c | 13 ------------- kernel/sched/sched.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a7a8ccde3bd7..bae8907c1635 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12602,19 +12602,6 @@ int sched_group_set_idle(struct task_group *tg, lo= ng idle) return 0; } =20 -#else /* CONFIG_FAIR_GROUP_SCHED */ - -void free_fair_sched_group(struct task_group *tg) { } - -int alloc_fair_sched_group(struct task_group *tg, struct task_group *paren= t) -{ - return 1; -} - -void online_fair_sched_group(struct task_group *tg) { } - -void unregister_fair_sched_group(struct task_group *tg) { } - #endif /* CONFIG_FAIR_GROUP_SCHED */ =20 =20 diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index d5ac0af1eede..0584fa15ffeb 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -453,10 +453,21 @@ static inline int walk_tg_tree(tg_visitor down, tg_vi= sitor up, void *data) =20 extern int tg_nop(struct task_group *tg, void *data); =20 +#ifdef CONFIG_FAIR_GROUP_SCHED extern void free_fair_sched_group(struct task_group *tg); extern int alloc_fair_sched_group(struct task_group *tg, struct task_group= *parent); extern void online_fair_sched_group(struct task_group *tg); extern void unregister_fair_sched_group(struct task_group *tg); +#else +static inline void free_fair_sched_group(struct task_group *tg) { } +static inline int alloc_fair_sched_group(struct task_group *tg, struct tas= k_group *parent) +{ + return 1; +} +static inline void online_fair_sched_group(struct task_group *tg) { } +static inline void unregister_fair_sched_group(struct task_group *tg) { } +#endif + extern void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq, struct sched_entity *se, int cpu, struct sched_entity *parent); --=20 2.39.2