coding-style.rst (beab6cb20c1dff4a0fb1ee9d14ff5f826ccd2c84) | coding-style.rst (1dc4bbf0b268246f6202c761016735933b6f0b99) |
---|---|
1.. _codingstyle: 2 3Linux kernel coding style 4========================= 5 6This is a short document describing the preferred coding style for the 7linux kernel. Coding style is very personal, and I won't **force** my 8views on anybody, but this is what goes for anything that I have to be --- 511 unchanged lines hidden (view full) --- 520function is so complex that you need to separately comment parts of it, 521you should probably go back to chapter 6 for a while. You can make 522small comments to note or warn about something particularly clever (or 523ugly), but try to avoid excess. Instead, put the comments at the head 524of the function, telling people what it does, and possibly WHY it does 525it. 526 527When commenting the kernel API functions, please use the kernel-doc format. | 1.. _codingstyle: 2 3Linux kernel coding style 4========================= 5 6This is a short document describing the preferred coding style for the 7linux kernel. Coding style is very personal, and I won't **force** my 8views on anybody, but this is what goes for anything that I have to be --- 511 unchanged lines hidden (view full) --- 520function is so complex that you need to separately comment parts of it, 521you should probably go back to chapter 6 for a while. You can make 522small comments to note or warn about something particularly clever (or 523ugly), but try to avoid excess. Instead, put the comments at the head 524of the function, telling people what it does, and possibly WHY it does 525it. 526 527When commenting the kernel API functions, please use the kernel-doc format. |
528See the files Documentation/kernel-documentation.rst and scripts/kernel-doc 529for details. | 528See the files at :ref:`Documentation/doc-guide/ <doc_guide>` and 529``scripts/kernel-doc`` for details. |
530 531The preferred style for long (multi-line) comments is: 532 533.. code-block:: c 534 535 /* 536 * This is the preferred style for multi-line 537 * comments in the Linux kernel source code. --- 525 unchanged lines hidden --- | 530 531The preferred style for long (multi-line) comments is: 532 533.. code-block:: c 534 535 /* 536 * This is the preferred style for multi-line 537 * comments in the Linux kernel source code. --- 525 unchanged lines hidden --- |