Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp251468rdh; Thu, 23 Nov 2023 03:07:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8eFhkPJF0RiK9Du6aprgl96aRHdi2xt7S1DGYdzdRK+ytC7FvLRq6SN/EfB2wigy0U+Bt X-Received: by 2002:a05:6a20:2619:b0:187:b7eb:944d with SMTP id i25-20020a056a20261900b00187b7eb944dmr4151890pze.13.1700737627509; Thu, 23 Nov 2023 03:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700737627; cv=none; d=google.com; s=arc-20160816; b=gRXjaD17H7t0ffnpA0bLMBWocf7epnx3rZQkYv3E7ACXeBw86GBLnh+I1eg4cYaeBS Ck+sqMjMxyiMfBKreHqg8yYDmYLmPp6cq2deA+kP0rYbABWSUO8SH8IP60bjIoCPjY9v IZhkKtT7FpMdRN9pzpIoDP/tOwsldJKTE+MtNvptnifCosjgNfYE1wrCagSrPCb/hBCc DeLu9J9tEk8bcZiY7hJJ7mgjB2Zu+umMMvl1e2HLrJRv4Q1+vnSLCEjA0GKEaDXWCoJy lTHni/GFa1IVipW85txpww+h2e+WdOwEL49mRM1X86PoHyGrv3i9cIH1NXtK5TNavXY7 mTgg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=66QoIwlhXMaKA+3kmTVbGKHGQoZNECyuuRe1FSCD1jY=; fh=TVF/ZsHt3bxRzFOIn6fcgDTEV6FaGOs0DFr4KT/S8uU=; b=xpYVGnZZanG8ykTrKnXhHJPzHMaRH8wNI3JmklJBZIqIp4BnfHqjbrud34/3YeBn6I mrFJqyIoZEspLB5+RUkOTb+UbMzNUXsKKSXiDkP7fCw0M+jtMv4oJGSPsjk+QgxtPX4O oBTcdXSWCfrXL357lZszDwUmj5dRuOyDUdt6Hh3GQ4g7qXehP8PcU96QmUBTmJAASFRn Uabey/e5beYGvc0miVFiyYl1oRIY0dun4FMjYWvu2bKBMQs9hhila8JQ/q+rHuDix1G8 zcD7Nqj2AXsIYyxRpaZ5m+J3aDNUYl8VDTOSsbRBABxJglNAQzTy5FIbe/MNOZG/hr6L 960w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b4qyrx9u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id l12-20020a056a00140c00b006b261e83225si1028025pfu.310.2023.11.23.03.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 03:07:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b4qyrx9u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 81CAA809214B; Thu, 23 Nov 2023 03:06:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235192AbjKWLFt (ORCPT + 99 others); Thu, 23 Nov 2023 06:05:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344979AbjKWLFf (ORCPT ); Thu, 23 Nov 2023 06:05:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22F4DD59 for ; Thu, 23 Nov 2023 03:05:41 -0800 (PST) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 03:06:15 -0800 (PST) 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); -- 2.39.2