diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/cpu.c | 9 | ||||
-rw-r--r-- | drivers/base/node.c | 17 | ||||
-rw-r--r-- | drivers/base/sys.c | 4 |
3 files changed, 20 insertions, 10 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 958bd1540c30..fd1b2f9b7b8f 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
@@ -151,7 +151,8 @@ static ssize_t print_cpus_map(char *buf, const struct cpumask *map) | |||
151 | } | 151 | } |
152 | 152 | ||
153 | #define print_cpus_func(type) \ | 153 | #define print_cpus_func(type) \ |
154 | static ssize_t print_cpus_##type(struct sysdev_class *class, char *buf) \ | 154 | static ssize_t print_cpus_##type(struct sysdev_class *class, \ |
155 | struct sysdev_class_attribute *attr, char *buf) \ | ||
155 | { \ | 156 | { \ |
156 | return print_cpus_map(buf, cpu_##type##_mask); \ | 157 | return print_cpus_map(buf, cpu_##type##_mask); \ |
157 | } \ | 158 | } \ |
@@ -165,7 +166,8 @@ print_cpus_func(present); | |||
165 | /* | 166 | /* |
166 | * Print values for NR_CPUS and offlined cpus | 167 | * Print values for NR_CPUS and offlined cpus |
167 | */ | 168 | */ |
168 | static ssize_t print_cpus_kernel_max(struct sysdev_class *class, char *buf) | 169 | static ssize_t print_cpus_kernel_max(struct sysdev_class *class, |
170 | struct sysdev_class_attribute *attr, char *buf) | ||
169 | { | 171 | { |
170 | int n = snprintf(buf, PAGE_SIZE-2, "%d\n", NR_CPUS - 1); | 172 | int n = snprintf(buf, PAGE_SIZE-2, "%d\n", NR_CPUS - 1); |
171 | return n; | 173 | return n; |
@@ -175,7 +177,8 @@ static SYSDEV_CLASS_ATTR(kernel_max, 0444, print_cpus_kernel_max, NULL); | |||
175 | /* arch-optional setting to enable display of offline cpus >= nr_cpu_ids */ | 177 | /* arch-optional setting to enable display of offline cpus >= nr_cpu_ids */ |
176 | unsigned int total_cpus; | 178 | unsigned int total_cpus; |
177 | 179 | ||
178 | static ssize_t print_cpus_offline(struct sysdev_class *class, char *buf) | 180 | static ssize_t print_cpus_offline(struct sysdev_class *class, |
181 | struct sysdev_class_attribute *attr, char *buf) | ||
179 | { | 182 | { |
180 | int n = 0, len = PAGE_SIZE-2; | 183 | int n = 0, len = PAGE_SIZE-2; |
181 | cpumask_var_t offline; | 184 | cpumask_var_t offline; |
diff --git a/drivers/base/node.c b/drivers/base/node.c index 70122791683d..85c9d30d7004 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
@@ -544,23 +544,29 @@ static ssize_t print_nodes_state(enum node_states state, char *buf) | |||
544 | return n; | 544 | return n; |
545 | } | 545 | } |
546 | 546 | ||
547 | static ssize_t print_nodes_possible(struct sysdev_class *class, char *buf) | 547 | static ssize_t print_nodes_possible(struct sysdev_class *class, |
548 | struct sysdev_class_attribute *attr, char *buf) | ||
548 | { | 549 | { |
549 | return print_nodes_state(N_POSSIBLE, buf); | 550 | return print_nodes_state(N_POSSIBLE, buf); |
550 | } | 551 | } |
551 | 552 | ||
552 | static ssize_t print_nodes_online(struct sysdev_class *class, char *buf) | 553 | static ssize_t print_nodes_online(struct sysdev_class *class, |
554 | struct sysdev_class_attribute *attr, | ||
555 | char *buf) | ||
553 | { | 556 | { |
554 | return print_nodes_state(N_ONLINE, buf); | 557 | return print_nodes_state(N_ONLINE, buf); |
555 | } | 558 | } |
556 | 559 | ||
557 | static ssize_t print_nodes_has_normal_memory(struct sysdev_class *class, | 560 | static ssize_t print_nodes_has_normal_memory(struct sysdev_class *class, |
558 | char *buf) | 561 | struct sysdev_class_attribute *attr, |
562 | char *buf) | ||
559 | { | 563 | { |
560 | return print_nodes_state(N_NORMAL_MEMORY, buf); | 564 | return print_nodes_state(N_NORMAL_MEMORY, buf); |
561 | } | 565 | } |
562 | 566 | ||
563 | static ssize_t print_nodes_has_cpu(struct sysdev_class *class, char *buf) | 567 | static ssize_t print_nodes_has_cpu(struct sysdev_class *class, |
568 | struct sysdev_class_attribute *attr, | ||
569 | char *buf) | ||
564 | { | 570 | { |
565 | return print_nodes_state(N_CPU, buf); | 571 | return print_nodes_state(N_CPU, buf); |
566 | } | 572 | } |
@@ -573,7 +579,8 @@ static SYSDEV_CLASS_ATTR(has_cpu, 0444, print_nodes_has_cpu, NULL); | |||
573 | 579 | ||
574 | #ifdef CONFIG_HIGHMEM | 580 | #ifdef CONFIG_HIGHMEM |
575 | static ssize_t print_nodes_has_high_memory(struct sysdev_class *class, | 581 | static ssize_t print_nodes_has_high_memory(struct sysdev_class *class, |
576 | char *buf) | 582 | struct sysdev_class_attribute *attr, |
583 | char *buf) | ||
577 | { | 584 | { |
578 | return print_nodes_state(N_HIGH_MEMORY, buf); | 585 | return print_nodes_state(N_HIGH_MEMORY, buf); |
579 | } | 586 | } |
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 0d903909af7e..a38445c0f8c5 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
@@ -89,7 +89,7 @@ static ssize_t sysdev_class_show(struct kobject *kobj, struct attribute *attr, | |||
89 | struct sysdev_class_attribute *class_attr = to_sysdev_class_attr(attr); | 89 | struct sysdev_class_attribute *class_attr = to_sysdev_class_attr(attr); |
90 | 90 | ||
91 | if (class_attr->show) | 91 | if (class_attr->show) |
92 | return class_attr->show(class, buffer); | 92 | return class_attr->show(class, class_attr, buffer); |
93 | return -EIO; | 93 | return -EIO; |
94 | } | 94 | } |
95 | 95 | ||
@@ -100,7 +100,7 @@ static ssize_t sysdev_class_store(struct kobject *kobj, struct attribute *attr, | |||
100 | struct sysdev_class_attribute *class_attr = to_sysdev_class_attr(attr); | 100 | struct sysdev_class_attribute *class_attr = to_sysdev_class_attr(attr); |
101 | 101 | ||
102 | if (class_attr->store) | 102 | if (class_attr->store) |
103 | return class_attr->store(class, buffer, count); | 103 | return class_attr->store(class, class_attr, buffer, count); |
104 | return -EIO; | 104 | return -EIO; |
105 | } | 105 | } |
106 | 106 | ||