public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Muizelaar <muizelaar@rogers.com>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] cleanup up seq file usage in resource.c
Date: Wed, 28 May 2003 20:05:33 -0400	[thread overview]
Message-ID: <3ED54ECD.1050005@rogers.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

This patch against 2.5.70-bk2 removes the buffer allocation from 
resource.c and lets seq_read do it instead.

-Jeff

[-- Attachment #2: resource-seq-file-cleanup.patch --]
[-- Type: text/plain, Size: 782 bytes --]

diff -urN linux-2.5.70-bk2/kernel/resource.c linux-2.5.70-bk2-resource-seq-file-cleanup/kernel/resource.c
--- linux-2.5.70-bk2/kernel/resource.c	2003-05-26 21:00:42.000000000 -0400
+++ linux-2.5.70-bk2-resource-seq-file-cleanup/kernel/resource.c	2003-05-28 19:22:04.000000000 -0400
@@ -71,20 +71,7 @@
 
 static int ioresources_open(struct file *file, struct resource *root)
 {
-	char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-	struct seq_file *m;
-	int res;
-
-	if (!buf)
-		return -ENOMEM;
-	res = single_open(file, ioresources_show, root);
-	if (!res) {
-		m = file->private_data;
-		m->buf = buf;
-		m->size = PAGE_SIZE;
-	} else
-		kfree(buf);
-	return res;
+	return single_open(file, ioresources_show, root);
 }
 
 static int ioports_open(struct inode *inode, struct file *file)

             reply	other threads:[~2003-05-28 23:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-29  0:05 Jeff Muizelaar [this message]
2003-05-29  0:25 ` [PATCH] cleanup up seq file usage in resource.c Jeff Muizelaar

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=3ED54ECD.1050005@rogers.com \
    --to=muizelaar@rogers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rddunlap@osdl.org \
    /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