Commit 5aba085ededa6c5a1ff465e2aebc3e8eb00a7567

Authored by Randy Dunlap
Committed by Linus Torvalds
1 parent 21b86bd5a8

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: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 48 additions and 42 deletions Side-by-side Diff

... ... @@ -226,7 +226,7 @@
226 226 /*
227 227 * allocate a new signal queue record
228 228 * - this may be called without locks if and only if t == current, otherwise an
229   - * appopriate lock must be held to stop the target task from exiting
  229 + * appropriate lock must be held to stop the target task from exiting
230 230 */
231 231 static struct sigqueue *
232 232 __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimit)
233 233  
... ... @@ -375,15 +375,15 @@
375 375 return !tracehook_consider_fatal_signal(tsk, sig);
376 376 }
377 377  
378   -
379   -/* Notify the system that a driver wants to block all signals for this
  378 +/*
  379 + * Notify the system that a driver wants to block all signals for this
380 380 * process, and wants to be notified if any signals at all were to be
381 381 * sent/acted upon. If the notifier routine returns non-zero, then the
382 382 * signal will be acted upon after all. If the notifier routine returns 0,
383 383 * then then signal will be blocked. Only one block per process is
384 384 * allowed. priv is a pointer to private data that the notifier routine
385   - * can use to determine if the signal should be blocked or not. */
386   -
  385 + * can use to determine if the signal should be blocked or not.
  386 + */
387 387 void
388 388 block_all_signals(int (*notifier)(void *priv), void *priv, sigset_t *mask)
389 389 {
... ... @@ -434,9 +434,10 @@
434 434 copy_siginfo(info, &first->info);
435 435 __sigqueue_free(first);
436 436 } else {
437   - /* Ok, it wasn't in the queue. This must be
438   - a fast-pathed signal or we must have been
439   - out of queue space. So zero out the info.
  437 + /*
  438 + * Ok, it wasn't in the queue. This must be
  439 + * a fast-pathed signal or we must have been
  440 + * out of queue space. So zero out the info.
440 441 */
441 442 info->si_signo = sig;
442 443 info->si_errno = 0;
... ... @@ -468,7 +469,7 @@
468 469 }
469 470  
470 471 /*
471   - * Dequeue a signal and return the element to the caller, which is
  472 + * Dequeue a signal and return the element to the caller, which is
472 473 * expected to free it.
473 474 *
474 475 * All callers have to hold the siglock.
... ... @@ -490,7 +491,7 @@
490 491 * itimers are process shared and we restart periodic
491 492 * itimers in the signal delivery path to prevent DoS
492 493 * attacks in the high resolution timer case. This is
493   - * compliant with the old way of self restarting
  494 + * compliant with the old way of self-restarting
494 495 * itimers, as the SIGALRM is a legacy signal and only
495 496 * queued once. Changing the restart behaviour to
496 497 * restart the timer in the signal dequeue path is
... ... @@ -923,14 +924,15 @@
923 924 if (info == SEND_SIG_FORCED)
924 925 goto out_set;
925 926  
926   - /* Real-time signals must be queued if sent by sigqueue, or
927   - some other real-time mechanism. It is implementation
928   - defined whether kill() does so. We attempt to do so, on
929   - the principle of least surprise, but since kill is not
930   - allowed to fail with EAGAIN when low on memory we just
931   - make sure at least one signal gets delivered and don't
932   - pass on the info struct. */
933   -
  927 + /*
  928 + * Real-time signals must be queued if sent by sigqueue, or
  929 + * some other real-time mechanism. It is implementation
  930 + * defined whether kill() does so. We attempt to do so, on
  931 + * the principle of least surprise, but since kill is not
  932 + * allowed to fail with EAGAIN when low on memory we just
  933 + * make sure at least one signal gets delivered and don't
  934 + * pass on the info struct.
  935 + */
934 936 if (sig < SIGRTMIN)
935 937 override_rlimit = (is_si_special(info) || info->si_code >= 0);
936 938 else
... ... @@ -1201,8 +1203,7 @@
1201 1203 return error;
1202 1204 }
1203 1205  
1204   -int
1205   -kill_proc_info(int sig, struct siginfo *info, pid_t pid)
  1206 +int kill_proc_info(int sig, struct siginfo *info, pid_t pid)
