Fw: [PATCH] cleanup up seq file usage in resource.c

Fw: [PATCH] cleanup up seq file usage in resource.c

Post by Randy.Dunla » Wed, 11 Jun 2003 23:30:24



Date: Wed, 28 May 2003 20:05:33 -0400



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

  resource-seq-file-cleanup.patch
< 1K Download
 
 
 

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

[ resource-seq-file-cleanup.patch < 1K ]
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

 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)

2. numlock. you know what i mean

3. [RFC][PATCH][CLEANUP] task->state cleanup: pilot

4. Backup Program Suggestions?

5. [PATCH] linux-2.5.46_timer-tsc-cleanups_A0.patch

6. Need help with CDE datatyping DATA_CRITERIA...

7. Help - process resource usage (output to files)

8. HOWTO - change desktop language back to English.

9. ok, one more time -- FS config file patch for cleanup

10. Shape Ups,Men's Shape Ups,Men's Skechers Shape Ups - new styles!

11. Unofficial patch file for UPS debugger available.

12. FW: "PIPE BROKEN" & "RESOURCE TEMPORARILY UNAVAILABLE"

13. Fw: Kernel 2.4.20 PCI: Device 00:0f.1 not available because of resource collisions