From patchwork Thu Nov 23 11:05:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1867720 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=XCkvDbZp; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=b4qyrx9u; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SbZzn1Lfzz1yR8 for ; Thu, 23 Nov 2023 22:06:13 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tBdpkjPrHOnuWKpQuygpruD0Rf9kH7F7QCmev8cL3eU=; b=XCkvDbZpuIh1Qx X0J6M2e+wuHRAtbQVTd8FMVYSEh/H7nhqK0zjKNzAWh2d80H5N2PbgdcTtAFAyd5ZNlMNjtJXEF/g DLg5oHfkLLJW+dCV0oPXgZBbhcOBMxc6Drcd4DQbZssy7Slcjep/c41bAle0iLczUC4lul7uwpQJE 2XrahlQEEMIWvETp8YwTjfHXuytzhAWJvxscEVm12i0OnkkHXs7q1KlrvPcaEnHwQZbdGwEaSHpL3 3TN1fE4maTlEi/ssZ4vm5CEH+kYQzNYAveJyVfXvniH4YlK8Wmgg9IpaK+uMnT2qHvAudGdi/SO3Q bw/jVlAJrwxNKsT1wPGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r67Wk-004Smv-3C; Thu, 23 Nov 2023 11:05:47 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r67Wh-004SkX-1w for linux-mtd@lists.infradead.org; Thu, 23 Nov 2023 11:05:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 186D6B82B67; Thu, 23 Nov 2023 11:05:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CE8AC433C9; Thu, 23 Nov 2023 11:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700737541; bh=tQoPadTOpEfcWFltgm4ylsWb6Qh7U5RzNAmqeA9wbms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b4qyrx9uuOYtARoBjjr3USSBbEXBVLT5+2YQt8UDuwSWOOjf/oxUtL6+Qaqgn1lHY U1iMAw+0oevXiM45qg8DWQRguuekx5nG/LH4T/UrhEC9jYaJLhnCSes0KEHDGJepMW EZa2UdrCcQC7mzu1KF1jgmLnI5rAwETjdiH0Pqww7458j+MaIjCDMCNfxUjRlNQ/f2 8QTqlMhE7BjvuWSLJEVDbQdNeHo+BAi/qGOnoD8MmIyKDc7pbImozDFyxKcmWK29M/ 8PW4kzF/3W9218KayKV8Z84KdQ6I+BiL/C/tm2vM4TkwgwH7TMj15madZX6mZcV3O9 R96xC7kcdciaA== From: Arnd Bergmann To: Andrew Morton Cc: Arnd Bergmann , "David S. Miller" , David Woodhouse , Dinh Nguyen , Greg Kroah-Hartman , Ivan Kokshaysky , John Paul Adrian Glaubitz , Michael Ellerman , Masahiro Yamada , Matt Turner , Nathan Chancellor , Nicolas Schier , Peter Zijlstra , Rich Felker , Richard Henderson , Richard Weinberger , Stephen Rothwell , Thomas Bogendoerfer , Tudor Ambarus , Yoshinori Sato , linux-arch@vger.kernel.org, linux-alpha@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mtd@lists.infradead.org, linux-sh@vger.kernel.org, linux-usb@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org Subject: [PATCH v3 3/6] sched: fair: move unused stub functions to header Date: Thu, 23 Nov 2023 12:05:03 +0100 Message-Id: <20231123110506.707903-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231123110506.707903-1-arnd@kernel.org> References: <20231123110506.707903-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_030543_902495_54E2E866 X-CRM114-Status: GOOD ( 15.88 ) X-Spam-Score: -2.7 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2604:1380:4601:e00:0:0:0:1 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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=1 warning: kernel/sched/fair.c:12544:6: error: no previous prototype for 'free_fair_sched_group' kernel/sched/fair.c:12546:5: error: no previous prototype for 'alloc_fair_sched_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_fair_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. [A different patch with the same description got applied by accident and was later reverted, but the original patch is still missing] Fixes: 7aa55f2a5902 ("sched/fair: Move unused stub functions to header") Signed-off-by: Arnd Bergmann --- 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 07f555857698..cb68d71c81bc 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -13040,19 +13040,6 @@ int sched_group_set_idle(struct task_group *tg, long idle) return 0; } -#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 *parent) -{ - 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 */ diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 8a70d51ffa33..eb7e07a1abcc 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -461,10 +461,21 @@ static inline int walk_tg_tree(tg_visitor down, tg_visitor up, void *data) extern int tg_nop(struct task_group *tg, void *data); +#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 task_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);