Commit d34bd869 authored by Richard Henderson's avatar Richard Henderson

[ALPHA] Add __user as necessary to fix sparse warnings.

parent 7c91bb87
...@@ -1110,46 +1110,47 @@ osf_getrusage(int who, struct rusage32 __user *ru) ...@@ -1110,46 +1110,47 @@ osf_getrusage(int who, struct rusage32 __user *ru)
return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0;
} }
asmlinkage int asmlinkage long
osf_wait4(pid_t pid, int __user *ustatus, int options, struct rusage32 __user *ur) osf_wait4(pid_t pid, int __user *ustatus, int options,
struct rusage32 __user *ur)
{ {
if (!ur) { struct rusage r;
long ret, err;
mm_segment_t old_fs;
if (!ur)
return sys_wait4(pid, ustatus, options, NULL); return sys_wait4(pid, ustatus, options, NULL);
} else {
struct rusage r; old_fs = get_fs();
int ret, status;
mm_segment_t old_fs = get_fs();
set_fs (KERNEL_DS); set_fs (KERNEL_DS);
ret = sys_wait4(pid, &status, options, &r); ret = sys_wait4(pid, ustatus, options, (struct rusage __user *) &r);
set_fs (old_fs); set_fs (old_fs);
if (!access_ok(VERIFY_WRITE, ur, sizeof(*ur))) if (!access_ok(VERIFY_WRITE, ur, sizeof(*ur)))
return -EFAULT; return -EFAULT;
__put_user(r.ru_utime.tv_sec, &ur->ru_utime.tv_sec);
__put_user(r.ru_utime.tv_usec, &ur->ru_utime.tv_usec);
__put_user(r.ru_stime.tv_sec, &ur->ru_stime.tv_sec);
__put_user(r.ru_stime.tv_usec, &ur->ru_stime.tv_usec);
__put_user(r.ru_maxrss, &ur->ru_maxrss);
__put_user(r.ru_ixrss, &ur->ru_ixrss);
__put_user(r.ru_idrss, &ur->ru_idrss);
__put_user(r.ru_isrss, &ur->ru_isrss);
__put_user(r.ru_minflt, &ur->ru_minflt);
__put_user(r.ru_majflt, &ur->ru_majflt);
__put_user(r.ru_nswap, &ur->ru_nswap);
__put_user(r.ru_inblock, &ur->ru_inblock);
__put_user(r.ru_oublock, &ur->ru_oublock);
__put_user(r.ru_msgsnd, &ur->ru_msgsnd);
__put_user(r.ru_msgrcv, &ur->ru_msgrcv);
__put_user(r.ru_nsignals, &ur->ru_nsignals);
__put_user(r.ru_nvcsw, &ur->ru_nvcsw);
if (__put_user(r.ru_nivcsw, &ur->ru_nivcsw))
return -EFAULT;
if (ustatus && put_user(status, ustatus)) err = 0;
return -EFAULT; err |= __put_user(r.ru_utime.tv_sec, &ur->ru_utime.tv_sec);
return ret; err |= __put_user(r.ru_utime.tv_usec, &ur->ru_utime.tv_usec);
} err |= __put_user(r.ru_stime.tv_sec, &ur->ru_stime.tv_sec);
err |= __put_user(r.ru_stime.tv_usec, &ur->ru_stime.tv_usec);
err |= __put_user(r.ru_maxrss, &ur->ru_maxrss);
err |= __put_user(r.ru_ixrss, &ur->ru_ixrss);
err |= __put_user(r.ru_idrss, &ur->ru_idrss);
err |= __put_user(r.ru_isrss, &ur->ru_isrss);
err |= __put_user(r.ru_minflt, &ur->ru_minflt);
err |= __put_user(r.ru_majflt, &ur->ru_majflt);
err |= __put_user(r.ru_nswap, &ur->ru_nswap);
err |= __put_user(r.ru_inblock, &ur->ru_inblock);
err |= __put_user(r.ru_oublock, &ur->ru_oublock);
err |= __put_user(r.ru_msgsnd, &ur->ru_msgsnd);
err |= __put_user(r.ru_msgrcv, &ur->ru_msgrcv);
err |= __put_user(r.ru_nsignals, &ur->ru_nsignals);
err |= __put_user(r.ru_nvcsw, &ur->ru_nvcsw);
err |= __put_user(r.ru_nivcsw, &ur->ru_nivcsw);
return err ? err : ret;
} }
/* /*
......
...@@ -146,7 +146,7 @@ srmcons_write(struct tty_struct *tty, int from_user, ...@@ -146,7 +146,7 @@ srmcons_write(struct tty_struct *tty, int from_user,
if (c > sizeof(tmp)) if (c > sizeof(tmp))
c = sizeof(tmp); c = sizeof(tmp);
c -= copy_from_user(tmp, buf, c); c -= copy_from_user(tmp, (const char __user *) buf, c);
if (!c) { if (!c) {
printk("%s: EFAULT (count %d)\n", printk("%s: EFAULT (count %d)\n",
......
...@@ -111,7 +111,7 @@ dik_show_code(unsigned int *pc) ...@@ -111,7 +111,7 @@ dik_show_code(unsigned int *pc)
printk("Code:"); printk("Code:");
for (i = -6; i < 2; i++) { for (i = -6; i < 2; i++) {
unsigned int insn; unsigned int insn;
if (__get_user(insn, pc+i)) if (__get_user(insn, (unsigned int __user *)pc + i))
break; break;
printk("%c%08x%c", i ? ' ' : '<', insn, i ? ' ' : '>'); printk("%c%08x%c", i ? ' ' : '<', insn, i ? ' ' : '>');
} }
......
...@@ -98,7 +98,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr, ...@@ -98,7 +98,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
by ignoring such an instruction. */ by ignoring such an instruction. */
if (cause == 0) { if (cause == 0) {
unsigned int insn; unsigned int insn;
__get_user(insn, (unsigned int *)regs->pc); __get_user(insn, (unsigned int __user *)regs->pc);
if ((insn >> 21 & 0x1f) == 0x1f && if ((insn >> 21 & 0x1f) == 0x1f &&
/* ldq ldl ldt lds ldg ldf ldwu ldbu */ /* ldq ldl ldt lds ldg ldf ldwu ldbu */
(1ul << (insn >> 26) & 0x30f00001400ul)) { (1ul << (insn >> 26) & 0x30f00001400ul)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment