Commit f3cbd435 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

sys_prctl(): coding-style cleanup

Remove a tabstop from the switch statement, in the usual fashion.  A few
instances of weirdwrapping were removed as a result.

Cc: Chen Gang <gang.chen@asianux.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7fe5e042
...@@ -2013,161 +2013,159 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, ...@@ -2013,161 +2013,159 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
error = 0; error = 0;
switch (option) { switch (option) {
case PR_SET_PDEATHSIG: case PR_SET_PDEATHSIG:
if (!valid_signal(arg2)) { if (!valid_signal(arg2)) {
error = -EINVAL; error = -EINVAL;
break;
}
me->pdeath_signal = arg2;
break;
case PR_GET_PDEATHSIG:
error = put_user(me->pdeath_signal, (int __user *)arg2);
break;
case PR_GET_DUMPABLE:
error = get_dumpable(me->mm);
break; break;
case PR_SET_DUMPABLE: }
if (arg2 != SUID_DUMP_DISABLE && me->pdeath_signal = arg2;
arg2 != SUID_DUMP_USER) { break;
error = -EINVAL; case PR_GET_PDEATHSIG:
break; error = put_user(me->pdeath_signal, (int __user *)arg2);
} break;
set_dumpable(me->mm, arg2); case PR_GET_DUMPABLE:
error = get_dumpable(me->mm);
break;
case PR_SET_DUMPABLE:
if (arg2 != SUID_DUMP_DISABLE && arg2 != SUID_DUMP_USER) {
error = -EINVAL;
break; break;
}
set_dumpable(me->mm, arg2);
break;
case PR_SET_UNALIGN: case PR_SET_UNALIGN:
error = SET_UNALIGN_CTL(me, arg2); error = SET_UNALIGN_CTL(me, arg2);
break; break;
case PR_GET_UNALIGN: case PR_GET_UNALIGN:
error = GET_UNALIGN_CTL(me, arg2); error = GET_UNALIGN_CTL(me, arg2);
break; break;
case PR_SET_FPEMU: case PR_SET_FPEMU:
error = SET_FPEMU_CTL(me, arg2); error = SET_FPEMU_CTL(me, arg2);
break; break;
case PR_GET_FPEMU: case PR_GET_FPEMU:
error = GET_FPEMU_CTL(me, arg2); error = GET_FPEMU_CTL(me, arg2);
break; break;
case PR_SET_FPEXC: case PR_SET_FPEXC:
error = SET_FPEXC_CTL(me, arg2); error = SET_FPEXC_CTL(me, arg2);
break; break;
case PR_GET_FPEXC: case PR_GET_FPEXC:
error = GET_FPEXC_CTL(me, arg2); error = GET_FPEXC_CTL(me, arg2);
break; break;
case PR_GET_TIMING: case PR_GET_TIMING:
error = PR_TIMING_STATISTICAL; error = PR_TIMING_STATISTICAL;
break; break;
case PR_SET_TIMING: case PR_SET_TIMING:
if (arg2 != PR_TIMING_STATISTICAL) if (arg2 != PR_TIMING_STATISTICAL)
error = -EINVAL; error = -EINVAL;
break; break;
case PR_SET_NAME: case PR_SET_NAME:
comm[sizeof(me->comm)-1] = 0; comm[sizeof(me->comm) - 1] = 0;
if (strncpy_from_user(comm, (char __user *)arg2, if (strncpy_from_user(comm, (char __user *)arg2,
sizeof(me->comm) - 1) < 0) sizeof(me->comm) - 1) < 0)
return -EFAULT; return -EFAULT;
set_task_comm(me, comm); set_task_comm(me, comm);
proc_comm_connector(me); proc_comm_connector(me);
break; break;
case PR_GET_NAME: case PR_GET_NAME:
get_task_comm(comm, me); get_task_comm(comm, me);
if (copy_to_user((char __user *)arg2, comm, if (copy_to_user((char __user *)arg2, comm, sizeof(comm)))
sizeof(comm))) return -EFAULT;
return -EFAULT; break;
break; case PR_GET_ENDIAN:
case PR_GET_ENDIAN: error = GET_ENDIAN(me, arg2);
error = GET_ENDIAN(me, arg2); break;
break; case PR_SET_ENDIAN:
case PR_SET_ENDIAN: error = SET_ENDIAN(me, arg2);
error = SET_ENDIAN(me, arg2); break;
break; case PR_GET_SECCOMP:
case PR_GET_SECCOMP: error = prctl_get_seccomp();
error = prctl_get_seccomp(); break;
break; case PR_SET_SECCOMP:
case PR_SET_SECCOMP: error = prctl_set_seccomp(arg2, (char __user *)arg3);
error = prctl_set_seccomp(arg2, (char __user *)arg3); break;
break; case PR_GET_TSC:
case PR_GET_TSC: error = GET_TSC_CTL(arg2);
error = GET_TSC_CTL(arg2); break;
break; case PR_SET_TSC:
case PR_SET_TSC: error = SET_TSC_CTL(arg2);
error = SET_TSC_CTL(arg2); break;
break; case PR_TASK_PERF_EVENTS_DISABLE:
case PR_TASK_PERF_EVENTS_DISABLE: error = perf_event_task_disable();
error = perf_event_task_disable(); break;
break; case PR_TASK_PERF_EVENTS_ENABLE:
case PR_TASK_PERF_EVENTS_ENABLE: error = perf_event_task_enable();
error = perf_event_task_enable(); break;
break; case PR_GET_TIMERSLACK:
case PR_GET_TIMERSLACK: error = current->timer_slack_ns;
error = current->timer_slack_ns; break;
break; case PR_SET_TIMERSLACK:
case PR_SET_TIMERSLACK: if (arg2 <= 0)
if (arg2 <= 0) current->timer_slack_ns =
current->timer_slack_ns =
current->default_timer_slack_ns; current->default_timer_slack_ns;
else else
current->timer_slack_ns = arg2; current->timer_slack_ns = arg2;
break; break;
case PR_MCE_KILL: case PR_MCE_KILL:
if (arg4 | arg5) if (arg4 | arg5)
return -EINVAL; return -EINVAL;
switch (arg2) { switch (arg2) {
case PR_MCE_KILL_CLEAR: case PR_MCE_KILL_CLEAR:
if (arg3 != 0) if (arg3 != 0)
return -EINVAL;
current->flags &= ~PF_MCE_PROCESS;
break;
case PR_MCE_KILL_SET:
current->flags |= PF_MCE_PROCESS;
if (arg3 == PR_MCE_KILL_EARLY)
current->flags |= PF_MCE_EARLY;
else if (arg3 == PR_MCE_KILL_LATE)
current->flags &= ~PF_MCE_EARLY;
else if (arg3 == PR_MCE_KILL_DEFAULT)
current->flags &=
~(PF_MCE_EARLY|PF_MCE_PROCESS);
else
return -EINVAL;
break;
default:
return -EINVAL; return -EINVAL;
} current->flags &= ~PF_MCE_PROCESS;
break; break;
case PR_MCE_KILL_GET: case PR_MCE_KILL_SET:
if (arg2 | arg3 | arg4 | arg5) current->flags |= PF_MCE_PROCESS;
return -EINVAL; if (arg3 == PR_MCE_KILL_EARLY)
if (current->flags & PF_MCE_PROCESS) current->flags |= PF_MCE_EARLY;
error = (current->flags & PF_MCE_EARLY) ? else if (arg3 == PR_MCE_KILL_LATE)
PR_MCE_KILL_EARLY : PR_MCE_KILL_LATE; current->flags &= ~PF_MCE_EARLY;
else if (arg3 == PR_MCE_KILL_DEFAULT)
current->flags &=
~(PF_MCE_EARLY|PF_MCE_PROCESS);
else else
error = PR_MCE_KILL_DEFAULT;
break;
case PR_SET_MM:
error = prctl_set_mm(arg2, arg3, arg4, arg5);
break;
case PR_GET_TID_ADDRESS:
error = prctl_get_tid_address(me, (int __user **)arg2);
break;
case PR_SET_CHILD_SUBREAPER:
me->signal->is_child_subreaper = !!arg2;
break;
case PR_GET_CHILD_SUBREAPER:
error = put_user(me->signal->is_child_subreaper,
(int __user *) arg2);
break;
case PR_SET_NO_NEW_PRIVS:
if (arg2 != 1 || arg3 || arg4 || arg5)
return -EINVAL; return -EINVAL;
current->no_new_privs = 1;
break; break;
case PR_GET_NO_NEW_PRIVS:
if (arg2 || arg3 || arg4 || arg5)
return -EINVAL;
return current->no_new_privs ? 1 : 0;
default: default:
error = -EINVAL; return -EINVAL;
break; }
break;
case PR_MCE_KILL_GET:
if (arg2 | arg3 | arg4 | arg5)
return -EINVAL;
if (current->flags & PF_MCE_PROCESS)
error = (current->flags & PF_MCE_EARLY) ?
PR_MCE_KILL_EARLY : PR_MCE_KILL_LATE;
else
error = PR_MCE_KILL_DEFAULT;
break;
case PR_SET_MM:
error = prctl_set_mm(arg2, arg3, arg4, arg5);
break;
case PR_GET_TID_ADDRESS:
error = prctl_get_tid_address(me, (int __user **)arg2);
break;
case PR_SET_CHILD_SUBREAPER:
me->signal->is_child_subreaper = !!arg2;
break;
case PR_GET_CHILD_SUBREAPER:
error = put_user(me->signal->is_child_subreaper,
(int __user *)arg2);
break;
case PR_SET_NO_NEW_PRIVS:
if (arg2 != 1 || arg3 || arg4 || arg5)
return -EINVAL;
current->no_new_privs = 1;
break;
case PR_GET_NO_NEW_PRIVS:
if (arg2 || arg3 || arg4 || arg5)
return -EINVAL;
return current->no_new_privs ? 1 : 0;
default:
error = -EINVAL;
break;
} }
return error; return error;
} }
......
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