Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187047
b: refs/heads/master
c: c9be0a3
h: refs/heads/master
i:
  187045: 83db8a5
  187043: 0b44f3d
  187039: 95c3bed
v: v3
  • Loading branch information
Andi Kleen authored and Greg Kroah-Hartman committed Mar 8, 2010
1 parent 465391e commit 492a6a1
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3d03ba4d1dd2246adff5a9ff1194a539b3bc05a7
refs/heads/master: c9be0a36f9bf392a7984473124a67a12964df11f
5 changes: 4 additions & 1 deletion trunk/arch/mips/txx9/generic/7segled.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ static ssize_t raw_store(struct sys_device *dev,
static SYSDEV_ATTR(ascii, 0200, NULL, ascii_store);
static SYSDEV_ATTR(raw, 0200, NULL, raw_store);

static ssize_t map_seg7_show(struct sysdev_class *class, char *buf)
static ssize_t map_seg7_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map));
return sizeof(txx9_seg7map);
}

static ssize_t map_seg7_store(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
const char *buf, size_t size)
{
if (size != sizeof(txx9_seg7map))
Expand Down
8 changes: 6 additions & 2 deletions trunk/arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,9 @@ int __ref smp_rescan_cpus(void)
return rc;
}

static ssize_t __ref rescan_store(struct sysdev_class *class, const char *buf,
static ssize_t __ref rescan_store(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
const char *buf,
size_t count)
{
int rc;
Expand All @@ -1041,7 +1043,9 @@ static ssize_t dispatching_show(struct sysdev_class *class, char *buf)
return count;
}

static ssize_t dispatching_store(struct sysdev_class *dev, const char *buf,
static ssize_t dispatching_store(struct sysdev_class *dev,
struct sysdev_class_attribute *attr,
const char *buf,
size_t count)
{
int val, rc;
Expand Down
49 changes: 37 additions & 12 deletions trunk/arch/s390/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,14 +1116,18 @@ static struct sys_device etr_port1_dev = {
/*
* ETR class attributes
*/
static ssize_t etr_stepping_port_show(struct sysdev_class *class, char *buf)
static ssize_t etr_stepping_port_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
return sprintf(buf, "%i\n", etr_port0.esw.p);
}

static SYSDEV_CLASS_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL);

static ssize_t etr_stepping_mode_show(struct sysdev_class *class, char *buf)
static ssize_t etr_stepping_mode_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
char *mode_str;

Expand Down Expand Up @@ -1584,7 +1588,9 @@ static struct sysdev_class stp_sysclass = {
.name = "stp",
};

static ssize_t stp_ctn_id_show(struct sysdev_class *class, char *buf)
static ssize_t stp_ctn_id_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
if (!stp_online)
return -ENODATA;
Expand All @@ -1594,7 +1600,9 @@ static ssize_t stp_ctn_id_show(struct sysdev_class *class, char *buf)

static SYSDEV_CLASS_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL);

static ssize_t stp_ctn_type_show(struct sysdev_class *class, char *buf)
static ssize_t stp_ctn_type_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
if (!stp_online)
return -ENODATA;
Expand All @@ -1603,7 +1611,9 @@ static ssize_t stp_ctn_type_show(struct sysdev_class *class, char *buf)

static SYSDEV_CLASS_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL);

static ssize_t stp_dst_offset_show(struct sysdev_class *class, char *buf)
static ssize_t stp_dst_offset_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
if (!stp_online || !(stp_info.vbits & 0x2000))
return -ENODATA;
Expand All @@ -1612,7 +1622,9 @@ static ssize_t stp_dst_offset_show(struct sysdev_class *class, char *buf)

static SYSDEV_CLASS_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL);

static ssize_t stp_leap_seconds_show(struct sysdev_class *class, char *buf)
static ssize_t stp_leap_seconds_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
if (!stp_online || !(stp_info.vbits & 0x8000))
return -ENODATA;
Expand All @@ -1621,7 +1633,9 @@ static ssize_t stp_leap_seconds_show(struct sysdev_class *class, char *buf)

static SYSDEV_CLASS_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL);

static ssize_t stp_stratum_show(struct sysdev_class *class, char *buf)
static ssize_t stp_stratum_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
if (!stp_online)
return -ENODATA;
Expand All @@ -1630,7 +1644,9 @@ static ssize_t stp_stratum_show(struct sysdev_class *class, char *buf)

static SYSDEV_CLASS_ATTR(stratum, 0400, stp_stratum_show, NULL);

