summaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/mem.c
diff options
context:
space:
mode:
authorWANG Cong2008-02-05 07:30:41 +0100
committerLinus Torvalds2008-02-05 18:44:25 +0100
commitc0a9290ecf0dbb89958cb3a3f78964015a7de402 (patch)
tree1a987905fe5047cd74966149fc11689713cd7bea /arch/um/os-Linux/mem.c
parentuml: further bugs.c tidying (diff)
downloadkernel-qcow2-linux-c0a9290ecf0dbb89958cb3a3f78964015a7de402.tar.gz
kernel-qcow2-linux-c0a9290ecf0dbb89958cb3a3f78964015a7de402.tar.xz
kernel-qcow2-linux-c0a9290ecf0dbb89958cb3a3f78964015a7de402.zip
uml: const and other tidying
This patch also does some improvements for uml code. Improvements include dropping unnecessary cast, killing some unnecessary code and still some constifying for pointers etc.. Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/mem.c')
-rw-r--r--arch/um/os-Linux/mem.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index c3b736adc1d9..9674ed1bef2f 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -30,7 +30,7 @@ static char *tempdir = NULL;
static void __init find_tempdir(void)
{
- char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL };
+ const char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL };
int i;
char *dir = NULL;
@@ -59,9 +59,10 @@ static void __init find_tempdir(void)
* read the file as needed. If there's an error, -errno is returned;
* if the end of the file is reached, 0 is returned.
*/
-static int next(int fd, char *buf, int size, char c)
+static int next(int fd, char *buf, size_t size, char c)
{
- int n, len;
+ ssize_t n;
+ size_t len;
char *ptr;
while((ptr = strchr(buf, c)) == NULL){