* [PATCH] cleanup single_open usage in dma.c
@ 2004-01-16 3:23 Jeff Muizelaar
0 siblings, 0 replies; only message in thread
From: Jeff Muizelaar @ 2004-01-16 3:23 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel Mailing List, Russell King
[-- Attachment #1: Type: text/plain, Size: 109 bytes --]
The attached patch lets the seq_file api take care of buffer allocation
instead of doing it by hand.
-Jeff
[-- Attachment #2: dma-proc-cleanup.patch --]
[-- Type: text/plain, Size: 704 bytes --]
diff -ur linux-2.6.1-mm3/kernel/dma.c linux-2.6.1-mm3-dma-proc/kernel/dma.c
--- linux-2.6.1-mm3/kernel/dma.c 2004-01-09 01:59:10.000000000 -0500
+++ linux-2.6.1-mm3-dma-proc/kernel/dma.c 2004-01-15 22:10:04.000000000 -0500
@@ -136,20 +136,7 @@
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 = {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-01-16 3:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-16 3:23 [PATCH] cleanup single_open usage in dma.c Jeff Muizelaar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox