]> git.dujemihanovic.xyz Git - linux.git/commitdiff
mm: shmem: use helper macro __ATTR_RW
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 22 Mar 2022 21:40:04 +0000 (14:40 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2022 22:57:02 +0000 (15:57 -0700)
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>
mm/shmem.c

index 83f99e7c00b0a0488ef5f7c5df76b1901308caa7..49447c5410d8b42aee4703df94dfa4bb8d37a026 100644 (file)
@@ -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 */