* [PATCH] kernel/signal.c: whitespace fixes
@ 2014-09-02 12:40 Vishnu Pratap Singh
2014-09-02 12:47 ` Jiri Kosina
2014-09-02 12:48 ` Richard Weinberger
0 siblings, 2 replies; 4+ messages in thread
From: Vishnu Pratap Singh @ 2014-09-02 12:40 UTC (permalink / raw)
To: akpm, oleg, richard, paulmck, jkosina, fabf, viro, linux-kernel,
cpgs
Cc: pintu.k, vishu13285, vishnu.ps
From: "vishnu.ps" <vishnu.ps@samsung.com>
Fix minor errors and warning messages in kernel/signal.c. These errors were
reported by checkpatch while working with some modifications in signal.c
file.
ERROR: code indent should use tabs where possible - 18
ERROR: need consistent spacing around '&' (ctx:WxO) - 11
ERROR: space prohibited after that '~' (ctx:OxW) - 11
ERROR: trailing whitespace - 4
ERROR: space required after that ',' (ctx:VxV) - 4
ERROR: trailing statements should be on next line - 3
ERROR: "foo * bar" should be "foo *bar" - 1
total 52 errors fixed.
Signed-off-by: Vishnu Pratap Singh <vishnu.ps@samsung.com>
---
kernel/signal.c | 75 ++++++++++++++++++++++++++++++---------------------------
1 file changed, 39 insertions(+), 36 deletions(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index 8f0876f..06e3d72 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -109,25 +109,28 @@ static inline int has_pending_signals(sigset_t *signal, sigset_t *blocked)
switch (_NSIG_WORDS) {
default:
for (i = _NSIG_WORDS, ready = 0; --i >= 0 ;)
- ready |= signal->sig[i] &~ blocked->sig[i];
+ ready |= signal->sig[i] & ~blocked->sig[i];
break;
- case 4: ready = signal->sig[3] &~ blocked->sig[3];
- ready |= signal->sig[2] &~ blocked->sig[2];
- ready |= signal->sig[1] &~ blocked->sig[1];
- ready |= signal->sig[0] &~ blocked->sig[0];
+ case 4:
+ ready = signal->sig[3] & ~blocked->sig[3];
+ ready |= signal->sig[2] & ~blocked->sig[2];
+ ready |= signal->sig[1] & ~blocked->sig[1];
+ ready |= signal->sig[0] & ~blocked->sig[0];
break;
- case 2: ready = signal->sig[1] &~ blocked->sig[1];
- ready |= signal->sig[0] &~ blocked->sig[0];
+ case 2:
+ ready = signal->sig[1] & ~blocked->sig[1];
+ ready |= signal->sig[0] & ~blocked->sig[0];
break;
- case 1: ready = signal->sig[0] &~ blocked->sig[0];
+ case 1:
+ ready = signal->sig[0] & ~blocked->sig[0];
}
return ready != 0;
}
-#define PENDING(p,b) has_pending_signals(&(p)->signal, (b))
+#define PENDING(p, b) has_pending_signals(&(p)->signal, (b))
static int recalc_sigpending_tsk(struct task_struct *t)
{
@@ -180,7 +183,7 @@ int next_signal(struct sigpending *pending, sigset_t *mask)
* Handle the first word specially: it contains the
* synchronous signals that need to be dequeued first.
*/
- x = *s &~ *m;
+ x = *s & ~*m;
if (x) {
if (x & SYNCHRONOUS_MASK)
x &= SYNCHRONOUS_MASK;
@@ -191,7 +194,7 @@ int next_signal(struct sigpending *pending, sigset_t *mask)
switch (_NSIG_WORDS) {
default:
for (i = 1; i < _NSIG_WORDS; ++i) {
- x = *++s &~ *++m;
+ x = *++s & ~*++m;
if (!x)
continue;
sig = ffz(~x) + i*_NSIG_BPW + 1;
@@ -200,7 +203,7 @@ int next_signal(struct sigpending *pending, sigset_t *mask)
break;
case 2:
- x = s[1] &~ m[1];
+ x = s[1] & ~m[1];
if (!x)
break;
sig = ffz(~x) + _NSIG_BPW + 1;
@@ -1431,7 +1434,7 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid)
pid ? find_vpid(-pid) : task_pgrp(current));
} else {
int retval = 0, count = 0;
- struct task_struct * p;
+ struct task_struct *p;
for_each_process(p) {
if (task_pid_vnr(p) > 1 &&
@@ -1622,8 +1625,8 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
BUG_ON(sig == -1);
- /* do_notify_parent_cldstop should have been called instead. */
- BUG_ON(task_is_stopped_or_traced(tsk));
+ /* do_notify_parent_cldstop should have been called instead. */
+ BUG_ON(task_is_stopped_or_traced(tsk));
BUG_ON(!tsk->ptrace &&
(tsk->group_leader != tsk || !thread_group_empty(tsk)));
@@ -1745,20 +1748,20 @@ static void do_notify_parent_cldstop(struct task_struct *tsk,
info.si_utime = cputime_to_clock_t(utime);
info.si_stime = cputime_to_clock_t(stime);
- info.si_code = why;
- switch (why) {
- case CLD_CONTINUED:
- info.si_status = SIGCONT;
- break;
- case CLD_STOPPED:
- info.si_status = tsk->signal->group_exit_code & 0x7f;
- break;
- case CLD_TRAPPED:
- info.si_status = tsk->exit_code & 0x7f;
- break;
- default:
- BUG();
- }
+ info.si_code = why;
+ switch (why) {
+ case CLD_CONTINUED:
+ info.si_status = SIGCONT;
+ break;
+ case CLD_STOPPED:
+ info.si_status = tsk->signal->group_exit_code & 0x7f;
+ break;
+ case CLD_TRAPPED:
+ info.si_status = tsk->exit_code & 0x7f;
+ break;
+ default:
+ BUG();
+ }
sighand = parent->sighand;
spin_lock_irqsave(&sighand->siglock, flags);
@@ -2357,7 +2360,7 @@ relock:
}
/**
- * signal_delivered -
+ * signal_delivered -
* @ksig: kernel signal struct
* @stepping: nonzero if debugger single-step or block-step in use
*
@@ -3195,7 +3198,7 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
out:
return error;
}
-SYSCALL_DEFINE2(sigaltstack,const stack_t __user *,uss, stack_t __user *,uoss)
+SYSCALL_DEFINE2(sigaltstack, const stack_t __user *, uss, stack_t __user *, uoss)
{
return do_sigaltstack(uss, uoss, current_user_stack_pointer());
}
@@ -3274,7 +3277,7 @@ int __compat_save_altstack(compat_stack_t __user *uss, unsigned long sp)
*/
SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set)
{
- return sys_rt_sigpending((sigset_t __user *)set, sizeof(old_sigset_t));
+ return sys_rt_sigpending((sigset_t __user *)set, sizeof(old_sigset_t));
}
#endif
@@ -3399,7 +3402,7 @@ COMPAT_SYSCALL_DEFINE4(rt_sigaction, int, sig,
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
if (!ret && oact) {
sigset_to_compat(&mask, &old_ka.sa.sa_mask);
- ret = put_user(ptr_to_compat(old_ka.sa.sa_handler),
+ ret = put_user(ptr_to_compat(old_ka.sa.sa_handler),
&oact->sa_handler);
ret |= copy_to_user(&oact->sa_mask, &mask, sizeof(mask));
ret |= put_user(old_ka.sa.sa_flags, &oact->sa_flags);
@@ -3416,7 +3419,7 @@ COMPAT_SYSCALL_DEFINE4(rt_sigaction, int, sig,
#ifdef CONFIG_OLD_SIGACTION
SYSCALL_DEFINE3(sigaction, int, sig,
const struct old_sigaction __user *, act,
- struct old_sigaction __user *, oact)
+ struct old_sigaction __user *, oact)
{
struct k_sigaction new_ka, old_ka;
int ret;
@@ -3452,7 +3455,7 @@ SYSCALL_DEFINE3(sigaction, int, sig,
#ifdef CONFIG_COMPAT_OLD_SIGACTION
COMPAT_SYSCALL_DEFINE3(sigaction, int, sig,
const struct compat_old_sigaction __user *, act,
- struct compat_old_sigaction __user *, oact)
+ struct compat_old_sigaction __user *, oact)
{
struct k_sigaction new_ka, old_ka;
int ret;
@@ -3575,7 +3578,7 @@ SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *, unewset, size_t, sigsetsize)
return -EFAULT;
return sigsuspend(&newset);
}
-
+
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE2(rt_sigsuspend, compat_sigset_t __user *, unewset, compat_size_t, sigsetsize)
{
--
1.8.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kernel/signal.c: whitespace fixes
2014-09-02 12:40 [PATCH] kernel/signal.c: whitespace fixes Vishnu Pratap Singh
@ 2014-09-02 12:47 ` Jiri Kosina
2014-09-02 13:04 ` Oleg Nesterov
2014-09-02 12:48 ` Richard Weinberger
1 sibling, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2014-09-02 12:47 UTC (permalink / raw)
To: Vishnu Pratap Singh
Cc: akpm, oleg, richard, paulmck, fabf, viro, linux-kernel, cpgs,
pintu.k, vishu13285
On Tue, 2 Sep 2014, Vishnu Pratap Singh wrote:
> From: "vishnu.ps" <vishnu.ps@samsung.com>
>
> Fix minor errors and warning messages in kernel/signal.c. These errors were
> reported by checkpatch while working with some modifications in signal.c
> file.
>
> ERROR: code indent should use tabs where possible - 18
> ERROR: need consistent spacing around '&' (ctx:WxO) - 11
> ERROR: space prohibited after that '~' (ctx:OxW) - 11
> ERROR: trailing whitespace - 4
> ERROR: space required after that ',' (ctx:VxV) - 4
> ERROR: trailing statements should be on next line - 3
> ERROR: "foo * bar" should be "foo *bar" - 1
>
> total 52 errors fixed.
I am not taking this through trivial.git; it just clutters results of 'git
blame' horribly for no measurable gain.
Changes like this are reasonable only if you make any real changes to the
code at the same time.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kernel/signal.c: whitespace fixes
2014-09-02 12:40 [PATCH] kernel/signal.c: whitespace fixes Vishnu Pratap Singh
2014-09-02 12:47 ` Jiri Kosina
@ 2014-09-02 12:48 ` Richard Weinberger
1 sibling, 0 replies; 4+ messages in thread
From: Richard Weinberger @ 2014-09-02 12:48 UTC (permalink / raw)
To: Vishnu Pratap Singh, akpm, oleg, paulmck, jkosina, fabf, viro,
linux-kernel, cpgs
Cc: pintu.k, vishu13285
Hi!
Am 02.09.2014 14:40, schrieb Vishnu Pratap Singh:
> From: "vishnu.ps" <vishnu.ps@samsung.com>
>
> Fix minor errors and warning messages in kernel/signal.c. These errors were
> reported by checkpatch while working with some modifications in signal.c
> file.
>
> ERROR: code indent should use tabs where possible - 18
> ERROR: need consistent spacing around '&' (ctx:WxO) - 11
> ERROR: space prohibited after that '~' (ctx:OxW) - 11
> ERROR: trailing whitespace - 4
> ERROR: space required after that ',' (ctx:VxV) - 4
> ERROR: trailing statements should be on next line - 3
> ERROR: "foo * bar" should be "foo *bar" - 1
>
> total 52 errors fixed.
Please don't run checkpatch.pl on in-kernel files.
The tool is designed to check patches, not files.
Such whitespace cleanups pollute the kernel history, i.e. such that
git blame returns false positives.
The purpose of --file is:
- Checking out-of-tree files (like existing drivers to be imported)
- One notable exception is drivers/staging/, you can run it on these files.
Thanks,
//richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kernel/signal.c: whitespace fixes
2014-09-02 12:47 ` Jiri Kosina
@ 2014-09-02 13:04 ` Oleg Nesterov
0 siblings, 0 replies; 4+ messages in thread
From: Oleg Nesterov @ 2014-09-02 13:04 UTC (permalink / raw)
To: Jiri Kosina
Cc: Vishnu Pratap Singh, akpm, richard, paulmck, fabf, viro,
linux-kernel, cpgs, pintu.k, vishu13285
On 09/02, Jiri Kosina wrote:
>
> On Tue, 2 Sep 2014, Vishnu Pratap Singh wrote:
>
> > From: "vishnu.ps" <vishnu.ps@samsung.com>
> >
> > Fix minor errors and warning messages in kernel/signal.c. These errors were
> > reported by checkpatch while working with some modifications in signal.c
> > file.
> >
> > ERROR: code indent should use tabs where possible - 18
> > ERROR: need consistent spacing around '&' (ctx:WxO) - 11
> > ERROR: space prohibited after that '~' (ctx:OxW) - 11
> > ERROR: trailing whitespace - 4
> > ERROR: space required after that ',' (ctx:VxV) - 4
> > ERROR: trailing statements should be on next line - 3
> > ERROR: "foo * bar" should be "foo *bar" - 1
> >
> > total 52 errors fixed.
>
> I am not taking this through trivial.git; it just clutters results of 'git
> blame' horribly for no measurable gain.
>
> Changes like this are reasonable only if you make any real changes to the
> code at the same time.
I agree very much.
Vishnu, please think about those (me in particular ;) who need to backport
the fixes from time to time. Just suppose we have a bug in, say,
do_notify_parent_cldstop(), and it is fixed later. Now I will likely need
to backport your change too, and this is not trivial in general, plus this
adds the additional risk.
Oleg.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-09-02 13:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-02 12:40 [PATCH] kernel/signal.c: whitespace fixes Vishnu Pratap Singh
2014-09-02 12:47 ` Jiri Kosina
2014-09-02 13:04 ` Oleg Nesterov
2014-09-02 12:48 ` Richard Weinberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox