linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fw: [PATCH] cleanup up seq file usage in resource.c
@ 2003-06-10 21:22 Randy.Dunlap
  0 siblings, 0 replies; only message in thread
From: Randy.Dunlap @ 2003-06-10 21:22 UTC (permalink / raw)
  To: Jeff Muizelaar; +Cc: lkml, akpm, viro

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



Date: Wed, 28 May 2003 20:05:33 -0400
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


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

-Jeff
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Looks fine to me and works too.

Andrew, please apply to your next patch set.

Thanks,
--
~Randy

[-- Attachment #2: resource-seq-file-cleanup.patch --]
[-- Type: text/plain, Size: 783 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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-10 21:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-10 21:22 Fw: [PATCH] cleanup up seq file usage in resource.c Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).