aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-14 19:05:51 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-16 13:57:36 -0400
commitb9b3259746d77f4fcb786e2a43c25bcc40773755 (patch)
tree220c5b779b174f5464ab64e68a85c1889a874b22
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
sysfs.h: add __ATTR_RW() macro
A number of parts of the kernel created their own version of this, might as well have the sysfs core provide it instead. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--include/linux/sysfs.h2
-rw-r--r--kernel/events/core.c2
-rw-r--r--mm/backing-dev.c2
3 files changed, 2 insertions, 4 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index e2cee22f578a..9cd20c8404e5 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -79,6 +79,8 @@ struct attribute_group {
79 .show = _name##_show, \ 79 .show = _name##_show, \
80} 80}
81 81
82#define __ATTR_RW(_name) __ATTR(_name, 0644, _name##_show, _name##_store)
83
82#define __ATTR_NULL { .attr = { .name = NULL } } 84#define __ATTR_NULL { .attr = { .name = NULL } }
83 85
84#ifdef CONFIG_DEBUG_LOCK_ALLOC 86#ifdef CONFIG_DEBUG_LOCK_ALLOC
diff --git a/kernel/events/core.c b/kernel/events/core.c
index eba8fb5834ae..dd9878029d1f 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6234,8 +6234,6 @@ perf_event_mux_interval_ms_store(struct device *dev,
6234 return count; 6234 return count;
6235} 6235}
6236 6236
6237#define __ATTR_RW(attr) __ATTR(attr, 0644, attr##_show, attr##_store)
6238
6239static struct device_attribute pmu_dev_attrs[] = { 6237static struct device_attribute pmu_dev_attrs[] = {
6240 __ATTR_RO(type), 6238 __ATTR_RO(type),
6241 __ATTR_RW(perf_event_mux_interval_ms), 6239 __ATTR_RW(perf_event_mux_interval_ms),
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index d014ee5fcbbd..e04454cdb33f 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -232,8 +232,6 @@ static ssize_t stable_pages_required_show(struct device *dev,
232 bdi_cap_stable_pages_required(bdi) ? 1 : 0); 232 bdi_cap_stable_pages_required(bdi) ? 1 : 0);
233} 233}
234 234
235#define __ATTR_RW(attr) __ATTR(attr, 0644, attr##_show, attr##_store)
236
237static struct device_attribute bdi_dev_attrs[] = { 235static struct device_attribute bdi_dev_attrs[] = {
238 __ATTR_RW(read_ahead_kb), 236 __ATTR_RW(read_ahead_kb),
239 __ATTR_RW(min_ratio), 237 __ATTR_RW(min_ratio),