Project

General

Profile

Actions

Coding standards » History » Revision 9

« Previous | Revision 9/37 (diff) | Next »
laforge, 02/21/2016 02:07 PM


Osmocom coding standards

Coding Style

In general, for the C-language projects we maintain in the Osmocom project, we follow the coding style
of the Linux kenrel. See https://www.kernel.org/doc/Documentation/CodingStyle for further information.

We will not debate about the coding style and whether some other style is better or worse. The important factor is not so much which coding style is followed, as long as there is one well-defined coding style and that all developers adhere to it.

Submitting Patches

For submitting patches, the best practises established by the Linux kernel development community should be followed, whenever applicable. See https://www.kernel.org/doc/Documentation/SubmittingPatches for further information.

The generally important topics are:

Submit patches against a current source tree

At time of submission, our patches should be based on current master branch of the respective project, or another (more current) feature branch of that repository.

Use unified diff format

It's best to let git generate the patches, so you don't have to worry about that.

Have meaningful descriptions in your patches

Every commit/patch should have an explanation in the commit message.

Separate your changes

Separate each logical change into a separate patch.

Respond to review comments

Include PATCH in the subject

Rules of thumb

Some general rules of thumb:
  • Consider using tools like Lindent and checkpatch.pl or universalindentgui before submitting code
  • Run make, make check and make distcheck on each of your commits to ensure the build
  • Use git send-email or git imap-send to send your patches (otherwise your mail client may wrap around lines and corrupt your patch)
Files (0)

Updated by laforge about 8 years ago · 9 revisions

Add picture from clipboard (Maximum size: 48.8 MB)