Re: Tuxradar patching article and [PATCH] scripts/cvt_kernel_style.pl
From: Frans Pop
Date: Tue Mar 09 2010 - 20:22:39 EST
Joe Perches wrote:
> The article recommends running checkpatch and fixing the various
> non-conforming style elements the output produces.
Hmm. I thought that "style cleanup only" patches were generally frowned
upon? For one because it requires some familiarity with the kernel coding
style to make sane choices in situations that are debatable and blindly
following checkpatch is seldom good. And also to avoid needless merge
issues.
I've seen several patches drift by the last few days where I thought some
of the changes were definitely not improvements.
> Convert printk(KERN_<level> to pr_<level>(
> Removes unnecessary parenthesis from return
> Add space after if, for and while
> Convert "for (foo;bar;baz)" to "for (foo; bar; baz)"
> Removes multiple semicolons
> Convert leading spaces to tabs
Maybe I missed it, but you should certainly add removal of trailing space.
And possibly remove spaces before the closing ";" after statements.
Maybe the script should print a large warning (unless -q is used?) that all
changes should be carefully reviewed manually and not combined with
functional changes, and have a pointer to Documentation/SubmittingPatches?
Cheers,
FJP
P.S.
I wonder what traffic the advice to mail lkml when "I have a line of code
that's over 80 chars" is going to generate...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/