|
|
|
The following section details the suggested coding guideline to be followed in the scmi tests project.
|
|
|
|
|
|
|
|
* This project follows Linux coding style in general
|
|
|
|
* Follow the 80 character width limit where ever possible
|
|
|
|
* Use snprintf instead of sprintf
|
|
|
|
* Avoid camel case throughout, but use small case
|
|
|
|
* Improve enum readability by using stacked coding style to allow inline comments
|
|
|
|
* Ensure copyright header is reproduce in all files
|
|
|
|
* Ensure file-scope variables and functions are defined with static keyword.
|
|
|
|
* Reduce stack usage by avoiding defining large local variables, instead go for static variables to use data segment storage.
|
|
|
|
* Header files to ensure have correct header guards
|
|
|
|
* Input parameters to functions that are immutable should be defined with const keyword.
|
|
|
|
* Codeblock / scope definitions start with opening braces { at the same line as the statement.
|
|
|
|
* All exported variables and functions to have arm_scmi_ prefix.
|
|
|
|
* Header includes to use angle brackets <my_header>
|
|
|
|
* All pointer variables to be checked for null pointer de-reference before use.
|
|
|
|
* Prefer the use of compound literals to initialise struct type variables
|
|
|
|
* Where ever the default external linkage is implied no need for explicit use of extern keyword.
|
|
|
|
* Avoid all whitespace errors |
|
|
|
\ No newline at end of file |