static ssize_t stp_time_offset_show(struct sysdev_class *class, char *buf)
static ssize_t stp_time_offset_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
if (!stp_online || !(stp_info.vbits & 0x0800))
return -ENODATA;
Expand All @@ -1639,7 +1655,9 @@ static ssize_t stp_time_offset_show(struct sysdev_class *class, char *buf)

static SYSDEV_CLASS_ATTR(time_offset, 0400, stp_time_offset_show, NULL);

static ssize_t stp_time_zone_offset_show(struct sysdev_class *class, char *buf)
static ssize_t stp_time_zone_offset_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
if (!stp_online || !(stp_info.vbits & 0x4000))
return -ENODATA;
Expand All @@ -1649,7 +1667,9 @@ static ssize_t stp_time_zone_offset_show(struct sysdev_class *class, char *buf)
static SYSDEV_CLASS_ATTR(time_zone_offset, 0400,
stp_time_zone_offset_show, NULL);

static ssize_t stp_timing_mode_show(struct sysdev_class *class, char *buf)
static ssize_t stp_timing_mode_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
if (!stp_online)
return -ENODATA;
Expand All @@ -1658,7 +1678,9 @@ static ssize_t stp_timing_mode_show(struct sysdev_class *class, char *buf)

static SYSDEV_CLASS_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL);

static ssize_t stp_timing_state_show(struct sysdev_class *class, char *buf)
static ssize_t stp_timing_state_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
if (!stp_online)
return -ENODATA;
Expand All @@ -1667,12 +1689,15 @@ static ssize_t stp_timing_state_show(struct sysdev_class *class, char *buf)

static SYSDEV_CLASS_ATTR(timing_state, 0400, stp_timing_state_show, NULL);

static ssize_t stp_online_show(struct sysdev_class *class, char *buf)
static ssize_t stp_online_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
return sprintf(buf, "%i\n", stp_online);
}

static ssize_t stp_online_store(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
const char *buf, size_t count)
{
unsigned int value;
Expand Down
9 changes: 6 additions & 3 deletions trunk/drivers/base/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ static ssize_t print_cpus_map(char *buf, const struct cpumask *map)
}

#define print_cpus_func(type) \
static ssize_t print_cpus_##type(struct sysdev_class *class, char *buf) \
static ssize_t print_cpus_##type(struct sysdev_class *class, \
struct sysdev_class_attribute *attr, char *buf) \
{ \
return print_cpus_map(buf, cpu_##type##_mask); \
} \
Expand All @@ -165,7 +166,8 @@ print_cpus_func(present);
/*
* Print values for NR_CPUS and offlined cpus
*/
static ssize_t print_cpus_kernel_max(struct sysdev_class *class, char *buf)
static ssize_t print_cpus_kernel_max(struct sysdev_class *class,
struct sysdev_class_attribute *attr, char *buf)
{
int n = snprintf(buf, PAGE_SIZE-2, "%d\n", NR_CPUS - 1);
return n;
Expand All @@ -175,7 +177,8 @@ static SYSDEV_CLASS_ATTR(kernel_max, 0444, print_cpus_kernel_max, NULL);
/* arch-optional setting to enable display of offline cpus >= nr_cpu_ids */
unsigned int total_cpus;

static ssize_t print_cpus_offline(struct sysdev_class *class, char *buf)
static ssize_t print_cpus_offline(struct sysdev_class *class,
struct sysdev_class_attribute *attr, char *buf)
{
int n = 0, len = PAGE_SIZE-2;
cpumask_var_t offline;
Expand Down
17 changes: 12 additions & 5 deletions trunk/drivers/base/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,23 +544,29 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
return n;
}

static ssize_t print_nodes_possible(struct sysdev_class *class, char *buf)
static ssize_t print_nodes_possible(struct sysdev_class *class,
struct sysdev_class_attribute *attr, char *buf)
{
return print_nodes_state(N_POSSIBLE, buf);
}

static ssize_t print_nodes_online(struct sysdev_class *class, char *buf)
static ssize_t print_nodes_online(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
return print_nodes_state(N_ONLINE, buf);
}

static ssize_t print_nodes_has_normal_memory(struct sysdev_class *class,
char *buf)
struct sysdev_class_attribute *attr,
char *buf)
{
return print_nodes_state(N_NORMAL_MEMORY, buf);
}

static ssize_t print_nodes_has_cpu(struct sysdev_class *class, char *buf)
static ssize_t print_nodes_has_cpu(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
return print_nodes_state(N_CPU, buf);
}
Expand All @@ -573,7 +579,8 @@ static SYSDEV_CLASS_ATTR(has_cpu, 0444, print_nodes_has_cpu, NULL);

#ifdef CONFIG_HIGHMEM
static ssize_t print_nodes_has_high_memory(struct sysdev_class *class,
char *buf)
struct sysdev_class_attribute *attr,
char *buf)
{
return print_nodes_state(N_HIGH_MEMORY, buf);
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/base/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static ssize_t sysdev_class_show(struct kobject *kobj, struct attribute *attr,
struct sysdev_class_attribute *class_attr = to_sysdev_class_attr(attr);

if (class_attr->show)
return class_attr->show(class, buffer);
return class_attr->show(class, class_attr, buffer);
return -EIO;
}

Expand All @@ -100,7 +100,7 @@ static ssize_t sysdev_class_store(struct kobject *kobj, struct attribute *attr,
struct sysdev_class_attribute *class_attr = to_sysdev_class_attr(attr);

if (class_attr->store)
return class_attr->store(class, buffer, count);
return class_attr->store(class, class_attr, buffer, count);
return -EIO;
}

Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/cpuidle/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static int __init cpuidle_sysfs_setup(char *unused)
__setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup);