1206 1207 {
1207 1208 int error;
1208 1209 rcu_read_lock();
... ... @@ -1299,8 +1300,7 @@
1299 1300 * These are for backward compatibility with the rest of the kernel source.
1300 1301 */
1301 1302  
1302   -int
1303   -send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
  1303 +int send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
1304 1304 {
1305 1305 /*
1306 1306 * Make sure legacy kernel users don't send in bad values
... ... @@ -1368,7 +1368,7 @@
1368 1368 * These functions support sending signals using preallocated sigqueue
1369 1369 * structures. This is needed "because realtime applications cannot
1370 1370 * afford to lose notifications of asynchronous events, like timer
1371   - * expirations or I/O completions". In the case of Posix Timers
  1371 + * expirations or I/O completions". In the case of POSIX Timers
1372 1372 * we allocate the sigqueue structure from the timer_create. If this
1373 1373 * allocation fails we are able to report the failure to the application
1374 1374 * with an EAGAIN error.
... ... @@ -1553,7 +1553,7 @@
1553 1553 info.si_signo = SIGCHLD;
1554 1554 info.si_errno = 0;
1555 1555 /*
1556   - * see comment in do_notify_parent() abot the following 3 lines
  1556 + * see comment in do_notify_parent() about the following 4 lines
1557 1557 */
1558 1558 rcu_read_lock();
1559 1559 info.si_pid = task_pid_nr_ns(tsk, parent->nsproxy->pid_ns);
... ... @@ -1611,7 +1611,7 @@
1611 1611 }
1612 1612  
1613 1613 /*
1614   - * Return nonzero if there is a SIGKILL that should be waking us up.
  1614 + * Return non-zero if there is a SIGKILL that should be waking us up.
1615 1615 * Called with the siglock held.
1616 1616 */
1617 1617 static int sigkill_pending(struct task_struct *tsk)
... ... @@ -1735,7 +1735,7 @@
1735 1735 /*
1736 1736 * This performs the stopping for SIGSTOP and other stop signals.
1737 1737 * We have to stop all threads in the thread group.
1738   - * Returns nonzero if we've actually stopped and released the siglock.
  1738 + * Returns non-zero if we've actually stopped and released the siglock.
1739 1739 * Returns zero if we didn't stop and still hold the siglock.
1740 1740 */
1741 1741 static int do_signal_stop(int signr)
... ... @@ -1823,10 +1823,12 @@
1823 1823  
1824 1824 current->exit_code = 0;
1825 1825  
1826   - /* Update the siginfo structure if the signal has
1827   - changed. If the debugger wanted something
1828   - specific in the siginfo structure then it should
1829   - have updated *info via PTRACE_SETSIGINFO. */
  1826 + /*
  1827 + * Update the siginfo structure if the signal has
  1828 + * changed. If the debugger wanted something
  1829 + * specific in the siginfo structure then it should
  1830 + * have updated *info via PTRACE_SETSIGINFO.
  1831 + */
1830 1832 if (signr != info->si_signo) {
1831 1833 info->si_signo = signr;
1832 1834 info->si_errno = 0;
... ... @@ -2034,7 +2036,8 @@
2034 2036 if (!signal_pending(tsk))
2035 2037 goto out;
2036 2038  
2037   - /* It could be that __group_complete_signal() choose us to
  2039 + /*
  2040 + * It could be that __group_complete_signal() choose us to
2038 2041 * notify about group-wide signal. Another thread should be
2039 2042 * woken now to take the signal since we will not.
2040 2043 */
... ... @@ -2183,7 +2186,7 @@
2183 2186  
2184 2187 out:
2185 2188 return error;
2186   -}
  2189 +}
2187 2190  
2188 2191 SYSCALL_DEFINE2(rt_sigpending, sigset_t __user *, set, size_t, sigsetsize)
2189 2192 {
2190 2193  
... ... @@ -2233,9 +2236,9 @@
2233 2236 err |= __put_user(from->si_trapno, &to->si_trapno);
2234 2237 #endif
2235 2238 #ifdef BUS_MCEERR_AO
2236   - /*
  2239 + /*
2237 2240 * Other callers might not initialize the si_lsb field,
2238   - * so check explicitely for the right codes here.
  2241 + * so check explicitly for the right codes here.
2239 2242 */
2240 2243 if (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)
2241 2244 err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb);
... ... @@ -2280,7 +2283,7 @@
2280 2283  
2281 2284 if (copy_from_user(&these, uthese, sizeof(these)))
2282 2285 return -EFAULT;
2283   -
  2286 +
2284 2287 /*
2285 2288 * Invert the set of allowed signals to get those we
2286 2289 * want to block.
2287 2290  
... ... @@ -2305,9 +2308,11 @@
2305 2308 + (ts.tv_sec || ts.tv_nsec));
2306 2309  
2307 2310 if (timeout) {
2308   - /* None ready -- temporarily unblock those we're
  2311 + /*
  2312 + * None ready -- temporarily unblock those we're
2309 2313 * interested while we are sleeping in so that we'll
2310   - * be awakened when they arrive. */
  2314 + * be awakened when they arrive.
  2315 + */
2311 2316 current->real_blocked = current->blocked;
2312 2317 sigandsets(&current->blocked, &current->blocked, &these);
2313 2318 recalc_sigpending();
2314 2319  
... ... @@ -2553,12 +2558,11 @@
2553 2558  
2554 2559 error = -EINVAL;
2555 2560 /*
2556   - *
2557   - * Note - this code used to test ss_flags incorrectly
  2561 + * Note - this code used to test ss_flags incorrectly:
2558 2562 * old code may have been written using ss_flags==0
2559 2563 * to mean ss_flags==SS_ONSTACK (as this was the only
2560 2564 * way that worked) - this fix preserves that older
2561   - * mechanism
  2565 + * mechanism.
2562 2566 */
2563 2567 if (ss_flags != SS_DISABLE && ss_flags != SS_ONSTACK && ss_flags != 0)
2564 2568 goto out;
... ... @@ -2600,8 +2604,10 @@
2600 2604 #endif
2601 2605  
2602 2606 #ifdef __ARCH_WANT_SYS_SIGPROCMASK
2603   -/* Some platforms have their own version with special arguments others
2604   - support only sys_rt_sigprocmask. */
  2607 +/*
  2608 + * Some platforms have their own version with special arguments;
  2609 + * others support only sys_rt_sigprocmask.
  2610 + */
2605 2611  
2606 2612 SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set,
2607 2613 old_sigset_t __user *, oset)