2023-05-22 20:01:43

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 1/5] sched: hide unused sched_update_scaling()

From: Arnd Bergmann <[email protected]>

This function is only used when CONFIG_SMP is enabled, without that there
is no caller and no prototype:

kernel/sched/fair.c:688:5: error: no previous prototype for 'sched_update_scaling' [-Werror=missing-prototypes

Hide the definition in the same #ifdef check as the declaration.

Fixes: 8a99b6833c88 ("sched: Move SCHED_DEBUG sysctl to debugfs")
Signed-off-by: Arnd Bergmann <[email protected]>
---
kernel/sched/fair.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 48b6f0ca13ac..2c1b345c3b8d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -684,7 +684,7 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
/**************************************************************
* Scheduling class statistics methods:
*/
-
+#ifdef CONFIG_SMP
int sched_update_scaling(void)
{
unsigned int factor = get_update_sysctl_factor();
@@ -702,6 +702,7 @@ int sched_update_scaling(void)
return 0;
}
#endif
+#endif

/*
* delta /= w
--
2.39.2



2023-05-23 06:57:29

by Mukesh Ojha

[permalink] [raw]
Subject: Re: [PATCH 1/5] sched: hide unused sched_update_scaling()



On 5/23/2023 1:20 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> This function is only used when CONFIG_SMP is enabled, without that there
> is no caller and no prototype:
>
> kernel/sched/fair.c:688:5: error: no previous prototype for 'sched_update_scaling' [-Werror=missing-prototypes
>
> Hide the definition in the same #ifdef check as the declaration.
>
> Fixes: 8a99b6833c88 ("sched: Move SCHED_DEBUG sysctl to debugfs")
> Signed-off-by: Arnd Bergmann <[email protected]>

LGTM, thanks.
Reviewed-by: Mukesh Ojha <[email protected]>

-- Mukesh

> ---
> kernel/sched/fair.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 48b6f0ca13ac..2c1b345c3b8d 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -684,7 +684,7 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
> /**************************************************************
> * Scheduling class statistics methods:
> */
> -
> +#ifdef CONFIG_SMP
> int sched_update_scaling(void)
> {
> unsigned int factor = get_update_sysctl_factor();
> @@ -702,6 +702,7 @@ int sched_update_scaling(void)
> return 0;
> }
> #endif
> +#endif
>
> /*
> * delta /= w

Subject: [tip: sched/core] sched: Hide unused sched_update_scaling()

The following commit has been merged into the sched/core branch of tip:

Commit-ID: d55ebae3f3122b07689cc4c34043114e09ce904c
Gitweb: https://git.kernel.org/tip/d55ebae3f3122b07689cc4c34043114e09ce904c
Author: Arnd Bergmann <[email protected]>
AuthorDate: Mon, 22 May 2023 21:50:17 +02:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Tue, 30 May 2023 22:46:24 +02:00

sched: Hide unused sched_update_scaling()

This function is only used when CONFIG_SMP is enabled, without that there
is no caller and no prototype:

kernel/sched/fair.c:688:5: error: no previous prototype for 'sched_update_scaling' [-Werror=missing-prototypes

Hide the definition in the same #ifdef check as the declaration.

Fixes: 8a99b6833c88 ("sched: Move SCHED_DEBUG sysctl to debugfs")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Vincent Guittot <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
kernel/sched/fair.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 48b6f0c..2c1b345 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -684,7 +684,7 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
/**************************************************************
* Scheduling class statistics methods:
*/
-
+#ifdef CONFIG_SMP
int sched_update_scaling(void)
{
unsigned int factor = get_update_sysctl_factor();
@@ -702,6 +702,7 @@ int sched_update_scaling(void)
return 0;
}
#endif
+#endif

/*
* delta /= w