From 489a867c51086cadf495bc6aa0839ef090fa740f Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 19 Jan 2004 05:14:37 -0800 Subject: [PATCH] [PATCH] cleanup single_open usage in dma.c From: Jeff Muizelaar The attached patch lets the seq_file api take care of buffer allocation instead of doing it by hand. --- kernel/dma.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/kernel/dma.c b/kernel/dma.c index 7ad7fbf83a837..af1d982a0c576 100644 --- a/kernel/dma.c +++ b/kernel/dma.c @@ -136,20 +136,7 @@ static int proc_dma_show(struct seq_file *m, void *v) static int proc_dma_open(struct inode *inode, struct file *file) { - char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); - struct seq_file *m; - int res; - - if (!buf) - return -ENOMEM; - res = single_open(file, proc_dma_show, NULL); - if (!res) { - m = file->private_data; - m->buf = buf; - m->size = PAGE_SIZE; - } else - kfree(buf); - return res; + return single_open(file, proc_dma_show, NULL); } static struct file_operations proc_dma_operations = { -- 2.53.0