Skip to content

Commit

Permalink
kallsyms: cleanup: use seq_release_private() where appropriate
Browse files Browse the repository at this point in the history
We can save some lines of code by using seq_release_private().

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Martin Peschke authored and Linus Torvalds committed May 8, 2007
1 parent 6272e26 commit 5a0c6a0
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions kernel/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,18 +470,11 @@ static int kallsyms_open(struct inode *inode, struct file *file)
return ret;
}

static int kallsyms_release(struct inode *inode, struct file *file)
{
struct seq_file *m = (struct seq_file *)file->private_data;
kfree(m->private);
return seq_release(inode, file);
}

static const struct file_operations kallsyms_operations = {
.open = kallsyms_open,
.read = seq_read,
.llseek = seq_lseek,
.release = kallsyms_release,
.release = seq_release_private,
};

static int __init kallsyms_init(void)
Expand Down

0 comments on commit 5a0c6a0

Please sign in to comment.