doc: add note into coding style
PATCH 1/1 doc: add note into coding style
Added a note into the coding style to
highlight the use of a bool within a struct
Signed-off-by Marko Kovacevic <[email protected]>
--- doc/guides/contributing/coding_style.rst | 9 +++++++++ 1 file changed, 9 insertions(+)
doc/guides/contributing/coding_style.rst +9 -0
@@ -247,6 +247,15 @@ Structure Declarations * Use of the structures should be by separate variable declarations and those declarations must be extern if they are declared in a header file. * Externally visible structure definitions should have the structure name prefixed by ``rte_`` to avoid namespace collisions. +.. note:: + + Uses of ``bool`` in structures are not preferred as is wastes space and + it's also not clear as to what type size the bool is. A preferred use of + ``bool`` is mainly as a return type from functions that return true/false, + and maybe local variable functions. + + Ref: `LKML <https://lkml.org/lkml/2017/11/21/384>`_ + Queues ~~~~~~
Signature · 1 line
2.9.5
Quoted 4 lines · Marko Kovacevic
Added a note into the coding style to
highlight the use of a bool within a structSigned-off-by Marko Kovacevic <[email protected]>
Reviewed-by Ferruh Yigit <[email protected]>
Thomas Monjalon
Applied17/09/2018 18:31, Ferruh Yigit:
Quoted 7 lines · Marko Kovacevic
Quoted 4 lines
Added a note into the coding style to
highlight the use of a bool within a structSigned-off-by Marko Kovacevic <[email protected]>Reviewed-by Ferruh Yigit <[email protected]>
Applied, thanks