Re: [PATCH] kernel/signal.c: whitespace fixes
On 09/02, Jiri Kosina wrote: > > On Tue, 2 Sep 2014, Vishnu Pratap Singh wrote: > > > From: "vishnu.ps" > > > > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kernel/signal.c: whitespace fixes
Hi! Am 02.09.2014 14:40, schrieb Vishnu Pratap Singh: > From: "vishnu.ps" > > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kernel/signal.c: whitespace fixes
On Tue, 2 Sep 2014, Vishnu Pratap Singh wrote: > From: "vishnu.ps" > > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] kernel/signal.c: whitespace fixes
From: "vishnu.ps" 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 --- 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: +
[PATCH] kernel/signal.c: whitespace fixes
From: vishnu.ps vishnu...@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...@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;
Re: [PATCH] kernel/signal.c: whitespace fixes
On Tue, 2 Sep 2014, Vishnu Pratap Singh wrote: From: vishnu.ps vishnu...@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 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kernel/signal.c: whitespace fixes
Hi! Am 02.09.2014 14:40, schrieb Vishnu Pratap Singh: From: vishnu.ps vishnu...@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 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kernel/signal.c: whitespace fixes
On 09/02, Jiri Kosina wrote: On Tue, 2 Sep 2014, Vishnu Pratap Singh wrote: From: vishnu.ps vishnu...@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. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/