diff options
author | YueHaibing <yuehaibing@huawei.com> | 2021-07-01 03:50:48 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-07-01 05:47:29 +0200 |
commit | 17adb230d6a6e39f9ba39440ee8441291795dff4 (patch) | |
tree | c8687ef2fda2f649b3b73fd5575663cd342bb9fa /mm/compaction.c | |
parent | mm/zbud: don't export any zbud API (diff) | |
download | linux-17adb230d6a6e39f9ba39440ee8441291795dff4.tar.xz linux-17adb230d6a6e39f9ba39440ee8441291795dff4.zip |
mm/compaction: use DEVICE_ATTR_WO macro
Use DEVICE_ATTR_WO helper instead of plain DEVICE_ATTR, which makes the
code a bit shorter and easier to read.
Link: https://lkml.kernel.org/r/20210523064521.32912-1-yuehaibing@huawei.com
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 7d41b58fb17c..b7fb991dee1b 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2722,9 +2722,9 @@ int sysctl_compaction_handler(struct ctl_table *table, int write, } #if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA) -static ssize_t sysfs_compact_node(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t compact_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) { int nid = dev->id; @@ -2737,7 +2737,7 @@ static ssize_t sysfs_compact_node(struct device *dev, return count; } -static DEVICE_ATTR(compact, 0200, NULL, sysfs_compact_node); +static DEVICE_ATTR_WO(compact); int compaction_register_node(struct node *node) { |