diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2008-02-05 01:30:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 12:44:25 -0500 |
commit | c0a9290ecf0dbb89958cb3a3f78964015a7de402 (patch) | |
tree | 1a987905fe5047cd74966149fc11689713cd7bea /arch/um/os-Linux | |
parent | 9226b8384776798986640ce07764d17ba66aa54f (diff) |
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')
-rw-r--r-- | arch/um/os-Linux/drivers/tuntap_user.c | 2 | ||||
-rw-r--r-- | arch/um/os-Linux/mem.c | 7 | ||||
-rw-r--r-- | arch/um/os-Linux/sigio.c | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/arch/um/os-Linux/drivers/tuntap_user.c b/arch/um/os-Linux/drivers/tuntap_user.c index 1037a3b6386e..1d847959d1d6 100644 --- a/arch/um/os-Linux/drivers/tuntap_user.c +++ b/arch/um/os-Linux/drivers/tuntap_user.c | |||
@@ -148,7 +148,7 @@ static int tuntap_open(void *data) | |||
148 | memset(&ifr, 0, sizeof(ifr)); | 148 | memset(&ifr, 0, sizeof(ifr)); |
149 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI; | 149 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
150 | strlcpy(ifr.ifr_name, pri->dev_name, sizeof(ifr.ifr_name)); | 150 | strlcpy(ifr.ifr_name, pri->dev_name, sizeof(ifr.ifr_name)); |
151 | if (ioctl(pri->fd, TUNSETIFF, (void *) &ifr) < 0) { | 151 | if (ioctl(pri->fd, TUNSETIFF, &ifr) < 0) { |
152 | err = -errno; | 152 | err = -errno; |
153 | printk(UM_KERN_ERR "TUNSETIFF failed, errno = %d\n", | 153 | printk(UM_KERN_ERR "TUNSETIFF failed, errno = %d\n", |
154 | errno); | 154 | errno); |
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; | |||
30 | 30 | ||
31 | static void __init find_tempdir(void) | 31 | static void __init find_tempdir(void) |
32 | { | 32 | { |
33 | char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL }; | 33 | const char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL }; |
34 | int i; | 34 | int i; |
35 | char *dir = NULL; | 35 | char *dir = NULL; |
36 | 36 | ||
@@ -59,9 +59,10 @@ static void __init find_tempdir(void) | |||
59 | * read the file as needed. If there's an error, -errno is returned; | 59 | * read the file as needed. If there's an error, -errno is returned; |
60 | * if the end of the file is reached, 0 is returned. | 60 | * if the end of the file is reached, 0 is returned. |
61 | */ | 61 | */ |
62 | static int next(int fd, char *buf, int size, char c) | 62 | static int next(int fd, char *buf, size_t size, char c) |
63 | { | 63 | { |
64 | int n, len; | 64 | ssize_t n; |
65 | size_t len; | ||
65 | char *ptr; | 66 | char *ptr; |
66 | 67 | ||
67 | while((ptr = strchr(buf, c)) == NULL){ | 68 | while((ptr = strchr(buf, c)) == NULL){ |
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index dc03e9cccb63..7243f5733772 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c | |||
@@ -407,7 +407,7 @@ static int async_pty(int master, int slave) | |||
407 | if((fcntl(slave, F_SETFL, flags | O_NONBLOCK) < 0)) | 407 | if((fcntl(slave, F_SETFL, flags | O_NONBLOCK) < 0)) |
408 | return -errno; | 408 | return -errno; |
409 | 409 | ||
410 | return(0); | 410 | return 0; |
411 | } | 411 | } |
412 | 412 | ||
413 | static void __init check_one_sigio(void (*proc)(int, int)) | 413 | static void __init check_one_sigio(void (*proc)(int, int)) |