]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ofed/management/opensm/doc/opensm-coding-style.txt
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ofed / management / opensm / doc / opensm-coding-style.txt
1 This short (hopefully) memo is about to define the coding style
2 recommended for OpenSM development.
3
4 The goal of this is to make OpenSM code base to be standard in terms of
5 the rest of OpenIB management software, OpenIB projects and Linux in
6 general. And in this way to make OpenSM more developer friendly and to
7 involve more open source programmers to be part of OpenSM development
8 process.
9
10 The goal of this is not to provide long and boring list of coding style
11 paradigms, but rather to define general coding style concept and to
12 suggest a way for such a concept to be implemented in the existing
13 OpenSM code base.
14
15 The OpenSM project is an OpenIB and Linux centric project, so we think
16 it is reasonable to use the coding style most popular with OpenIB
17 projects (linux/Documentation/CodingStyle) as the starting point rather
18 than reinventing one more coding style rule-set.
19
20 Some things from there in short: tab character for indentation and space
21 character for alignment, K&R style braces, short local and meanful
22 global names, please no confused Hungary style, short functions. And of
23 course to be reasonable about all above.
24
25
26 Some ideas about existing OpenSM code improvements in terms of the
27 Coding style:
28
29 * When writing new code, please try to follow the new Coding style.
30 * Coding style improvement patches are desired and accepted, but please
31   try to not mix coding style improvement with functional and other
32   changes in one patch.
33 * When you are going to improve coding style for existing code, please
34   try to do it for entire file(s).