From: Ingo Molnar <mingo@elte.hu>
To: Andy Whitcroft <apw@shadowen.org>
Cc: "Kok, Auke" <auke-jan.h.kok@intel.com>,
Andrew Morton <akpm@osdl.org>,
Randy Dunlap <rdunlap@xenotime.net>,
Joel Schopp <jschopp@austin.ibm.com>,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] update checkpatch.pl to version 0.08
Date: Tue, 24 Jul 2007 13:47:13 +0200 [thread overview]
Message-ID: <20070724114713.GA9817@elte.hu> (raw)
In-Reply-To: <46A5E39D.7030009@shadowen.org>
* Andy Whitcroft <apw@shadowen.org> wrote:
> > within the last 3 weeks, this script went from *really usable* to *a
> > big noise maker*.
seconded ...
v0.06 was "almost there". I fixed kernel/sched.c to be completely clean,
except for 3 false positives. That was a real improvement, and i started
to like checkpatch.pl.
v0.08 is a clear step backwards: it emits 61 warnings now, 90% of which
are totally bogus. The only 'fix' for many of those warnings is to make
the code _worse_. That is unacceptable.
> > Warning on multiple declarations on a line is nice, but IMO really
> > too verbose (why is "int i, j;" bad? Did C somehow change syntax
> > today?).
>
> No the normal response is two fold:
>
> 1) "what the heck are i and j those are meaningless names"
> 2) "please can we have some comments for those variables"
you really should not even be arguing about this. LOOK AT the many false
positives in sched.c. This is perfectly readable code:
void __init sched_init(void)
{
u64 now = sched_clock();
int highest_cpu = 0;
int i, j;
for_each_possible_cpu(i) {
struct rt_prio_array *array;
struct rq *rq;
rq = cpu_rq(i);
this warning for "i, j" is clearly bogus. So are many of the other
warnings. checkpatch.pl went from a useful tool that improved the
quality of the kernel to a rigid, unflexible policeman. It needs to be
fixed or needs to be gotten rid of.
> which normally leads to the suggestion that it be the following form:
>
> int source; /* source clock hand */
> int destination; /* destination clock hand */
what the hell are you thinking? Not every trivial line of code needs to
be commented. Comments are needed for the _nontrivial_ lines of code,
and there's no way a tool can decide that. The longer "destination"
variable suggested by you can _easily_ make a previously readable piece
of code unreadable.
Ingo
next prev parent reply other threads:[~2007-07-24 11:47 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-15 8:25 [PATCH] update checkpatch.pl to version 0.08 Andy Whitcroft
2007-07-23 23:08 ` Kok, Auke
2007-07-24 0:11 ` Randy Dunlap
2007-07-24 9:06 ` Andy Whitcroft
2007-07-24 9:15 ` Andrew Morton
2007-07-24 11:19 ` Andy Whitcroft
2007-07-24 13:08 ` Dmitry Torokhov
2007-07-24 16:51 ` Jan Engelhardt
2007-07-24 17:20 ` Randy Dunlap
2007-07-24 17:46 ` Jan Engelhardt
2007-07-24 18:03 ` Randy Dunlap
2007-07-24 18:30 ` Andy Whitcroft
2007-07-24 17:22 ` Paul Mundt
2007-07-24 18:00 ` Jan Engelhardt
2007-07-24 18:31 ` Andy Whitcroft
2007-07-24 19:49 ` Adrian Bunk
2007-07-24 20:32 ` jschopp
2007-07-25 1:13 ` Adrian Bunk
2007-07-25 15:39 ` SL Baur
2007-07-25 16:54 ` Adrian Bunk
2007-07-24 18:45 ` jschopp
2007-07-24 19:59 ` Adrian Bunk
2007-07-24 20:53 ` jschopp
2007-07-23 23:13 ` Jesper Juhl
2007-07-23 23:36 ` Kok, Auke
2007-07-24 16:53 ` Jan Engelhardt
2007-07-24 17:06 ` Andy Whitcroft
2007-08-03 12:37 ` Andy Whitcroft
2007-07-23 23:52 ` Kok, Auke
2007-07-24 11:33 ` Andy Whitcroft
2007-07-24 11:47 ` Ingo Molnar [this message]
2007-07-24 11:51 ` Ingo Molnar
2007-07-24 16:56 ` Jan Engelhardt
2007-07-24 18:38 ` Andy Whitcroft
2007-07-24 13:58 ` jschopp
2007-07-24 14:33 ` Adrian Bunk
2007-07-24 14:50 ` Andy Whitcroft
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=20070724114713.GA9817@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=apw@shadowen.org \
--cc=auke-jan.h.kok@intel.com \
--cc=jschopp@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox