Merge branch 'x86-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / kernel / sched / debug.c
index b0212f4..60caf1f 100644 (file)
@@ -111,20 +111,19 @@ static int sched_feat_set(char *cmp)
                cmp += 3;
        }
 
-       for (i = 0; i < __SCHED_FEAT_NR; i++) {
-               if (strcmp(cmp, sched_feat_names[i]) == 0) {
-                       if (neg) {
-                               sysctl_sched_features &= ~(1UL << i);
-                               sched_feat_disable(i);
-                       } else {
-                               sysctl_sched_features |= (1UL << i);
-                               sched_feat_enable(i);
-                       }
-                       break;
-               }
+       i = match_string(sched_feat_names, __SCHED_FEAT_NR, cmp);
+       if (i < 0)
+               return i;
+
+       if (neg) {
+               sysctl_sched_features &= ~(1UL << i);
+               sched_feat_disable(i);
+       } else {
+               sysctl_sched_features |= (1UL << i);
+               sched_feat_enable(i);
        }
 
-       return i;
+       return 0;
 }
 
 static ssize_t
@@ -133,7 +132,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
 {
        char buf[64];
        char *cmp;
-       int i;
+       int ret;
        struct inode *inode;
 
        if (cnt > 63)
@@ -148,10 +147,10 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
        /* Ensure the static_key remains in a consistent state */
        inode = file_inode(filp);
        inode_lock(inode);
-       i = sched_feat_set(cmp);
+       ret = sched_feat_set(cmp);
        inode_unlock(inode);
-       if (i == __SCHED_FEAT_NR)
-               return -EINVAL;
+       if (ret < 0)
+               return ret;
 
        *ppos += cnt;
 
@@ -841,8 +840,8 @@ void print_numa_stats(struct seq_file *m, int node, unsigned long tsf,
                unsigned long tpf, unsigned long gsf, unsigned long gpf)
 {
        SEQ_printf(m, "numa_faults node=%d ", node);
-       SEQ_printf(m, "task_private=%lu task_shared=%lu ", tsf, tpf);
-       SEQ_printf(m, "group_private=%lu group_shared=%lu\n", gsf, gpf);
+       SEQ_printf(m, "task_private=%lu task_shared=%lu ", tpf, tsf);
+       SEQ_printf(m, "group_private=%lu group_shared=%lu\n", gpf, gsf);
 }
 #endif