History

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.

Randy Dunlap committed 15 years ago

Commit 5aba0851 parent 21b86bd1 file · +48 −42Browse files

Unified · Split

kernel/signal.c+48−42
@@ -226,7 +226,7 @@ static inline void print_dropped_signal(int sig) · 225 unmodified lines
226226 /*
227227 * allocate a new signal queue record
228228 * - 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
230230 */
231231 static struct sigqueue *
232232 __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) · 142 unmodified lines
375375 return !tracehook_consider_fatal_signal(tsk, sig);
376376 }
377377
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
380380 * process, and wants to be notified if any signals at all were to be
381381 * sent/acted upon. If the notifier routine returns non-zero, then the
382382 * signal will be acted upon after all. If the notifier routine returns 0,
383383 * then then signal will be blocked. Only one block per process is
384384 * 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+ */
387387 void
388388 block_all_signals(int (*notifier)(void *priv), void *priv, sigset_t *mask)
389389 {
@@ -434,9 +434,10 @@ still_pending: · 44 unmodified lines
434434 copy_siginfo(info, &first->info);
435435 __sigqueue_free(first);
436436 } 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.
440441 */
441442 info->si_signo = sig;
442443 info->si_errno = 0;
@@ -468,7 +469,7 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, · 25 unmodified lines
468469 }
469470
470471 /*
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
472473 * expected to free it.
473474 *
474475 * All callers have to hold the siglock.
@@ -490,7 +491,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) · 15 unmodified lines
490491 * itimers are process shared and we restart periodic
491492 * itimers in the signal delivery path to prevent DoS
492493 * 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
494495 * itimers, as the SIGALRM is a legacy signal and only
495496 * queued once. Changing the restart behaviour to
496497 * 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, · 426 unmodified lines
923924 if (info == SEND_SIG_FORCED)
924925 goto out_set;
925926
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+ */
934936 if (sig < SIGRTMIN)
935937 override_rlimit = (is_si_special(info) || info->si_code >= 0);
936938 else
@@ -1201,8 +1203,7 @@ retry: · 264 unmodified lines
12011203 return error;
12021204 }
12031205
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)
12061207 {
12071208 int error;
12081209 rcu_read_lock();
@@ -1299,8 +1300,7 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid) · 90 unmodified lines
12991300 * These are for backward compatibility with the rest of the kernel source.
13001301 */
13011302
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)
13041304 {
13051305 /*
13061306 * Make sure legacy kernel users don't send in bad values
@@ -1368,7 +1368,7 @@ EXPORT_SYMBOL(kill_pid); · 61 unmodified lines
13681368 * These functions support sending signals using preallocated sigqueue
13691369 * structures. This is needed "because realtime applications cannot
13701370 * 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
13721372 * we allocate the sigqueue structure from the timer_create. If this
13731373 * allocation fails we are able to report the failure to the application
13741374 * with an EAGAIN error.
@@ -1553,7 +1553,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, int why) · 178 unmodified lines
15531553 info.si_signo = SIGCHLD;
15541554 info.si_errno = 0;
15551555 /*
1556− * see comment in do_notify_parent() abot the following 3 lines
1556+ * see comment in do_notify_parent() about the following 4 lines
15571557 */
15581558 rcu_read_lock();
15591559 info.si_pid = task_pid_nr_ns(tsk, parent->nsproxy->pid_ns);
@@ -1611,7 +1611,7 @@ static inline int may_ptrace_stop(void) · 51 unmodified lines
16111611 }
16121612
16131613 /*
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.
16151615 * Called with the siglock held.
16161616 */
16171617 static int sigkill_pending(struct task_struct *tsk)
@@ -1735,7 +1735,7 @@ void ptrace_notify(int exit_code) · 117 unmodified lines
17351735 /*
17361736 * This performs the stopping for SIGSTOP and other stop signals.
17371737 * 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.
17391739 * Returns zero if we didn't stop and still hold the siglock.
17401740 */
17411741 static int do_signal_stop(int signr)
@@ -1823,10 +1823,12 @@ static int ptrace_signal(int signr, siginfo_t *info, · 81 unmodified lines
18231823
18241824 current->exit_code = 0;
18251825
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+ */
18301832 if (signr != info->si_signo) {
18311833 info->si_signo = signr;
18321834 info->si_errno = 0;
@@ -2034,7 +2036,8 @@ void exit_signals(struct task_struct *tsk) · 201 unmodified lines
20342036 if (!signal_pending(tsk))
20352037 goto out;
20362038
2037− /* It could be that __group_complete_signal() choose us to
2039+ /*
2040+ * It could be that __group_complete_signal() choose us to
20382041 * notify about group-wide signal. Another thread should be
20392042 * woken now to take the signal since we will not.
20402043 */
@@ -2183,7 +2186,7 @@ long do_sigpending(void __user *set, unsigned long sigsetsize) · 142 unmodified lines
21832186
21842187 out:
21852188 return error;
2186−}
2189+}
21872190
21882191 SYSCALL_DEFINE2(rt_sigpending, sigset_t __user *, set, size_t, sigsetsize)
21892192 {
@@ -2233,9 +2236,9 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from) · 43 unmodified lines
22332236 err |= __put_user(from->si_trapno, &to->si_trapno);
22342237 #endif
22352238 #ifdef BUS_MCEERR_AO
2236− /*
2239+ /*
22372240 * 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.
22392242 */
22402243 if (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)
22412244 err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb);
@@ -2280,7 +2283,7 @@ SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, · 38 unmodified lines
22802283
22812284 if (copy_from_user(&these, uthese, sizeof(these)))
22822285 return -EFAULT;
2283−
2286+
22842287 /*
22852288 * Invert the set of allowed signals to get those we
22862289 * want to block.
@@ -2305,9 +2308,11 @@ SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, · 18 unmodified lines
23052308 + (ts.tv_sec || ts.tv_nsec));
23062309
23072310 if (timeout) {
2308− /* None ready -- temporarily unblock those we're
2311+ /*
2312+ * None ready -- temporarily unblock those we're
23092313 * interested while we are sleeping in so that we'll
2310− * be awakened when they arrive. */
2314+ * be awakened when they arrive.
2315+ */
23112316 current->real_blocked = current->blocked;
23122317 sigandsets(&current->blocked, &current->blocked, &these);
23132318 recalc_sigpending();
@@ -2553,12 +2558,11 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s · 239 unmodified lines
25532558
25542559 error = -EINVAL;
25552560 /*
2556− *
2557− * Note - this code used to test ss_flags incorrectly
2561+ * Note - this code used to test ss_flags incorrectly:
25582562 * old code may have been written using ss_flags==0
25592563 * to mean ss_flags==SS_ONSTACK (as this was the only
25602564 * way that worked) - this fix preserves that older
2561− * mechanism
2565+ * mechanism.
25622566 */
25632567 if (ss_flags != SS_DISABLE && ss_flags != SS_ONSTACK && ss_flags != 0)
25642568 goto out;
@@ -2600,8 +2604,10 @@ SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set) · 35 unmodified lines
26002604 #endif
26012605
26022606 #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+ */
26052611
26062612 SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set,
26072613 old_sigset_t __user *, oset)