static ssize_t show_available_governors(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
ssize_t i = 0;
Expand All @@ -41,6 +42,7 @@ static ssize_t show_available_governors(struct sysdev_class *class,
}

static ssize_t show_current_driver(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
ssize_t ret;
Expand All @@ -56,6 +58,7 @@ static ssize_t show_current_driver(struct sysdev_class *class,
}

static ssize_t show_current_governor(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
ssize_t ret;
Expand All @@ -71,6 +74,7 @@ static ssize_t show_current_governor(struct sysdev_class *class,
}

static ssize_t store_current_governor(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
const char *buf, size_t count)
{
char gov_name[CPUIDLE_NAME_LEN];
Expand Down
6 changes: 4 additions & 2 deletions trunk/include/linux/sysdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ struct sysdev_class {

struct sysdev_class_attribute {
struct attribute attr;
ssize_t (*show)(struct sysdev_class *, char *);
ssize_t (*store)(struct sysdev_class *, const char *, size_t);
ssize_t (*show)(struct sysdev_class *, struct sysdev_class_attribute *,
char *);
ssize_t (*store)(struct sysdev_class *, struct sysdev_class_attribute *,
const char *, size_t);
};

#define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
Expand Down
13 changes: 10 additions & 3 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -5481,13 +5481,16 @@ void __init perf_event_init(void)
register_cpu_notifier(&perf_cpu_nb);
}

static ssize_t perf_show_reserve_percpu(struct sysdev_class *class, char *buf)
static ssize_t perf_show_reserve_percpu(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
return sprintf(buf, "%d\n", perf_reserved_percpu);
}

static ssize_t
perf_set_reserve_percpu(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
const char *buf,
size_t count)
{
Expand Down Expand Up @@ -5516,13 +5519,17 @@ perf_set_reserve_percpu(struct sysdev_class *class,
return count;
}

static ssize_t perf_show_overcommit(struct sysdev_class *class, char *buf)
static ssize_t perf_show_overcommit(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *buf)
{
return sprintf(buf, "%d\n", perf_overcommit);
}

static ssize_t
perf_set_overcommit(struct sysdev_class *class, const char *buf, size_t count)
perf_set_overcommit(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
const char *buf, size_t count)
{
unsigned long val;
int err;
Expand Down
4 changes: 4 additions & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -7406,11 +7406,13 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt)

#ifdef CONFIG_SCHED_MC
static ssize_t sched_mc_power_savings_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
char *page)
{
return sprintf(page, "%u\n", sched_mc_power_savings);
}
static ssize_t sched_mc_power_savings_store(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
const char *buf, size_t count)
{
return sched_power_savings_store(buf, count, 0);
Expand All @@ -7422,11 +7424,13 @@ static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644,

#ifdef CONFIG_SCHED_SMT
static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev,
struct sysdev_class_attribute *attr,
char *page)
{
return sprintf(page, "%u\n", sched_smt_power_savings);
}
static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev,
struct sysdev_class_attribute *attr,
const char *buf, size_t count)
{
return sched_power_savings_store(buf, count, 1);
Expand Down

0 comments on commit 492a6a1

Please sign in to comment.