diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-13 05:50:25 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-13 05:50:25 -0500 |
commit | 29c0177e6a4ac094302bed54a1d4bbb6b740a9ef (patch) | |
tree | d8ee57c5b40baa3f53d607b719344dd20f8c85a0 /kernel | |
parent | 98a79d6a50181ca1ecf7400eda01d5dc1bc0dbf0 (diff) |
cpumask: change cpumask_scnprintf, cpumask_parse_user, cpulist_parse, and cpulist_scnprintf to take pointers.
Impact: change calling convention of existing cpumask APIs
Most cpumask functions started with cpus_: these have been replaced by
cpumask_ ones which take struct cpumask pointers as expected.
These four functions don't have good replacement names; fortunately
they're rarely used, so we just change them over.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: paulus@samba.org
Cc: mingo@redhat.com
Cc: tony.luck@intel.com
Cc: ralf@linux-mips.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: cl@linux-foundation.org
Cc: srostedt@redhat.com
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 4 | ||||
-rw-r--r-- | kernel/irq/proc.c | 4 | ||||
-rw-r--r-- | kernel/profile.c | 4 | ||||
-rw-r--r-- | kernel/sched.c | 4 | ||||
-rw-r--r-- | kernel/sched_stats.h | 2 | ||||
-rw-r--r-- | kernel/taskstats.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace.c | 4 |
7 files changed, 12 insertions, 12 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 96c0ba13b8cd..39c1a4c1c5a9 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -896,7 +896,7 @@ static int update_cpumask(struct cpuset *cs, const char *buf) | |||
896 | if (!*buf) { | 896 | if (!*buf) { |
897 | cpus_clear(trialcs.cpus_allowed); | 897 | cpus_clear(trialcs.cpus_allowed); |
898 | } else { | 898 | } else { |
899 | retval = cpulist_parse(buf, trialcs.cpus_allowed); | 899 | retval = cpulist_parse(buf, &trialcs.cpus_allowed); |
900 | if (retval < 0) | 900 | if (retval < 0) |
901 | return retval; | 901 | return retval; |
902 | 902 | ||
@@ -1482,7 +1482,7 @@ static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs) | |||
1482 | mask = cs->cpus_allowed; | 1482 | mask = cs->cpus_allowed; |
1483 | mutex_unlock(&callback_mutex); | 1483 | mutex_unlock(&callback_mutex); |
1484 | 1484 | ||
1485 | return cpulist_scnprintf(page, PAGE_SIZE, mask); | 1485 | return cpulist_scnprintf(page, PAGE_SIZE, &mask); |
1486 | } | 1486 | } |
1487 | 1487 | ||
1488 | static int cpuset_sprintf_memlist(char *page, struct cpuset *cs) | 1488 | static int cpuset_sprintf_memlist(char *page, struct cpuset *cs) |
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index d257e7d6a8a4..f293349d49d0 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c | |||
@@ -47,7 +47,7 @@ static ssize_t irq_affinity_proc_write(struct file *file, | |||
47 | irq_balancing_disabled(irq)) | 47 | irq_balancing_disabled(irq)) |
48 | return -EIO; | 48 | return -EIO; |
49 | 49 | ||
50 | err = cpumask_parse_user(buffer, count, new_value); | 50 | err = cpumask_parse_user(buffer, count, &new_value); |
51 | if (err) | 51 | if (err) |
52 | return err; | 52 | return err; |
53 | 53 | ||
@@ -95,7 +95,7 @@ static ssize_t default_affinity_write(struct file *file, | |||
95 | cpumask_t new_value; | 95 | cpumask_t new_value; |
96 | int err; | 96 | int err; |
97 | 97 | ||
98 | err = cpumask_parse_user(buffer, count, new_value); | 98 | err = cpumask_parse_user(buffer, count, &new_value); |
99 | if (err) | 99 | if (err) |
100 | return err; | 100 | return err; |
101 | 101 | ||
diff --git a/kernel/profile.c b/kernel/profile.c index dc41827fbfee..7d620dfdde59 100644 --- a/kernel/profile.c +++ b/kernel/profile.c | |||
@@ -442,7 +442,7 @@ void profile_tick(int type) | |||
442 | static int prof_cpu_mask_read_proc(char *page, char **start, off_t off, | 442 | static int prof_cpu_mask_read_proc(char *page, char **start, off_t off, |
443 | int count, int *eof, void *data) | 443 | int count, int *eof, void *data) |
444 | { | 444 | { |
445 | int len = cpumask_scnprintf(page, count, *(cpumask_t *)data); | 445 | int len = cpumask_scnprintf(page, count, (cpumask_t *)data); |
446 | if (count - len < 2) | 446 | if (count - len < 2) |
447 | return -EINVAL; | 447 | return -EINVAL; |
448 | len += sprintf(page + len, "\n"); | 448 | len += sprintf(page + len, "\n"); |
@@ -456,7 +456,7 @@ static int prof_cpu_mask_write_proc(struct file *file, | |||
456 | unsigned long full_count = count, err; | 456 | unsigned long full_count = count, err; |
457 | cpumask_t new_value; | 457 | cpumask_t new_value; |
458 | 458 | ||
459 | err = cpumask_parse_user(buffer, count, new_value); | 459 | err = cpumask_parse_user(buffer, count, &new_value); |
460 | if (err) | 460 | if (err) |
461 | return err; | 461 | return err; |
462 | 462 | ||
diff --git a/kernel/sched.c b/kernel/sched.c index e4bb1dd7b308..d2d16d1273b1 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -6666,7 +6666,7 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level, | |||
6666 | struct sched_group *group = sd->groups; | 6666 | struct sched_group *group = sd->groups; |
6667 | char str[256]; | 6667 | char str[256]; |
6668 | 6668 | ||
6669 | cpulist_scnprintf(str, sizeof(str), sd->span); | 6669 | cpulist_scnprintf(str, sizeof(str), &sd->span); |
6670 | cpus_clear(*groupmask); | 6670 | cpus_clear(*groupmask); |
6671 | 6671 | ||
6672 | printk(KERN_DEBUG "%*s domain %d: ", level, "", level); | 6672 | printk(KERN_DEBUG "%*s domain %d: ", level, "", level); |
@@ -6720,7 +6720,7 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level, | |||
6720 | 6720 | ||
6721 | cpus_or(*groupmask, *groupmask, group->cpumask); | 6721 | cpus_or(*groupmask, *groupmask, group->cpumask); |
6722 | 6722 | ||
6723 | cpulist_scnprintf(str, sizeof(str), group->cpumask); | 6723 | cpulist_scnprintf(str, sizeof(str), &group->cpumask); |
6724 | printk(KERN_CONT " %s", str); | 6724 | printk(KERN_CONT " %s", str); |
6725 | 6725 | ||
6726 | group = group->next; | 6726 | group = group->next; |
diff --git a/kernel/sched_stats.h b/kernel/sched_stats.h index 7dbf72a2b02c..6beff1e4eeae 100644 --- a/kernel/sched_stats.h +++ b/kernel/sched_stats.h | |||
@@ -42,7 +42,7 @@ static int show_schedstat(struct seq_file *seq, void *v) | |||
42 | for_each_domain(cpu, sd) { | 42 | for_each_domain(cpu, sd) { |
43 | enum cpu_idle_type itype; | 43 | enum cpu_idle_type itype; |
44 | 44 | ||
45 | cpumask_scnprintf(mask_str, mask_len, sd->span); | 45 | cpumask_scnprintf(mask_str, mask_len, &sd->span); |
46 | seq_printf(seq, "domain%d %s", dcount++, mask_str); | 46 | seq_printf(seq, "domain%d %s", dcount++, mask_str); |
47 | for (itype = CPU_IDLE; itype < CPU_MAX_IDLE_TYPES; | 47 | for (itype = CPU_IDLE; itype < CPU_MAX_IDLE_TYPES; |
48 | itype++) { | 48 | itype++) { |
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index bd6be76303cf..6d7dc4ec4aa5 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
@@ -352,7 +352,7 @@ static int parse(struct nlattr *na, cpumask_t *mask) | |||
352 | if (!data) | 352 | if (!data) |
353 | return -ENOMEM; | 353 | return -ENOMEM; |
354 | nla_strlcpy(data, na, len); | 354 | nla_strlcpy(data, na, len); |
355 | ret = cpulist_parse(data, *mask); | 355 | ret = cpulist_parse(data, mask); |
356 | kfree(data); | 356 | kfree(data); |
357 | return ret; | 357 | return ret; |
358 | } | 358 | } |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index d86e3252f300..d2e75479dc50 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2126,7 +2126,7 @@ tracing_cpumask_read(struct file *filp, char __user *ubuf, | |||
2126 | 2126 | ||
2127 | mutex_lock(&tracing_cpumask_update_lock); | 2127 | mutex_lock(&tracing_cpumask_update_lock); |
2128 | 2128 | ||
2129 | len = cpumask_scnprintf(mask_str, count, tracing_cpumask); | 2129 | len = cpumask_scnprintf(mask_str, count, &tracing_cpumask); |
2130 | if (count - len < 2) { | 2130 | if (count - len < 2) { |
2131 | count = -EINVAL; | 2131 | count = -EINVAL; |
2132 | goto out_err; | 2132 | goto out_err; |
@@ -2147,7 +2147,7 @@ tracing_cpumask_write(struct file *filp, const char __user *ubuf, | |||
2147 | int err, cpu; | 2147 | int err, cpu; |
2148 | 2148 | ||
2149 | mutex_lock(&tracing_cpumask_update_lock); | 2149 | mutex_lock(&tracing_cpumask_update_lock); |
2150 | err = cpumask_parse_user(ubuf, count, tracing_cpumask_new); | 2150 | err = cpumask_parse_user(ubuf, count, &tracing_cpumask_new); |
2151 | if (err) | 2151 | if (err) |
2152 | goto err_unlock; | 2152 | goto err_unlock; |
2153 | 2153 | ||