diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-31 05:30:15 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 15:18:51 -0500 |
| commit | 4d338e1accfc3473f7e453427dfd4f1ebf4dbbe6 (patch) | |
| tree | ac6559e533cd4720b5c5b13119b3d10f0ab8b51d | |
| parent | 694a464e19b9e3278dbaf6a09fa7c1efec3f8eb5 (diff) | |
[PATCH] uml: sparse cleanups
misc sparse annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | arch/um/drivers/harddog_kern.c | 8 | ||||
| -rw-r--r-- | arch/um/drivers/hostaudio_kern.c | 10 | ||||
| -rw-r--r-- | arch/um/drivers/slirp_kern.c | 2 | ||||
| -rw-r--r-- | arch/um/include/line.h | 18 | ||||
| -rw-r--r-- | arch/um/include/sysdep-i386/checksum.h | 5 | ||||
| -rw-r--r-- | arch/um/kernel/exec_kern.c | 4 | ||||
| -rw-r--r-- | arch/um/kernel/process_kern.c | 2 | ||||
| -rw-r--r-- | arch/um/kernel/ptrace.c | 34 | ||||
| -rw-r--r-- | arch/um/kernel/syscall_kern.c | 4 | ||||
| -rw-r--r-- | arch/um/kernel/trap_kern.c | 8 | ||||
| -rw-r--r-- | arch/um/sys-i386/ptrace.c | 28 | ||||
| -rw-r--r-- | arch/um/sys-i386/signal.c | 48 | ||||
| -rw-r--r-- | arch/um/sys-i386/syscalls.c | 2 | ||||
| -rw-r--r-- | include/asm-um/ptrace-generic.h | 2 | ||||
| -rw-r--r-- | include/asm-um/thread_info.h | 16 | ||||
| -rw-r--r-- | include/asm-um/uaccess.h | 2 |
16 files changed, 93 insertions, 100 deletions
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c index 49acb2badf..d18a974735 100644 --- a/arch/um/drivers/harddog_kern.c +++ b/arch/um/drivers/harddog_kern.c | |||
| @@ -104,7 +104,7 @@ static int harddog_release(struct inode *inode, struct file *file) | |||
| 104 | 104 | ||
| 105 | extern int ping_watchdog(int fd); | 105 | extern int ping_watchdog(int fd); |
| 106 | 106 | ||
| 107 | static ssize_t harddog_write(struct file *file, const char *data, size_t len, | 107 | static ssize_t harddog_write(struct file *file, const char __user *data, size_t len, |
| 108 | loff_t *ppos) | 108 | loff_t *ppos) |
| 109 | { | 109 | { |
| 110 | /* | 110 | /* |
| @@ -118,6 +118,7 @@ static ssize_t harddog_write(struct file *file, const char *data, size_t len, | |||
| 118 | static int harddog_ioctl(struct inode *inode, struct file *file, | 118 | static int harddog_ioctl(struct inode *inode, struct file *file, |
| 119 | unsigned int cmd, unsigned long arg) | 119 | unsigned int cmd, unsigned long arg) |
| 120 | { | 120 | { |
| 121 | void __user *argp= (void __user *)arg; | ||
| 121 | static struct watchdog_info ident = { | 122 | static struct watchdog_info ident = { |
| 122 | WDIOC_SETTIMEOUT, | 123 | WDIOC_SETTIMEOUT, |
| 123 | 0, | 124 | 0, |
| @@ -127,13 +128,12 @@ static int harddog_ioctl(struct inode *inode, struct file *file, | |||
| 127 | default: | 128 | default: |
| 128 | return -ENOTTY; | 129 | return -ENOTTY; |
| 129 | case WDIOC_GETSUPPORT: | 130 | case WDIOC_GETSUPPORT: |
| 130 | if(copy_to_user((struct harddog_info *)arg, &ident, | 131 | if(copy_to_user(argp, &ident, sizeof(ident))) |
| 131 | sizeof(ident))) | ||
| 132 | return -EFAULT; | 132 | return -EFAULT; |
| 133 | return 0; | 133 | return 0; |
| 134 | case WDIOC_GETSTATUS: | 134 | case WDIOC_GETSTATUS: |
| 135 | case WDIOC_GETBOOTSTATUS: | 135 | case WDIOC_GETBOOTSTATUS: |
| 136 | return put_user(0,(int *)arg); | 136 | return put_user(0,(int __user *)argp); |
| 137 | case WDIOC_KEEPALIVE: | 137 | case WDIOC_KEEPALIVE: |
| 138 | return(ping_watchdog(harddog_out_fd)); | 138 | return(ping_watchdog(harddog_out_fd)); |
| 139 | } | 139 | } |
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c index 59602b81b2..37232f908c 100644 --- a/arch/um/drivers/hostaudio_kern.c +++ b/arch/um/drivers/hostaudio_kern.c | |||
| @@ -67,8 +67,8 @@ MODULE_PARM_DESC(mixer, MIXER_HELP); | |||
| 67 | 67 | ||
| 68 | /* /dev/dsp file operations */ | 68 | /* /dev/dsp file operations */ |
| 69 | 69 | ||
| 70 | static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count, | 70 | static ssize_t hostaudio_read(struct file *file, char __user *buffer, |
| 71 | loff_t *ppos) | 71 | size_t count, loff_t *ppos) |
| 72 | { | 72 | { |
| 73 | struct hostaudio_state *state = file->private_data; | 73 | struct hostaudio_state *state = file->private_data; |
| 74 | void *kbuf; | 74 | void *kbuf; |
| @@ -94,7 +94,7 @@ static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count, | |||
| 94 | return(err); | 94 | return(err); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | static ssize_t hostaudio_write(struct file *file, const char *buffer, | 97 | static ssize_t hostaudio_write(struct file *file, const char __user *buffer, |
| 98 | size_t count, loff_t *ppos) | 98 | size_t count, loff_t *ppos) |
| 99 | { | 99 | { |
| 100 | struct hostaudio_state *state = file->private_data; | 100 | struct hostaudio_state *state = file->private_data; |
| @@ -152,7 +152,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file, | |||
| 152 | case SNDCTL_DSP_CHANNELS: | 152 | case SNDCTL_DSP_CHANNELS: |
| 153 | case SNDCTL_DSP_SUBDIVIDE: | 153 | case SNDCTL_DSP_SUBDIVIDE: |
| 154 | case SNDCTL_DSP_SETFRAGMENT: | 154 | case SNDCTL_DSP_SETFRAGMENT: |
| 155 | if(get_user(data, (int *) arg)) | 155 | if(get_user(data, (int __user *) arg)) |
| 156 | return(-EFAULT); | 156 | return(-EFAULT); |
| 157 | break; | 157 | break; |
| 158 | default: | 158 | default: |
| @@ -168,7 +168,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file, | |||
| 168 | case SNDCTL_DSP_CHANNELS: | 168 | case SNDCTL_DSP_CHANNELS: |
| 169 | case SNDCTL_DSP_SUBDIVIDE: | 169 | case SNDCTL_DSP_SUBDIVIDE: |
| 170 | case SNDCTL_DSP_SETFRAGMENT: | 170 | case SNDCTL_DSP_SETFRAGMENT: |
| 171 | if(put_user(data, (int *) arg)) | 171 | if(put_user(data, (int __user *) arg)) |
| 172 | return(-EFAULT); | 172 | return(-EFAULT); |
| 173 | break; | 173 | break; |
| 174 | default: | 174 | default: |
diff --git a/arch/um/drivers/slirp_kern.c b/arch/um/drivers/slirp_kern.c index 109c541e78..95e50c943e 100644 --- a/arch/um/drivers/slirp_kern.c +++ b/arch/um/drivers/slirp_kern.c | |||
| @@ -77,7 +77,7 @@ static int slirp_setup(char *str, char **mac_out, void *data) | |||
| 77 | int i=0; | 77 | int i=0; |
| 78 | 78 | ||
| 79 | *init = ((struct slirp_init) | 79 | *init = ((struct slirp_init) |
| 80 | { argw : { { "slirp", NULL } } }); | 80 | { .argw = { { "slirp", NULL } } }); |
| 81 | 81 | ||
| 82 | str = split_if_spec(str, mac_out, NULL); | 82 | str = split_if_spec(str, mac_out, NULL); |
| 83 | 83 | ||
diff --git a/arch/um/include/line.h b/arch/um/include/line.h index 6f4d680dc1..6ac0f8252e 100644 --- a/arch/um/include/line.h +++ b/arch/um/include/line.h | |||
| @@ -58,23 +58,17 @@ struct line { | |||
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | #define LINE_INIT(str, d) \ | 60 | #define LINE_INIT(str, d) \ |
| 61 | { init_str : str, \ | 61 | { .init_str = str, \ |
| 62 | init_pri : INIT_STATIC, \ | 62 | .init_pri = INIT_STATIC, \ |
| 63 | valid : 1, \ | 63 | .valid = 1, \ |
| 64 | throttled : 0, \ | 64 | .lock = SPIN_LOCK_UNLOCKED, \ |
| 65 | lock : SPIN_LOCK_UNLOCKED, \ | 65 | .driver = d } |
| 66 | buffer : NULL, \ | ||
| 67 | head : NULL, \ | ||
| 68 | tail : NULL, \ | ||
| 69 | sigio : 0, \ | ||
| 70 | driver : d, \ | ||
| 71 | have_irq : 0 } | ||
| 72 | 66 | ||
| 73 | struct lines { | 67 | struct lines { |
| 74 | int num; | 68 | int num; |
| 75 | }; | 69 | }; |
| 76 | 70 | ||
| 77 | #define LINES_INIT(n) { num : n } | 71 | #define LINES_INIT(n) { .num = n } |
| 78 | 72 | ||
| 79 | extern void line_close(struct tty_struct *tty, struct file * filp); | 73 | extern void line_close(struct tty_struct *tty, struct file * filp); |
| 80 | extern int line_open(struct line *lines, struct tty_struct *tty); | 74 | extern int line_open(struct line *lines, struct tty_struct *tty); |
diff --git a/arch/um/include/sysdep-i386/checksum.h b/arch/um/include/sysdep-i386/checksum.h index 7d3d202d7f..052bb061a9 100644 --- a/arch/um/include/sysdep-i386/checksum.h +++ b/arch/um/include/sysdep-i386/checksum.h | |||
| @@ -48,7 +48,8 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char * | |||
| 48 | */ | 48 | */ |
| 49 | 49 | ||
| 50 | static __inline__ | 50 | static __inline__ |
| 51 | unsigned int csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, | 51 | unsigned int csum_partial_copy_from_user(const unsigned char __user *src, |
| 52 | unsigned char *dst, | ||
| 52 | int len, int sum, int *err_ptr) | 53 | int len, int sum, int *err_ptr) |
| 53 | { | 54 | { |
| 54 | if(copy_from_user(dst, src, len)){ | 55 | if(copy_from_user(dst, src, len)){ |
| @@ -192,7 +193,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | |||
| 192 | */ | 193 | */ |
| 193 | #define HAVE_CSUM_COPY_USER | 194 | #define HAVE_CSUM_COPY_USER |
| 194 | static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src, | 195 | static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src, |
| 195 | unsigned char *dst, | 196 | unsigned char __user *dst, |
| 196 | int len, int sum, int *err_ptr) | 197 | int len, int sum, int *err_ptr) |
| 197 | { | 198 | { |
| 198 | if (access_ok(VERIFY_WRITE, dst, len)){ | 199 | if (access_ok(VERIFY_WRITE, dst, len)){ |
diff --git a/arch/um/kernel/exec_kern.c b/arch/um/kernel/exec_kern.c index 1ca8431931..f9b346e05b 100644 --- a/arch/um/kernel/exec_kern.c +++ b/arch/um/kernel/exec_kern.c | |||
| @@ -58,14 +58,14 @@ long um_execve(char *file, char __user *__user *argv, char __user *__user *env) | |||
| 58 | return(err); | 58 | return(err); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | long sys_execve(char *file, char __user *__user *argv, | 61 | long sys_execve(char __user *file, char __user *__user *argv, |
| 62 | char __user *__user *env) | 62 | char __user *__user *env) |
| 63 | { | 63 | { |
| 64 | long error; | 64 | long error; |
| 65 | char *filename; | 65 | char *filename; |
| 66 | 66 | ||
| 67 | lock_kernel(); | 67 | lock_kernel(); |
| 68 | filename = getname((char __user *) file); | 68 | filename = getname(file); |
| 69 | error = PTR_ERR(filename); | 69 | error = PTR_ERR(filename); |
