LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-20-2014, 04:09 PM   #1
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Arch, Debian
Posts: 859

Rep: Reputation: 245Reputation: 245Reputation: 245
Kernel source code style


So I decided to take the Eudyptula Challenge, and as part of that I am trying to make myself familiar with the kernel source coding style.

There is obviously the document CodingStyle in the Documentation directory, but I could not find many other resources...

The obvious idea that comes to mind is the source itself, but I understand that not all source files are 100% formatted according to the rules.
So I guess my question is: Which files of the kernel source are considered "perfectly formatted" and would hence be good examples to work with...?
 
Old 05-20-2014, 05:11 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,855

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
It is very hard for mere mortals to submit code to the kernel which has not been run through scripts/checkpatch.pl.

Your kernel source should be a git clone of some repo. Make your changes and create the patch file with:

Code:
git format-patch
 
1 members found this post helpful.
Old 05-21-2014, 04:16 PM   #3
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Arch, Debian
Posts: 859

Original Poster
Rep: Reputation: 245Reputation: 245Reputation: 245
Hi smallpond, thanks for the reply, I did know the checkpatch.pl but was unaware of "git format-patch". Will look into that. But what I was really looking for was some example files that are formatted well enough to serve as a reference...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Microsoft dev tools to add Linux-style source code versioning LXer Syndicated Linux News 0 01-31-2013 10:30 AM
How to attach a kernel module with kernel source code Gourab Das Linux - Kernel 2 02-04-2010 08:19 AM
Compiling kernel Debian style or Native style ? Raynus Debian 1 06-16-2008 07:56 AM
The kernel source code mazzus Linux - General 3 05-15-2007 12:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration