diff options
author | Liu Shixin | 2022-09-09 16:31:40 +0800 |
---|---|---|
committer | Andrew Morton | 2022-10-03 14:03:07 -0700 |
commit | 6b1964e685544b8f8ba6780c10a6b38c2b1282a5 (patch) | |
tree | 630f9c39d77b5225a133c1307075f09125c52242 | |
parent | 671f2fa8a2b2d15940d80be4a2baf22758724647 (diff) |
mm: kfence: convert to DEFINE_SEQ_ATTRIBUTE
Use DEFINE_SEQ_ATTRIBUTE helper macro to simplify the code.
Link: https://lkml.kernel.org/r/20220909083140.3592919-1-liushixin2@huawei.com
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Reviewed-by: Marco Elver <elver@google.com>
Tested-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | mm/kfence/core.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/mm/kfence/core.c b/mm/kfence/core.c index 8c08ae2101d7..26de62a51665 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -719,24 +719,13 @@ static int show_object(struct seq_file *seq, void *v) return 0; } -static const struct seq_operations object_seqops = { +static const struct seq_operations objects_sops = { .start = start_object, .next = next_object, .stop = stop_object, .show = show_object, }; - -static int open_objects(struct inode *inode, struct file *file) -{ - return seq_open(file, &object_seqops); -} - -static const struct file_operations objects_fops = { - .open = open_objects, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; +DEFINE_SEQ_ATTRIBUTE(objects); static int __init kfence_debugfs_init(void) { |