This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
SCMI Tests Coding Guidelines
Basil Eljuse edited this page Sep 9, 2017
·
4 revisions
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 reproduced 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.
- Ensure Header files 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.
- 0 warnings and 0 errors policy to be followed.