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

Message ID 20230510235417.3061-1-zeming@nfschina.com
State New
Headers
Series sched: rt: Remove unnecessary ‘NULL’ values from push_task |

Commit Message

Li zeming May 10, 2023, 11:54 p.m. UTC
  push_task is assigned first, so it does not need to initialize the
assignment.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 kernel/sched/rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Valentin Schneider June 12, 2023, 9:21 a.m. UTC | #1
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 <zeming@nfschina.com>

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

Reviewed-by: Valentin Schneider <vschneid@redhat.com>

> ---
>  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
  

Patch

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)