summaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2022-03-22 22:40:04 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-22 23:57:02 +0100
commit4bfa8ada803af1d073c76b43d079eee72a1d442a (patch)
tree8e23b5ad7c6ceff17537208c97a5ef7c1e9b8945 /mm/shmem.c
parenttmpfs: do not allocate pages on read (diff)
downloadlinux-4bfa8ada803af1d073c76b43d079eee72a1d442a.tar.xz
linux-4bfa8ada803af1d073c76b43d079eee72a1d442a.zip
mm: shmem: use helper macro __ATTR_RW
Use helper macro __ATTR_RW to define shmem_enabled_attr to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220312082252.55586-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 83f99e7c00b0..49447c5410d8 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3965,8 +3965,7 @@ static ssize_t shmem_enabled_store(struct kobject *kobj,
return count;
}
-struct kobj_attribute shmem_enabled_attr =
- __ATTR(shmem_enabled, 0644, shmem_enabled_show, shmem_enabled_store);
+struct kobj_attribute shmem_enabled_attr = __ATTR_RW(shmem_enabled);
#endif /* CONFIG_TRANSPARENT_HUGEPAGE && CONFIG_SYSFS */
#else /* !CONFIG_SHMEM */