* Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
@ 2012-04-16 9:17 Ingo Molnar
2012-04-16 18:27 ` David Miller
2012-04-16 19:44 ` Randy Dunlap
0 siblings, 2 replies; 19+ messages in thread
From: Ingo Molnar @ 2012-04-16 9:17 UTC (permalink / raw)
To: Joe Perches; +Cc: linux-kernel, Andrew Morton, Linus Torvalds, Andy Whitcroft
This recent checkpatch commit, added in v3.4-rc1:
aad4f6149831 checkpatch: add --strict tests for braces, comments and casts
made the default checkpatch run complain about the following
perfectly fine multi-line comment block:
+ rdp->qlen_lazy = 0;
+ rdp->qlen = 0;
+
+ /*
+ * Adopt all callbacks. The outgoing CPU was in no shape
+ * to advance them, so make them all go through a full
+ * grace period.
+ */
+ *receive_rdp->nxttail[RCU_NEXT_TAIL] = rdp->nxtlist;
With:
CHECK: Don't begin block comments with only a /* line, use /* comment...
#80: FILE: kernel/rcutree.c:1428:
+
+ /*
Which is an obviously bogus warning: the comment is perfectly
fine and it has the form that Documentation/CodingStyle
specifically recommends:
| Chapter 8: Commenting
|
| [...]
|
| The preferred style for long (multi-line) comments is:
|
| /*
| * This is the preferred style for multi-line
| * comments in the Linux kernel source code.
| * Please use it consistently.
| *
| * Description: A column of asterisks on the left side,
| * with beginning and ending almost-blank lines.
| */
|
Please turn this new warning off by default, or fix the check,
or revert it. (The revert below applies cleanly on top of latest
-git and solves the warning for me.)
Thanks,
Ingo
This reverts commit aad4f61498314d41d047ea2161b7bd7237b72d33.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
scripts/checkpatch.pl | 40 ++++++++--------------------------------
1 files changed, 8 insertions(+), 32 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index de639ee..6217093 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1864,17 +1864,6 @@ sub process {
}
}
- if ($line =~ /^\+.*\*[ \t]*\)[ \t]+/) {
- CHK("SPACING",
- "No space is necessary after a cast\n" . $hereprev);
- }
-
- if ($rawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
- $prevrawline =~ /^\+[ \t]*$/) {
- CHK("BLOCK_COMMENT_STYLE",
- "Don't begin block comments with only a /* line, use /* comment...\n" . $hereprev);
- }
-
# check for spaces at the beginning of a line.
# Exceptions:
# 1) within comments
@@ -2987,8 +2976,7 @@ sub process {
#print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n";
#print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n";
if ($#chunks > 0 && $level == 0) {
- my @allowed = ();
- my $allow = 0;
+ my $allowed = 0;
my $seen = 0;
my $herectx = $here . "\n";
my $ln = $linenr - 1;
@@ -2999,7 +2987,6 @@ sub process {
my ($whitespace) = ($cond =~ /^((?:\s*\n[+-])*\s*)/s);
my $offset = statement_rawlines($whitespace) - 1;
- $allowed[$allow] = 0;
#print "COND<$cond> whitespace<$whitespace> offset<$offset>\n";
# We have looked at and allowed this specific line.
@@ -3012,34 +2999,23 @@ sub process {
$seen++ if ($block =~ /^\s*{/);
- #print "cond<$cond> block<$block> allowed<$allowed[$allow]>\n";
+ #print "cond<$cond> block<$block> allowed<$allowed>\n";
if (statement_lines($cond) > 1) {
#print "APW: ALLOWED: cond<$cond>\n";
- $allowed[$allow] = 1;
+ $allowed = 1;
}
if ($block =~/\b(?:if|for|while)\b/) {
#print "APW: ALLOWED: block<$block>\n";
- $allowed[$allow] = 1;
+ $allowed = 1;
}
if (statement_block_size($block) > 1) {
#print "APW: ALLOWED: lines block<$block>\n";
- $allowed[$allow] = 1;
+ $allowed = 1;
}
- $allow++;
}
- if ($seen) {
- my $sum_allowed = 0;
- foreach (@allowed) {
- $sum_allowed += $_;
- }
- if ($sum_allowed == 0) {
- WARN("BRACES",
- "braces {} are not necessary for any arm of this statement\n" . $herectx);
- } elsif ($sum_allowed != $allow &&
- $seen != $allow) {
- CHK("BRACES",
- "braces {} should be used on all arms of this statement\n" . $herectx);
- }
+ if ($seen && !$allowed) {
+ WARN("BRACES",
+ "braces {} are not necessary for any arm of this statement\n" . $herectx);
}
}
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 9:17 Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts Ingo Molnar
@ 2012-04-16 18:27 ` David Miller
2012-04-16 19:09 ` Linus Torvalds
2012-04-16 20:26 ` Ingo Molnar
2012-04-16 19:44 ` Randy Dunlap
1 sibling, 2 replies; 19+ messages in thread
From: David Miller @ 2012-04-16 18:27 UTC (permalink / raw)
To: mingo; +Cc: joe, linux-kernel, akpm, torvalds, apw
From: Ingo Molnar <mingo@kernel.org>
Date: Mon, 16 Apr 2012 11:17:20 +0200
>
> This recent checkpatch commit, added in v3.4-rc1:
>
> aad4f6149831 checkpatch: add --strict tests for braces, comments and casts
>
> made the default checkpatch run complain about the following
> perfectly fine multi-line comment block:
>
> + rdp->qlen_lazy = 0;
> + rdp->qlen = 0;
> +
> + /*
> + * Adopt all callbacks. The outgoing CPU was in no shape
> + * to advance them, so make them all go through a full
> + * grace period.
> + */
> + *receive_rdp->nxttail[RCU_NEXT_TAIL] = rdp->nxtlist;
>
I would like to formally propose that we change CodingStyle so that
our comments are of the form:
/* XXX
* YYY
*/
So that we can save one line of vertical space.
We've adopted this all across the networking, and the code looks a
lot nicer as well as allowing more actual code onto a single window
of text.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 18:27 ` David Miller
@ 2012-04-16 19:09 ` Linus Torvalds
2012-04-16 19:13 ` David Miller
2012-04-16 20:26 ` Ingo Molnar
1 sibling, 1 reply; 19+ messages in thread
From: Linus Torvalds @ 2012-04-16 19:09 UTC (permalink / raw)
To: David Miller; +Cc: mingo, joe, linux-kernel, akpm, apw
On Mon, Apr 16, 2012 at 11:27 AM, David Miller <davem@davemloft.net> wrote:
>
> I would like to formally propose that we change CodingStyle so that
> our comments are of the form:
>
> /* XXX
> * YYY
> */
>
> So that we can save one line of vertical space.
Ugh, I personally hate it. No way will we make that the recommended
version, even if it might be an acceptable substitute in some
subsystems.
It looks unbalanced. If you want to save that vertical space, just use
C++ style comments instead, for chissake! Then you save *two* lines,
without the unbalanced thing, and just write it as
// XXX
// YYY
which is much preferred.
Your suggested format just sucks, and has the worst of all worlds.
Linus
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 19:09 ` Linus Torvalds
@ 2012-04-16 19:13 ` David Miller
0 siblings, 0 replies; 19+ messages in thread
From: David Miller @ 2012-04-16 19:13 UTC (permalink / raw)
To: torvalds; +Cc: mingo, joe, linux-kernel, akpm, apw
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Mon, 16 Apr 2012 12:09:12 -0700
> It looks unbalanced. If you want to save that vertical space, just use
> C++ style comments instead, for chissake! Then you save *two* lines,
> without the unbalanced thing, and just write it as
>
> // XXX
> // YYY
>
> which is much preferred.
I'm perfectly fine with this too.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH] checkpatch: revert --strict test for net/ and drivers/net block comment style
2012-04-16 19:44 ` Randy Dunlap
@ 2012-04-16 19:32 ` Joe Perches
2012-04-16 19:35 ` Joe Perches
1 sibling, 0 replies; 19+ messages in thread
From: Joe Perches @ 2012-04-16 19:32 UTC (permalink / raw)
To: Randy Dunlap
Cc: Ingo Molnar, linux-kernel, Andrew Morton, Linus Torvalds, Andy Whitcroft
---
On Mon, 2012-04-16 at 12:44 -0700, Randy Dunlap wrote:
> On 04/16/2012 02:17 AM, Ingo Molnar wrote:
> > aad4f6149831 checkpatch: add --strict tests for braces, comments and casts
> > made the default checkpatch run complain about the following
> > perfectly fine multi-line comment block:
No, it didn't.
It only made checkpatch complain if --strict was
added to the command line arguments.
I don't care about the comment style, it is/was
David Miller's preferred style for drivers/net and
net/
I think a straight revert isn't appropriate.
Here's one that just removes the comment check.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH] checkpatch: revert --strict test for net/ and drivers/net block comment style
2012-04-16 19:44 ` Randy Dunlap
2012-04-16 19:32 ` [PATCH] checkpatch: revert --strict test for net/ and drivers/net block comment style Joe Perches
@ 2012-04-16 19:35 ` Joe Perches
2012-04-16 20:28 ` Ingo Molnar
1 sibling, 1 reply; 19+ messages in thread
From: Joe Perches @ 2012-04-16 19:35 UTC (permalink / raw)
To: Randy Dunlap
Cc: Ingo Molnar, linux-kernel, Andrew Morton, Linus Torvalds, Andy Whitcroft
Revert the --strict test for the old preferred block
comment style in drivers/net and net/
Signed-off-by: Joe Perches <joe@perches.com>
---
grumble. Don't reply to email from internet cafes.
On Mon, 2012-04-16 at 12:44 -0700, Randy Dunlap wrote:
> On 04/16/2012 02:17 AM, Ingo Molnar wrote:
> > aad4f6149831 checkpatch: add --strict tests for braces, comments and casts
> > made the default checkpatch run complain about the following
> > perfectly fine multi-line comment block:
No, it didn't.
It only made checkpatch complain if --strict was
added to the command line arguments.
I don't care about the comment style, it is/was
David Miller's preferred style for drivers/net and
net/
I think a straight revert isn't appropriate.
Here's one that just removes the comment check.
scripts/checkpatch.pl | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index de639ee..faea0ec 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1869,12 +1869,6 @@ sub process {
"No space is necessary after a cast\n" . $hereprev);
}
- if ($rawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
- $prevrawline =~ /^\+[ \t]*$/) {
- CHK("BLOCK_COMMENT_STYLE",
- "Don't begin block comments with only a /* line, use /* comment...\n" . $hereprev);
- }
-
# check for spaces at the beginning of a line.
# Exceptions:
# 1) within comments
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 9:17 Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts Ingo Molnar
2012-04-16 18:27 ` David Miller
@ 2012-04-16 19:44 ` Randy Dunlap
2012-04-16 19:32 ` [PATCH] checkpatch: revert --strict test for net/ and drivers/net block comment style Joe Perches
2012-04-16 19:35 ` Joe Perches
1 sibling, 2 replies; 19+ messages in thread
From: Randy Dunlap @ 2012-04-16 19:44 UTC (permalink / raw)
To: Ingo Molnar
Cc: Joe Perches, linux-kernel, Andrew Morton, Linus Torvalds, Andy Whitcroft
On 04/16/2012 02:17 AM, Ingo Molnar wrote:
>
> This recent checkpatch commit, added in v3.4-rc1:
>
> aad4f6149831 checkpatch: add --strict tests for braces, comments and casts
>
> made the default checkpatch run complain about the following
> perfectly fine multi-line comment block:
>
> + rdp->qlen_lazy = 0;
> + rdp->qlen = 0;
> +
> + /*
> + * Adopt all callbacks. The outgoing CPU was in no shape
> + * to advance them, so make them all go through a full
> + * grace period.
> + */
> + *receive_rdp->nxttail[RCU_NEXT_TAIL] = rdp->nxtlist;
>
> With:
>
> CHECK: Don't begin block comments with only a /* line, use /* comment...
>
> #80: FILE: kernel/rcutree.c:1428:
> +
> + /*
>
> Which is an obviously bogus warning: the comment is perfectly
> fine and it has the form that Documentation/CodingStyle
> specifically recommends:
>
> | Chapter 8: Commenting
> |
> | [...]
> |
> | The preferred style for long (multi-line) comments is:
> |
> | /*
> | * This is the preferred style for multi-line
> | * comments in the Linux kernel source code.
> | * Please use it consistently.
> | *
> | * Description: A column of asterisks on the left side,
> | * with beginning and ending almost-blank lines.
> | */
> |
>
> Please turn this new warning off by default, or fix the check,
> or revert it. (The revert below applies cleanly on top of latest
> -git and solves the warning for me.)
>
> Thanks,
>
> Ingo
>
> This reverts commit aad4f61498314d41d047ea2161b7bd7237b72d33.
>
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Thanks.
> ---
> scripts/checkpatch.pl | 40 ++++++++--------------------------------
> 1 files changed, 8 insertions(+), 32 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index de639ee..6217093 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1864,17 +1864,6 @@ sub process {
> }
> }
>
> - if ($line =~ /^\+.*\*[ \t]*\)[ \t]+/) {
> - CHK("SPACING",
> - "No space is necessary after a cast\n" . $hereprev);
> - }
> -
> - if ($rawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
> - $prevrawline =~ /^\+[ \t]*$/) {
> - CHK("BLOCK_COMMENT_STYLE",
> - "Don't begin block comments with only a /* line, use /* comment...\n" . $hereprev);
> - }
> -
> # check for spaces at the beginning of a line.
> # Exceptions:
> # 1) within comments
> @@ -2987,8 +2976,7 @@ sub process {
> #print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n";
> #print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n";
> if ($#chunks > 0 && $level == 0) {
> - my @allowed = ();
> - my $allow = 0;
> + my $allowed = 0;
> my $seen = 0;
> my $herectx = $here . "\n";
> my $ln = $linenr - 1;
> @@ -2999,7 +2987,6 @@ sub process {
> my ($whitespace) = ($cond =~ /^((?:\s*\n[+-])*\s*)/s);
> my $offset = statement_rawlines($whitespace) - 1;
>
> - $allowed[$allow] = 0;
> #print "COND<$cond> whitespace<$whitespace> offset<$offset>\n";
>
> # We have looked at and allowed this specific line.
> @@ -3012,34 +2999,23 @@ sub process {
>
> $seen++ if ($block =~ /^\s*{/);
>
> - #print "cond<$cond> block<$block> allowed<$allowed[$allow]>\n";
> + #print "cond<$cond> block<$block> allowed<$allowed>\n";
> if (statement_lines($cond) > 1) {
> #print "APW: ALLOWED: cond<$cond>\n";
> - $allowed[$allow] = 1;
> + $allowed = 1;
> }
> if ($block =~/\b(?:if|for|while)\b/) {
> #print "APW: ALLOWED: block<$block>\n";
> - $allowed[$allow] = 1;
> + $allowed = 1;
> }
> if (statement_block_size($block) > 1) {
> #print "APW: ALLOWED: lines block<$block>\n";
> - $allowed[$allow] = 1;
> + $allowed = 1;
> }
> - $allow++;
> }
> - if ($seen) {
> - my $sum_allowed = 0;
> - foreach (@allowed) {
> - $sum_allowed += $_;
> - }
> - if ($sum_allowed == 0) {
> - WARN("BRACES",
> - "braces {} are not necessary for any arm of this statement\n" . $herectx);
> - } elsif ($sum_allowed != $allow &&
> - $seen != $allow) {
> - CHK("BRACES",
> - "braces {} should be used on all arms of this statement\n" . $herectx);
> - }
> + if ($seen && !$allowed) {
> + WARN("BRACES",
> + "braces {} are not necessary for any arm of this statement\n" . $herectx);
> }
> }
> }
> --
--
~Randy
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 18:27 ` David Miller
2012-04-16 19:09 ` Linus Torvalds
@ 2012-04-16 20:26 ` Ingo Molnar
2012-04-16 20:34 ` Joe Perches
` (2 more replies)
1 sibling, 3 replies; 19+ messages in thread
From: Ingo Molnar @ 2012-04-16 20:26 UTC (permalink / raw)
To: David Miller; +Cc: joe, linux-kernel, akpm, torvalds, apw
* David Miller <davem@davemloft.net> wrote:
> From: Ingo Molnar <mingo@kernel.org>
> Date: Mon, 16 Apr 2012 11:17:20 +0200
>
> >
> > This recent checkpatch commit, added in v3.4-rc1:
> >
> > aad4f6149831 checkpatch: add --strict tests for braces, comments and casts
> >
> > made the default checkpatch run complain about the following
> > perfectly fine multi-line comment block:
> >
> > + rdp->qlen_lazy = 0;
> > + rdp->qlen = 0;
> > +
> > + /*
> > + * Adopt all callbacks. The outgoing CPU was in no shape
> > + * to advance them, so make them all go through a full
> > + * grace period.
> > + */
> > + *receive_rdp->nxttail[RCU_NEXT_TAIL] = rdp->nxtlist;
> >
>
> I would like to formally propose that we change CodingStyle so that
> our comments are of the form:
>
> /* XXX
> * YYY
> */
>
> So that we can save one line of vertical space.
>
> We've adopted this all across the networking, and the code
> looks a lot nicer as well as allowing more actual code onto a
> single window of text.
Sigh, this is sad for two reasons:
1) It's butt ugly and it violates every basic principle of
typography. Saving a line is often counter-productive, a
well placed whitespace (vertical or horizontal) will often
increase readability. Key is good balance.
If you don't "see" it as ugly it's simply because your brain
is not wired up to see 3D/2D geometry as a significant
source of information. A significant portion (I'd
guesstimate a narrow majority) of kernel hackers *does* see
2D/3D layout details in code and finds inconsistencies in
them counterproductive.
( It's roughly the same distinction that makes some people
love the typographic layout of the iPhone/iPad while
others consider it unnecessary bling. )
2) Even if it was proper typography (which it isnt), we have
Documentation/CodingStyle for damn good reasons: so that
people see a uniform style of code across the kernel. The
taste set out there is sometimes arbitrary in its details,
but one thing is certainly worse than arbitrary style rules:
*random*, inconsistent rules, because that only adds noise.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] checkpatch: revert --strict test for net/ and drivers/net block comment style
2012-04-16 19:35 ` Joe Perches
@ 2012-04-16 20:28 ` Ingo Molnar
2012-04-16 20:33 ` Linus Torvalds
0 siblings, 1 reply; 19+ messages in thread
From: Ingo Molnar @ 2012-04-16 20:28 UTC (permalink / raw)
To: Joe Perches
Cc: Randy Dunlap, linux-kernel, Andrew Morton, Linus Torvalds,
Andy Whitcroft
* Joe Perches <joe@perches.com> wrote:
> Revert the --strict test for the old preferred block
> comment style in drivers/net and net/
Emphatic NAK.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] checkpatch: revert --strict test for net/ and drivers/net block comment style
2012-04-16 20:28 ` Ingo Molnar
@ 2012-04-16 20:33 ` Linus Torvalds
2012-04-17 10:07 ` Ingo Molnar
0 siblings, 1 reply; 19+ messages in thread
From: Linus Torvalds @ 2012-04-16 20:33 UTC (permalink / raw)
To: Ingo Molnar
Cc: Joe Perches, Randy Dunlap, linux-kernel, Andrew Morton, Andy Whitcroft
On Mon, Apr 16, 2012 at 1:28 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Joe Perches <joe@perches.com> wrote:
>
>> Revert the --strict test for the old preferred block
>> comment style in drivers/net and net/
>
> Emphatic NAK.
Ingo, I don't think you understood. That test reverts the thing you
wanted reverted wrt the block comments.
It does not revert the *other* things in that patch (testing for empty
braces etc).
So Joe's patch seems to be exactly what you asked for,
Linus
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 20:26 ` Ingo Molnar
@ 2012-04-16 20:34 ` Joe Perches
2012-04-16 20:34 ` Ingo Molnar
2012-04-16 20:58 ` David Miller
2 siblings, 0 replies; 19+ messages in thread
From: Joe Perches @ 2012-04-16 20:34 UTC (permalink / raw)
To: Ingo Molnar; +Cc: David Miller, linux-kernel, akpm, torvalds, apw
On Mon, 2012-04-16 at 22:26 +0200, Ingo Molnar wrote:
> 1) It's butt ugly and it violates every basic principle of
> typography. Saving a line is often counter-productive, a
> well placed whitespace (vertical or horizontal) will often
> increase readability. Key is good balance.
True enough.
> If you don't "see" it as ugly it's simply because your brain
> is not wired up to see 3D/2D geometry as a significant
> source of information. A significant portion (I'd
> guesstimate a narrow majority) of kernel hackers *does* see
> 2D/3D layout details in code and finds inconsistencies in
> them counterproductive.
I believe there's an empty hat somewhere that must
have produced this email.
I rather doubt anyone "sees" 3d geometries out of
a coding style. Otherwise, cite please...
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 20:26 ` Ingo Molnar
2012-04-16 20:34 ` Joe Perches
@ 2012-04-16 20:34 ` Ingo Molnar
2012-04-16 21:00 ` David Miller
2012-04-16 20:58 ` David Miller
2 siblings, 1 reply; 19+ messages in thread
From: Ingo Molnar @ 2012-04-16 20:34 UTC (permalink / raw)
To: David Miller; +Cc: joe, linux-kernel, akpm, torvalds, apw
* Ingo Molnar <mingo@kernel.org> wrote:
> If you don't "see" it as ugly it's simply because your brain
> is not wired up to see 3D/2D geometry as a significant
> source of information. A significant portion (I'd
> guesstimate a narrow majority) of kernel hackers *does* see
> 2D/3D layout details in code and finds inconsistencies in
> them counterproductive.
>
> ( It's roughly the same distinction that makes some people
> love the typographic layout of the iPhone/iPad while
> others consider it unnecessary bling. )
Another example are the recent Google+ layout changes. Those who
don't see 2D details found it an unnecessary waste of screen
real estate.
To me and many others the new layout, while sparser, is actually
noticeably less taxing to read, because information is
structured in such a "geometrically obvious" way.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 20:26 ` Ingo Molnar
2012-04-16 20:34 ` Joe Perches
2012-04-16 20:34 ` Ingo Molnar
@ 2012-04-16 20:58 ` David Miller
2012-04-25 8:42 ` Ingo Molnar
2 siblings, 1 reply; 19+ messages in thread
From: David Miller @ 2012-04-16 20:58 UTC (permalink / raw)
To: mingo; +Cc: joe, linux-kernel, akpm, torvalds, apw
From: Ingo Molnar <mingo@kernel.org>
Date: Mon, 16 Apr 2012 22:26:54 +0200
> If you don't "see" it as ugly it's simply because your brain
> is not wired up to see 3D/2D geometry as a significant
> source of information.
I'm sorry that I'm so handicapped that I cannot match your
visual capabilitites.
I hope you have a nice day too Ingo.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 20:34 ` Ingo Molnar
@ 2012-04-16 21:00 ` David Miller
2012-04-17 3:30 ` Steven Rostedt
2012-04-25 8:33 ` Ingo Molnar
0 siblings, 2 replies; 19+ messages in thread
From: David Miller @ 2012-04-16 21:00 UTC (permalink / raw)
To: mingo; +Cc: joe, linux-kernel, akpm, torvalds, apw
From: Ingo Molnar <mingo@kernel.org>
Date: Mon, 16 Apr 2012 22:34:51 +0200
>
> * Ingo Molnar <mingo@kernel.org> wrote:
>
>> If you don't "see" it as ugly it's simply because your brain
>> is not wired up to see 3D/2D geometry as a significant
>> source of information. A significant portion (I'd
>> guesstimate a narrow majority) of kernel hackers *does* see
>> 2D/3D layout details in code and finds inconsistencies in
>> them counterproductive.
>>
>> ( It's roughly the same distinction that makes some people
>> love the typographic layout of the iPhone/iPad while
>> others consider it unnecessary bling. )
>
> Another example are the recent Google+ layout changes. Those who
> don't see 2D details found it an unnecessary waste of screen
> real estate.
>
> To me and many others the new layout, while sparser, is actually
> noticeably less taxing to read, because information is
> structured in such a "geometrically obvious" way.
I guess us visual retards will have to find a new web site to
use then, thanks for the lesson Ingo.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 21:00 ` David Miller
@ 2012-04-17 3:30 ` Steven Rostedt
2012-04-25 8:33 ` Ingo Molnar
1 sibling, 0 replies; 19+ messages in thread
From: Steven Rostedt @ 2012-04-17 3:30 UTC (permalink / raw)
To: David Miller; +Cc: mingo, joe, linux-kernel, akpm, torvalds, apw
On Mon, Apr 16, 2012 at 05:00:04PM -0400, David Miller wrote:
>
> I guess us visual retards will have to find a new web site to
> use then, thanks for the lesson Ingo.
Facebook would love to welcome you back :-)
I must be retarded, as I still find facebook better than G+.
-- Steve
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] checkpatch: revert --strict test for net/ and drivers/net block comment style
2012-04-16 20:33 ` Linus Torvalds
@ 2012-04-17 10:07 ` Ingo Molnar
2012-04-25 22:42 ` Joe Perches
0 siblings, 1 reply; 19+ messages in thread
From: Ingo Molnar @ 2012-04-17 10:07 UTC (permalink / raw)
To: Linus Torvalds
Cc: Joe Perches, Randy Dunlap, linux-kernel, Andrew Morton, Andy Whitcroft
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Mon, Apr 16, 2012 at 1:28 PM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Joe Perches <joe@perches.com> wrote:
> >
> >> Revert the --strict test for the old preferred block
> >> comment style in drivers/net and net/
> >
> > Emphatic NAK.
>
> Ingo, I don't think you understood. That test reverts the thing you
> wanted reverted wrt the block comments.
Yeah, I was confused: I judged it by the title and description
and assumed it was only doing it for drivers/net/ and net/.
But in reality it just does a wholesale revert of this check
with no net/ and drivers/net/ specificity to it, so it's
perfectly fine to me:
Acked-by: Ingo Molnar <mingo@elte.hu>
Thanks,
Ingo
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 21:00 ` David Miller
2012-04-17 3:30 ` Steven Rostedt
@ 2012-04-25 8:33 ` Ingo Molnar
1 sibling, 0 replies; 19+ messages in thread
From: Ingo Molnar @ 2012-04-25 8:33 UTC (permalink / raw)
To: David Miller; +Cc: joe, linux-kernel, akpm, torvalds, apw
* David Miller <davem@davemloft.net> wrote:
> From: Ingo Molnar <mingo@kernel.org>
> Date: Mon, 16 Apr 2012 22:34:51 +0200
>
> >
> > * Ingo Molnar <mingo@kernel.org> wrote:
> >
> >> If you don't "see" it as ugly it's simply because your brain
> >> is not wired up to see 3D/2D geometry as a significant
> >> source of information. A significant portion (I'd
> >> guesstimate a narrow majority) of kernel hackers *does* see
> >> 2D/3D layout details in code and finds inconsistencies in
> >> them counterproductive.
> >>
> >> ( It's roughly the same distinction that makes some people
> >> love the typographic layout of the iPhone/iPad while
> >> others consider it unnecessary bling. )
> >
> > Another example are the recent Google+ layout changes. Those who
> > don't see 2D details found it an unnecessary waste of screen
> > real estate.
> >
> > To me and many others the new layout, while sparser, is actually
> > noticeably less taxing to read, because information is
> > structured in such a "geometrically obvious" way.
>
> I guess us visual retards will have to find a new web site to
> use then, thanks for the lesson Ingo.
All I'm trying to point out is that it's a visual conflict that
exists which probably has genetic origins.
For you it's too much whitespace, for me (and apparently Linus)
the lack of it results in harder to read patterns of code due to
missing geometric symmetry clues.
Since I don't have your brain and your eyes I cannot know
exactly how bad the extra whitespaces are for you - and you
probably don't know how bad the lack of symmetry is for me and
others.
So I did not intend to make any judgement about it one way or
another, but I guessed that a bit more vertical size is probably
less taxing than less structure - but I'm obviously biased. If
it's really bad for you we can still reconsider.
( I suspect it would be pretty hard but not impossible to
construct an objective readability test to settle similar
issues scientifically and create an 'ideal' coding style based
on objective rules alone, eliminating subjective 'taste'. )
Thanks,
Ingo
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts
2012-04-16 20:58 ` David Miller
@ 2012-04-25 8:42 ` Ingo Molnar
0 siblings, 0 replies; 19+ messages in thread
From: Ingo Molnar @ 2012-04-25 8:42 UTC (permalink / raw)
To: David Miller; +Cc: joe, linux-kernel, akpm, torvalds, apw
(Sorry about the late reply, was busy with other things.)
* David Miller <davem@davemloft.net> wrote:
> From: Ingo Molnar <mingo@kernel.org>
> Date: Mon, 16 Apr 2012 22:26:54 +0200
>
> > If you don't "see" it as ugly it's simply because your brain
> > is not wired up to see 3D/2D geometry as a significant
> > source of information.
>
> I'm sorry that I'm so handicapped that I cannot match your
> visual capabilitites.
I genuinely think that it's the other way around: if what I say
above is true then *you* have the superior vision for coding.
Geometric properties of code are a distraction really, they
don't matter to the end result.
So in reality keeping comments balanced helps *my* disability:
my inability to ignore functionally irrelevant patterns of
characters...
So I am asking *you* to do me a favor: please understand my
perspective and insert a bit more whitespace to keep code
readable for people like me.
( The wider question is, what is the contribution weighted
proportion of the two groups of kernel developers and what is
the disutility and utility of the two variants. It's a
difficult balancing task and there's no perfect solution. )
Thanks,
Ingo
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] checkpatch: revert --strict test for net/ and drivers/net block comment style
2012-04-17 10:07 ` Ingo Molnar
@ 2012-04-25 22:42 ` Joe Perches
0 siblings, 0 replies; 19+ messages in thread
From: Joe Perches @ 2012-04-25 22:42 UTC (permalink / raw)
To: Ingo Molnar
Cc: Linus Torvalds, Randy Dunlap, linux-kernel, Andrew Morton,
Andy Whitcroft
On Tue, 2012-04-17 at 12:07 +0200, Ingo Molnar wrote:
> Yeah, I was confused: I judged it by the title and description
> and assumed it was only doing it for drivers/net/ and net/.
If you don't read the text, no amount of
geometric layout symmetry will clarify it.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2012-04-25 22:42 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 9:17 Please fix or revert: [PATCH] checkpatch: add --strict tests for braces, comments and casts Ingo Molnar
2012-04-16 18:27 ` David Miller
2012-04-16 19:09 ` Linus Torvalds
2012-04-16 19:13 ` David Miller
2012-04-16 20:26 ` Ingo Molnar
2012-04-16 20:34 ` Joe Perches
2012-04-16 20:34 ` Ingo Molnar
2012-04-16 21:00 ` David Miller
2012-04-17 3:30 ` Steven Rostedt
2012-04-25 8:33 ` Ingo Molnar
2012-04-16 20:58 ` David Miller
2012-04-25 8:42 ` Ingo Molnar
2012-04-16 19:44 ` Randy Dunlap
2012-04-16 19:32 ` [PATCH] checkpatch: revert --strict test for net/ and drivers/net block comment style Joe Perches
2012-04-16 19:35 ` Joe Perches
2012-04-16 20:28 ` Ingo Molnar
2012-04-16 20:33 ` Linus Torvalds
2012-04-17 10:07 ` Ingo Molnar
2012-04-25 22:42 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).