sched: Clean up parameter passing of proc_sched_autogroup_set_nice()
[firefly-linux-kernel-4.4.55.git] / kernel / sched / auto_group.c
index e8a1f83ee0e7ce629852458ceccea42d3b2a40c3..0984a21076a3ed8a37e56d5381bff6320d8fa5f2 100644 (file)
@@ -195,20 +195,20 @@ __setup("noautogroup", setup_autogroup);
 
 #ifdef CONFIG_PROC_FS
 
-int proc_sched_autogroup_set_nice(struct task_struct *p, int *nice)
+int proc_sched_autogroup_set_nice(struct task_struct *p, int nice)
 {
        static unsigned long next = INITIAL_JIFFIES;
        struct autogroup *ag;
        int err;
 
-       if (*nice < -20 || *nice > 19)
+       if (nice < -20 || nice > 19)
                return -EINVAL;
 
-       err = security_task_setnice(current, *nice);
+       err = security_task_setnice(current, nice);
        if (err)
                return err;
 
-       if (*nice < 0 && !can_nice(current, *nice))
+       if (nice < 0 && !can_nice(current, nice))
                return -EPERM;
 
        /* this is a heavy operation taking global locks.. */
@@ -219,9 +219,9 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int *nice)
        ag = autogroup_task_get(p);
 
        down_write(&ag->lock);
-       err = sched_group_set_shares(ag->tg, prio_to_weight[*nice + 20]);
+       err = sched_group_set_shares(ag->tg, prio_to_weight[nice + 20]);
        if (!err)
-               ag->nice = *nice;
+               ag->nice = nice;
        up_write(&ag->lock);
 
        autogroup_kref_put(ag);