Skip to contentSkip to conversation

sched: rt: Remove unnecessary ‘NULL’ values from push_task

PATCH In review Li zeming 2 participants 2 messages May 9, 2023 – Jun 12, 2023 Scheduler

lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 sched: rt: Remove unnecessary ‘NULL’ values from push_task

push_task is assigned first, so it does not need to initialize the assignment.

---
 kernel/sched/rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/rt.c +1 -1
index 662c565745fd..55e480d5174a 100644
@@ -2073,7 +2073,7 @@ static int push_rt_task(struct rq *rq, bool pull)
 	}
 
 	if (is_migration_disabled(next_task)) {
-		struct task_struct *push_task = NULL;
+		struct task_struct *push_task;
 		int cpu;
 
 		if (!pull || rq->push_busy)
Signature · 1 line
2.18.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Li zeming

push_task is assigned first, so it does not need to initialize the assignment.

Subject would be clearer as "Remove unnecessary initialization", but regardless:

Quoted 19 lines
---
 kernel/sched/rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/rt.c +1 -2
index 662c565745fd..55e480d5174a 100644
@@ -2073,7 +2073,7 @@ static int push_rt_task(struct rq *rq, bool pull)
      }
 
      if (is_migration_disabled(next_task)) {
-		struct task_struct *push_task = NULL;
+		struct task_struct *push_task;
              int cpu;
 
              if (!pull || rq->push_busy)
--

2.18.2