aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-12-13 05:50:25 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-12-13 05:50:25 -0500
commit29c0177e6a4ac094302bed54a1d4bbb6b740a9ef (patch)
treed8ee57c5b40baa3f53d607b719344dd20f8c85a0
parent98a79d6a50181ca1ecf7400eda01d5dc1bc0dbf0 (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
-rw-r--r--arch/ia64/kernel/topology.c2
-rw-r--r--arch/mips/kernel/smp-cmp.c4
-rw-r--r--arch/powerpc/platforms/pseries/xics.c2
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c4
-rw-r--r--arch/x86/kernel/setup_percpu.c2
-rw-r--r--drivers/base/cpu.c2
-rw-r--r--drivers/base/node.c4
-rw-r--r--drivers/base/topology.c4
-rw-r--r--drivers/pci/pci-sysfs.c4
-rw-r--r--drivers/pci/probe.c4
-rw-r--r--include/linux/cpumask.h87
-rw-r--r--kernel/cpuset.c4
-rw-r--r--kernel/irq/proc.c4
-rw-r--r--kernel/profile.c4
-rw-r--r--kernel/sched.c4
-rw-r--r--kernel/sched_stats.h2
-rw-r--r--kernel/taskstats.c2
-rw-r--r--kernel/trace/trace.c4
-rw-r--r--mm/slub.c2
19 files changed, 86 insertions, 59 deletions
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index c75b914f2d6b..a8d61a3e9a94 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -219,7 +219,7 @@ static ssize_t show_shared_cpu_map(struct cache_info *this_leaf, char *buf)
219 cpumask_t shared_cpu_map; 219 cpumask_t shared_cpu_map;
220 220
221 cpus_and(shared_cpu_map, this_leaf->shared_cpu_map, cpu_online_map); 221 cpus_and(shared_cpu_map, this_leaf->shared_cpu_map, cpu_online_map);
222 len = cpumask_scnprintf(buf, NR_CPUS+1, shared_cpu_map); 222 len = cpumask_scnprintf(buf, NR_CPUS+1, &shared_cpu_map);
223 len += sprintf(buf+len, "\n"); 223 len += sprintf(buf+len, "\n");
224 return len; 224 return len;
225} 225}
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c
index 6789c1a12120..f27beca4b26d 100644
--- a/arch/mips/kernel/smp-cmp.c
+++ b/arch/mips/kernel/smp-cmp.c
@@ -51,10 +51,10 @@ static int __init allowcpus(char *str)
51 int len; 51 int len;
52 52
53 cpus_clear(cpu_allow_map); 53 cpus_clear(cpu_allow_map);
54 if (cpulist_parse(str, cpu_allow_map) == 0) { 54 if (cpulist_parse(str, &cpu_allow_map) == 0) {
55 cpu_set(0, cpu_allow_map); 55 cpu_set(0, cpu_allow_map);
56 cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map); 56 cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map);
57 len = cpulist_scnprintf(buf, sizeof(buf)-1, cpu_possible_map); 57 len = cpulist_scnprintf(buf, sizeof(buf)-1, &cpu_possible_map);
58 buf[len] = '\0'; 58 buf[len] = '\0';
59 pr_debug("Allowable CPUs: %s\n", buf); 59 pr_debug("Allowable CPUs: %s\n", buf);
60 return 1; 60 return 1;
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index e1904774a70f..64d24310ce7e 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -358,7 +358,7 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
358 irq_server = get_irq_server(virq, 1); 358 irq_server = get_irq_server(virq, 1);
359 if (irq_server == -1) { 359 if (irq_server == -1) {
360 char cpulist[128]; 360 char cpulist[128];
361 cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask); 361 cpumask_scnprintf(cpulist, sizeof(cpulist), &cpumask);
362 printk(KERN_WARNING 362 printk(KERN_WARNING
363 "%s: No online cpus in the mask %s for irq %d\n", 363 "%s: No online cpus in the mask %s for irq %d\n",
364 __func__, cpulist, virq); 364 __func__, cpulist, virq);
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 3f46afbb1cf1..43ea612d3e9d 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -626,8 +626,8 @@ static ssize_t show_shared_cpu_map_func(struct _cpuid4_info *this_leaf,
626 cpumask_t *mask = &this_leaf->shared_cpu_map; 626 cpumask_t *mask = &this_leaf->shared_cpu_map;
627 627
628 n = type? 628 n = type?
629 cpulist_scnprintf(buf, len-2, *mask): 629 cpulist_scnprintf(buf, len-2, mask) :
630 cpumask_scnprintf(buf, len-2, *mask); 630 cpumask_scnprintf(buf, len-2, mask);
631 buf[n++] = '\n'; 631 buf[n++] = '\n';
632 buf[n] = '\0'; 632 buf[n] = '\0';
633 } 633 }
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index ae0c0d3bb770..1c2084291f97 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -282,7 +282,7 @@ static void __cpuinit numa_set_cpumask(int cpu, int enable)
282 else 282 else
283 cpu_clear(cpu, *mask); 283 cpu_clear(cpu, *mask);
284 284
285 cpulist_scnprintf(buf, sizeof(buf), *mask); 285 cpulist_scnprintf(buf, sizeof(buf), mask);
286 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n", 286 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
287 enable? "numa_add_cpu":"numa_remove_cpu", cpu, node, buf); 287 enable? "numa_add_cpu":"numa_remove_cpu", cpu, node, buf);
288 } 288 }
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 64f5d54f7edc..4259072f5bd0 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -109,7 +109,7 @@ static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL);
109 */ 109 */
110static ssize_t print_cpus_map(char *buf, cpumask_t *map) 110static ssize_t print_cpus_map(char *buf, cpumask_t *map)
111{ 111{
112 int n = cpulist_scnprintf(buf, PAGE_SIZE-2, *map); 112 int n = cpulist_scnprintf(buf, PAGE_SIZE-2, map);
113 113
114 buf[n++] = '\n'; 114 buf[n++] = '\n';
115 buf[n] = '\0'; 115 buf[n] = '\0';
diff --git a/drivers/base/node.c b/drivers/base/node.c
index f5207090885a..91636cd8b6c9 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -30,8 +30,8 @@ static ssize_t node_read_cpumap(struct sys_device *dev, int type, char *buf)
30 BUILD_BUG_ON((NR_CPUS/32 * 9) > (PAGE_SIZE-1)); 30 BUILD_BUG_ON((NR_CPUS/32 * 9) > (PAGE_SIZE-1));
31 31
32 len = type? 32 len = type?
33 cpulist_scnprintf(buf, PAGE_SIZE-2, *mask): 33 cpulist_scnprintf(buf, PAGE_SIZE-2, mask) :
34 cpumask_scnprintf(buf, PAGE_SIZE-2, *mask); 34 cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
35 buf[len++] = '\n'; 35 buf[len++] = '\n';
36 buf[len] = '\0'; 36 buf[len] = '\0';
37 return len; 37 return len;
diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index 199cd97e32e6..a8bc1cbcfa7c 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -49,8 +49,8 @@ static ssize_t show_cpumap(int type, cpumask_t *mask, char *buf)
49 49
50 if (len > 1) { 50 if (len > 1) {
51 n = type? 51 n = type?
52 cpulist_scnprintf(buf, len-2, *mask): 52 cpulist_scnprintf(buf, len-2, mask) :
53 cpumask_scnprintf(buf, len-2, *mask); 53 cpumask_scnprintf(buf, len-2, mask);
54 buf[n++] = '\n'; 54 buf[n++] = '\n';
55 buf[n] = '\0'; 55 buf[n] = '\0';
56 } 56 }
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 5d72866897a8..c88485860a0a 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -74,7 +74,7 @@ static ssize_t local_cpus_show(struct device *dev,
74 int len; 74 int len;
75 75
76 mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); 76 mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
77 len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask); 77 len = cpumask_scnprintf(buf, PAGE_SIZE-2, &mask);
78 buf[len++] = '\n'; 78 buf[len++] = '\n';
79 buf[len] = '\0'; 79 buf[len] = '\0';
80 return len; 80 return len;
@@ -88,7 +88,7 @@ static ssize_t local_cpulist_show(struct device *dev,
88 int len; 88 int len;
89 89
90 mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); 90 mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
91 len = cpulist_scnprintf(buf, PAGE_SIZE-2, mask); 91 len = cpulist_scnprintf(buf, PAGE_SIZE-2, &mask);
92 buf[len++] = '\n'; 92 buf[len++] = '\n';
93 buf[len] = '\0'; 93 buf[len] = '\0';
94 return len; 94 return len;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 003a9b3c293f..5b3f5937ecf5 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -55,8 +55,8 @@ static ssize_t pci_bus_show_cpuaffinity(struct device *dev,
55 55
56 cpumask = pcibus_to_cpumask(to_pci_bus(dev)); 56 cpumask = pcibus_to_cpumask(to_pci_bus(dev));
57 ret = type? 57 ret = type?
58 cpulist_scnprintf(buf, PAGE_SIZE-2, cpumask): 58 cpulist_scnprintf(buf, PAGE_SIZE-2, &cpumask) :
59 cpumask_scnprintf(buf, PAGE_SIZE-2, cpumask); 59 cpumask_scnprintf(buf, PAGE_SIZE-2, &cpumask);
60 buf[ret++] = '\n'; 60 buf[ret++] = '\n';
61 buf[ret] = '\0'; 61 buf[ret] = '\0';
62 return ret; 62 return ret;
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 21e1dd43e52a..94a2ab88ae85 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -339,36 +339,6 @@ extern cpumask_t cpu_mask_all;
339#endif 339#endif
340#define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v) 340#define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v)
341 341
342#define cpumask_scnprintf(buf, len, src) \
343 __cpumask_scnprintf((buf), (len), &(src), NR_CPUS)
344static inline int __cpumask_scnprintf(char *buf, int len,
345 const cpumask_t *srcp, int nbits)
346{
347 return bitmap_scnprintf(buf, len, srcp->bits, nbits);
348}
349
350#define cpumask_parse_user(ubuf, ulen, dst) \
351 __cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS)
352static inline int __cpumask_parse_user(const char __user *buf, int len,
353 cpumask_t *dstp, int nbits)
354{
355 return bitmap_parse_user(buf, len, dstp->bits, nbits);
356}
357
358#define cpulist_scnprintf(buf, len, src) \
359 __cpulist_scnprintf((buf), (len), &(src), NR_CPUS)
360static inline int __cpulist_scnprintf(char *buf, int len,
361 const cpumask_t *srcp, int nbits)
362{
363 return bitmap_scnlistprintf(buf, len, srcp->bits, nbits);
364}
365
366#define cpulist_parse(buf, dst) __cpulist_parse((buf), &(dst), NR_CPUS)
367static inline int __cpulist_parse(const char *buf, cpumask_t *dstp, int nbits)
368{
369 return bitmap_parselist(buf, dstp->bits, nbits);
370}
371
372#define cpu_remap(oldbit, old, new) \ 342#define cpu_remap(oldbit, old, new) \
373 __cpu_remap((oldbit), &(old), &(new), NR_CPUS) 343 __cpu_remap((oldbit), &(old), &(new), NR_CPUS)
374static inline int __cpu_remap(int oldbit, 344static inline int __cpu_remap(int oldbit,
@@ -946,6 +916,63 @@ static inline void cpumask_copy(struct cpumask *dstp,
946#define cpumask_of(cpu) (get_cpu_mask(cpu)) 916#define cpumask_of(cpu) (get_cpu_mask(cpu))
947 917
948/** 918/**
919 * cpumask_scnprintf - print a cpumask into a string as comma-separated hex
920 * @buf: the buffer to sprintf into
921 * @len: the length of the buffer
922 * @srcp: the cpumask to print
923 *
924 * If len is zero, returns zero. Otherwise returns the length of the
925 * (nul-terminated) @buf string.
926 */
927static inline int cpumask_scnprintf(char *buf, int len,
928 const struct cpumask *srcp)
929{
930 return bitmap_scnprintf(buf, len, srcp->bits, nr_cpumask_bits);
931}
932
933/**
934 * cpumask_parse_user - extract a cpumask from a user string
935 * @buf: the buffer to extract from
936 * @len: the length of the buffer
937 * @dstp: the cpumask to set.
938 *
939 * Returns -errno, or 0 for success.
940 */
941static inline int cpumask_parse_user(const char __user *buf, int len,
942 struct cpumask *dstp)
943{
944 return bitmap_parse_user(buf, len, dstp->bits, nr_cpumask_bits);
945}
946
947/**
948 * cpulist_scnprintf - print a cpumask into a string as comma-separated list
949 * @buf: the buffer to sprintf into
950 * @len: the length of the buffer
951 * @srcp: the cpumask to print
952 *
953 * If len is zero, returns zero. Otherwise returns the length of the
954 * (nul-terminated) @buf string.
955 */
956static inline int cpulist_scnprintf(char *buf, int len,
957 const struct cpumask *srcp)
958{
959 return bitmap_scnlistprintf(buf, len, srcp->bits, nr_cpumask_bits);
960}
961
962/**
963 * cpulist_parse_user - extract a cpumask from a user string of ranges
964 * @buf: the buffer to extract from
965 * @len: the length of the buffer
966 * @dstp: the cpumask to set.
967 *
968 * Returns -errno, or 0 for success.
969 */
970static inline int cpulist_parse(const char *buf, struct cpumask *dstp)
971{
972 return bitmap_parselist(buf, dstp->bits, nr_cpumask_bits);
973}
974
975/**
949 * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * 976 * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask *
950 * @bitmap: the bitmap 977 * @bitmap: the bitmap
951 * 978 *
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
1488static int cpuset_sprintf_memlist(char *page, struct cpuset *cs) 1488static 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)
442static int prof_cpu_mask_read_proc(char *page, char **start, off_t off, 442static 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
diff --git a/mm/slub.c b/mm/slub.c
index a2cd47d89e0a..8e516e29f989 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3626,7 +3626,7 @@ static int list_locations(struct kmem_cache *s, char *buf,
3626 len < PAGE_SIZE - 60) { 3626 len < PAGE_SIZE - 60) {
3627 len += sprintf(buf + len, " cpus="); 3627 len += sprintf(buf + len, " cpus=");
3628 len += cpulist_scnprintf(buf + len, PAGE_SIZE - len - 50, 3628 len += cpulist_scnprintf(buf + len, PAGE_SIZE - len - 50,
3629 l->cpus); 3629 &l->cpus);
3630 } 3630 }
3631 3631
3632 if (num_online_nodes() > 1 && !nodes_empty(l->nodes) && 3632 if (num_online_nodes() > 1 && !nodes_empty(l->nodes) &&