2023-05-09 07:47:42

by Li zeming

[permalink] [raw]
Subject: [PATCH] sched: rt: Remove unnecessary ‘NULL’ values from push_task

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

Signed-off-by: Li zeming <[email protected]>
---
kernel/sched/rt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 662c565745fd..55e480d5174a 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -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


2023-06-12 09:33:38

by Valentin Schneider

[permalink] [raw]
Subject: Re: [PATCH] sched: rt: Remove unnecessary ‘NULL’ values from push_task

On 11/05/23 07:54, Li zeming wrote:
> push_task is assigned first, so it does not need to initialize the
> assignment.
>
> Signed-off-by: Li zeming <[email protected]>

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

Reviewed-by: Valentin Schneider <[email protected]>

> ---
> kernel/sched/rt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 662c565745fd..55e480d5174a 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -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