2022-04-22 17:29:11

by kunyu

[permalink] [raw]
Subject: [PATCH] sched: Optimize unused integer return values

sched: Optimize unused integer return values

Signed-off-by: Li kunyu<[email protected]>
---
kernel/sched/core.c | 3 +--
kernel/sched/sched.h | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 51efaabac3e4..a71d09d6bb75 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5491,11 +5491,10 @@ static void sched_tick_stop(int cpu)
}
#endif /* CONFIG_HOTPLUG_CPU */

-int __init sched_tick_offload_init(void)
+void __init sched_tick_offload_init(void)
{
tick_work_cpu = alloc_percpu(struct tick_work);
BUG_ON(!tick_work_cpu);
- return 0;
}

#else /* !CONFIG_NO_HZ_FULL */
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 8dccb34eb190..850e25f7460d 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2326,7 +2326,7 @@ extern void post_init_entity_util_avg(struct task_struct *p);

#ifdef CONFIG_NO_HZ_FULL
extern bool sched_can_stop_tick(struct rq *rq);
-extern int __init sched_tick_offload_init(void);
+extern void __init sched_tick_offload_init(void);

/*
* Tick may be needed by tasks in the runqueue depending on their policy and
@@ -2346,7 +2346,7 @@ static inline void sched_update_tick_dependency(struct rq *rq)
tick_nohz_dep_set_cpu(cpu, TICK_DEP_BIT_SCHED);
}
#else
-static inline int sched_tick_offload_init(void) { return 0; }
+static inline void sched_tick_offload_init(void) { }
static inline void sched_update_tick_dependency(struct rq *rq) { }
#endif

--
2.18.2