sched: core: Simplify sched_can_stop_tick()

Message ID 20230429002831.2875-1-zeming@nfschina.com
State New
Headers
Series sched: core: Simplify sched_can_stop_tick() |

Commit Message

Li zeming April 29, 2023, 12:28 a.m. UTC
  Remove useless intermediate variable "fifo_nr_running".

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 kernel/sched/core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Patch

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3249c1272e57..1bab401920e8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1176,8 +1176,6 @@  static void nohz_csd_func(void *info)
 #ifdef CONFIG_NO_HZ_FULL
 bool sched_can_stop_tick(struct rq *rq)
 {
-	int fifo_nr_running;
-
 	/* Deadline tasks, even if single, need the tick */
 	if (rq->dl.dl_nr_running)
 		return false;
@@ -1197,8 +1195,7 @@  bool sched_can_stop_tick(struct rq *rq)
 	 * If there's no RR tasks, but FIFO tasks, we can skip the tick, no
 	 * forced preemption between FIFO tasks.
 	 */
-	fifo_nr_running = rq->rt.rt_nr_running - rq->rt.rr_nr_running;
-	if (fifo_nr_running)
+	if (rq->rt.rt_nr_running - rq->rt.rr_nr_running)
 		return true;
 
 	/*