Commit 5aba085e authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

kernel/signal.c: fix typos and coding style

General coding style and comment fixes; no code changes:

 - Use multi-line-comment coding style.
 - Put some function signatures completely on one line.
 - Hyphenate some words.
 - Spell Posix as POSIX.
 - Correct typos & spellos in some comments.
 - Drop trailing whitespace.
 - End sentences with periods.
Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 21b86bd5
...@@ -226,7 +226,7 @@ static inline void print_dropped_signal(int sig) ...@@ -226,7 +226,7 @@ static inline void print_dropped_signal(int sig)
/* /*
* allocate a new signal queue record * allocate a new signal queue record
* - this may be called without locks if and only if t == current, otherwise an * - this may be called without locks if and only if t == current, otherwise an
* appopriate lock must be held to stop the target task from exiting * appropriate lock must be held to stop the target task from exiting
*/ */
static struct sigqueue * static struct sigqueue *
__sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimit) __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimit)
...@@ -375,15 +375,15 @@ int unhandled_signal(struct task_struct *tsk, int sig) ...@@ -375,15 +375,15 @@ int unhandled_signal(struct task_struct *tsk, int sig)
return !tracehook_consider_fatal_signal(tsk, sig); return !tracehook_consider_fatal_signal(tsk, sig);
} }
/*
/* Notify the system that a driver wants to block all signals for this * Notify the system that a driver wants to block all signals for this
* process, and wants to be notified if any signals at all were to be * process, and wants to be notified if any signals at all were to be
* sent/acted upon. If the notifier routine returns non-zero, then the * sent/acted upon. If the notifier routine returns non-zero, then the
* signal will be acted upon after all. If the notifier routine returns 0, * signal will be acted upon after all. If the notifier routine returns 0,
* then then signal will be blocked. Only one block per process is * then then signal will be blocked. Only one block per process is
* allowed. priv is a pointer to private data that the notifier routine * allowed. priv is a pointer to private data that the notifier routine
* can use to determine if the signal should be blocked or not. */ * can use to determine if the signal should be blocked or not.
*/
void void
block_all_signals(int (*notifier)(void *priv), void *priv, sigset_t *mask) block_all_signals(int (*notifier)(void *priv), void *priv, sigset_t *mask)
{ {
...@@ -434,9 +434,10 @@ static void collect_signal(int sig, struct sigpending *list, siginfo_t *info) ...@@ -434,9 +434,10 @@ static void collect_signal(int sig, struct sigpending *list, siginfo_t *info)
copy_siginfo(info, &first->info); copy_siginfo(info, &first->info);
__sigqueue_free(first); __sigqueue_free(first);
} else { } else {
/* Ok, it wasn't in the queue. This must be /*
a fast-pathed signal or we must have been * Ok, it wasn't in the queue. This must be
out of queue space. So zero out the info. * a fast-pathed signal or we must have been
* out of queue space. So zero out the info.
*/ */
info->si_signo = sig; info->si_signo = sig;
info->si_errno = 0; info->si_errno = 0;
...@@ -490,7 +491,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) ...@@ -490,7 +491,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
* itimers are process shared and we restart periodic * itimers are process shared and we restart periodic
* itimers in the signal delivery path to prevent DoS * itimers in the signal delivery path to prevent DoS
* attacks in the high resolution timer case. This is * attacks in the high resolution timer case. This is
* compliant with the old way of self restarting * compliant with the old way of self-restarting
* itimers, as the SIGALRM is a legacy signal and only * itimers, as the SIGALRM is a legacy signal and only
* queued once. Changing the restart behaviour to * queued once. Changing the restart behaviour to
* restart the timer in the signal dequeue path is * restart the timer in the signal dequeue path is
...@@ -923,14 +924,15 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t, ...@@ -923,14 +924,15 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
if (info == SEND_SIG_FORCED) if (info == SEND_SIG_FORCED)
goto out_set; goto out_set;
/* Real-time signals must be queued if sent by sigqueue, or /*
some other real-time mechanism. It is implementation * Real-time signals must be queued if sent by sigqueue, or
defined whether kill() does so. We attempt to do so, on * some other real-time mechanism. It is implementation
the principle of least surprise, but since kill is not * defined whether kill() does so. We attempt to do so, on
allowed to fail with EAGAIN when low on memory we just * the principle of least surprise, but since kill is not
make sure at least one signal gets delivered and don't * allowed to fail with EAGAIN when low on memory we just
pass on the info struct. */ * make sure at least one signal gets delivered and don't
* pass on the info struct.
*/
if (sig < SIGRTMIN) if (sig < SIGRTMIN)
override_rlimit = (is_si_special(info) || info->si_code >= 0); override_rlimit = (is_si_special(info) || info->si_code >= 0);
else else
...@@ -1201,8 +1203,7 @@ int kill_pid_info(int sig, struct siginfo *info, struct pid *pid) ...@@ -1201,8 +1203,7 @@ int kill_pid_info(int sig, struct siginfo *info, struct pid *pid)
return error; return error;
} }
int int kill_proc_info(int sig, struct siginfo *info, pid_t pid)
kill_proc_info(int sig, struct siginfo *info, pid_t pid)
{ {
int error; int error;
rcu_read_lock(); rcu_read_lock();
...@@ -1299,8 +1300,7 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid) ...@@ -1299,8 +1300,7 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid)
* These are for backward compatibility with the rest of the kernel source. * These are for backward compatibility with the rest of the kernel source.
*/ */
int int send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
{ {
/* /*
* Make sure legacy kernel users don't send in bad values * Make sure legacy kernel users don't send in bad values
...@@ -1368,7 +1368,7 @@ EXPORT_SYMBOL(kill_pid); ...@@ -1368,7 +1368,7 @@ EXPORT_SYMBOL(kill_pid);
* These functions support sending signals using preallocated sigqueue * These functions support sending signals using preallocated sigqueue
* structures. This is needed "because realtime applications cannot * structures. This is needed "because realtime applications cannot
* afford to lose notifications of asynchronous events, like timer * afford to lose notifications of asynchronous events, like timer
* expirations or I/O completions". In the case of Posix Timers * expirations or I/O completions". In the case of POSIX Timers
* we allocate the sigqueue structure from the timer_create. If this * we allocate the sigqueue structure from the timer_create. If this
* allocation fails we are able to report the failure to the application * allocation fails we are able to report the failure to the application
* with an EAGAIN error. * with an EAGAIN error.
...@@ -1553,7 +1553,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, int why) ...@@ -1553,7 +1553,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, int why)
info.si_signo = SIGCHLD; info.si_signo = SIGCHLD;
info.si_errno = 0; info.si_errno = 0;
/* /*
* see comment in do_notify_parent() abot the following 3 lines * see comment in do_notify_parent() about the following 4 lines
*/ */
rcu_read_lock(); rcu_read_lock();
info.si_pid = task_pid_nr_ns(tsk, parent->nsproxy->pid_ns); info.si_pid = task_pid_nr_ns(tsk, parent->nsproxy->pid_ns);
...@@ -1611,7 +1611,7 @@ static inline int may_ptrace_stop(void) ...@@ -1611,7 +1611,7 @@ static inline int may_ptrace_stop(void)
} }
/* /*
* Return nonzero if there is a SIGKILL that should be waking us up. * Return non-zero if there is a SIGKILL that should be waking us up.
* Called with the siglock held. * Called with the siglock held.
*/ */
static int sigkill_pending(struct task_struct *tsk) static int sigkill_pending(struct task_struct *tsk)
...@@ -1735,7 +1735,7 @@ void ptrace_notify(int exit_code) ...@@ -1735,7 +1735,7 @@ void ptrace_notify(int exit_code)
/* /*
* This performs the stopping for SIGSTOP and other stop signals. * This performs the stopping for SIGSTOP and other stop signals.
* We have to stop all threads in the thread group. * We have to stop all threads in the thread group.
* Returns nonzero if we've actually stopped and released the siglock. * Returns non-zero if we've actually stopped and released the siglock.
* Returns zero if we didn't stop and still hold the siglock. * Returns zero if we didn't stop and still hold the siglock.
*/ */
static int do_signal_stop(int signr) static int do_signal_stop(int signr)
...@@ -1823,10 +1823,12 @@ static int ptrace_signal(int signr, siginfo_t *info, ...@@ -1823,10 +1823,12 @@ static int ptrace_signal(int signr, siginfo_t *info,
current->exit_code = 0; current->exit_code = 0;
/* Update the siginfo structure if the signal has /*
changed. If the debugger wanted something * Update the siginfo structure if the signal has
specific in the siginfo structure then it should * changed. If the debugger wanted something
have updated *info via PTRACE_SETSIGINFO. */ * specific in the siginfo structure then it should
* have updated *info via PTRACE_SETSIGINFO.
*/
if (signr != info->si_signo) { if (signr != info->si_signo) {
info->si_signo = signr; info->si_signo = signr;
info->si_errno = 0; info->si_errno = 0;
...@@ -2034,7 +2036,8 @@ void exit_signals(struct task_struct *tsk) ...@@ -2034,7 +2036,8 @@ void exit_signals(struct task_struct *tsk)
if (!signal_pending(tsk)) if (!signal_pending(tsk))
goto out; goto out;
/* It could be that __group_complete_signal() choose us to /*
* It could be that __group_complete_signal() choose us to
* notify about group-wide signal. Another thread should be * notify about group-wide signal. Another thread should be
* woken now to take the signal since we will not. * woken now to take the signal since we will not.
*/ */
...@@ -2235,7 +2238,7 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from) ...@@ -2235,7 +2238,7 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from)
#ifdef BUS_MCEERR_AO #ifdef BUS_MCEERR_AO
/* /*
* Other callers might not initialize the si_lsb field, * Other callers might not initialize the si_lsb field,
* so check explicitely for the right codes here. * so check explicitly for the right codes here.
*/ */
if (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO) if (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)
err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb); err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb);
...@@ -2305,9 +2308,11 @@ SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, ...@@ -2305,9 +2308,11 @@ SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese,
+ (ts.tv_sec || ts.tv_nsec)); + (ts.tv_sec || ts.tv_nsec));
if (timeout) { if (timeout) {
/* None ready -- temporarily unblock those we're /*
* None ready -- temporarily unblock those we're
* interested while we are sleeping in so that we'll * interested while we are sleeping in so that we'll
* be awakened when they arrive. */ * be awakened when they arrive.
*/
current->real_blocked = current->blocked; current->real_blocked = current->blocked;
sigandsets(&current->blocked, &current->blocked, &these); sigandsets(&current->blocked, &current->blocked, &these);
recalc_sigpending(); recalc_sigpending();
...@@ -2553,12 +2558,11 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s ...@@ -2553,12 +2558,11 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
error = -EINVAL; error = -EINVAL;
/* /*
* * Note - this code used to test ss_flags incorrectly:
* Note - this code used to test ss_flags incorrectly
* old code may have been written using ss_flags==0 * old code may have been written using ss_flags==0
* to mean ss_flags==SS_ONSTACK (as this was the only * to mean ss_flags==SS_ONSTACK (as this was the only
* way that worked) - this fix preserves that older * way that worked) - this fix preserves that older
* mechanism * mechanism.
*/ */
if (ss_flags != SS_DISABLE && ss_flags != SS_ONSTACK && ss_flags != 0) if (ss_flags != SS_DISABLE && ss_flags != SS_ONSTACK && ss_flags != 0)
goto out; goto out;
...@@ -2600,8 +2604,10 @@ SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set) ...@@ -2600,8 +2604,10 @@ SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set)
#endif #endif
#ifdef __ARCH_WANT_SYS_SIGPROCMASK #ifdef __ARCH_WANT_SYS_SIGPROCMASK
/* Some platforms have their own version with special arguments others /*
support only sys_rt_sigprocmask. */ * Some platforms have their own version with special arguments;
* others support only sys_rt_sigprocmask.
*/
SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set, SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set,
old_sigset_t __user *, oset) old_sigset_t __user *, oset)
......
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