Skip to contentSkip to conversation

cleanup up seq file usage in resource.c

PATCH In review Jeff Muizelaar 2 participants 2 messages May 28, 2003 – May 29, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

kernel/resource.c +1 -14
diff -urN linux-2.5.70-bk2/kernel/resource.c linux-2.5.70-bk2-resource-seq-file-cleanup/kernel/resource.c
@@ -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)