From: Andi Kleen <ak@suse.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH x86] [5/16] Replace hard coded reservations in x86-64 early boot code with dynamic table II
Date: Fri, 4 Jan 2008 16:03:58 +0100 [thread overview]
Message-ID: <200801041603.58358.ak@suse.de> (raw)
In-Reply-To: <20080104144140.GA4203@elte.hu>
> ERROR: use tabs not spaces
> #92: FILE: arch/x86/kernel/e820_64.c:89:
> + ^I}$
Can't you just convert them using a script on new if you care so much about those?
Ok I can write such a script too, but then every new contributor would need too which
will be a collective waste of time.
> ERROR: use tabs not spaces
> #135: FILE: arch/x86/kernel/e820_64.c:107:
> + ^I}$
>
> total: 2 errors, 0 warnings, 308 lines checked
>
> i'm not sure how you manage patches - if you have some 'refresh patch'
> command then you might want to stick a call to scripts/checkpatch.pl in
> there. I have such a check included in my quilt refresh shortcut.
>
> #3:
>
> + int i;
> + struct early_res *r;
> + for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) {
> + r = &early_res[i];
>
> newline needed after the variables.
That's an Ingo only rule I disagree with and is actually not in CodingStyle
When checkpatch.pl warns about it it is wrong and I would lobby for removing it.
> #4:
>
> void __init early_res_to_bootmem(void)
> {
> int i;
> for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) {
> struct early_res *r = &early_res[i];
> reserve_bootmem_generic(r->start, r->end - r->start);
>
> the variables definition here is totally misaligned.
Yes I fixed that now.
>
> - style cleanliness is an admittedly secondary concept but it
> strengthens the most important, primary aspect of any code:
> readability and maintainability.
In a minor way -- it is far less important than let's say good high level
comments or clear code flow.
e.g. this patch imho is a major improvement in code clarity and logic
and makes previously quite fragile code much simpler and more approachable
and easier changeable (I can say this because I was responsible for the
original mess -- only excuse is that it has grown over time). And then when
people don't see these advantages and just talk about tabs<->spaces that is
quite annoying.
> - sloppy style is also often a statistical indicator for sloppy quality:
> code written in rush, not reviewed and not read well enough. I'm not
> implying anything like that about this patch of yours, but it's a
> general policy and you'd sure agree that writing 100% clean code is
> not that much harder than just writing good code.
It depends. e.g. I personally consider the newline after variables rule
ugly for small functions and writing code for what I consider ugly
style is harder. Also it was always my personal style to put
a variable near its first use in the same paragraph (imho that makes it clearer) so
int foo;
for (foo = ...; foo ; foo) {
}
makes perfect sense to me. And I don't really see a reason to change
that.
I think all the cases you complained about were like this. Which means
you didn't actually look at the code logic, just at some abstract rule
that had nothing to do with the code flow. Which is bad.
I guess it's ok to add these newlines for larger functions and on those
you should have paragraphs anyways to separate logically separate
code blocks; but again that's not really something that can
Same for tabs versus spaces. That is something no human should
need to care about. And it is something a machine can handle fine too
anyways.
> - cleanup is generally pushed back to patch submitters - this
> distributes better as it removes load from maintainers (and subsequent
> patch developers).
When it makes sense. e.g. for trailing white space at least Andrew (and I,
don't know about you) always just removed those automatically on merge. No need to
push a patch back for such a silly thing. Tabs versus Spaces is similar --
something a machine can do fine without any human assistance.
If you really feel strongly about those the right way is to remove
it from checkpatch.pl and just let the major maintainers run a script
to convert those on all new lines automatically.
Also I really dislike the recent flurry of checkpatch.pl
only patches on linux-kernel. Adding the whole file mode to it was a
really bad idea. Style is only a minor incredient to the real
goal of good linux code and when people convert whole files everybody
who has outstanding patching against these files is forced to redo them
which is a large waste of time. Fixing style when something is changed
anyways is ok on the other hand because then other patches will reject
anyways. To borrow one of your favourite expressions it is is pissing
on the work of people who actually do non trivial changes to the tree.
I wish that disease would stop.
> - it's also a matter of visual taste. People are more likely to fix and
> improve clean _looking_ code than messy looking code.
Even more likely they are to improve code which is logically clean.
The best coding style doesn't help if that's not the case. Ok it's not totally
unimportant, but definitely not as much as you claim it to be. Also
some minor coding style variants in the tree are not the end of the world
for anybody.
-Andi
next prev parent reply other threads:[~2008-01-04 15:04 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-03 15:42 [PATCH x86] [0/16] Various i386/x86-64 changes Andi Kleen
2008-01-03 15:42 ` [PATCH x86] [1/16] Make clocksource watchdog cycle through online CPUs Andi Kleen
2008-01-04 8:51 ` Ingo Molnar
2008-01-04 12:59 ` Andi Kleen
2008-01-03 15:42 ` [PATCH x86] [2/16] Add a counter for per cpu clocksource watchdog checks and report them in /proc/interrupts Andi Kleen
2008-01-04 8:53 ` Ingo Molnar
2008-01-03 15:42 ` [PATCH x86] [3/16] Turn irq debugging options into module params Andi Kleen
2008-01-04 8:55 ` Ingo Molnar
2008-01-03 15:42 ` [PATCH x86] [4/16] Add /proc/irq/*/spurious to dump the spurious irq debugging state Andi Kleen
2008-01-04 8:58 ` Ingo Molnar
2008-01-04 12:22 ` Andi Kleen
2008-01-03 15:42 ` [PATCH x86] [5/16] Replace hard coded reservations in x86-64 early boot code with dynamic table Andi Kleen
2008-01-04 9:00 ` Ingo Molnar
2008-01-04 12:23 ` Andi Kleen
2008-01-04 12:38 ` [PATCH x86] [5/16] Replace hard coded reservations in x86-64 early boot code with dynamic table II Andi Kleen
2008-01-04 14:41 ` Ingo Molnar
2008-01-04 15:03 ` Andi Kleen [this message]
2008-01-04 17:51 ` Sam Ravnborg
2008-01-04 18:06 ` Andi Kleen
2008-01-04 18:47 ` Joe Perches
2008-01-04 22:13 ` Andi Kleen
2008-01-04 22:46 ` J. Bruce Fields
2008-01-04 20:56 ` Sam Ravnborg
2008-01-04 12:41 ` [PATCH x86] [5/16] Replace hard coded reservations in x86-64 early boot code with dynamic table Cyrill Gorcunov
2008-01-03 15:42 ` [PATCH x86] [6/16] Add a new arch_early_alloc() interface for x86-64 Andi Kleen
2008-01-03 16:22 ` Eric Dumazet
2008-01-03 17:17 ` Andi Kleen
2008-01-03 15:42 ` [PATCH x86] [7/16] Convert lockdep to use arch_early_alloc() if available for its large arrays Andi Kleen
2008-01-04 9:03 ` Ingo Molnar
2008-01-03 15:42 ` [PATCH x86] [8/16] Make lockdep_init __init Andi Kleen
2008-01-04 9:06 ` Ingo Molnar
2008-01-03 15:42 ` [PATCH x86] [9/16] Remove CPU capabitilites printks on i386 Andi Kleen
2008-01-04 9:11 ` Ingo Molnar
2008-01-03 15:42 ` [PATCH x86] [10/16] Document fdimage/isoimage completely in make help Andi Kleen
2008-01-04 9:00 ` Sam Ravnborg
2008-01-04 9:15 ` Ingo Molnar
2008-01-03 15:42 ` [PATCH x86] [11/16] Compile apm and voyager module only when selected in Kconfig Andi Kleen
2008-01-04 4:15 ` Stephen Rothwell
2008-01-03 15:42 ` [PATCH x86] [12/16] Optimize lock prefix switching to run less frequently Andi Kleen
2008-01-04 9:42 ` Thomas Gleixner
2008-01-04 12:17 ` Andi Kleen
2008-01-04 14:19 ` Thomas Gleixner
2008-01-04 14:39 ` Andi Kleen
2008-01-04 15:02 ` Pekka Enberg
2008-01-04 15:04 ` Andi Kleen
2008-01-04 20:34 ` Thomas Gleixner
2008-01-04 22:11 ` Andi Kleen
2008-01-05 1:19 ` Ingo Molnar
2008-01-05 14:37 ` Andi Kleen
2008-01-03 15:42 ` [PATCH x86] [13/16] i386: Set CFQ as default in i386 defconfig Andi Kleen
2008-01-04 9:19 ` Ingo Molnar
2008-01-03 15:42 ` [PATCH x86] [14/16] Enable RDC321X subarch only on 32bit Andi Kleen
2008-01-04 9:22 ` Ingo Molnar
2008-01-03 15:42 ` [PATCH x86] [15/16] Force __cpuinit on for CONFIG_PM without HOTPLUG_CPU Andi Kleen
2008-01-03 17:22 ` Rafael J. Wysocki
2008-01-03 17:42 ` Andi Kleen
2008-01-03 21:41 ` Rafael J. Wysocki
2008-01-04 9:23 ` Ingo Molnar
2008-01-10 17:14 ` Rafael J. Wysocki
2008-01-03 18:14 ` Adrian Bunk
2008-01-03 18:43 ` Andi Kleen
2008-01-10 9:54 ` Adrian Bunk
2008-01-10 9:58 ` Andi Kleen
2008-01-10 10:19 ` Adrian Bunk
2008-01-10 11:15 ` Andi Kleen
2008-01-10 11:26 ` Adrian Bunk
2008-01-10 11:42 ` Andi Kleen
2008-01-10 12:47 ` Adrian Bunk
2008-01-10 13:12 ` Andi Kleen
2008-01-10 15:09 ` Adrian Bunk
2008-01-14 13:52 ` Ingo Molnar
2008-01-14 14:09 ` Sam Ravnborg
2008-01-14 14:58 ` Ingo Molnar
2008-01-14 15:01 ` Ingo Molnar
2008-01-14 18:20 ` Adrian Bunk
2008-01-14 19:10 ` Ingo Molnar
2008-01-14 19:52 ` Adrian Bunk
2008-01-14 20:01 ` Sam Ravnborg
2008-01-14 20:18 ` Adrian Bunk
2008-01-14 20:27 ` Sam Ravnborg
2008-01-14 20:34 ` Adrian Bunk
2008-01-15 22:14 ` Ingo Molnar
2008-01-15 22:51 ` Adrian Bunk
2008-01-14 19:59 ` Sam Ravnborg
2008-01-15 22:12 ` [patch for v2.6.24] fix section mismatch warning in page_alloc.c Ingo Molnar
2008-01-14 15:05 ` [PATCH x86] [15/16] Force __cpuinit on for CONFIG_PM without HOTPLUG_CPU Ingo Molnar
2008-01-14 15:24 ` Ingo Molnar
2008-01-14 20:12 ` Sam Ravnborg
2008-01-15 15:17 ` Ingo Molnar
2008-01-15 16:25 ` Sam Ravnborg
2008-01-15 17:11 ` Andi Kleen
2008-01-15 17:27 ` Adrian Bunk
2008-01-15 18:21 ` Sam Ravnborg
2008-01-15 18:29 ` Andi Kleen
2008-01-15 18:31 ` Sam Ravnborg
2008-01-15 18:47 ` Adrian Bunk
2008-01-14 18:17 ` Adrian Bunk
2008-01-14 15:25 ` Adrian Bunk
2008-01-10 17:17 ` Rafael J. Wysocki
2008-01-11 23:06 ` [PATCH] x86: Change unnecessary dependencies on CONFIG_PM Rafael J. Wysocki
2008-01-03 15:42 ` [PATCH x86] [16/16] Mark memory_setup __init Andi Kleen
2008-01-04 9:25 ` Ingo Molnar
2008-01-04 9:53 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200801041603.58358.ak@suse.de \
--to=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.