]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] uml: sparse cleanups
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 31 Mar 2006 10:30:15 +0000 (02:30 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 31 Mar 2006 20:18:51 +0000 (12:18 -0800)
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>
16 files changed:
arch/um/drivers/harddog_kern.c
arch/um/drivers/hostaudio_kern.c
arch/um/drivers/slirp_kern.c
arch/um/include/line.h
arch/um/include/sysdep-i386/checksum.h
arch/um/kernel/exec_kern.c
arch/um/kernel/process_kern.c
arch/um/kernel/ptrace.c
arch/um/kernel/syscall_kern.c
arch/um/kernel/trap_kern.c
arch/um/sys-i386/ptrace.c
arch/um/sys-i386/signal.c
arch/um/sys-i386/syscalls.c
include/asm-um/ptrace-generic.h
include/asm-um/thread_info.h
include/asm-um/uaccess.h

index 49acb2badf3229437c7a0149bc3da5be8d7d2109..d18a974735e649ed25f95159ef19ce274d59d408 100644 (file)
@@ -104,7 +104,7 @@ static int harddog_release(struct inode *inode, struct file *file)
 
 extern int ping_watchdog(int fd);
 
-static ssize_t harddog_write(struct file *file, const char *data, size_t len,
+static ssize_t harddog_write(struct file *file, const char __user *data, size_t len,
                             loff_t *ppos)
 {
        /*
@@ -118,6 +118,7 @@ static ssize_t harddog_write(struct file *file, const char *data, size_t len,
 static int harddog_ioctl(struct inode *inode, struct file *file,
                         unsigned int cmd, unsigned long arg)
 {
+       void __user *argp= (void __user *)arg;
        static struct watchdog_info ident = {
                WDIOC_SETTIMEOUT,
                0,
@@ -127,13 +128,12 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
                default:
                        return -ENOTTY;
                case WDIOC_GETSUPPORT:
-                       if(copy_to_user((struct harddog_info *)arg, &ident,
-                                       sizeof(ident)))
+                       if(copy_to_user(argp, &ident, sizeof(ident)))
                                return -EFAULT;
                        return 0;
                case WDIOC_GETSTATUS:
                case WDIOC_GETBOOTSTATUS:
-                       return put_user(0,(int *)arg);
+                       return put_user(0,(int __user *)argp);
                case WDIOC_KEEPALIVE:
                        return(ping_watchdog(harddog_out_fd));
        }
index 59602b81b2402be669fe264eee5f9afb2999565a..37232f908cd74e1c86e88874f68f41bb342fabcf 100644 (file)
@@ -67,8 +67,8 @@ MODULE_PARM_DESC(mixer, MIXER_HELP);
 
 /* /dev/dsp file operations */
 
-static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count, 
-                             loff_t *ppos)
+static ssize_t hostaudio_read(struct file *file, char __user *buffer,
+                             size_t count, loff_t *ppos)
 {
         struct hostaudio_state *state = file->private_data;
        void *kbuf;
@@ -94,7 +94,7 @@ static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count,
        return(err);
 }
 
-static ssize_t hostaudio_write(struct file *file, const char *buffer, 
+static ssize_t hostaudio_write(struct file *file, const char __user *buffer,
                               size_t count, loff_t *ppos)
 {
         struct hostaudio_state *state = file->private_data;
@@ -152,7 +152,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file,
        case SNDCTL_DSP_CHANNELS:
        case SNDCTL_DSP_SUBDIVIDE:
        case SNDCTL_DSP_SETFRAGMENT:
-               if(get_user(data, (int *) arg))
+               if(get_user(data, (int __user *) arg))
                        return(-EFAULT);
                break;
        default:
@@ -168,7 +168,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file,
        case SNDCTL_DSP_CHANNELS:
        case SNDCTL_DSP_SUBDIVIDE:
        case SNDCTL_DSP_SETFRAGMENT:
-               if(put_user(data, (int *) arg))
+               if(put_user(data, (int __user *) arg))
                        return(-EFAULT);
                break;
        default:
index 109c541e78f2673fa9751a9e6f91571be570e384..95e50c943e14f52c7770be2788d5f598cab64adf 100644 (file)
@@ -77,7 +77,7 @@ static int slirp_setup(char *str, char **mac_out, void *data)
        int i=0;
 
        *init = ((struct slirp_init)
-               { argw :                { { "slirp", NULL  } } });
+               { .argw = { { "slirp", NULL  } } });
 
        str = split_if_spec(str, mac_out, NULL);
 
index 6f4d680dc1d4a810cb531b6370c61a2ad0206a94..6ac0f8252e21e3dfdf55d359c0d46c8f7dbc069a 100644 (file)
@@ -58,23 +58,17 @@ struct line {
 };
 
 #define LINE_INIT(str, d) \
-       { init_str :    str, \
-         init_pri :    INIT_STATIC, \
-         valid :       1, \
-         throttled :   0, \
-         lock :        SPIN_LOCK_UNLOCKED, \
-         buffer :      NULL, \
-         head :        NULL, \
-         tail :        NULL, \
-         sigio :       0, \
-         driver :      d, \
-         have_irq :    0 }
+       { .init_str =   str, \
+         .init_pri =   INIT_STATIC, \
+         .valid =      1, \
+         .lock =       SPIN_LOCK_UNLOCKED, \
+         .driver =     d }
 
 struct lines {
        int num;
 };
 
-#define LINES_INIT(n) {  num :         n }
+#define LINES_INIT(n) {  .num =        n }
 
 extern void line_close(struct tty_struct *tty, struct file * filp);
 extern int line_open(struct line *lines, struct tty_struct *tty);
index 7d3d202d7fff542163cce7329b21e5e910ab1f14..052bb061a978171a11ab2be664301fbfa94f2dd3 100644 (file)
@@ -48,7 +48,8 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *
  */
 
 static __inline__
-unsigned int csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst,
+unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
+                                        unsigned char *dst,
                                         int len, int sum, int *err_ptr)
 {
        if(copy_from_user(dst, src, len)){
@@ -192,7 +193,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
  */
 #define HAVE_CSUM_COPY_USER
 static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src,
-                                                    unsigned char *dst,
+                                                    unsigned char __user *dst,
                                                     int len, int sum, int *err_ptr)
 {
        if (access_ok(VERIFY_WRITE, dst, len)){
index 1ca84319317d2cfe8f49423d848339ecd2e07127..f9b346e05b007a49034dd514071938f08f3084cf 100644 (file)
@@ -58,14 +58,14 @@ long um_execve(char *file, char __user *__user *argv, char __user *__user *env)
        return(err);
 }
 
-long sys_execve(char *file, char __user *__user *argv,
+long sys_execve(char __user *file, char __user *__user *argv,
                char __user *__user *env)
 {
        long error;
        char *filename;
 
        lock_kernel();
-       filename = getname((char __user *) file);
+       filename = getname(file);
        error = PTR_ERR(filename);
        if (IS_ERR(filename)) goto out;
        error = execve1(filename, argv, env);
index 3113cab8675e6358c6909201ebbb3ae90beacf60..6922bdfb5ad5a9b5af66d4cd675480269c00e978 100644 (file)
@@ -407,7 +407,7 @@ static int proc_read_sysemu(char *buf, char **start, off_t offset, int size,int
        return strlen(buf);
 }
 
-static int proc_write_sysemu(struct file *file,const char *buf, unsigned long count,void *data)
+static int proc_write_sysemu(struct file *file,const char __user *buf, unsigned long count,void *data)
 {
        char tmp[2];
 
index 98e09395c093c1d75be57ab82ed3b46c084e533f..394582202ce628d62b48933ee4a448e57d20d390 100644 (file)
@@ -46,6 +46,7 @@ extern int poke_user(struct task_struct * child, long addr, long data);
 long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 {
        int i, ret;
+       unsigned long __user *p = (void __user *)(unsigned long)data;
 
        switch (request) {
                /* when I and D space are separate, these will need to be fixed. */
@@ -58,7 +59,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
                if (copied != sizeof(tmp))
                        break;
-               ret = put_user(tmp, (unsigned long __user *) data);
+               ret = put_user(tmp, p);
                break;
        }
 
@@ -136,15 +137,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 
 #ifdef PTRACE_GETREGS
        case PTRACE_GETREGS: { /* Get all gp regs from the child. */
-               if (!access_ok(VERIFY_WRITE, (unsigned long *)data, 
-                              MAX_REG_OFFSET)) {
+               if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) {
                        ret = -EIO;
                        break;
                }
                for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) {
-                       __put_user(getreg(child, i),
-                                  (unsigned long __user *) data);
-                       data += sizeof(long);
+                       __put_user(getreg(child, i), p);
+                       p++;
                }
                ret = 0;
                break;
@@ -153,15 +152,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 #ifdef PTRACE_SETREGS
        case PTRACE_SETREGS: { /* Set all gp regs in the child. */
                unsigned long tmp = 0;
-               if (!access_ok(VERIFY_READ, (unsigned *)data, 
-                              MAX_REG_OFFSET)) {
+               if (!access_ok(VERIFY_READ, p, MAX_REG_OFFSET)) {
                        ret = -EIO;
                        break;
                }
                for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) {
-                       __get_user(tmp, (unsigned long __user *) data);
+                       __get_user(tmp, p);
                        putreg(child, i, tmp);
-                       data += sizeof(long);
+                       p++;
                }
                ret = 0;
                break;
@@ -188,13 +186,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                break;
 #endif
        case PTRACE_FAULTINFO: {
-                /* Take the info from thread->arch->faultinfo,
-                 * but transfer max. sizeof(struct ptrace_faultinfo).
-                 * On i386, ptrace_faultinfo is smaller!
-                 */
-                ret = copy_to_user((unsigned long __user *) data,
-                                   &child->thread.arch.faultinfo,
-                                   sizeof(struct ptrace_faultinfo));
+               /* Take the info from thread->arch->faultinfo,
+                * but transfer max. sizeof(struct ptrace_faultinfo).
+                * On i386, ptrace_faultinfo is smaller!
+                */
+               ret = copy_to_user(p, &child->thread.arch.faultinfo,
+                                  sizeof(struct ptrace_faultinfo));
                if(ret)
                        break;
                break;
@@ -204,8 +201,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
        case PTRACE_LDT: {
                struct ptrace_ldt ldt;
 
-               if(copy_from_user(&ldt, (unsigned long __user *) data,
-                                 sizeof(ldt))){
+               if(copy_from_user(&ldt, p, sizeof(ldt))){
                        ret = -EIO;
                        break;
                }
index 8e1a3501ff46362814c0bb83b974951cbafbe9e2..37d3978337d87a3e31756c1b997047026d945dfa 100644 (file)
@@ -104,7 +104,7 @@ long sys_pipe(unsigned long __user * fildes)
 }
 
 
-long sys_uname(struct old_utsname * name)
+long sys_uname(struct old_utsname __user * name)
 {
        long err;
        if (!name)
@@ -115,7 +115,7 @@ long sys_uname(struct old_utsname * name)
        return err?-EFAULT:0;
 }
 
-long sys_olduname(struct oldold_utsname * name)
+long sys_olduname(struct oldold_utsname __user * name)
 {
        long error;
 
index d56046c2aba2fec7799ae39df1ef8b53fdcba9f9..02f6d4d8dc3af3a5fd5842909f24fe1b89f980bb 100644 (file)
@@ -198,7 +198,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
                si.si_signo = SIGBUS;
                si.si_errno = 0;
                si.si_code = BUS_ADRERR;
-               si.si_addr = (void *)address;
+               si.si_addr = (void __user *)address;
                 current->thread.arch.faultinfo = fi;
                force_sig_info(SIGBUS, &si, current);
        } else if (err == -ENOMEM) {
@@ -207,7 +207,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
        } else {
                BUG_ON(err != -EFAULT);
                si.si_signo = SIGSEGV;
-               si.si_addr = (void *) address;
+               si.si_addr = (void __user *) address;
                 current->thread.arch.faultinfo = fi;
                force_sig_info(SIGSEGV, &si, current);
        }
@@ -220,8 +220,8 @@ void bad_segv(struct faultinfo fi, unsigned long ip)
 
        si.si_signo = SIGSEGV;
        si.si_code = SEGV_ACCERR;
-        si.si_addr = (void *) FAULT_ADDRESS(fi);
-        current->thread.arch.faultinfo = fi;
+       si.si_addr = (void __user *) FAULT_ADDRESS(fi);
+       current->thread.arch.faultinfo = fi;
        force_sig_info(SIGSEGV, &si, current);
 }
 
index 8032a105949a02155945d52e00e1123f29039a1e..ff94eded93ebf537b555030f3aaae3566e0bc67c 100644 (file)
@@ -124,22 +124,22 @@ unsigned long getreg(struct task_struct *child, int regno)
 int peek_user(struct task_struct *child, long addr, long data)
 {
 /* read the word at location addr in the USER area. */
-        unsigned long tmp;
+       unsigned long tmp;
 
-        if ((addr & 3) || addr < 0)
-                return -EIO;
+       if ((addr & 3) || addr < 0)
+               return -EIO;
 
-        tmp = 0;  /* Default return condition */
-        if(addr < MAX_REG_OFFSET){
-                tmp = getreg(child, addr);
-        }
-        else if((addr >= offsetof(struct user, u_debugreg[0])) &&
-                (addr <= offsetof(struct user, u_debugreg[7]))){
-                addr -= offsetof(struct user, u_debugreg[0]);
-                addr = addr >> 2;
-                tmp = child->thread.arch.debugregs[addr];
-        }
-        return put_user(tmp, (unsigned long *) data);
+       tmp = 0;  /* Default return condition */
+       if(addr < MAX_REG_OFFSET){
+               tmp = getreg(child, addr);
+       }
+       else if((addr >= offsetof(struct user, u_debugreg[0])) &&
+               (addr <= offsetof(struct user, u_debugreg[7]))){
+               addr -= offsetof(struct user, u_debugreg[0]);
+               addr = addr >> 2;
+               tmp = child->thread.arch.debugregs[addr];
+       }
+       return put_user(tmp, (unsigned long __user *) data);
 }
 
 struct i387_fxsave_struct {
index 33a40f5ef0d2d5666df8bfa43052a73013eaebf4..f5d0e1c37ea263950d03d33a6edb50ce0966da81 100644 (file)
@@ -19,7 +19,7 @@
 #include "skas.h"
 
 static int copy_sc_from_user_skas(struct pt_regs *regs,
-                                 struct sigcontext *from)
+                                 struct sigcontext __user *from)
 {
        struct sigcontext sc;
        unsigned long fpregs[HOST_FP_SIZE];
@@ -57,7 +57,7 @@ static int copy_sc_from_user_skas(struct pt_regs *regs,
        return(0);
 }
 
-int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
+int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate __user *to_fp,
                          struct pt_regs *regs, unsigned long sp)
 {
        struct sigcontext sc;
@@ -92,7 +92,7 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
                       "errno = %d\n", err);
                return(1);
        }
-       to_fp = (to_fp ? to_fp : (struct _fpstate *) (to + 1));
+       to_fp = (to_fp ? to_fp : (struct _fpstate __user *) (to + 1));
        sc.fpstate = to_fp;
 
        if(err)
@@ -113,10 +113,11 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
  * saved pointer is in the kernel, but the sigcontext is in userspace, so we
  * copy_to_user it.
  */
-int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
+int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from,
                         int fpsize)
 {
-       struct _fpstate *to_fp, *from_fp;
+       struct _fpstate *to_fp;
+       struct _fpstate __user *from_fp;
        unsigned long sigs;
        int err;
 
@@ -131,13 +132,14 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
        return(err);
 }
 
-int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp,
+int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate __user *fp,
                       struct sigcontext *from, int fpsize, unsigned long sp)
 {
-       struct _fpstate *to_fp, *from_fp;
+       struct _fpstate __user *to_fp;
+       struct _fpstate *from_fp;
        int err;
 
-       to_fp = (fp ? fp : (struct _fpstate *) (to + 1));
+       to_fp = (fp ? fp : (struct _fpstate __user *) (to + 1));
        from_fp = from->fpstate;
        err = copy_to_user(to, from, sizeof(*to));
 
@@ -165,7 +167,7 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from)
        return(ret);
 }
 
-static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp,
+static int copy_sc_to_user(struct sigcontext *to, struct _fpstate __user *fp,
                           struct pt_regs *from, unsigned long sp)
 {
        return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs),
@@ -173,7 +175,7 @@ static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp,
                            copy_sc_to_user_skas(to, fp, from, sp)));
 }
 
-static int copy_ucontext_to_user(struct ucontext *uc, struct _fpstate *fp,
+static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __user *fp,
                                 sigset_t *set, unsigned long sp)
 {
        int err = 0;
@@ -188,7 +190,7 @@ static int copy_ucontext_to_user(struct ucontext *uc, struct _fpstate *fp,
 
 struct sigframe
 {
-       char *pretcode;
+       char __user *pretcode;
        int sig;
        struct sigcontext sc;
        struct _fpstate fpstate;
@@ -198,10 +200,10 @@ struct sigframe
 
 struct rt_sigframe
 {
-       char *pretcode;
+       char __user *pretcode;
        int sig;
-       struct siginfo *pinfo;
-       void *puc;
+       struct siginfo __user *pinfo;
+       void __user *puc;
        struct siginfo info;
        struct ucontext uc;
        struct _fpstate fpstate;
@@ -213,16 +215,16 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
                          sigset_t *mask)
 {
        struct sigframe __user *frame;
-       void *restorer;
+       void __user *restorer;
        unsigned long save_sp = PT_REGS_SP(regs);
        int err = 0;
 
        stack_top &= -8UL;
-       frame = (struct sigframe *) stack_top - 1;
+       frame = (struct sigframe __user *) stack_top - 1;
        if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
                return 1;
 
-       restorer = (void *) frame->retcode;
+       restorer = frame->retcode;
        if(ka->sa.sa_flags & SA_RESTORER)
                restorer = ka->sa.sa_restorer;
 
@@ -278,16 +280,16 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
                          siginfo_t *info, sigset_t *mask)
 {
        struct rt_sigframe __user *frame;
-       void *restorer;
+       void __user *restorer;
        unsigned long save_sp = PT_REGS_SP(regs);
        int err = 0;
 
        stack_top &= -8UL;
-       frame = (struct rt_sigframe *) stack_top - 1;
+       frame = (struct rt_sigframe __user *) stack_top - 1;
        if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
                return 1;
 
-       restorer = (void *) frame->retcode;
+       restorer = frame->retcode;
        if(ka->sa.sa_flags & SA_RESTORER)
                restorer = ka->sa.sa_restorer;
 
@@ -333,7 +335,7 @@ err:
 long sys_sigreturn(struct pt_regs regs)
 {
        unsigned long sp = PT_REGS_SP(&current->thread.regs);
-       struct sigframe __user *frame = (struct sigframe *)(sp - 8);
+       struct sigframe __user *frame = (struct sigframe __user *)(sp - 8);
        sigset_t set;
        struct sigcontext __user *sc = &frame->sc;
        unsigned long __user *oldmask = &sc->oldmask;
@@ -365,8 +367,8 @@ long sys_sigreturn(struct pt_regs regs)
 
 long sys_rt_sigreturn(struct pt_regs regs)
 {
-       unsigned long __user sp = PT_REGS_SP(&current->thread.regs);
-       struct rt_sigframe __user *frame = (struct rt_sigframe *) (sp - 4);
+       unsigned long sp = PT_REGS_SP(&current->thread.regs);
+       struct rt_sigframe __user *frame = (struct rt_sigframe __user *) (sp - 4);
        sigset_t set;
        struct ucontext __user *uc = &frame->uc;
        int sig_size = _NSIG_WORDS * sizeof(unsigned long);
index 83e9be820a86991b50ccf25de396c5f0cd626088..1845123ed1249b5305303c02a1a870f70d20143a 100644 (file)
@@ -104,7 +104,7 @@ long sys_ipc (uint call, int first, int second,
                union semun fourth;
                if (!ptr)
                        return -EINVAL;
-               if (get_user(fourth.__pad, (void **) ptr))
+               if (get_user(fourth.__pad, (void __user * __user *) ptr))
                        return -EFAULT;
                return sys_semctl (first, second, third, fourth);
        }
index 46599ac44037202109eea89a46e9e830320efb44..8c57e384cb8a7dffa954a60bd0f5e4e77394b6f4 100644 (file)
@@ -28,7 +28,7 @@ struct pt_regs {
        union uml_pt_regs regs;
 };
 
-#define EMPTY_REGS { regs : EMPTY_UML_PT_REGS }
+#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS }
 
 #define PT_REGS_IP(r) UPT_IP(&(r)->regs)
 #define PT_REGS_SP(r) UPT_SP(&(r)->regs)
index 17b6b07c4332f01a577981ab8bae819a01a29bd2..f166b9837c6a59eca771e760d2b4b46dbfbd3a43 100644 (file)
@@ -27,14 +27,14 @@ struct thread_info {
 
 #define INIT_THREAD_INFO(tsk)                  \
 {                                              \
-       task:           &tsk,                   \
-       exec_domain:    &default_exec_domain,   \
-       flags:          0,                      \
-       cpu:            0,                      \
-       preempt_count:  1,                      \
-       addr_limit:     KERNEL_DS,              \
-       restart_block:  {                       \
-               fn:  do_no_restart_syscall,     \
+       .task =         &tsk,                   \
+       .exec_domain =  &default_exec_domain,   \
+       .flags =                0,              \
+       .cpu =          0,                      \
+       .preempt_count =        1,              \
+       .addr_limit =   KERNEL_DS,              \
+       .restart_block =  {                     \
+               .fn =  do_no_restart_syscall,   \
        },                                      \
 }
 
index 4e460d6f5ac825c6f7daca027200259b737b4fbd..bea5a015f6674b4102030cf81de18813a07e2883 100644 (file)
@@ -57,7 +57,7 @@
 ({ \
         const __typeof__((*(ptr))) __user *private_ptr = (ptr); \
         (access_ok(VERIFY_READ, private_ptr, sizeof(*private_ptr)) ? \
-        __get_user(x, private_ptr) : ((x) = 0, -EFAULT)); \
+        __get_user(x, private_ptr) : ((x) = (__typeof__(*ptr))0, -EFAULT)); \
 })
 
 #define __put_user(x, ptr) \