Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: fixup many sparse errors.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+220 -61
+1 -1
arch/sh/boot/compressed/misc_32.c
··· 191 191 192 192 void decompress_kernel(void) 193 193 { 194 - output_data = 0; 194 + output_data = NULL; 195 195 output_ptr = PHYSADDR((unsigned long)&_text+PAGE_SIZE); 196 196 #ifdef CONFIG_29BIT 197 197 output_ptr |= P2SEG;
+1
arch/sh/include/asm/clock.h
··· 39 39 40 40 /* Should be defined by processor-specific code */ 41 41 void arch_init_clk_ops(struct clk_ops **, int type); 42 + int __init arch_clk_init(void); 42 43 43 44 /* arch/sh/kernel/cpu/clock.c */ 44 45 int clk_init(void);
+2 -2
arch/sh/include/asm/io.h
··· 194 194 195 195 #define IO_SPACE_LIMIT 0xffffffff 196 196 197 + extern unsigned long generic_io_base; 198 + 197 199 /* 198 200 * This function provides a method for the generic case where a board-specific 199 201 * ioport_map simply needs to return the port + some arbitrary port base. ··· 205 203 */ 206 204 static inline void __set_io_port_base(unsigned long pbase) 207 205 { 208 - extern unsigned long generic_io_base; 209 - 210 206 generic_io_base = pbase; 211 207 } 212 208
+3
arch/sh/include/asm/irq.h
··· 41 41 #define irq_canonicalize(irq) (irq) 42 42 #define irq_demux(irq) sh_mv.mv_irq_demux(irq) 43 43 44 + void init_IRQ(void); 45 + asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs); 46 + 44 47 #ifdef CONFIG_IRQSTACKS 45 48 extern void irq_ctx_init(int cpu); 46 49 extern void irq_ctx_exit(int cpu);
+4
arch/sh/include/asm/processor.h
··· 45 45 46 46 /* Forward decl */ 47 47 struct sh_cpuinfo; 48 + struct seq_operations; 49 + 50 + extern struct pt_regs fake_swapper_regs; 48 51 49 52 /* arch/sh/kernel/setup.c */ 50 53 const char *get_cpu_subtype(struct sh_cpuinfo *c); 54 + extern const struct seq_operations cpuinfo_op; 51 55 52 56 #ifdef CONFIG_VSYSCALL 53 57 int vsyscall_init(void);
+3
arch/sh/include/asm/processor_32.h
··· 10 10 #ifdef __KERNEL__ 11 11 12 12 #include <linux/compiler.h> 13 + #include <linux/linkage.h> 13 14 #include <asm/page.h> 14 15 #include <asm/types.h> 15 16 #include <asm/cache.h> ··· 44 43 #define boot_cpu_data cpu_data[0] 45 44 #define current_cpu_data cpu_data[smp_processor_id()] 46 45 #define raw_current_cpu_data cpu_data[raw_smp_processor_id()] 46 + 47 + asmlinkage void __init sh_cpu_init(void); 47 48 48 49 /* 49 50 * User space process size: 2GB.
-2
arch/sh/include/asm/processor_64.h
··· 169 169 #define INIT_MMAP \ 170 170 { &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } 171 171 172 - extern struct pt_regs fake_swapper_regs; 173 - 174 172 #define INIT_THREAD { \ 175 173 .sp = sizeof(init_stack) + \ 176 174 (long) &init_stack, \
+1
arch/sh/include/asm/rtc.h
··· 1 1 #ifndef _ASM_RTC_H 2 2 #define _ASM_RTC_H 3 3 4 + void time_init(void); 4 5 extern void (*board_time_init)(void); 5 6 extern void (*rtc_sh_get_time)(struct timespec *); 6 7 extern int (*rtc_sh_set_time)(const time_t);
+2
arch/sh/include/asm/setup.h
··· 1 1 #ifndef _SH_SETUP_H 2 2 #define _SH_SETUP_H 3 3 4 + #include <asm/mmzone.h> 5 + 4 6 #define COMMAND_LINE_SIZE 256 5 7 6 8 #ifdef __KERNEL__
+25
arch/sh/include/asm/syscalls.h
··· 1 + #ifndef __ASM_SH_SYSCALLS_H 2 + #define __ASM_SH_SYSCALLS_H 3 + 4 + #ifdef __KERNEL__ 5 + 6 + struct old_utsname; 7 + 8 + asmlinkage int old_mmap(unsigned long addr, unsigned long len, 9 + unsigned long prot, unsigned long flags, 10 + int fd, unsigned long off); 11 + asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 12 + unsigned long prot, unsigned long flags, 13 + unsigned long fd, unsigned long pgoff); 14 + asmlinkage int sys_ipc(uint call, int first, int second, 15 + int third, void __user *ptr, long fifth); 16 + asmlinkage int sys_uname(struct old_utsname __user *name); 17 + 18 + #ifdef CONFIG_SUPERH32 19 + # include "syscalls_32.h" 20 + #else 21 + # include "syscalls_64.h" 22 + #endif 23 + 24 + #endif /* __KERNEL__ */ 25 + #endif /* __ASM_SH_SYSCALLS_H */
+56
arch/sh/include/asm/syscalls_32.h
··· 1 + #ifndef __ASM_SH_SYSCALLS_32_H 2 + #define __ASM_SH_SYSCALLS_32_H 3 + 4 + #ifdef __KERNEL__ 5 + 6 + #include <linux/compiler.h> 7 + #include <linux/linkage.h> 8 + #include <linux/types.h> 9 + 10 + struct pt_regs; 11 + 12 + asmlinkage int sys_fork(unsigned long r4, unsigned long r5, 13 + unsigned long r6, unsigned long r7, 14 + struct pt_regs __regs); 15 + asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, 16 + unsigned long parent_tidptr, 17 + unsigned long child_tidptr, 18 + struct pt_regs __regs); 19 + asmlinkage int sys_vfork(unsigned long r4, unsigned long r5, 20 + unsigned long r6, unsigned long r7, 21 + struct pt_regs __regs); 22 + asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, 23 + char __user * __user *uenvp, unsigned long r7, 24 + struct pt_regs __regs); 25 + asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5, 26 + unsigned long r6, unsigned long r7, 27 + struct pt_regs __regs); 28 + asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act, 29 + struct old_sigaction __user *oact); 30 + asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 31 + unsigned long r6, unsigned long r7, 32 + struct pt_regs __regs); 33 + asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, 34 + unsigned long r6, unsigned long r7, 35 + struct pt_regs __regs); 36 + asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, 37 + unsigned long r6, unsigned long r7, 38 + struct pt_regs __regs); 39 + asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, 40 + unsigned long r6, unsigned long r7, 41 + struct pt_regs __regs); 42 + asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, 43 + size_t count, long dummy, loff_t pos); 44 + asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, 45 + size_t count, long dummy, loff_t pos); 46 + asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1, 47 + u32 len0, u32 len1, int advice); 48 + 49 + /* Misc syscall related bits */ 50 + asmlinkage long do_syscall_trace_enter(struct pt_regs *regs); 51 + asmlinkage void do_syscall_trace_leave(struct pt_regs *regs); 52 + asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, 53 + unsigned long thread_info_flags); 54 + 55 + #endif /* __KERNEL__ */ 56 + #endif /* __ASM_SH_SYSCALLS_32_H */
+34
arch/sh/include/asm/syscalls_64.h
··· 1 + #ifndef __ASM_SH_SYSCALLS_64_H 2 + #define __ASM_SH_SYSCALLS_64_H 3 + 4 + #ifdef __KERNEL__ 5 + 6 + #include <linux/compiler.h> 7 + #include <linux/linkage.h> 8 + #include <linux/types.h> 9 + 10 + struct pt_regs; 11 + 12 + asmlinkage int sys_fork(unsigned long r2, unsigned long r3, 13 + unsigned long r4, unsigned long r5, 14 + unsigned long r6, unsigned long r7, 15 + struct pt_regs *pregs); 16 + asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, 17 + unsigned long r4, unsigned long r5, 18 + unsigned long r6, unsigned long r7, 19 + struct pt_regs *pregs); 20 + asmlinkage int sys_vfork(unsigned long r2, unsigned long r3, 21 + unsigned long r4, unsigned long r5, 22 + unsigned long r6, unsigned long r7, 23 + struct pt_regs *pregs); 24 + asmlinkage int sys_execve(char *ufilename, char **uargv, 25 + char **uenvp, unsigned long r5, 26 + unsigned long r6, unsigned long r7, 27 + struct pt_regs *pregs); 28 + 29 + /* Misc syscall related bits */ 30 + asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs); 31 + asmlinkage void do_syscall_trace_leave(struct pt_regs *regs); 32 + 33 + #endif /* __KERNEL__ */ 34 + #endif /* __ASM_SH_SYSCALLS_64_H */
+4 -2
arch/sh/include/asm/system.h
··· 127 127 }) 128 128 129 129 extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn)); 130 + void free_initmem(void); 131 + void free_initrd_mem(unsigned long start, unsigned long end); 130 132 131 133 extern void *set_exception_table_vec(unsigned int vec, void *handler); 132 134 ··· 181 179 #define arch_align_stack(x) (x) 182 180 183 181 struct mem_access { 184 - unsigned long (*from)(void *dst, const void *src, unsigned long cnt); 185 - unsigned long (*to)(void *dst, const void *src, unsigned long cnt); 182 + unsigned long (*from)(void *dst, const void __user *src, unsigned long cnt); 183 + unsigned long (*to)(void __user *dst, const void *src, unsigned long cnt); 186 184 }; 187 185 188 186 #ifdef CONFIG_SUPERH32
+16
arch/sh/include/asm/system_32.h
··· 99 99 int handle_unaligned_access(opcode_t instruction, struct pt_regs *regs, 100 100 struct mem_access *ma); 101 101 102 + asmlinkage void do_address_error(struct pt_regs *regs, 103 + unsigned long writeaccess, 104 + unsigned long address); 105 + asmlinkage void do_divide_error(unsigned long r4, unsigned long r5, 106 + unsigned long r6, unsigned long r7, 107 + struct pt_regs __regs); 108 + asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5, 109 + unsigned long r6, unsigned long r7, 110 + struct pt_regs __regs); 111 + asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5, 112 + unsigned long r6, unsigned long r7, 113 + struct pt_regs __regs); 114 + asmlinkage void do_exception_error(unsigned long r4, unsigned long r5, 115 + unsigned long r6, unsigned long r7, 116 + struct pt_regs __regs); 117 + 102 118 #endif /* __ASM_SH_SYSTEM_32_H */
+3 -2
arch/sh/kernel/cpu/clock.c
··· 294 294 { 295 295 } 296 296 297 - void __init __attribute__ ((weak)) 297 + int __init __attribute__ ((weak)) 298 298 arch_clk_init(void) 299 299 { 300 + return 0; 300 301 } 301 302 302 303 static int show_clocks(char *buf, char **start, off_t off, ··· 332 331 ret |= clk_register(clk); 333 332 } 334 333 335 - arch_clk_init(); 334 + ret |= arch_clk_init(); 336 335 337 336 /* Kick the child clocks.. */ 338 337 propagate_rate(&master_clk);
+3 -3
arch/sh/kernel/io_generic.c
··· 81 81 volatile u8 *port_addr; 82 82 u8 *buf = dst; 83 83 84 - port_addr = (volatile u8 *)__ioport_map(port, 1); 84 + port_addr = (volatile u8 __force *)__ioport_map(port, 1); 85 85 while (count--) 86 86 *buf++ = *port_addr; 87 87 } ··· 91 91 volatile u16 *port_addr; 92 92 u16 *buf = dst; 93 93 94 - port_addr = (volatile u16 *)__ioport_map(port, 2); 94 + port_addr = (volatile u16 __force *)__ioport_map(port, 2); 95 95 while (count--) 96 96 *buf++ = *port_addr; 97 97 ··· 103 103 volatile u32 *port_addr; 104 104 u32 *buf = dst; 105 105 106 - port_addr = (volatile u32 *)__ioport_map(port, 4); 106 + port_addr = (volatile u32 __force *)__ioport_map(port, 4); 107 107 while (count--) 108 108 *buf++ = *port_addr; 109 109
+1
arch/sh/kernel/machvec.c
··· 14 14 #include <linux/string.h> 15 15 #include <asm/machvec.h> 16 16 #include <asm/sections.h> 17 + #include <asm/setup.h> 17 18 #include <asm/io.h> 18 19 #include <asm/irq.h> 19 20
+1
arch/sh/kernel/process_32.c
··· 26 26 #include <asm/system.h> 27 27 #include <asm/ubc.h> 28 28 #include <asm/fpu.h> 29 + #include <asm/syscalls.h> 29 30 30 31 static int hlt_counter; 31 32 int ubc_usercnt = 0;
+1
arch/sh/kernel/process_64.c
··· 25 25 #include <linux/module.h> 26 26 #include <linux/proc_fs.h> 27 27 #include <linux/io.h> 28 + #include <asm/syscalls.h> 28 29 #include <asm/uaccess.h> 29 30 #include <asm/pgtable.h> 30 31 #include <asm/mmu_context.h>
+4 -2
arch/sh/kernel/ptrace_32.c
··· 27 27 #include <asm/system.h> 28 28 #include <asm/processor.h> 29 29 #include <asm/mmu_context.h> 30 + #include <asm/syscalls.h> 30 31 31 32 /* 32 33 * does not yet catch signals sent when the child dies. ··· 106 105 long arch_ptrace(struct task_struct *child, long request, long addr, long data) 107 106 { 108 107 struct user * dummy = NULL; 108 + unsigned long __user *datap = (unsigned long __user *)data; 109 109 int ret; 110 110 111 111 switch (request) { ··· 135 133 tmp = !!tsk_used_math(child); 136 134 else 137 135 tmp = 0; 138 - ret = put_user(tmp, (unsigned long __user *)data); 136 + ret = put_user(tmp, datap); 139 137 break; 140 138 } 141 139 ··· 204 202 } 205 203 206 204 ret = 0; 207 - if (put_user(tmp, (unsigned long *) data)) { 205 + if (put_user(tmp, datap)) { 208 206 ret = -EFAULT; 209 207 break; 210 208 }
+1
arch/sh/kernel/ptrace_64.c
··· 35 35 #include <asm/system.h> 36 36 #include <asm/processor.h> 37 37 #include <asm/mmu_context.h> 38 + #include <asm/syscalls.h> 38 39 #include <asm/fpu.h> 39 40 40 41 /* This mask defines the bits of the SR which the user is not allowed to
+1
arch/sh/kernel/setup.c
··· 26 26 #include <linux/err.h> 27 27 #include <linux/debugfs.h> 28 28 #include <linux/crash_dump.h> 29 + #include <linux/mmzone.h> 29 30 #include <asm/uaccess.h> 30 31 #include <asm/io.h> 31 32 #include <asm/page.h>
+4 -6
arch/sh/kernel/signal_32.c
··· 30 30 #include <asm/uaccess.h> 31 31 #include <asm/pgtable.h> 32 32 #include <asm/cacheflush.h> 33 + #include <asm/syscalls.h> 33 34 #include <asm/fpu.h> 34 35 35 36 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) ··· 248 247 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); 249 248 struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->regs[15]; 250 249 sigset_t set; 251 - stack_t st; 252 250 int r0; 253 251 254 252 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) ··· 265 265 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) 266 266 goto badframe; 267 267 268 - if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) 268 + if (do_sigaltstack(&frame->uc.uc_stack, NULL, 269 + regs->regs[15]) == -EFAULT) 269 270 goto badframe; 270 - /* It is more difficult to avoid calling this function than to 271 - call it and ignore errors. */ 272 - do_sigaltstack((const stack_t __user *)&st, NULL, (unsigned long)frame); 273 271 274 272 return r0; 275 273 ··· 427 429 428 430 /* Create the ucontext. */ 429 431 err |= __put_user(0, &frame->uc.uc_flags); 430 - err |= __put_user(0, &frame->uc.uc_link); 432 + err |= __put_user(NULL, &frame->uc.uc_link); 431 433 err |= __put_user((void *)current->sas_ss_sp, 432 434 &frame->uc.uc_stack.ss_sp); 433 435 err |= __put_user(sas_ss_flags(regs->regs[15]),
+4 -3
arch/sh/kernel/sys_sh.c
··· 23 23 #include <linux/fs.h> 24 24 #include <linux/ipc.h> 25 25 #include <asm/cacheflush.h> 26 + #include <asm/syscalls.h> 26 27 #include <asm/uaccess.h> 27 28 #include <asm/unistd.h> 28 29 ··· 187 186 union semun fourth; 188 187 if (!ptr) 189 188 return -EINVAL; 190 - if (get_user(fourth.__pad, (void * __user *) ptr)) 189 + if (get_user(fourth.__pad, (void __user * __user *) ptr)) 191 190 return -EFAULT; 192 191 return sys_semctl (first, second, third, fourth); 193 192 } ··· 262 261 return -EINVAL; 263 262 } 264 263 265 - asmlinkage int sys_uname(struct old_utsname * name) 264 + asmlinkage int sys_uname(struct old_utsname __user *name) 266 265 { 267 266 int err; 268 267 if (!name) 269 268 return -EFAULT; 270 269 down_read(&uts_sem); 271 - err = copy_to_user(name, utsname(), sizeof (*name)); 270 + err = copy_to_user(name, utsname(), sizeof(*name)); 272 271 up_read(&uts_sem); 273 272 return err?-EFAULT:0; 274 273 }
+3 -2
arch/sh/kernel/sys_sh32.c
··· 16 16 #include <asm/cacheflush.h> 17 17 #include <asm/uaccess.h> 18 18 #include <asm/unistd.h> 19 + #include <asm/syscalls.h> 19 20 20 21 /* 21 22 * sys_pipe() is the normal C calling standard for creating ··· 38 37 return error; 39 38 } 40 39 41 - asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char * buf, 40 + asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, 42 41 size_t count, long dummy, loff_t pos) 43 42 { 44 43 return sys_pread64(fd, buf, count, pos); 45 44 } 46 45 47 - asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char * buf, 46 + asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, 48 47 size_t count, long dummy, loff_t pos) 49 48 { 50 49 return sys_pwrite64(fd, buf, count, pos);
+1
arch/sh/kernel/time_32.c
··· 16 16 #include <linux/timex.h> 17 17 #include <linux/sched.h> 18 18 #include <linux/clockchips.h> 19 + #include <linux/mc146818rtc.h> /* for rtc_lock */ 19 20 #include <linux/smp.h> 20 21 #include <asm/clock.h> 21 22 #include <asm/rtc.h>
+1 -1
arch/sh/kernel/timers/timer-cmt.c
··· 174 174 return 0; 175 175 } 176 176 177 - struct sys_timer_ops cmt_timer_ops = { 177 + static struct sys_timer_ops cmt_timer_ops = { 178 178 .init = cmt_timer_init, 179 179 .start = cmt_timer_start, 180 180 .stop = cmt_timer_stop,
+35 -33
arch/sh/kernel/traps_32.c
··· 192 192 int ret, index, count; 193 193 unsigned long *rm, *rn; 194 194 unsigned char *src, *dst; 195 + unsigned char __user *srcu, *dstu; 195 196 196 197 index = (instruction>>8)&15; /* 0x0F00 */ 197 198 rn = &regs->regs[index]; ··· 207 206 case 0: /* mov.[bwl] to/from memory via r0+rn */ 208 207 if (instruction & 8) { 209 208 /* from memory */ 210 - src = (unsigned char*) *rm; 211 - src += regs->regs[0]; 212 - dst = (unsigned char*) rn; 213 - *(unsigned long*)dst = 0; 209 + srcu = (unsigned char __user *)*rm; 210 + srcu += regs->regs[0]; 211 + dst = (unsigned char *)rn; 212 + *(unsigned long *)dst = 0; 214 213 215 214 #if !defined(__LITTLE_ENDIAN__) 216 215 dst += 4-count; 217 216 #endif 218 - if (ma->from(dst, src, count)) 217 + if (ma->from(dst, srcu, count)) 219 218 goto fetch_fault; 220 219 221 220 sign_extend(count, dst); 222 221 } else { 223 222 /* to memory */ 224 - src = (unsigned char*) rm; 223 + src = (unsigned char *)rm; 225 224 #if !defined(__LITTLE_ENDIAN__) 226 225 src += 4-count; 227 226 #endif 228 - dst = (unsigned char*) *rn; 229 - dst += regs->regs[0]; 227 + dstu = (unsigned char __user *)*rn; 228 + dstu += regs->regs[0]; 230 229 231 - if (ma->to(dst, src, count)) 230 + if (ma->to(dstu, src, count)) 232 231 goto fetch_fault; 233 232 } 234 233 ret = 0; ··· 236 235 237 236 case 1: /* mov.l Rm,@(disp,Rn) */ 238 237 src = (unsigned char*) rm; 239 - dst = (unsigned char*) *rn; 240 - dst += (instruction&0x000F)<<2; 238 + dstu = (unsigned char __user *)*rn; 239 + dstu += (instruction&0x000F)<<2; 241 240 242 - if (ma->to(dst, src, 4)) 241 + if (ma->to(dstu, src, 4)) 243 242 goto fetch_fault; 244 243 ret = 0; 245 244 break; ··· 248 247 if (instruction & 4) 249 248 *rn -= count; 250 249 src = (unsigned char*) rm; 251 - dst = (unsigned char*) *rn; 250 + dstu = (unsigned char __user *)*rn; 252 251 #if !defined(__LITTLE_ENDIAN__) 253 252 src += 4-count; 254 253 #endif 255 - if (ma->to(dst, src, count)) 254 + if (ma->to(dstu, src, count)) 256 255 goto fetch_fault; 257 256 ret = 0; 258 257 break; 259 258 260 259 case 5: /* mov.l @(disp,Rm),Rn */ 261 - src = (unsigned char*) *rm; 262 - src += (instruction&0x000F)<<2; 263 - dst = (unsigned char*) rn; 264 - *(unsigned long*)dst = 0; 260 + srcu = (unsigned char __user *)*rm; 261 + srcu += (instruction & 0x000F) << 2; 262 + dst = (unsigned char *)rn; 263 + *(unsigned long *)dst = 0; 265 264 266 - if (ma->from(dst, src, 4)) 265 + if (ma->from(dst, srcu, 4)) 267 266 goto fetch_fault; 268 267 ret = 0; 269 268 break; 270 269 271 270 case 6: /* mov.[bwl] from memory, possibly with post-increment */ 272 - src = (unsigned char*) *rm; 271 + srcu = (unsigned char __user *)*rm; 273 272 if (instruction & 4) 274 273 *rm += count; 275 274 dst = (unsigned char*) rn; ··· 278 277 #if !defined(__LITTLE_ENDIAN__) 279 278 dst += 4-count; 280 279 #endif 281 - if (ma->from(dst, src, count)) 280 + if (ma->from(dst, srcu, count)) 282 281 goto fetch_fault; 283 282 sign_extend(count, dst); 284 283 ret = 0; ··· 287 286 case 8: 288 287 switch ((instruction&0xFF00)>>8) { 289 288 case 0x81: /* mov.w R0,@(disp,Rn) */ 290 - src = (unsigned char*) &regs->regs[0]; 289 + src = (unsigned char *) &regs->regs[0]; 291 290 #if !defined(__LITTLE_ENDIAN__) 292 291 src += 2; 293 292 #endif 294 - dst = (unsigned char*) *rm; /* called Rn in the spec */ 295 - dst += (instruction&0x000F)<<1; 293 + dstu = (unsigned char __user *)*rm; /* called Rn in the spec */ 294 + dstu += (instruction & 0x000F) << 1; 296 295 297 - if (ma->to(dst, src, 2)) 296 + if (ma->to(dstu, src, 2)) 298 297 goto fetch_fault; 299 298 ret = 0; 300 299 break; 301 300 302 301 case 0x85: /* mov.w @(disp,Rm),R0 */ 303 - src = (unsigned char*) *rm; 304 - src += (instruction&0x000F)<<1; 305 - dst = (unsigned char*) &regs->regs[0]; 306 - *(unsigned long*)dst = 0; 302 + srcu = (unsigned char __user *)*rm; 303 + srcu += (instruction & 0x000F) << 1; 304 + dst = (unsigned char *) &regs->regs[0]; 305 + *(unsigned long *)dst = 0; 307 306 308 307 #if !defined(__LITTLE_ENDIAN__) 309 308 dst += 2; 310 309 #endif 311 - if (ma->from(dst, src, 2)) 310 + if (ma->from(dst, srcu, 2)) 312 311 goto fetch_fault; 313 312 sign_extend(2, dst); 314 313 ret = 0; ··· 334 333 struct mem_access *ma) 335 334 { 336 335 opcode_t instruction; 337 - void *addr = (void *)(regs->pc + instruction_size(old_instruction)); 336 + void __user *addr = (void __user *)(regs->pc + 337 + instruction_size(old_instruction)); 338 338 339 339 if (copy_from_user(&instruction, addr, sizeof(instruction))) { 340 340 /* the instruction-fetch faulted */ ··· 561 559 } 562 560 563 561 set_fs(USER_DS); 564 - if (copy_from_user(&instruction, (void *)(regs->pc), 562 + if (copy_from_user(&instruction, (void __user *)(regs->pc), 565 563 sizeof(instruction))) { 566 564 /* Argh. Fault on the instruction itself. 567 565 This should never happen non-SMP ··· 591 589 die("unaligned program counter", regs, error_code); 592 590 593 591 set_fs(KERNEL_DS); 594 - if (copy_from_user(&instruction, (void *)(regs->pc), 592 + if (copy_from_user(&instruction, (void __user *)(regs->pc), 595 593 sizeof(instruction))) { 596 594 /* Argh. Fault on the instruction itself. 597 595 This should never happen non-SMP
+1
arch/sh/lib/div64-generic.c
··· 3 3 */ 4 4 5 5 #include <linux/types.h> 6 + #include <asm/div64.h> 6 7 7 8 extern uint64_t __xdiv64_32(u64 n, u32 d); 8 9
+1 -1
arch/sh/mm/consistent.c
··· 44 44 */ 45 45 dma_cache_sync(dev, ret, size, DMA_BIDIRECTIONAL); 46 46 47 - ret_nocache = ioremap_nocache(virt_to_phys(ret), size); 47 + ret_nocache = (void __force *)ioremap_nocache(virt_to_phys(ret), size); 48 48 if (!ret_nocache) { 49 49 free_pages((unsigned long)ret, order); 50 50 return NULL;
+1
arch/sh/mm/pg-nommu.c
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/string.h> 15 15 #include <asm/page.h> 16 + #include <asm/uaccess.h> 16 17 17 18 void copy_page(void *to, void *from) 18 19 {
+1
arch/sh/mm/tlb-nommu.c
··· 10 10 #include <linux/kernel.h> 11 11 #include <linux/mm.h> 12 12 #include <asm/pgtable.h> 13 + #include <asm/tlbflush.h> 13 14 14 15 /* 15 16 * Nothing too terribly exciting here ..
+1 -1
drivers/serial/sh-sci.c
··· 1113 1113 case PORT_IRDA: return "irda"; 1114 1114 } 1115 1115 1116 - return 0; 1116 + return NULL; 1117 1117 } 1118 1118 1119 1119 static void sci_release_port(struct uart_port *port)