doc/contribute/style/code.rst
.. _general_code_style:
C Code and General Style Guidelines ###################################
Coding style is enforced on any new or modified code, but contributors are not expected to correct the style on existing code that they are not modifying.
For style aspects where the guidelines don't offer explicit guidance or permit multiple valid ways to express something, contributors should follow the style of existing code in the tree, with higher importance given to "nearby" code (first look at the function, then the same file, then subsystem, etc).
In general, follow the Linux kernel coding style_, with the following
exceptions and clarifications:
snake case_ for code and variables.if, else, do, while, for and
switch body, even for single-line code blocks./* */. The C99-style single line
comment, //, is not allowed./** */ for doxygen comments that need to appear in the documentation.0b).UART and not
uart, CMake and not cmake)... _Linux kernel coding style: https://kernel.org/doc/html/latest/process/coding-style.html
.. _snake case: https://en.wikipedia.org/wiki/Snake_case