Commit 0a1345f8 authored by Yevgen Pronenko's avatar Yevgen Pronenko Committed by Linus Torvalds

mm/memory.c: convert to DEFINE_DEBUGFS_ATTRIBUTE

The preferred strategy to define debugfs attributes is to use the
DEFINE_DEBUGFS_ATTRIBUTE() macro and to use debugfs_create_file_unsafe().

Link: http://lkml.kernel.org/r/20170528145948.32127-1-y.pronenko@gmail.comSigned-off-by: default avatarYevgen Pronenko <y.pronenko@gmail.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7a8f58f3
...@@ -3262,14 +3262,14 @@ static int fault_around_bytes_set(void *data, u64 val) ...@@ -3262,14 +3262,14 @@ static int fault_around_bytes_set(void *data, u64 val)
fault_around_bytes = PAGE_SIZE; /* rounddown_pow_of_two(0) is undefined */ fault_around_bytes = PAGE_SIZE; /* rounddown_pow_of_two(0) is undefined */
return 0; return 0;
} }
DEFINE_SIMPLE_ATTRIBUTE(fault_around_bytes_fops, DEFINE_DEBUGFS_ATTRIBUTE(fault_around_bytes_fops,
fault_around_bytes_get, fault_around_bytes_set, "%llu\n"); fault_around_bytes_get, fault_around_bytes_set, "%llu\n");
static int __init fault_around_debugfs(void) static int __init fault_around_debugfs(void)
{ {
void *ret; void *ret;
ret = debugfs_create_file("fault_around_bytes", 0644, NULL, NULL, ret = debugfs_create_file_unsafe("fault_around_bytes", 0644, NULL, NULL,
&fault_around_bytes_fops); &fault_around_bytes_fops);
if (!ret) if (!ret)
pr_warn("Failed to create fault_around_bytes in debugfs"); pr_warn("Failed to create fault_around_bytes in debugfs");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment