sh: fixup many sparse errors.
authorPaul Mundt <lethal@linux-sh.org>
Thu, 4 Sep 2008 09:53:58 +0000 (18:53 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 8 Sep 2008 01:35:04 +0000 (10:35 +0900)
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
33 files changed:
arch/sh/boot/compressed/misc_32.c
arch/sh/include/asm/clock.h
arch/sh/include/asm/io.h
arch/sh/include/asm/irq.h
arch/sh/include/asm/processor.h
arch/sh/include/asm/processor_32.h
arch/sh/include/asm/processor_64.h
arch/sh/include/asm/rtc.h
arch/sh/include/asm/setup.h
arch/sh/include/asm/syscalls.h [new file with mode: 0644]
arch/sh/include/asm/syscalls_32.h [new file with mode: 0644]
arch/sh/include/asm/syscalls_64.h [new file with mode: 0644]
arch/sh/include/asm/system.h
arch/sh/include/asm/system_32.h
arch/sh/kernel/cpu/clock.c
arch/sh/kernel/io_generic.c
arch/sh/kernel/machvec.c
arch/sh/kernel/process_32.c
arch/sh/kernel/process_64.c
arch/sh/kernel/ptrace_32.c
arch/sh/kernel/ptrace_64.c
arch/sh/kernel/setup.c
arch/sh/kernel/signal_32.c
arch/sh/kernel/sys_sh.c
arch/sh/kernel/sys_sh32.c
arch/sh/kernel/time_32.c
arch/sh/kernel/timers/timer-cmt.c
arch/sh/kernel/traps_32.c
arch/sh/lib/div64-generic.c
arch/sh/mm/consistent.c
arch/sh/mm/pg-nommu.c
arch/sh/mm/tlb-nommu.c
drivers/serial/sh-sci.c

index f386997e4d9c3b0c347b209b54852d3d4194e2bb..efdba6b295727a3f58c5c221e88450307df8c30e 100644 (file)
@@ -191,7 +191,7 @@ long* stack_start = &user_stack[STACK_SIZE];
 
 void decompress_kernel(void)
 {
-       output_data = 0;
+       output_data = NULL;
        output_ptr = PHYSADDR((unsigned long)&_text+PAGE_SIZE);
 #ifdef CONFIG_29BIT
        output_ptr |= P2SEG;
index 720dfab7b15e5b5605714a3511436fd27103e6d9..f9c88583d90aba3395c2a520ed05662056231269 100644 (file)
@@ -39,6 +39,7 @@ struct clk {
 
 /* Should be defined by processor-specific code */
 void arch_init_clk_ops(struct clk_ops **, int type);
+int __init arch_clk_init(void);
 
 /* arch/sh/kernel/cpu/clock.c */
 int clk_init(void);
index a4fbf0c84fb14aecf694379038d2d579c6607e2a..e49cfee95fb262327042ef8d92904fc14819c8a2 100644 (file)
@@ -194,6 +194,8 @@ __BUILD_MEMORY_STRING(w, u16)
 
 #define IO_SPACE_LIMIT 0xffffffff
 
+extern unsigned long generic_io_base;
+
 /*
  * This function provides a method for the generic case where a board-specific
  * ioport_map simply needs to return the port + some arbitrary port base.
@@ -203,8 +205,6 @@ __BUILD_MEMORY_STRING(w, u16)
  */
 static inline void __set_io_port_base(unsigned long pbase)
 {
-       extern unsigned long generic_io_base;
-
        generic_io_base = pbase;
 }
 
index 6195a531c1b0c93b878519c173b87aef34c454dc..d319baaf4fbdf21a20b65cb659dcfaefd93d5f91 100644 (file)
@@ -41,6 +41,9 @@ static inline int generic_irq_demux(int irq)
 #define irq_canonicalize(irq)  (irq)
 #define irq_demux(irq)         sh_mv.mv_irq_demux(irq)
 
+void init_IRQ(void);
+asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs);
+
 #ifdef CONFIG_IRQSTACKS
 extern void irq_ctx_init(int cpu);
 extern void irq_ctx_exit(int cpu);
index 15d9f92ca383c38c35e001d27828c33d77aff09f..58e2be55ab93a8c06f70964abb5a7c5bdb437f36 100644 (file)
@@ -45,9 +45,13 @@ enum cpu_type {
 
 /* Forward decl */
 struct sh_cpuinfo;
+struct seq_operations;
+
+extern struct pt_regs fake_swapper_regs;
 
 /* arch/sh/kernel/setup.c */
 const char *get_cpu_subtype(struct sh_cpuinfo *c);
+extern const struct seq_operations cpuinfo_op;
 
 #ifdef CONFIG_VSYSCALL
 int vsyscall_init(void);
index 0dadd75bd93c8cb8720e5129ed1975fc4e3517a7..41d23210583c99a39b203c57b6107f9e638e6816 100644 (file)
@@ -10,6 +10,7 @@
 #ifdef __KERNEL__
 
 #include <linux/compiler.h>
+#include <linux/linkage.h>
 #include <asm/page.h>
 #include <asm/types.h>
 #include <asm/cache.h>
@@ -44,6 +45,8 @@ extern struct sh_cpuinfo cpu_data[];
 #define current_cpu_data cpu_data[smp_processor_id()]
 #define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
 
+asmlinkage void __init sh_cpu_init(void);
+
 /*
  * User space process size: 2GB.
  *
index 770d5169983b61e4c286e70024a3749d489dd87a..16609bc11627282de612b4ab1e769241ad46b3d4 100644 (file)
@@ -169,8 +169,6 @@ struct thread_struct {
 #define INIT_MMAP \
 { &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
 
-extern  struct pt_regs fake_swapper_regs;
-
 #define INIT_THREAD  {                         \
        .sp             = sizeof(init_stack) +  \
                          (long) &init_stack,   \
index 1813f4202a24f2a5fdb24e0e10b2e0579f69297e..f7b010d48af7b17d8c6dbf475d105f7839f816a5 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _ASM_RTC_H
 #define _ASM_RTC_H
 
+void time_init(void);
 extern void (*board_time_init)(void);
 extern void (*rtc_sh_get_time)(struct timespec *);
 extern int (*rtc_sh_set_time)(const time_t);
index 55a2bd328d990e24abc3e496641bddfd764eb3a7..554f865075ca1c1cf0e4140050fc4e5e2b807502 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _SH_SETUP_H
 #define _SH_SETUP_H
 
+#include <asm/mmzone.h>
+
 #define COMMAND_LINE_SIZE 256
 
 #ifdef __KERNEL__
diff --git a/arch/sh/include/asm/syscalls.h b/arch/sh/include/asm/syscalls.h
new file mode 100644 (file)
index 0000000..c1e2b8d
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef __ASM_SH_SYSCALLS_H
+#define __ASM_SH_SYSCALLS_H
+
+#ifdef __KERNEL__
+
+struct old_utsname;
+
+asmlinkage int old_mmap(unsigned long addr, unsigned long len,
+                       unsigned long prot, unsigned long flags,
+                       int fd, unsigned long off);
+asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
+                         unsigned long prot, unsigned long flags,
+                         unsigned long fd, unsigned long pgoff);
+asmlinkage int sys_ipc(uint call, int first, int second,
+                      int third, void __user *ptr, long fifth);
+asmlinkage int sys_uname(struct old_utsname __user *name);
+
+#ifdef CONFIG_SUPERH32
+# include "syscalls_32.h"
+#else
+# include "syscalls_64.h"
+#endif
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_SYSCALLS_H */
diff --git a/arch/sh/include/asm/syscalls_32.h b/arch/sh/include/asm/syscalls_32.h
new file mode 100644 (file)
index 0000000..104c5e6
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef __ASM_SH_SYSCALLS_32_H
+#define __ASM_SH_SYSCALLS_32_H
+
+#ifdef __KERNEL__
+
+#include <linux/compiler.h>
+#include <linux/linkage.h>
+#include <linux/types.h>
+
+struct pt_regs;
+
+asmlinkage int sys_fork(unsigned long r4, unsigned long r5,
+                       unsigned long r6, unsigned long r7,
+                       struct pt_regs __regs);
+asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
+                        unsigned long parent_tidptr,
+                        unsigned long child_tidptr,
+                        struct pt_regs __regs);
+asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
+                        unsigned long r6, unsigned long r7,
+                        struct pt_regs __regs);
+asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv,
+                         char __user * __user *uenvp, unsigned long r7,
+                         struct pt_regs __regs);
+asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5,
+                             unsigned long r6, unsigned long r7,
+                             struct pt_regs __regs);
+asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act,
+                            struct old_sigaction __user *oact);
+asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
+                              unsigned long r6, unsigned long r7,
+                              struct pt_regs __regs);
+asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5,
+                            unsigned long r6, unsigned long r7,
+                            struct pt_regs __regs);
+asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
+                               unsigned long r6, unsigned long r7,
+                               struct pt_regs __regs);
+asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
+                       unsigned long r6, unsigned long r7,
+                       struct pt_regs __regs);
+asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf,
+                                    size_t count, long dummy, loff_t pos);
+asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf,
+                                     size_t count, long dummy, loff_t pos);
+asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1,
+                                       u32 len0, u32 len1, int advice);
+
+/* Misc syscall related bits */
+asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
+asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
+asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0,
+                                unsigned long thread_info_flags);
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_SYSCALLS_32_H */
diff --git a/arch/sh/include/asm/syscalls_64.h b/arch/sh/include/asm/syscalls_64.h
new file mode 100644 (file)
index 0000000..751fd88
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __ASM_SH_SYSCALLS_64_H
+#define __ASM_SH_SYSCALLS_64_H
+
+#ifdef __KERNEL__
+
+#include <linux/compiler.h>
+#include <linux/linkage.h>
+#include <linux/types.h>
+
+struct pt_regs;
+
+asmlinkage int sys_fork(unsigned long r2, unsigned long r3,
+                       unsigned long r4, unsigned long r5,
+                       unsigned long r6, unsigned long r7,
+                       struct pt_regs *pregs);
+asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
+                        unsigned long r4, unsigned long r5,
+                        unsigned long r6, unsigned long r7,
+                        struct pt_regs *pregs);
+asmlinkage int sys_vfork(unsigned long r2, unsigned long r3,
+                        unsigned long r4, unsigned long r5,
+                        unsigned long r6, unsigned long r7,
+                        struct pt_regs *pregs);
+asmlinkage int sys_execve(char *ufilename, char **uargv,
+                         char **uenvp, unsigned long r5,
+                         unsigned long r6, unsigned long r7,
+                         struct pt_regs *pregs);
+
+/* Misc syscall related bits */
+asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs);
+asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_SYSCALLS_64_H */
index fbac113bbfbfa846fe76e40f4a6fb722ab99973d..6160fe445161e12071f6daeabbca709350563da2 100644 (file)
@@ -127,6 +127,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
   })
 
 extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn));
+void free_initmem(void);
+void free_initrd_mem(unsigned long start, unsigned long end);
 
 extern void *set_exception_table_vec(unsigned int vec, void *handler);
 
@@ -179,8 +181,8 @@ BUILD_TRAP_HANDLER(fpu_state_restore);
 #define arch_align_stack(x) (x)
 
 struct mem_access {
-       unsigned long (*from)(void *dst, const void *src, unsigned long cnt);
-       unsigned long (*to)(void *dst, const void *src, unsigned long cnt);
+       unsigned long (*from)(void *dst, const void __user *src, unsigned long cnt);
+       unsigned long (*to)(void __user *dst, const void *src, unsigned long cnt);
 };
 
 #ifdef CONFIG_SUPERH32
index f11bcf0855ed59b7c5bdd521eccfd73b2416ad3a..16509ed2bb605979923594ae496dc152e1b6fae1 100644 (file)
@@ -99,4 +99,20 @@ do {                                                 \
 int handle_unaligned_access(opcode_t instruction, struct pt_regs *regs,
                            struct mem_access *ma);
 
+asmlinkage void do_address_error(struct pt_regs *regs,
+                                unsigned long writeaccess,
+                                unsigned long address);
+asmlinkage void do_divide_error(unsigned long r4, unsigned long r5,
+                               unsigned long r6, unsigned long r7,
+                               struct pt_regs __regs);
+asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
+                               unsigned long r6, unsigned long r7,
+                               struct pt_regs __regs);
+asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5,
+                               unsigned long r6, unsigned long r7,
+                               struct pt_regs __regs);
+asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
+                                  unsigned long r6, unsigned long r7,
+                                  struct pt_regs __regs);
+
 #endif /* __ASM_SH_SYSTEM_32_H */
index f5eb56e6bc59b8bb68e8b1552f82f64150b527ea..b7e46d5bba439057a6f503d72b509515554db89a 100644 (file)
@@ -294,9 +294,10 @@ arch_init_clk_ops(struct clk_ops **ops, int type)
 {
 }
 
-void __init __attribute__ ((weak))
+int __init __attribute__ ((weak))
 arch_clk_init(void)
 {
+       return 0;
 }
 
 static int show_clocks(char *buf, char **start, off_t off,
@@ -331,7 +332,7 @@ int __init clk_init(void)
                ret |= clk_register(clk);
        }
 
-       arch_clk_init();
+       ret |= arch_clk_init();
 
        /* Kick the child clocks.. */
        propagate_rate(&master_clk);
index db769449f5a733daf74bcff1f86ed50a3f1f0d1d..f1b214d3bce3a578d36364cec856d254bb7badc5 100644 (file)
@@ -81,7 +81,7 @@ void generic_insb(unsigned long port, void *dst, unsigned long count)
        volatile u8 *port_addr;
        u8 *buf = dst;
 
-       port_addr = (volatile u8 *)__ioport_map(port, 1);
+       port_addr = (volatile u8 __force *)__ioport_map(port, 1);
        while (count--)
                *buf++ = *port_addr;
 }
