diff options
author | Rob Jones <rob.jones@codethink.co.uk> | 2014-10-13 18:52:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-13 20:18:16 -0400 |
commit | 0049f26ae0ad00016d8e237a6d712bff155cedc5 (patch) | |
tree | 1d6ea48be5b4fb749eab799ab804761dce8e1105 | |
parent | de8288b1f87146da06f6912028a1a9615a75c987 (diff) |
kernel/kallsyms.c: use __seq_open_private()
Reduce boilerplate code by using __seq_open_private() instead of
seq_open() in kallsyms_open().
Signed-off-by: Rob Jones <rob.jones@codethink.co.uk>
Cc: Gideon Israel Dsouza <gidisrael@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/kallsyms.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index ae5167087845..5c5987f10819 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c | |||
@@ -565,19 +565,12 @@ static int kallsyms_open(struct inode *inode, struct file *file) | |||
565 | * using get_symbol_offset for every symbol. | 565 | * using get_symbol_offset for every symbol. |
566 | */ | 566 | */ |
567 | struct kallsym_iter *iter; | 567 | struct kallsym_iter *iter; |
568 | int ret; | 568 | iter = __seq_open_private(file, &kallsyms_op, sizeof(*iter)); |
569 | |||
570 | iter = kmalloc(sizeof(*iter), GFP_KERNEL); | ||
571 | if (!iter) | 569 | if (!iter) |
572 | return -ENOMEM; | 570 | return -ENOMEM; |
573 | reset_iter(iter, 0); | 571 | reset_iter(iter, 0); |
574 | 572 | ||
575 | ret = seq_open(file, &kallsyms_op); | 573 | return 0; |
576 | if (ret == 0) | ||
577 | ((struct seq_file *)file->private_data)->private = iter; | ||
578 | else | ||
579 | kfree(iter); | ||
580 | return ret; | ||
581 | } | 574 | } |
582 | 575 | ||
583 | #ifdef CONFIG_KGDB_KDB | 576 | #ifdef CONFIG_KGDB_KDB |