diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-02-29 11:37:02 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-29 11:37:02 -0800 |
commit | 9a8c09e73bf6c8b1720b1172cdcabb14fc823cf8 (patch) | |
tree | 00c88ccd0a1a062bec3076c1563a624d6a2c3b2a /net/atm/proc.c | |
parent | 45af1754bc09926b5e062bda24f789d7b320939f (diff) | |
download | kernel_samsung_tuna-9a8c09e73bf6c8b1720b1172cdcabb14fc823cf8.zip kernel_samsung_tuna-9a8c09e73bf6c8b1720b1172cdcabb14fc823cf8.tar.gz kernel_samsung_tuna-9a8c09e73bf6c8b1720b1172cdcabb14fc823cf8.tar.bz2 |
[ATM]: Use seq_open/release_privade instead of manual manipulations.
lec_seq_open/lec_seq_release and __vcc_seq_open/vcc_seq_release
do seq_open/release_private's job.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/proc.c')
-rw-r--r-- | net/atm/proc.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/net/atm/proc.c b/net/atm/proc.c index e9693ae..b995b66 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c @@ -114,31 +114,13 @@ static int __vcc_seq_open(struct inode *inode, struct file *file, int family, const struct seq_operations *ops) { struct vcc_state *state; - struct seq_file *seq; - int rc = -ENOMEM; - state = kmalloc(sizeof(*state), GFP_KERNEL); - if (!state) - goto out; - - rc = seq_open(file, ops); - if (rc) - goto out_kfree; + state = __seq_open_private(file, ops, sizeof(*state)); + if (state == NULL) + return -ENOMEM; state->family = family; - - seq = file->private_data; - seq->private = state; -out: - return rc; -out_kfree: - kfree(state); - goto out; -} - -static int vcc_seq_release(struct inode *inode, struct file *file) -{ - return seq_release_private(inode, file); + return 0; } static void *vcc_seq_start(struct seq_file *seq, loff_t *pos) @@ -314,7 +296,7 @@ static const struct file_operations pvc_seq_fops = { .open = pvc_seq_open, .read = seq_read, .llseek = seq_lseek, - .release = vcc_seq_release, + .release = seq_release_private, }; static int vcc_seq_show(struct seq_file *seq, void *v) @@ -348,7 +330,7 @@ static const struct file_operations vcc_seq_fops = { .open = vcc_seq_open, .read = seq_read, .llseek = seq_lseek, - .release = vcc_seq_release, + .release = seq_release_private, }; static int svc_seq_show(struct seq_file *seq, void *v) @@ -383,7 +365,7 @@ static const struct file_operations svc_seq_fops = { .open = svc_seq_open, .read = seq_read, .llseek = seq_lseek, - .release = vcc_seq_release, + .release = seq_release_private, }; static ssize_t proc_dev_atm_read(struct file *file, char __user *buf, |