Tool for automatic style of coding guidelines

Greg Freemyer greg.freemyer at gmail.com
Fri Jan 27 13:55:27 EST 2012


On Fri, Jan 27, 2012 at 9:18 AM, Philipp Ittershagen
<p.ittershagen at googlemail.com> wrote:
> Hi Prajosh,
>
> On Fri, Jan 27, 2012 at 1:20 PM, Prajosh Premdas
> <premdas.prajosh at gmail.com> wrote:
>> Hi
>>
>> I have developed some kernel drivers and would like to send the patches for
>> review. But i find that I have not followed the coding guideline for tabs
>> and spaces properly, which can be easily corrected by using some tools like
>> astyle.
>>
>> Can any body please help me with the proper commands string for the astyle
>> tool? Or could any body please suggest me with any new tool like indent etc
>> which you are using
>>
>
> there is a script called checkpatch.pl in the srcipts/ subdirectory.
> It will show you the problems with your code style among other things.
> The kernel maintainers strongly suggest to use the script before
> posting any patches so that any major (style) flaws like indent etc.
> can be fixed before posting the patch to the mailing list.
>
>
> Hope this helps!
>
>  Philipp

And don't forget it has various options (see checkpatch -h).

One is "-f" which allows you to check a normal source file, not a patch.

BUT, can checkpatch actually modify the files?  I think I've only used
it to identify issues, not resolve them.

Greg



More information about the Kernelnewbies mailing list