OSDN Git Service

sched/core: Remove unused variable from set_user_nice()
authorQian Cai <cai@lca.pw>
Thu, 19 Dec 2019 14:03:14 +0000 (09:03 -0500)
committerIngo Molnar <mingo@kernel.org>
Wed, 25 Dec 2019 09:42:06 +0000 (10:42 +0100)
This commit left behind an unused variable:

  5443a0be6121 ("sched: Use fair:prio_changed() instead of ad-hoc implementation") left behind an unused variable.

  kernel/sched/core.c: In function 'set_user_nice':
  kernel/sched/core.c:4507:16: warning: variable 'delta' set but not used
    int old_prio, delta;
                ^~~~~

Signed-off-by: Qian Cai <cai@lca.pw>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 5443a0be6121 ("sched: Use fair:prio_changed() instead of ad-hoc implementation")
Link: https://lkml.kernel.org/r/20191219140314.1252-1-cai@lca.pw
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/core.c

index 15508c2..1f6c094 100644 (file)
@@ -4504,7 +4504,7 @@ static inline int rt_effective_prio(struct task_struct *p, int prio)
 void set_user_nice(struct task_struct *p, long nice)
 {
        bool queued, running;
-       int old_prio, delta;
+       int old_prio;
        struct rq_flags rf;
        struct rq *rq;
 
@@ -4538,7 +4538,6 @@ void set_user_nice(struct task_struct *p, long nice)
        set_load_weight(p, true);
        old_prio = p->prio;
        p->prio = effective_prio(p);
-       delta = p->prio - old_prio;
 
        if (queued)
                enqueue_task(rq, p, ENQUEUE_RESTORE | ENQUEUE_NOCLOCK);