lkml.org 
[lkml]   [2005]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] cpuset crapectomy
	Switched cpuset_common_file_read() to simple_read_from_buffer(),
killed a bunch of useless (and not quite correct - e.g. min(size_t,ssize_t))
code.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
----
diff -urN RC14-rc2-git6-base/kernel/cpuset.c current/kernel/cpuset.c
--- RC14-rc2-git6-base/kernel/cpuset.c 2005-09-28 21:33:37.000000000 -0400
+++ current/kernel/cpuset.c 2005-09-29 16:09:00.000000000 -0400
@@ -968,8 +968,6 @@
char *page;
ssize_t retval = 0;
char *s;
- char *start;
- ssize_t n;

if (!(page = (char *)__get_free_page(GFP_KERNEL)))
return -ENOMEM;
@@ -999,15 +997,7 @@
*s++ = '\n';
*s = '\0';

- start = page + *ppos;
- n = s - start;
-
- /* Do nothing if *ppos is at the eof or beyond the eof. */
- if (n <= 0)
- goto out;
-
- retval = n - copy_to_user(buf, start, min(n, nbytes));
- *ppos += retval;
+ retval = simple_read_from_buffer(buf, nbytes, ppos, page, s - page);
out:
free_page((unsigned long)page);
return retval;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-09-30 04:31    [W:0.030 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site