@@ -91,7 +91,7 @@ void generic_insw(unsigned long port, void *dst, unsigned long count)
        volatile u16 *port_addr;
        u16 *buf = dst;
 
-       port_addr = (volatile u16 *)__ioport_map(port, 2);
+       port_addr = (volatile u16 __force *)__ioport_map(port, 2);
        while (count--)
                *buf++ = *port_addr;
 
@@ -103,7 +103,7 @@ void generic_insl(unsigned long port, void *dst, unsigned long count)
        volatile u32 *port_addr;
        u32 *buf = dst;
 
-       port_addr = (volatile u32 *)__ioport_map(port, 4);
+       port_addr = (volatile u32 __force *)__ioport_map(port, 4);
        while (count--)
                *buf++ = *port_addr;
 
index 129b2cfd18a84db251d5791e17bb7c4360f869ae..8bfdd275e94004845cd3f178701dff4a8e9bd5b6 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/string.h>
 #include <asm/machvec.h>
 #include <asm/sections.h>
+#include <asm/setup.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 
index 7326313bcfdbc566d8919fa69243a76237580ae6..914e543102df1f9908dcf5653981929e0acba513 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/system.h>
 #include <asm/ubc.h>
 #include <asm/fpu.h>
+#include <asm/syscalls.h>
 
 static int hlt_counter;
 int ubc_usercnt = 0;
index b9dbd2d3b4a5845624829c547ed613c8fe259b51..d0dddc438c0ce5b43fd6023865daf96bb17c579b 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/io.h>
+#include <asm/syscalls.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
index 035cb300d3dcf245b894e86ac39931cbdeee696f..84bf3420597c77c861a1af55721e9c349b12e23b 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/system.h>
 #include <asm/processor.h>
 #include <asm/mmu_context.h>
+#include <asm/syscalls.h>
 
 /*
  * does not yet catch signals sent when the child dies.
@@ -105,6 +106,7 @@ void ptrace_disable(struct task_struct *child)
 long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 {
        struct user * dummy = NULL;
+       unsigned long __user *datap = (unsigned long __user *)data;
        int ret;
 
        switch (request) {
@@ -133,7 +135,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                        tmp = !!tsk_used_math(child);
                else
                        tmp = 0;
-               ret = put_user(tmp, (unsigned long __user *)data);
+               ret = put_user(tmp, datap);
                break;
        }
 
@@ -202,7 +204,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                }
 
                ret = 0;
-               if (put_user(tmp, (unsigned long *) data)) {
+               if (put_user(tmp, datap)) {
                        ret = -EFAULT;
                        break;
                }
index 9c6424892bd37fcca32ae16e02e8691198c6c788..e15b099c1f069f8856e43caa7db2187ab129cb7e 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/system.h>
 #include <asm/processor.h>
 #include <asm/mmu_context.h>
+#include <asm/syscalls.h>
 #include <asm/fpu.h>
 
 /* This mask defines the bits of the SR which the user is not allowed to
index de832056bf1b28ae1196633d0bf23633144f8f26..6d0899e890d09595a8f13ef3c748d9a657a00eb4 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/err.h>
 #include <linux/debugfs.h>
 #include <linux/crash_dump.h>
+#include <linux/mmzone.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/page.h>
index 51689d29ad45d331aa7c42b9ca4c301afafabdb6..345de2f1d53c909f68aa7b295848f344e46c7c03 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/cacheflush.h>
+#include <asm/syscalls.h>
 #include <asm/fpu.h>
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
@@ -247,7 +248,6 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
        struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
        struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->regs[15];
        sigset_t set;
-       stack_t st;
        int r0;
 
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -265,11 +265,9 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
        if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0))
                goto badframe;
 
-       if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
+       if (do_sigaltstack(&frame->uc.uc_stack, NULL,
+                          regs->regs[15]) == -EFAULT)
                goto badframe;
-       /* It is more difficult to avoid calling this function than to
-          call it and ignore errors.  */
-       do_sigaltstack((const stack_t __user *)&st, NULL, (unsigned long)frame);
 
        return r0;
 
@@ -429,7 +427,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 
        /* Create the ucontext.  */
        err |= __put_user(0, &frame->uc.uc_flags);
-       err |= __put_user(0, &frame->uc.uc_link);
+       err |= __put_user(NULL, &frame->uc.uc_link);
        err |= __put_user((void *)current->sas_ss_sp,
                          &frame->uc.uc_stack.ss_sp);
        err |= __put_user(sas_ss_flags(regs->regs[15]),
index 9061b86d73fadefef5b20d7834a6c25299fcc289..0dfb88925addc3b209b082da0b51e01fb58b7606 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/fs.h>
 #include <linux/ipc.h>
 #include <asm/cacheflush.h>
+#include <asm/syscalls.h>
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
 
@@ -186,7 +187,7 @@ asmlinkage int sys_ipc(uint call, int first, int second,
                        union semun fourth;
                        if (!ptr)
                                return -EINVAL;
-                       if (get_user(fourth.__pad, (void * __user *) ptr))
+                       if (get_user(fourth.__pad, (void __user * __user *) ptr))
                                return -EFAULT;
                        return sys_semctl (first, second, third, fourth);
                        }
@@ -261,13 +262,13 @@ asmlinkage int sys_ipc(uint call, int first, int second,
        return -EINVAL;
 }
 
-asmlinkage int sys_uname(struct old_utsname name)
+asmlinkage int sys_uname(struct old_utsname __user *name)
 {
        int err;
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err = copy_to_user(name, utsname(), sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof(*name));
        up_read(&uts_sem);
        return err?-EFAULT:0;
 }
index f0aa5c398656ca5b7fc1e4d0812b41951c57a79b..dbba1e1833d43703362aee63cbba2f2c8bfb08f2 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/cacheflush.h>
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
+#include <asm/syscalls.h>
 
 /*
  * sys_pipe() is the normal C calling standard for creating
@@ -37,13 +38,13 @@ asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
        return error;
 }
 
-asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char buf,
+asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf,
                             size_t count, long dummy, loff_t pos)
 {
        return sys_pread64(fd, buf, count, pos);
 }
 
-asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char buf,
+asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf,
                              size_t count, long dummy, loff_t pos)
 {
        return sys_pwrite64(fd, buf, count, pos);
index e2f74cc71d8c5b8508b89ffb59582c1ac49f678f..23ca711c27d2af9e6e15106a17bcdb8e92bea47c 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/timex.h>
 #include <linux/sched.h>
 #include <linux/clockchips.h>
+#include <linux/mc146818rtc.h> /* for rtc_lock */
 #include <linux/smp.h>
 #include <asm/clock.h>
 #include <asm/rtc.h>
index d20c8c3758817981549ac4fce5e47d7dafc2ffa7..c127293271e1f4072140e334697346bb0ab24779 100644 (file)
@@ -174,7 +174,7 @@ static int cmt_timer_init(void)
        return 0;
 }
 
-struct sys_timer_ops cmt_timer_ops = {
+static struct sys_timer_ops cmt_timer_ops = {
        .init           = cmt_timer_init,
        .start          = cmt_timer_start,
        .stop           = cmt_timer_stop,
index 511a9426cec58a348fb7fd45bdf4db11d654b31c..4901f673216210b5b5f26bf39fa7604a1c16377d 100644 (file)
@@ -192,6 +192,7 @@ static int handle_unaligned_ins(opcode_t instruction, struct pt_regs *regs,
        int ret, index, count;
        unsigned long *rm, *rn;
        unsigned char *src, *dst;
+       unsigned char __user *srcu, *dstu;
 
        index = (instruction>>8)&15;    /* 0x0F00 */
        rn = &regs->regs[index];
@@ -206,28 +207,28 @@ static int handle_unaligned_ins(opcode_t instruction, struct pt_regs *regs,
        case 0: /* mov.[bwl] to/from memory via r0+rn */
                if (instruction & 8) {
                        /* from memory */
-                       src = (unsigned char*) *rm;
-                       src += regs->regs[0];
-                       dst = (unsigned char*) rn;
-                       *(unsigned long*)dst = 0;
+                       srcu = (unsigned char __user *)*rm;
+                       srcu += regs->regs[0];
+                       dst = (unsigned char *)rn;
+                       *(unsigned long *)dst = 0;
 
 #if !defined(__LITTLE_ENDIAN__)
                        dst += 4-count;
 #endif
-                       if (ma->from(dst, src, count))
+                       if (ma->from(dst, srcu, count))
                                goto fetch_fault;
 
                        sign_extend(count, dst);
                } else {
                        /* to memory */
-                       src = (unsigned char*) rm;
+                       src = (unsigned char *)rm;
 #if !defined(__LITTLE_ENDIAN__)
                        src += 4-count;
 #endif
-                       dst = (unsigned char*) *rn;
-                       dst += regs->regs[0];
+                       dstu = (unsigned char __user *)*rn;
+                       dstu += regs->regs[0];
 
-                       if (ma->to(dst, src, count))
+                       if (ma->to(dstu, src, count))
                                goto fetch_fault;
                }
                ret = 0;
@@ -235,10 +236,10 @@ static int handle_unaligned_ins(opcode_t instruction, struct pt_regs *regs,
 
        case 1: /* mov.l Rm,@(disp,Rn) */
                src = (unsigned char*) rm;
-               dst = (unsigned char*) *rn;
-               dst += (instruction&0x000F)<<2;
+               dstu = (unsigned char __user *)*rn;
+               dstu += (instruction&0x000F)<<2;
 
-               if (ma->to(dst, src, 4))
+               if (ma->to(dstu, src, 4))
                        goto fetch_fault;
                ret = 0;
                break;
@@ -247,28 +248,28 @@ static int handle_unaligned_ins(opcode_t instruction, struct pt_regs *regs,
                if (instruction & 4)
                        *rn -= count;
                src = (unsigned char*) rm;
-               dst = (unsigned char*) *rn;
+               dstu = (unsigned char __user *)*rn;
 #if !defined(__LITTLE_ENDIAN__)
                src += 4-count;
 #endif
-               if (ma->to(dst, src, count))
+               if (ma->to(dstu, src, count))
                        goto fetch_fault;
                ret = 0;
                break;
 
        case 5: /* mov.l @(disp,Rm),Rn */
-               src = (unsigned char*) *rm;
-               src += (instruction&0x000F)<<2;
-               dst = (unsigned char*) rn;
-               *(unsigned long*)dst = 0;
+               srcu = (unsigned char __user *)*rm;
+               srcu += (instruction & 0x000F) << 2;
+               dst = (unsigned char *)rn;
+               *(unsigned long *)dst = 0;
 
-               if (ma->from(dst, src, 4))
+               if (ma->from(dst, srcu, 4))
                        goto fetch_fault;
                ret = 0;
                break;
 
        case 6: /* mov.[bwl] from memory, possibly with post-increment */
-               src = (unsigned char*) *rm;
+               srcu = (unsigned char __user *)*rm;
                if (instruction & 4)
                        *rm += count;
                dst = (unsigned char*) rn;
@@ -277,7 +278,7 @@ static int handle_unaligned_ins(opcode_t instruction, struct pt_regs *regs,
 #if !defined(__LITTLE_ENDIAN__)
                dst += 4-count;
 #endif
-               if (ma->from(dst, src, count))
+               if (ma->from(dst, srcu, count))
                        goto fetch_fault;
                sign_extend(count, dst);
                ret = 0;
@@ -286,28 +287,28 @@ static int handle_unaligned_ins(opcode_t instruction, struct pt_regs *regs,
        case 8:
                switch ((instruction&0xFF00)>>8) {
                case 0x81: /* mov.w R0,@(disp,Rn) */
-                       src = (unsigned char*) &regs->regs[0];
+                       src = (unsigned char *) &regs->regs[0];
 #if !defined(__LITTLE_ENDIAN__)
                        src += 2;
 #endif
-                       dst = (unsigned char*) *rm; /* called Rn in the spec */
-                       dst += (instruction&0x000F)<<1;
+                       dstu = (unsigned char __user *)*rm; /* called Rn in the spec */
+                       dstu += (instruction & 0x000F) << 1;
 
-                       if (ma->to(dst, src, 2))
+                       if (ma->to(dstu, src, 2))
                                goto fetch_fault;
                        ret = 0;
                        break;
 
                case 0x85: /* mov.w @(disp,Rm),R0 */
-                       src = (unsigned char*) *rm;
-                       src += (instruction&0x000F)<<1;
-                       dst = (unsigned char*) &regs->regs[0];
-                       *(unsigned long*)dst = 0;
+                       srcu = (unsigned char __user *)*rm;
+                       srcu += (instruction & 0x000F) << 1;
+                       dst = (unsigned char *) &regs->regs[0];
+                       *(unsigned long *)dst = 0;
 
 #if !defined(__LITTLE_ENDIAN__)
                        dst += 2;
 #endif
-                       if (ma->from(dst, src, 2))
+                       if (ma->from(dst, srcu, 2))
                                goto fetch_fault;
                        sign_extend(2, dst);
                        ret = 0;
@@ -333,7 +334,8 @@ static inline int handle_delayslot(struct pt_regs *regs,
                                   struct mem_access *ma)
 {
        opcode_t instruction;
-       void *addr = (void *)(regs->pc + instruction_size(old_instruction));
+       void __user *addr = (void __user *)(regs->pc +
+               instruction_size(old_instruction));
 
        if (copy_from_user(&instruction, addr, sizeof(instruction))) {
                /* the instruction-fetch faulted */
@@ -559,7 +561,7 @@ asmlinkage void do_address_error(struct pt_regs *regs,
                }
 
                set_fs(USER_DS);
-               if (copy_from_user(&instruction, (void *)(regs->pc),
+               if (copy_from_user(&instruction, (void __user *)(regs->pc),
                                   sizeof(instruction))) {
                        /* Argh. Fault on the instruction itself.
                           This should never happen non-SMP
@@ -589,7 +591,7 @@ uspace_segv:
                        die("unaligned program counter", regs, error_code);
 
                set_fs(KERNEL_DS);
-               if (copy_from_user(&instruction, (void *)(regs->pc),
+               if (copy_from_user(&instruction, (void __user *)(regs->pc),
                                   sizeof(instruction))) {
                        /* Argh. Fault on the instruction itself.
                           This should never happen non-SMP
index 4bef3b5d964a1aecdec64923883f1424227a7d54..60e76aa8b53eceb6aaac7edf548c4c3a857d5827 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include <linux/types.h>
+#include <asm/div64.h>
 
 extern uint64_t __xdiv64_32(u64 n, u32 d);
 
index 64b8f7f96f9aed038e87be11ee374d5b0797f239..7619a0fae086ceb114594e43bf8b3f8f9ac65f77 100644 (file)
@@ -44,7 +44,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
         */
        dma_cache_sync(dev, ret, size, DMA_BIDIRECTIONAL);
 
-       ret_nocache = ioremap_nocache(virt_to_phys(ret), size);
+       ret_nocache = (void __force *)ioremap_nocache(virt_to_phys(ret), size);
        if (!ret_nocache) {
                free_pages((unsigned long)ret, order);
                return NULL;
index 677dd57f0877dfa0cb0ca6de0025558b2df176de..91ed4e695ff7cd0e9624583c777eab2215411b69 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <asm/page.h>
+#include <asm/uaccess.h>
 
 void copy_page(void *to, void *from)
 {
index 15111bc7ddd62719d6fd9fe25e9bd6dcacaa659e..71c742b5aee313b4badeaa62ac8610086fad2522 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <asm/pgtable.h>
+#include <asm/tlbflush.h>
 
 /*
  * Nothing too terribly exciting here ..
index 3df2aaec829fe874a633fecc3def9d5369e64446..f5aebc9f27e721cf56374f6e6b5e2ed82af7dd8a 100644 (file)
@@ -1113,7 +1113,7 @@ static const char *sci_type(struct uart_port *port)
                case PORT_IRDA: return "irda";
        }
 
-       return 0;
+       return NULL;
 }
 
 static void sci_release_port(struct uart_port *port)