From: Jeff Muizelaar <muizelaar@rogers.com>
To: Andrew Morton <akpm@digeo.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Russell King <rmk@arm.linux.org.uk>
Subject: [PATCH] cleanup single_open usage in dma.c
Date: Thu, 15 Jan 2004 22:23:00 -0500 [thread overview]
Message-ID: <40075914.5000008@rogers.com> (raw)
[-- 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 = {
reply other threads:[~2004-01-16 3:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40075914.5000008@rogers.com \
--to=muizelaar@rogers.com \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox