Skip to content

Commit

Permalink
md: 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>
Acked-by: Neil Brown <neilb@suse.de>
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 9, 2007
1 parent 50511da commit c3f94b4
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -4941,15 +4941,6 @@ static int md_seq_open(struct inode *inode, struct file *file)
return error;
}

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

static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
{
struct seq_file *m = filp->private_data;
Expand All @@ -4971,7 +4962,7 @@ static const struct file_operations md_seq_fops = {
.open = md_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = md_seq_release,
.release = seq_release_private,
.poll = mdstat_poll,
};

Expand Down

0 comments on commit c3f94b4

Please sign in to comment.